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
// referenced from http://docs.spring.io/spring-batch/trunk/reference/html/readersAndWriters.html | |
public class Foo {} | |
public class Bar { | |
public Bar(Foo foo) {} | |
} | |
public class Foobar{ | |
public Foobar(Bar bar) {} | |
} |
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
# -*- coding: utf-8 -*- | |
class Tree: | |
def __init__(self, value=0): | |
self.value = value | |
self.child = [] | |
def insertChild(self, index, v): | |
self.child.insert(index, Tree(v)) | |
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 glob | |
import os | |
os.chdir("/mydir") | |
for file in glob.glob("*.txt"): | |
print file | |
import os | |
for file in os.listdir("/mydir"): | |
if file.endswith(".txt"): | |
print 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
#!/bin/bash | |
echo -ne '[======......................................................](10%)\r' | |
sleep 0.1 | |
echo -ne '[============................................................](20%)\r' | |
sleep 0.1 | |
echo -ne '[==================..........................................](30%)\r' | |
sleep 0.1 | |
echo -ne '[========================....................................](40%)\r' | |
sleep 0.1 |
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
#coding: utf8 | |
""" | |
1. Download this gist. | |
2. Get the MNIST data. | |
wget http://deeplearning.net/data/mnist/mnist.pkl.gz | |
3. Run this code. | |
python autoencoder.py 100 -e 1 -b 20 -v | |
Wait about a minute ... and get a vialization of weights. | |
""" |
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
#coding: utf8 | |
""" | |
1. Download this gist. | |
2. Get the MNIST data. | |
wget http://deeplearning.net/data/mnist/mnist.pkl.gz | |
3. Run this code. | |
python autoencoder.py 100 -e 1 -b 20 -v | |
Wait about a minute ... and get a vialization of weights. | |
""" |
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
tr -d "\r" < file.txt > modified.txt |
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 | |
cat $1 | sed -e '1s/^/id\ | |
/g' > _$1 |
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
for f in *.txt; do sed -e 's/\t\|\s/,/g' $f > "${f%.*}".csv; done |
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
awk '/A/ {print >> "a.txt"} /B/ { print >> "b.txt"}' |