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
/* | |
Settings (the ones below are examples: choose what is best for your data) | |
set lag to 5; # lag 5 for the smoothing functions | |
set threshold to 3.5; # 3.5 standard deviations for signal | |
set influence to 0.5; # between 0 and 1, where 1 is normal influence, 0.5 is half | |
*/ | |
// ZScore on 16bit WAV samples | |
func ZScore(samples []int16, lag int, threshold float64, influence float64) (signals []int16) { | |
//lag := 20 |
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
$ LD_PRELOAD=$PWD/sendmsg.so dig twitter.com @8.8.8.8 | |
;; Warning: Message parser reports malformed message packet. <-- malformed 因为把压缩指针当作域名一部分了 | |
;; Question section mismatch: got twitter.com/RESERVED0/CLASS256 | |
; <<>> DiG 9.9.5-3-Ubuntu <<>> twitter.com @8.8.8.8 | |
;; global options: +cmd | |
;; Got answer: | |
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 44722 | |
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 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
package main | |
import ( | |
"net/http" | |
"database/sql" | |
"fmt" | |
"log" | |
"os" | |
) |
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
# SSL self signed localhost for rails start to finish, no red warnings. | |
# 1) Create your private key (any password will do, we remove it below) | |
$ openssl genrsa -des3 -out server.orig.key 2048 | |
# 2) Remove the password | |
$ openssl rsa -in server.orig.key -out server.key |
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
group :production do | |
gem "unicorn" | |
end |
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
# encoding: utf-8 | |
require 'rubygems' | |
require 'haml' | |
require 'erb' | |
require 'erubis' | |
notes = [] | |
20.times { notes << {:title => "标题标题", :content => "内容,内容"} } | |
obj = { |