This file contains 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
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css"/> | |
<script src="http://cmx.io/v/0.1/cmx.js"></script> | |
<body> | |
<scene id="scene1"> | |
<label t="translate(0,346)"> | |
<tspan x="0" y="0em">Comix Sample</tspan> | |
</label> | |
<actor t="translate(131,49)" pose="-11,9|-5,117|-11,99|-11,89|-11,79|-11,59|-16,34|-21,9|-6,34|-1,9|-18,79|-18,59|-6,79|-1,59"> |
This file contains 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
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css"/> | |
<script src="http://cmx.io/v/0.1/cmx.js"></script> | |
<style>.cmx-user-scene4 .cmx-text-border .cmx-path {stroke: orange}</style> | |
<body> | |
<div style="max-width:900px; -webkit-transform:rotate(0deg);"> | |
<scene id="scene1"> | |
<label t="translate(0,346)"> |
This file contains 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
CLEARNLP=. | |
CLASSPATH=$CLEARNLP/lib/args4j-2.0.16.jar:$CLEARNLP/lib/commons-compress-1.4.1.jar:$CLEARNLP/lib/hppc-0.4.1.jar:$CLEARNLP/lib/jregex1.2_01.jar:$CLEARNLP/lib/clearnlp-1.3$ | |
java -classpath $CLASSPATH com.googlecode.clearnlp.run.Version | |
FILE=iphone5.txt | |
echo "Test Tokenizer" | |
java -classpath $CLASSPATH com.googlecode.clearnlp.run.Tokenizer \ | |
-d model/dictionary-1.3.1.zip -i $FILE |
This file contains 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 perl pkg-config autoconf automake libtool libncurses5-dev | |
git clone https://github.com/yorhel/ncdu.git | |
cd ncdu | |
autoreconf -i | |
./configure --prefix=/usr | |
make | |
sudo make install | |
# Examples | |
# scan a directory and export the results for later viewing |
This file contains 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
from fn import _ | |
from fn.op import zipwith | |
from itertools import repeat | |
assert list(map(_ * 2, range(5))) == [0,2,4,6,8] | |
assert list(filter(_ < 10, [9,10,11])) == [9] | |
assert list(zipwith(_ + _)([0,1,2], repeat(10))) == [10,11,12] | |
from fn import _ | |
print (_ + 2) # "(x1) => (x1 + 2)" |
This file contains 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
import os | |
import time | |
import boto | |
import boto.manage.cmdshell | |
def launch_instance(ami='ami-7341831a', | |
instance_type='t1.micro', | |
key_name='paws', | |
key_extension='.pem', | |
key_dir='~/.ssh', |
This file contains 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
#!bin/sh | |
# USAGE: | |
# bash <(curl -s https://gist.github.com/baojie/5175293/raw/cba116a7b3dae98626f775d31aef2301ce5e5ee9/tarall.sh) | |
# files to be excluded | |
cat > /tmp/exclude.txt << EOL | |
/dev | |
/tmp | |
/proc |
This file contains 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
#encoding=utf-8 | |
import jieba | |
seg_list = jieba.cut("我来到北京清华大学",cut_all=True) | |
print "Full Mode:", "/ ".join(seg_list) #全模式 | |
seg_list = jieba.cut("我来到北京清华大学",cut_all=False) | |
print "Default Mode:", "/ ".join(seg_list) #精确模式 | |
seg_list = jieba.cut("他来到了网易杭研大厦") |
This file contains 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
from shapely.geometry import Point | |
point = Point(0, 0) | |
print point.geom_type | |
# OUT: Point | |
print point.area | |
# OUT: 0.0 | |
patch = point.buffer(10) | |
print patch.bounds | |
# OUT: (-10.0, -10.0, 10.0, 10.0) |
This file contains 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
# host | |
sudo apt-get install virtualbox dkms | |
# client | |
sudo apt-get install virtualbox-ose-guest-utils virtualbox-ose-guest-x11 virtualbox-ose-guest-dkms |