Camelia, the Perl 6 bug

IRC log for #bioruby, 2012-10-21

| Channels | #bioruby index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
09:47 lintsu shevy: have you done graphic ruby programs?
09:50 shevy lintsu I worked with ruby-gnome for a while
09:51 lintsu shevy: how you pass arguments to ARGF with it?
09:53 shevy lintsu I myself do not use ARGF
09:53 shevy when you start a .rb file, the commandline data is available in the constant array ARGV
09:53 shevy I typically do something like this then:
09:53 shevy MyClass.new(ARGV)
09:53 shevy or
09:53 shevy MyClass.new(ARGV[0])
09:56 shevy lintsu, typically like this https://gist.github.com/3926564
09:57 lintsu hmmm
09:57 lintsu i have something like readFolder = ask_open_file
09:57 lintsu maybe I could have ARGV = ask_open_file
09:59 shevy no that is bad
09:59 shevy don't reassign to ARGV
09:59 lintsu ah
09:59 shevy just pass it to a method like any other argument
09:59 shevy the input of ARGV is by default "tainted"
10:00 shevy so that a user can not safely insert dumb or evil code with it
10:00 shevy that's why I tend to use .dup after sanity checking
10:00 lintsu but i have to use that ask_open_file command so that it ask for the fil
10:01 lintsu file
10:01 lintsu ah now I maybe get it
10:02 shevy well
10:02 shevy if it is your method, you can change it to anything you want to
10:02 shevy def ask_open_file(input = ARGV)
10:03 shevy ^^^ now, you can either specify a specific input, or if you omit it, it defaults to ARGV
10:03 shevy what is the current code you have?
10:03 lintsu i don't use methods because I didn't get it working :D
10:04 lintsu https://gist.github.com/7327c8c0149653bc9556
10:04 lintsu this is my whole code
10:05 lintsu it's the button "open sequence folder"
10:10 shevy methods are a must :)
10:10 shevy they arrange your code into logical parts
10:11 lintsu yeah that why I tried them :D
10:11 lintsu like that new button, it would great if I could call it on start
10:11 shevy hmm ask_open_file() is nowhere defined?
10:12 lintsu it's shoes own thing
10:12 shevy ah
10:12 shevy it is shoes way of getting user input?
10:12 lintsu yeah
10:12 shevy I see
10:12 lintsu i could check how it works
10:12 shevy you can use the commandline data then perhaps
10:12 shevy via ARGV
10:13 shevy before you start shoes
10:13 lintsu iiiii dont want commandline :D
10:13 shevy hehehe
10:13 lintsu i'm trying to get standalone app without commandline
10:13 lintsu so I can give it to lab workers
10:15 shevy ok
10:15 shevy I thought you need commandline information
11:59 lintsu http://bioruby.org/rdoc/Bio/FastaFormat.html lots of typos in that page :D
11:59 lintsu returens, seuqnce
12:42 shevy hehe
15:09 lintsu yay!! now it translates my fasta file :)
16:33 shevy \o/
16:33 shevy you could turn this into a gem one day :)
16:33 shevy it's simple
16:34 shevy (1) register at https://rubygems.org/
16:34 shevy (2) write one file called a .gemspec file, that describes about 5-6 components. then you can use a gem-command to build the gem, and use another gem-command to upload the gem to rubygems.org
16:34 shevy so that others can use it too, distributed!
16:39 lintsu :)
16:39 lintsu first I have to study how to use "tables" (arrays or hash)
16:42 shevy hehe
16:42 shevy array = []
16:42 shevy hash = {}
16:42 shevy that's it :)
16:42 shevy you can append to an array via <<
16:43 shevy array << 'this is the first string'
16:43 shevy array << 'this is the second string'
16:43 shevy hashes you can set directly
16:43 shevy hash[key] = new_value
16:43 shevy hash['cat'] = 'Garfield'
16:43 shevy hash['cat'] # this will query the value, which is 'Garfield'
16:50 lintsu hmm yeah
16:58 lintsu can I just say seqArray << File.read(file) ?
17:28 shevy what is seqArray
17:29 shevy but yeah try it, it should work
17:29 shevy yeah
17:29 shevy File.read(foo) returns a string
17:29 shevy so you absically append a string to your array
17:38 lintsu seqHash = {name, dna, protein}
17:38 lintsu seqHash << f.definition, s, s.translate
17:38 lintsu ?
17:38 lintsu there is syntax error with that
17:57 shevy joined #bioruby
23:25 audy joined #bioruby

| Channels | #bioruby index | Today | | Search | Google Search | Plain-Text | summary