xmake provides a convenient and flexible cross-compiling support, in most cases, we need not to configure complex toolchains prefix, for example: arm-linux-
As long as this toolchains meet the following directory structure:
/home/toolchains_sdkdir
- bin
- arm-linux-gcc
- arm-linux-ld
- ...
继续阅读 »
Question
Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight).
For example, the 32-bit integer ’11' has binary representation 00000000000000000000000000001011, so the function should return 3.
解说
这道题的意思是统计32位整数二进制格式下的‘1’的个数。
more
Solution
rig继续阅读 »
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继续阅读 »
People love dealing with well-structured data. It costs much less efforts than working with disorganized raw texts.
In economic and financial research, we typically download data from open-access websites or authentication-required databases. These sources may provide data in multiple formats. For example, almost all 继续阅读 »
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:继续阅读 »
Here is a simple example, what is the output of this program?
```
include
using namespace std;
int main()
{
float f = 0.0;
int i = 5;
f = (float)i;
cout<继续阅读 »
tbox provides a lightweight implementation of stackless coroutines
and it's interfaces are very simple too, for example:
c
tb_lo_coroutine_enter(coroutine)
{
while (1)
{
tb_lo_coroutine_yield();
}
}
The switch performance of this stackless coroutines is faster than the implementation of tbox's继续阅读 »