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
lass Drio < Struct.new("Whatever", :fc_name) | |
def initialize | |
super @fc_name = Dir.pwd.split("/")[-1] | |
#@fc_name = Dir.pwd.split("/")[-1] | |
end | |
def show | |
@fc_name |
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
lass Drio < Struct.new("Whatever", :fc_name) | |
def initialize | |
super @fc_name = Dir.pwd.split("/")[-1] | |
#@fc_name = Dir.pwd.split("/")[-1] | |
end | |
def show | |
@fc_name |
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
def valid_run?(d) | |
%w{\. \.. qc test}.inject(true) { |prev, n| prev && (/#{n}/ =~ d) != 0 } | |
end | |
puts "drio VALID run?: " + valid_run?('drio').to_s | |
puts "test VALID run?: " + valid_run?('test_solid').to_s | |
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
module Foo | |
%w{ mount umount }.each do |m| | |
self.module_eval "def self.#{m}; puts '#{m}'; end" | |
end | |
end | |
Foo.mount | |
Foo.umount | |
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
Date: Tue, 30 Dec 2008 20:35:07 +0900 | |
From: Robert Dober <[email protected]> | |
To: ruby-talk ML <[email protected]> | |
Reply-To: [email protected] | |
Subject: Re: Why Ruby? | |
It is however quite obvious (my favourite prove method ;), | |
that the pressure which exists in our professional lives discourages | |
reflexion, deep understanding of what we are doing and innovative | |
decisions. It is my believe that the winning business model will be |
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
one_f, two_f = File.new("./one.txt", "r"), File.new("two.txt", "r") | |
while (l_one = one_f.gets) | |
while (l_two = two_f.gets) | |
puts "#{l_one} -- #{l_two}" | |
end | |
two_f.rewind # You were missing that!!!!!! | |
puts "----------------" | |
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
one_f, two_f = File.new("./one.txt", "r"), File.new("two.txt", "r") | |
one_f.each_line do |l_one| | |
two_f.each_line do |l_two| | |
puts "#{l_one} -- #{l_two}" | |
end | |
two_f.rewind | |
end | |
[ one_f, two_f ].each {|f| f.close} |
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
$ git push origin drio | |
Counting objects: 23, done. | |
Compressing objects: 100% (18/18), done. | |
Writing objects: 100% (18/18), 3.20 KiB, done. | |
Total 18 (delta 11), reused 0 (delta 0) | |
To 10.10.59.162:git_repo/egenotype.git | |
* [new branch] drio -> drio | |
$ git branch -a |
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
include Math | |
def chr_to_phred(s) | |
s.each_byte {|c| printf "%d,", (c-33) } | |
end | |
def chr_to_phred_chr(c) | |
#s.each_byte {|c| printf "%d,", (c-33) } | |
q = (10 * (log(1 + 10 ** (c - 64) / 10.0)) / log(10)).to_i | |
(((q <= 93) ? q : 93) + 33).chr |
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
def process_command | |
File.open(@o_file, 'w') do |of| | |
File.open(@i_file).each_line do |l| | |
of.puts affy_to_csv(l.split) | |
end | |
end | |
end | |
private | |