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) |
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
#!/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
##INFO=<ID=BaseQRankSum,Number=1,Type=Float,Description="."> | |
##INFO=<ID=InbreedingCoeff,Number=1,Type=Float,Description="."> | |
##INFO=<ID=ReadPosRankSum,Number=1,Type=Float,Description="."> | |
##INFO=<ID=NEGATIVE_TRAIN_SITE,Number=0,Type=Flag,Description="."> | |
##INFO=<ID=POSITIVE_TRAIN_SITE,Number=0,Type=Flag,Description="."> | |
##INFO=<ID=TOMMO_POSSIBLE_PLATFORM_BIAS_SITE,Number=0,Type=Flag,Description="."> | |
##INFO=<ID=CLNREVSTAT,Number=A,Type=String,Description="."> | |
##INFO=<ID=CLNSIGCONF,Number=A,Type=String,Description="."> | |
##INFO=<ID=CLNDISDBINCL,Number=A,Type=String,Description="."> | |
##INFO=<ID=CLNSIGINCL,Number=A,Type=String,Description="."> |
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
require 'statistics2' | |
def chisq_test(a, b, c, d) | |
total = a + b + c + d | |
row1_total = a + b | |
row2_total = c + d | |
col1_total = a + c | |
col2_total = b + d | |
e_a = (row1_total * col1_total).to_f / total | |
e_b = (row1_total * col2_total).to_f / total |
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 'optparse' | |
require 'fileutils' | |
require 'rubyXL' | |
require 'rubyXL/convenience_methods/cell' | |
require 'rubyXL/convenience_methods/color' | |
require 'rubyXL/convenience_methods/font' | |
require 'rubyXL/convenience_methods/workbook' | |
require 'rubyXL/convenience_methods/worksheet' |
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 | |
# $ ./klass.rb --hoge=fuga --hoge=puyo --foo=bar | |
# {:h=>false, :hoge=>["fuga", "puyo"] :foo=>["bar"]} | |
require 'optparse' | |
class Klass | |
attr_reader :opts | |
def initialize(opts) |
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 | |
# | |
# Blink all locate LEDs of an SAS-enclosure binded to a block device | |
# Hiroyuki Mishima ([email protected]) | |
# | |
require 'optparse' | |
class BlinkEnclosure | |
PARALLEL = "parallel -j1" |
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 PhysPosGrouping() | |
Dim oRange As Range | |
Dim lRorB As Long | |
Dim lColR As Long | |
Dim gcount As Long | |
Set oRange = ActiveSheet.UsedRange | |
lRowB = oRange.Row + oRange.Rows.Count - 1 | |
lColR = oRange.Column + oRange.Columns.Count - 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
#!/bin/bash | |
sel=$(byobu ls | peco | cut -d ":" -f 1) | |
if [ ! -z "${sel}" ] ; then | |
byobu a -t ${sel} | |
fi |
NewerOlder