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
enum Direction { | |
VERTICAL { | |
public Direction opposite() { | |
return HORIZONTAL; | |
} | |
}, | |
HORIZONTAL { | |
public Direction opposite() { | |
return VERTICAL; | |
} |
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
It depends on how you integrate with Eclipse. | |
If you use Gradle's 'apply plugin: eclipse', run 'gradle cleanEclipse eclipse'. | |
If you use the STS Gradle plugin, right-click the project and choose 'Gradle - Refresh Dependencies'. |
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
joz = @(k) k+1; | |
>> joz(1) | |
ans = | |
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
// transform (x,y) to 1D | |
// where x - colomn, y - row (for CV applications or picture filtering) | |
//this.x = picture.width(); | |
private int p(int x, int y) { | |
return y * this.x + x + 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
### | |
# !!! THIS IS NOT A BASH SCRIPT !!! | |
### | |
# named .sh just so Github does correct syntax highlighting | |
# Inspired by https://gist.github.com/erikbern/78ba519b97b440e10640 | |
# | |
# This setup is available as a public AMI in US-East(N. Virginia): ami-9d0f3ff7 | |
# Add repos for cmake and gcc |
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
### | |
# !!! THIS IS NOT A BASH SCRIPT !!! | |
### | |
# named .sh just so Github does correct syntax highlighting | |
# Inspired by https://gist.github.com/AlexJoz/1670baf0b32573ca7923 | |
# | |
# This setup is available as a public AMI in US-East(N. Virginia): ami-60da5a77 | |
# | |
# Tensorflow 0.9 with gpu support (installing cuda drivers and cudnn lib) for python3 with numpy, matplotlib and sklearn installed |
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 rsync -azv -e "ssh -i /home/ubuntu/key-to-ec2.pem" [email protected]:/home/ubuntu/source/ /home/ubuntu/target |
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
#python2 | |
from email.utils import parsedate_tz | |
import datetime | |
z = parsedate_tz('Fri, 1 Jan 2016 17:58:28 +0700') | |
print z | |
print datetime.datetime.strptime('{}-{}-{}'.format(z[0],z[1],z[2]), '%Y-%m-%d').timetuple().tm_yday | |
output: | |
''' | |
(2016, 1, 1, 17, 58, 28, 0, 1, -1, 25200) |
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 urllib2 | |
#put your link here =) | |
url = "http://ichart.finance.yahoo.com/table.csv?s=^GSPC&c=2016" | |
file_name = "table.csv" #can parse fname from url, ofcoz. | |
u = urllib2.urlopen(url) | |
gspc = u.read() | |
with open(file_name, 'wb') as f: |
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 sgdisk -Z /dev/sdc Wipe guid partition table | |
sudo apt-get purge `dpkg -l | awk '{print $2}' | grep -E 'gnome|unity'` Wipe unity | |
sudo apt-get install bumblebee bumblebee-nvidia primus linux-headers-generic for NVidia Optimus cards |
OlderNewer