Skip to content

Instantly share code, notes, and snippets.

View AlexJoz's full-sized avatar

Alex Joz AlexJoz

  • uk
  • 23:33 (UTC +01:00)
View GitHub Profile
@AlexJoz
AlexJoz / gist:e6e45e3c84fb7143cb1da0f8c9f46e76
Last active August 5, 2016 16:22
Syncronize files with running ec2 instance (download data from aws)
sudo rsync -azv -e "ssh -i /home/ubuntu/key-to-ec2.pem" ubuntu@xx.xxx.xxx.xx:/home/ubuntu/source/ /home/ubuntu/target
@AlexJoz
AlexJoz / tensorflow 0.9 with gpu support for py3 on aws ec2
Created July 11, 2016 14:56
tensorflow 0.9 with gpu support for py3 on aws ec2
###
# !!! 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
@AlexJoz
AlexJoz / xyto1D.java
Last active November 29, 2015 13:21
Transform 2D to 1D array coordinates, where x - col and y - row
// 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;
}
@AlexJoz
AlexJoz / gist:46b489e2303cddb3c85f
Created November 26, 2015 23:48
Function handle in Matlab
joz = @(k) k+1;
>> joz(1)
ans =
2
@AlexJoz
AlexJoz / gist:23c3cd19e94de9d61f7c
Created November 21, 2015 22:54
Refresh Dependencies in Gradle & Eclipse
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'.
@AlexJoz
AlexJoz / Direction.java
Created October 22, 2015 16:02
Enum Direction
enum Direction {
VERTICAL {
public Direction opposite() {
return HORIZONTAL;
}
},
HORIZONTAL {
public Direction opposite() {
return VERTICAL;
}