Skip to content

Instantly share code, notes, and snippets.

// 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) {}
}
@akiniwa
akiniwa / Tree.py
Last active August 29, 2015 14:03
# -*- 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))
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
#!/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
#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.
"""
#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.
"""
@akiniwa
akiniwa / remove_newline.sh
Last active August 29, 2015 13:59
remove windows newline.
tr -d "\r" < file.txt > modified.txt
#!/bin/sh
cat $1 | sed -e '1s/^/id\
/g' > _$1
for f in *.txt; do sed -e 's/\t\|\s/,/g' $f > "${f%.*}".csv; done
awk '/A/ {print >> "a.txt"} /B/ { print >> "b.txt"}'