Oftentimes, we obtain a long or a wide table from a certain data source, and it may be the only format we can get. For example, some financial databases provide daily tick data for all stocks in a financial market. The data table may be arranged in a long format like this:继续阅读 »
###To be or not to be###
我们也许曾经在写注释与不写之间摇晃不已, 不写是因为代码容易变化而注释往往被忽略掉了,这时注释反而有害; 但又因为就算一个有意义的名字 也难以信达雅的传递程序的意义.
But the problem with comments is that they just don’t get maintained. The code changes, the comment gets stale, and it becomes useless. Fortunately, ExUnit has doctest, a tool that extracts继续阅读 »
Trunk：would be the main body of development, originating from the start of the project until the present.
Branch： will be a copy of code derived from a certain point in the trunk that is used for applying major changes to the code while preserving the integrity of the 继续阅读 »
In R, function may not be as special as it is in other programming languages; it is regarded as one of the many types and can be passed as an argument to some other function. The way we deal with other objects such list and data.frame definitely applies to function. Here is a simple example in which we define two funct继续阅读 »
What Is Google C++ Mocking Framework?
When you write a prototype or test, often it's not feasible or wise to rely on real objects entirely. A mock object implements the same interface as a real object (so it can be used as one), but lets you specify at run time how it will be used and what it should do (which methods 继续阅读 »
1. Pythonic Thinking
1.1 know which version of python you're using
two major python version;
multiple popular runtimes for python: cpython, jython, ironpython, pypy, etc;
be sure that the command line for running python on your system is the version you want;
prefer python 3 in your next project;继续阅读 »