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
class Cell { | |
boolean alive = false; | |
public void setAlive(boolean alive){ | |
this.alive = alive; | |
} | |
public boolean isAlive(){ | |
return this.alive; | |
} |
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
sub vcl_recv { | |
if(req.request == "PUT" && req.url ~ "^/api/0.1/userMedia"){ | |
ban ("req.url == '/api/0.1/user'"); | |
return(pass); | |
} | |
if(req.url ~ "^/api/0.1"){ | |
return(lookup); | |
} | |
} |
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
/* | |
Converts a maze to a string of the format: | |
▛▀▜▛▀▜▛▀▜▛▀▜▛▀▜▛▀▜▛▀▜▛▀▜▛▀▜▛▀▜▛▀▜▛▀▜▛▀▜▛▀▜▛▀▜ | |
▌· · ·▐▌· ·▐▌· · · · ·▐▌· · · ·▐▌·▐ | |
▙ ▟▙▄▟▙ ▟▙ ▟▙ ▟▙ ▟▙ ▟▙▄▟▙▄▟▙ ▟▙▄▟▙ ▟▙▄▟▙ ▟▙ ▟ | |
▛ ▜▛▀▜▛ ▜▛ ▜▛ ▜▛ ▜▛ ▜▛▀▜▛▀▜▛ ▜▛▀▜▛ ▜▛▀▜▛ ▜▛ ▜ | |
▌· ·▐▌· ·▐▌· ·▐▌·▐▌· ·▐▌· ·▐▌· ·▐▌· ·▐ | |
▙▄▟▙ ▟▙▄▟▙▄▟▙▄▟▙ ▟▙▄▟▙ ▟▙ ▟▙▄▟▙ ▟▙▄▟▙ ▟▙▄▟▙ ▟ | |
▛▀▜▛ ▜▛▀▜▛▀▜▛▀▜▛ ▜▛▀▜▛ ▜▛ ▜▛▀▜▛ ▜▛▀▜▛ ▜▛▀▜▛ ▜ | |
▌· ·▐▌· ·▐▌· ·▐▌· ·▐▌· ·▐▌· ·▐▌· ·▐▌·▐ |
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
[merge] | |
tool = intellij | |
[mergetool "intellij"] | |
cmd = cmd.exe //c "\"C:/Program Files (x86)/IntelliJ IDEA Community Edition 12.0/bin/idea.bat\" merge \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\"" | |
trustExitCode = true | |
[diff] | |
tool = intellij | |
[difftool "intellij"] | |
cmd = cmd.exe //c "\"C:/Program Files (x86)/IntelliJ IDEA Community Edition 12.0/bin/idea.bat\" diff \"$LOCAL\" \"$REMOTE\"" |
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
#!/bin/bash | |
ls *.000 | xargs -I @ bash -c "ogrinfo @ | awk '{if(NR>3)print \$2}' | xargs -I xxx ogr2ogr -f \"GeoJSON\" @_xxx.geojson @ xxx" |
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
/* RETRANSMISSION/FAST RETRANSMISSION/OUT-OF-ORDER | |
* If the segment contains data (or is a SYN or a FIN) and | |
* if it does not advance the sequence number, it must be one | |
* of these three. | |
* Only test for this if we know what the seq number should be | |
* (tcpd->fwd->nextseq) | |
* | |
* Note that a simple KeepAlive is not a retransmission | |
*/ | |
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
interface Subscription<T> { | |
id: number, | |
type: new () => T | |
fn: (event:T)=>any | |
} | |
class Bus { | |
private seq:number = 0; | |
private subscribers:Map<string,Array<Subscription<any>>> = new Map(); |
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
#!/bin/bash | |
find /path/to/JPEGImages | grep jpg$ | shuf > files.list | |
cat files.list | wc -l | |
#180 = 10% | |
cat files.list | head -n 180 > test.txt | |
#rest goes into train.txt | |
cat files.list | grep -v -f test.txt > train.txt |
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
// A []C.int64_t slice backed by C memory. | |
// See: https://github.com/golang/go/wiki/cgo#turning-c-arrays-into-go-slices | |
// Using [1<<27] instead of [1<<30] so it works on 32-bit architecture |
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
//dump jpeg | |
curl "http://10.41.3.120/cgi-bin/faststream.jpg?stream=MxPEG&fps=0.1" | mxgconv_linux format=jpeg,of=img | |
//split images | |
find ./ | grep jpg |xargs -I@ convert -quality 100 -crop 640x480 @ @_cropped_%d.jpg | |
//preserve original filename in images | |
ls | xargs -I@ echo exiftool -Comment=@ @ | |
//rename file to md5sum name |
OlderNewer