2016-07-22 ruki
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 - ... 继续阅读 »
2016-05-18 craneyuan
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 继续阅读 »
2014-03-15 Kun Ren
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 继续阅读 »
2014-02-20 Kun Ren
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 继续阅读 »
2015-04-05 Alex Sun
JSX和HTML 在JSX中,可以像通常使用HTML标签那样使用它们,也可以自定义标签,例如: javascript React.render( welcome to react world, document.getElementById('example') ); 继续阅读 »
2014-03-14 Kun Ren
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: 继续阅读 »
2016-06-17 YongHao Hu
C++
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< 继续阅读 »
2011-04-14 Jamling
前一段时间,写了两个关于j2me打包签名的工具,界面技术使用的是SWT。在eclipse测试OK之后,将src打包为jar。其中META-INF/MENIFEST.MF中指定Main-Class为 我的main类,并且classpath等也加进去了。但在双击jar并不能成功运行。 没办法,只好写bat文件来启动swt。但惊奇的发现,竟然找不到某些类。主要还是swt包中的。刚开始还以为是java.library.path的问题,最后确定不是,当时还懵了一下子,不知道怎么解决。 后来去eclipse swt网站查看swt example的运行。才恍然大悟,原来要这样运行。兹记之 原文请参考:http://www.eclipse.o 继续阅读 »
2016-12-03 ruki
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 继续阅读 »
2016-10-29 Meng Lei
Node.js代理服务器 出于信息安全的需求,很多公司对于员工电脑访问外网都会有很多特别的限制,比如某国内大型上市IT解决方案供应商,所有的员工电脑必须通过某个指定的HTTP代理服务器访问互联网资源,并且还要进行用户名密码的验证,导致很多无法设置代理服务器的软件以及仅支持socks5代理的软件都无法使用,甚至想要在调试应用的时候调用一些第三方api都需要做很多特殊设置。 比如正常的Node.js在做HTTP请求的时候,代码如下: var http = require('http'); var opt = { host: 'api.example.com', //要访问的服务器地址或者域名 port: 808 继续阅读 »