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
$ locale | |
LANG=en_US.UTF-8 | |
$ cat file_in_cp1251 | vim --cmd ':set enc=cp1251' --cmd ':set tenc=utf8' - |
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
#!/usr/bin/env node | |
process.stdin.resume(); | |
process.stdin.setEncoding('utf8'); | |
function line_reader(stream, call_back) { | |
var remainder = ''; | |
stream.on('data', function (chunk) { | |
var lines = chunk.toString().split('\n'); | |
lines.unshift(remainder + lines.shift()); |
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 http://thirld.com/blog/2014/11/30/visualizing-the-results-of-profiling-python-code/ | |
pip install pyprof2calltree | |
#Profile your program as usual: | |
python -m cProfile -o prof.out mycode.py | |
#Then visualize the results in KCacheGrind: | |
pyprof2calltree -i prof.out -k |
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
yum install yum-utils | |
repoquery --list packagename |
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
# performance monitor | |
nvidia-smi -q -g 0 -d UTILIZATION -l |
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
X = sparse.model.matrix( | |
as.formula( | |
paste("Hazard~", paste(colnames(ts.train), sep = "_", collapse=" +")) | |
), data = ts.train) |