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
wget -r -l -H -A pdf www.homepage.com/afolder |
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 [imgs]=LoadData(DirName) | |
imgs=dir(strcat(DirName,'/*.png')); | |
for it=1:numel(imgs) | |
%getting metadata from the filename itself | |
info=regexp(imgs(it).name,'(test|train)_digit(\d*)_(\d*)','tokens'); | |
info=info{1}; | |
if(numel(info)~=3) | |
error(strcat(imgs(it).name,' is malformed filename-format')); | |
end |
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
all(i<10 for i in range(100)) #10+1 evaluations | |
any(i*i>10 for i in range(100)) #4+1 evaluations |
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
URL=www.homepage.com/folder | |
TEMP= /tmp | |
wget_testdata: | |
wget $(URL)/testdata.tar.gz -O $(TMP)/testdata.tar.gz | |
tar -xf $(TMP)/testdata.tar.gz -C $(TMP) | |
if [ -h test ]; then echo "test does already exist"; else ln -s $(TMP)/testdata testdata; fi |
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
imagesc((adapthisteq(mean(double(imread('image.png'))/255,3)))) |
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
df -T %to find the label of the usbstick (in this case /dev/sdd1) | |
sudo umount /dev/sdd1 | |
sudo mkfs.ext4 /dev/sdd1 | |
sudo e2label /dev/sdd1 memstick | |
sudo chmod 777 /media/memstick_folder |
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
# Error message when trying to start a virtualbox OS: | |
# | |
#VirtualBox can’t operate in VMX root mode. Please disable the KVM kernel extension, recompile your kernel and #reboot (VERR_VMX_IN_VMX_ROOT_MODE). | |
# | |
# Fix: | |
modprobe -r kvm_intel | |
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
from itertools import * | |
def matrix_range(N,M): | |
return map(lambda i: range(i,i+M),range(0,N*M,M)) #Create a MxN matrix (for testing) | |
A=matrix_range(5,3) | |
At=zip(*A) #transpose | |
At2=map(list,zip(*A)) #transpose without the tuple problems (slower) | |
At3=map(list,izip(*A)) #could be faster for big lists | |
a=chain(*A) #flatten to vector, lazyversion: http://docs.python.org/library/itertools.html#itertools.chain.from_iterable |
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
import operator | |
data = [['1','2','3','4'],['a','b','c','d'],['A','B','C','D'],['!','@','#','$']] | |
data03 = map(operator.itemgetter(0,3),data) | |
data023= map(operator.itemgetter(0,2,3),data) | |
import itertools | |
datavector_1 = list(itertools.chain(*map(operator.itemgetter(1),data))) |
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
netstat -nr |