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
#!/usr/bin/env ruby | |
class Percentile | |
ROUND_DIGIT = 1 | |
def pctile(data0) | |
return [] if data0.empty? | |
data = data0.map{|x|Integer(x.round(ROUND_DIGIT) * (10 ** ROUND_DIGIT))} | |
sorted_data = data.sort | |
index_sum = Hash.new(0) | |
count = Hash.new(0) |
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
#!/usr/bin/env ruby | |
require 'oj' | |
class MyHandler | |
# see Oj::ScHandler | |
def hash_start ; {} ; end | |
def hash_end ; end | |
def array_start ; [] ; end | |
def array_end ; end | |
def add_value(value) ; value ; 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
;; Explicitly copy/paste between the kill-ring and x-clipboard | |
;; using the xlip command | |
;; C-c y : yank from x-clipboard | |
;; C-c c : copy from kill-ring to x-clipboard | |
(setq x-select-enable-clipboard nil) | |
(setq x-select-enable-primary nil) | |
(defun yank-from-x-clipboard() | |
"Yank from X clipboard using xclip." | |
(interactive) |
OlderNewer