Wednesday, September 28, 2011

Sage - Online Mathematical Software

Sage is an mathematical software, the coolest point is it can run with any web browser.

I tried a sample plot function below, the usability is awesome too!

x=var('x')
plot(-0.3+(x+0.6)^0.5, (0,100))

Monday, September 19, 2011

Benchmarks for mt_rand() and rand()

Benchmarks results as below:

mt_rand() 10000000 times for 4.7026278972626 seconds
each one average is 0.00000047 seconds
rand() 10000000 times for 4.7438910007477 seconds
each one average is 0.00000047 seconds

The test machine is Amazon EC2 High-CPU Instances (20 ECU)

Another test as below:

mt_rand() 10000000 times for 2.4974269866943 seconds
each one average is 0.00000025 seconds
rand() 10000000 times for 2.4646849632263 seconds
each one average is 0.00000025 seconds

The test machine is Amazon EC2 Micro Instances (1 ECU)

Tuesday, September 06, 2011

CentOS install node.js

Basically, follow the installation guide in the node.js GitHub wiki page. I use the "Building from source" guide. Then install npm, follow the guide too, just easy type with "curl http://npmjs.org/install.sh | sh"

When I test nmp installation (install express), I found that I should type 'npm install -g express', and the express will be installed in the directory which I want. Otherwise, nmp will install locally (such as: ./node_modules/).