This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get update | |
sudo apt-get install openjdk-6-jre-headless -f | |
sudo wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.0.tar.gz -O elasticsearch.tar.gz | |
sudo tar -xf elasticsearch.tar.gz | |
sudo rm elasticsearch.tar.gz | |
sudo mv elasticsearch-0.19.0 elasticsearch | |
sudo mv elasticsearch /usr/local/share | |
sudo wget http://github.com/elasticsearch/elasticsearch-servicewrapper/tarball/master -O - | tar xz | |
sudo mv elasticsearch-elasticsearch-servicewrapper-3e0b23d/service /usr/local/share/elasticsearch/bin/ | |
sudo rm -rv elasticsearch-elasticsearch-servicewrapper-3e0b23d/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 | |
sudo echo "deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen" >> /etc/apt/sources.list | |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 | |
sudo apt-get update | |
sudo apt-get install mongodb-10gen |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install curl | |
sudo curl -O ftp://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz | |
sudo tar xvzf js185-1.0.0.tar.gz | |
cd js/src | |
export CFLAGS="-DJS_C_STRINGS_ARE_UTF8" | |
make -f Makefile.ref | |
JS_DIST=/usr make -f Makefile.ref export |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get update | |
sudo apt-get install openjdk-6-jre-headless -f | |
sudo apt-get install curl | |
sudo apt-get install unzip | |
sudo apt-get install openssh-server | |
sudo curl -OL http://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.8.zip | |
sudo unzip elasticsearch-* && rm elasticsearch-*.zip | |
cd elasticsearch-0.19.8 | |
sudo mkdir /usr/local/elasticsearch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo /usr/bin/mongod --replSet foo --port 27017 -fork --quiet --dbpath /data/r0 --logpath /var/log/mongodb0.log | |
sudo /usr/bin/mongod --replSet foo --port 27018 -fork --quiet --dbpath /data/r1 --logpath /var/log/mongodb1.log | |
sudo /usr/bin/mongod --replSet foo --port 27019 -fork --quiet --dbpath /data/r2 --logpath /var/log/mongodb2.log | |
sudo mongo localhost:27017 --eval "config = {_id: 'foo', members: [{_id: 0, host: 'localhost:27017'},{_id: 1, host: 'localhost:27018'},{_id: 2, host: 'localhost:27019'}]};rs.initiate(config);" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "stdafx.h" | |
#include <conio.h> | |
int _tmain(int argc, _TCHAR* argv[]) | |
{ | |
int a[10], i; | |
for (i = 0; i <= 10; i++) { | |
printf("before: i = %d\t", i); | |
a[i] = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "stdafx.h" | |
#include <conio.h> | |
int _tmain(int argc, _TCHAR* argv[]) | |
{ | |
int a[10], i; | |
for (i = 9; i >= -1; i--) { | |
printf("before: i = %d\t", i); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function F(n){ | |
var a = 0; | |
var b = 1; | |
var result = 0; | |
for(var i=2; i<=n; i++){ | |
result = a + b; | |
a = b; | |
b = result; | |
} | |
return result; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function F(n){ | |
if(n == 0 || n == 1) | |
return n; | |
return F(n-1) + F(n-2); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function F(n, a, b){ | |
if(!a) | |
a = 0; | |
if(!b) | |
b = 1; | |
if(n == 0) | |
return a; | |
return F(n-1, b, a+b); | |
} |
OlderNewer