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
[Unit] | |
Description=Norikra | |
After=network.target | |
[Service] | |
Type=simple | |
PIDFile=/var/run/norikra.pid | |
EnvironmentFile=/etc/sysconfig/norikra | |
ExecStart=/usr/lib/jruby/jruby-9.0.1.0/bin/norikra start -l /var/log/norikra | |
ExecStop=/usr/lib/jruby/jruby-9.0.1.0/bin/norikra stop |
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
package main | |
import( | |
"fmt" | |
"sync" | |
"time" | |
"runtime" | |
) | |
func main(){ |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
freq.vec <- function(csv, xs = 0, xe = 0) { | |
d <- read.csv(csv) | |
vars <- d[[1]] | |
# if default, apply min and max of vars | |
xs <- ifelse(xs == 0, min(vars), xs) | |
xe <- ifelse(xe == 0, max(vars), xe) | |
d.ext <- d[vars >= xs & vars <= xe, ] | |
rep(d.ext[[1]], d.ext[[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
ps -eo pid,ppid,lstart,cmd |
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
/** | |
* ROIを指定してモザイク処理 | |
* @param image 元画像となる {@link Mat} | |
* @param rectangles モザイク対象のROIを指定した {@link MatOfRect} | |
* @param size モザイクのピクセル幅 | |
* @return モザイク処理後の {@link Mat} | |
*/ | |
public static Mat drawMosaic(Mat image, MatOfRect rectangles, int size) { | |
Mat dstImage = image.clone(); | |
for (Rect rect : rectangles.toArray()) { |
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
ssh [remotehost] 'cat /path/to/the/remote/file' | diff - /path/to/the/local/file |
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
rsync -e 'ssh -i [秘密鍵パス]' user@server:/path/to/the/remote/file /path/to/the/local/file |
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
byte[] buff = new byte[length]; | |
int i; | |
while((i = in.read(buff, 0, length)) != -1){ | |
long start = System.currentTimeMillis(); | |
out.write(buff, 0, i); | |
long diff = System.currentTimeMillis() - start; | |
Thread.sleep(1000 - diff); | |
} |
NewerOlder