312003-327176

311861-334518 subjects 312250-317285

^ 1.9, C extension vs encoding
312003 [vshepelev im] Ruby 1.9.
312329 [kubo jiubao.] rb_str_new() creates a ASCII-8BIT string in Ruby 1.9.

^ Add e method "inline" to an object?
312016 [ibc aliax.ne] SGksIEkga25vdyB0aGF0IEkgY2FuIGV4dGVuZCBhIENsYXNzIGluc3RhbmNlIChhbiBvYmplY3Qp
+ 312021 [flo andersgr] a =3D "a"
+ 312023 [ged FaerieMU] irb(main):001:0> object =3D Object.new
  312057 [ibc aliax.ne] Thanks to both :)

^ Iterating through a hash
312026 [p.brian.ross] How can I iterate through a hash so that each key is modified and saved into
+ 312027 [wpdster gmai] map = {}
+ 312030 [farrel.lifso] Hash[*hash.map{|key,value| [key.upcase, value]}.flatten]
| 312313 [anguskwan vi] *hash.map{|key,value| [key.upcase, value]}.flatten
+ 312034 [flo andersgr] #upcase doesn't modify the receiver.
+ 312037 [shortcutter ] Folks, thanks for leaving the #inject solution to me. :-)
| 312039 [martindemell] map = hash.inject({}) {|h, (k,v)| h.update({k.upcase => v})}
| + 312049 [p.brian.ross] Thanks everyone! Using Martin's example, how would I then use upcase for an
| | 312060 [martindemell] new_array = this_array.collect do |hash|
| + 312119 [shortcutter ] But with ugly and unnecessary brackets.  This works as well
+ 312128 [botp delmont] # I'd imagine that this would return map as a new hash with the=20
| 312149 [shortcutter ] ect like feature similar to plain arrays.
+ 313305 [clay daemons] class Hash

^ ActiveRecord Question -- making arrays or hashs out of database tables
312036 [glenn_ritz y] ctiveRecord is that you can use it as a kind of bridge between Ruby and a r=
+ 312043 [dlb.id.au gm] Yes, you can do that.
+ 312873 [fxn hashref.] I believe this is overkill for an ORM, you can just use the DBI

^ Alternatives to class variables
312038 [sam.hendley ] ruby for a couple of weeks so forgive me if its overly simple, I spent a
312145 [pit.capitain] Welcome Sam. Before answering, let me ask you two more questions :-)
312171 [sam.hendley ] Thanks for the response.
312258 [pit.capitain] Great!

^ unintuitive language feature (exclamation functions)
312048 [ruby-forum.c] I was surprised to discover that the code
+ 312050 [fred lacave.] Please provide some code to demonstrate this.  I'm willing to bet
| 312054 [ruby-forum.c] #!/usr/bin/env ruby
| + 312061 [stefano.croc] If in your first post you'd have stated more clearly what you expected and
| | 312063 [patrickli_20] I would agree with Stefano. I doesn't look like an issue with sub and
| + 312062 [fred lacave.] Don't ask me why (yet) but...
| + 312064 [brabuhr gmai] Internal to the CGI object, it appears that "a" in the @params hash is
| | 312066 [brabuhr gmai] z.rb:7: warning: don't put space before argument parentheses
| | 312069 [ruby-forum.c] So the problem doesn't seem to be with sub! at all. It's with cgi.
| | + 312075 [stefano.croc] The string returned by Cgi#[] are extended by the CGI::QueryExtension::Value
| | + 312081 [dblack rubyp] Not necessarily. Objects do what they do. Classes are mainly a way to
| | + 312085 [gregory.t.br] => "foo"
| + 312065 [ruby-forum.c] I'm starting to wonder if this is actually a bug in Ruby? The
|   312070 [brabuhr gmai] #!/usr/bin/env ruby
|   312071 [brabuhr gmai] irb(main)> cgi = CGI.new('html4')
|   312072 [brabuhr gmai] irb(main):061:0> b = "hi"
|   312077 [brabuhr gmai] require 'cgi'
+ 312051 [gregory.t.br] If the two were identical, why would we have both sub and sub! methods?
+ 312053 [stefano.croc] Unless I misunderstood you, you're asking why two different methods
+ 312108 [uzimonkey gm] This works.  Doing it this way returns the actual string, not some

^ best way to connect to ftp server through proxy?
312052 [shane digita] The only docs I found on this is using a SOCKS proxy. What's the best way to
312180 [shane digita] Replying to my own post in case anyone else needs the code (all of one

^ Dynamically Create Class. (or. Why is eval() messy?)
312055 [patrickli_20] I'm trying to create a utility method that will automatically create a
312058 [stefano.croc] You're almost there. This works
312059 [patrickli_20] Ah =), that's quite lovely. Thank you.

^ Time, Date o DateTime?
312067 [ibc aliax.ne] e=20

^ "num in [1,2,3,4]" in a cool way?
312068 [ibc aliax.ne] if num in [1,2,3,4]
+ 312073 [Rob AgileCon] if [1,2,3,4].include?(num)
| + 312078 [ibc aliax.ne] Thanks.
| + 312097 [m.fellinger ] T24gVGh1LCBBdWcgMjEsIDIwMDggYXQgNjo0MSBBTSwgUm9iIEJpZWRlbmhhcm4KPFJvYkBhZ2ls
|   312100 [martindemell] ary.inject([num, false]) {|(n,a), i| [n, a | (n == i)]}.last
|   312101 [mikael hoilu] true
|   312102 [martindemell] or even
|   312152 [shortcutter ] But since you asked...
|   312156 [robert.dober] In case of ranges #include? really should be your choice, it seems to
+ 312076 [stefano.croc] if [1,2,3,4].include? num
+ 312080 [martindemell] class Object
+ 312095 [frederick.ch] Well not saying this is actually a good idea, but...
+ 312194 [gregory.t.br] num.between?(1,4)
  312207 [ibc aliax.ne] Great, I didn't know!  :)
  + 312209 [gregory.t.br] Sure, this is implemented by Comparable, so you just need to include
  + 312247 [botp delmont] # > num.between?(1,4)
    312264 [robert.dober] The same warning holds for Range#include? of course

^ (none)
312074 [functional.n] unsubscribe Cedric Allam

^ Help
312088 [gizabo yahoo] okay, so in the book im reading it wanted me to do 2 things
+ 312089 [botpena gmai] start here http://pine.fm/LearnToProgram/
| 312091 [gizabo yahoo] that was helpful
+ 312164 [victor.reyes] Daniel,

^ [ANN] Ruby Hoedown 2008 Videos Now Live
312090 [carl youngbl] <p>We just got finished uploading the last of the videos from Ruby

^ Validation
312104 [hema angleri] I have Column called Description In My Table.
312121 [phlip2005 gm] But you should read /Agile Web Development with Rails/, by the Daves, before

^ Ruby/DL: How to create and use a buffer?
312106 [vze26m98 opt] I'm trying to hookup Erik de Castro Lopo's libsndfile with Ruby via
312167 [vze26m98 opt] buffer = DL::CPtr.malloc(40)

^ Re: GrowlNotifier 1.0.1
312110 [e.duran supe] At some point we decided we wanted to extract this code as a separate

^ IMG (REGULAR EXPRESSIONS
312111 [hema angleri] I Need to Extract Img tag Using Regular Expressions From The Html Page
+ 312120 [shortcutter ] I would choose a different regexp.
+ 312122 [phlip2005 gm] Regexp is not a parser; it strongly resists matching well-formed syntax, such as
  312123 [phlip2005 gm] Another way to scrub input is don't allow raw HTML. Only allow a wiki markup,

^ each, stuck up...
312114 [kathe.mayure] A while back there was this discussion about what code could crash irb
+ 312115 [jcoglan goog] In the above example, x is the value of each member of the array, not its
+ 312116 [robert.dober] looks like an endless loop to me, well and to irb too ;)

^ Grabbing Text From a Website
312117 [kmurph79 hot] Let's say I wanted to make a program that traversed all 125 products on
312124 [brabuhr gmai] I have used: mechanize, scrubyt, and firewatir

^ begin ... while ...  ???
312118 [kdream95 gme] def test_begin_while(*l)
+ 312155 [shortcutter ] irb(main):005:0> def test_begin_while(*l)
+ 312467 [angico angic] If I did well understand, you just want to catch the values passed in as
+ 312470 [tpreal gmail] It works like this because your line works like

^ confused by this simple regular expressions behaviour
312127 [adamtemporar] why does this regexpression match
+ 312130 [stefano.croc] It's because \w stands for [a-zA-Z0-9], that is an uppercase letter or a
| + 312135 [adamtemporar] hey stefano thanks for pointing that out...cant believe i missed that
| | + 312137 [stefano.croc] As far as I know, there's not such shortcut.
| | + 312139 [botp delmont] RnJvbTogQWRhbSBBa2h0YXIgW21haWx0bzphZGFtdGVtcG9yYXJ5QGdtYWlsLmNvbV0gDQojIGlz
| + 312147 [dblack rubyp] And also underscore.
+ 312133 [wujciol gmai] Posted via http://www.ruby-forum.com/.
  312136 [adamtemporar] Thanks Mateusz as well!

^ STRING FUNCTIONS
312129 [hema angleri] I have string.
+ 312131 [wujciol gmai] name[0] #shows code
+ 312132 [stefano.croc] Try String#[] or String#slice, but since they return a number (the code of the
+ 312134 [pilz osp-dd.] "ASDASDAS"[0] -> 65

^ RSS FEEDS
312138 [hema angleri] Using Rss Parser I loaded Some Url's into the database.
312150 [phlip2005 gm] Instead of the last line, does this work?

^ REGEXP HELP
312142 [hema angleri] I Need to Extract Img tag Using Regular Expressions From The Html Page
312143 [etaern yahoo] Instead of using a regular expression you could consider a html parser ,
312146 [wieczo.yo go] require 'open-uri'
312151 [hema angleri] yes i used as this
312153 [pilz osp-dd.] Then do
+ 312154 [etaern yahoo] i'm not really sure about hpricot , but with html/tree parser , when you
+ 312254 [hema angleri] yes It works..

^ Curses replacement for JRuby?
312144 [hramrach cen] Is there some replacement for Curses in JRuby?

^ [ANN] Rack 0.4, a modular Ruby webserver interface
312148 [chneukirchen] Today I'm proud to release Rack 0.4.

^ does ruby have source filters?
312157 [etaern yahoo] I come from a perl background , and in perl there was a module called
312158 [fxn hashref.] Not builtin.
312160 [cdj goh-inc.] WW91IGhhdmUgdG8gYWN0dWFsbHkgY2FsbCBpdCBieSBpdHMgZm9yZWlnbiBuYW1lLiBMaWtlIEls
312168 [etaern yahoo] What is Ilterfay::Implesay? Neither google , nor rubyforge returns any
312173 [rmagick gmai] Posted via http://www.ruby-forum.com/.

^ class << Array vs. Array.class
312159 [niklas.baums] i just wondered where the difference between the following code parts is?
+ 312161 [perfectly.no] "class << Array" opens the eigenclass of the Array object.
| 312163 [niklas.baums] thank you!
+ 312162 [jcoglan goog] Array.class is equal to Class -- all classes are instances of Class. So, the

^ RDTool Status
312165 [transfire gm] Is anyone using rdtool? Is anyone actively maintianing it?

^ Find all subclasses of a class/module
312166 [jcoglan goog] I'm trying to find all the classes/modules that descend from a particular
+ 312176 [black.eyes.c] the following are code in http://gist.github.com/6560
+ 312179 [ara.t.howard] class A
  312195 [jcoglan goog] That's probably more efficient than my version, but won't it fail to capture
  312222 [ara.t.howard] that's correct.  generally that's what people are after.

^ hahses and sort
312169 [adamtemporar] i have a hash whose values are hashes themselves like this
+ 312174 [farrel.lifso] In general hashes are not ordered data structures.
+ 312175 [etaern yahoo] state_hash.each_key do |key|
+ 312178 [rmagick gmai] Hashes are by definition unordered. The best you can do is make an array
+ 312243 [botp delmont] RnJvbTogQWRhbSBBa2h0YXIgW21haWx0bzphZGFtdGVtcG9yYXJ5QGdtYWlsLmNvbV0gDQojLi4u
  312245 [adamtemporar] wow thanks for that. I actually found a post which had similiar syntax

^ Re: Ruby/SerialPort Library is slow/delay/portions on Window
312170 [rogerpack200] If you're not afraid of experimenting then you could try it

^ FILE * friom C to ruby with swig
312172 [lyesjob gmai] FILE * getContent (void  * objetc, char  * code);
+ 312196 [alex deletem] <SWIG::TYPE_p_XXX> is what SWIG returns when it doesn't know how to deal
+ 312199 [hramrach cen] What you get is a FILE * object which ruby cannot handle. However, you
  312358 [lyesjob gmai] OK, thank you all, I will try your suggets!

^ (none)
312177 [mariano.ayes] unsubscribe=0A=0A=0A      Yahoo! Cocina=0ARecetas pr=E1cticas y comida salu=

^ copy a folder and its contents
312181 [aidy.lewis g] I am looking at copying a folder and its contents from one destination
312182 [etaern yahoo] use cp_r
312183 [aidy.lewis g] Thanks, I had previously tried it and received this recursive
312184 [shortcutter ] This comes as no surprise because you are trying to copy a folder
312197 [uzimonkey gm] It looks like he's just trying to make a backup of all the files in a
312253 [ninja slapha] files = Dir.glob('*') - ['backup']

^ possible simple marshall error
312185 [etaern yahoo] I recently tried to learn to use Marshal with a simple script , but I
+ 312186 [ara.t.howard] you are probably on windows and have forgotten to open the file in
| 312188 [etaern yahoo] I am using opensuse , could binary files be a issue on linux ?
+ 312187 [michael.c.li] This line is actually the problem from what I can tell.
  + 312189 [etaern yahoo] Thanks Michael , that was the problem indeed . But , what is the
  | 312192 [michael.c.li] See my other post in this thread on buffering. What makes it even
  | 312193 [etaern yahoo] thanks !
  + 312190 [michael.c.li] And allow me to point out why what you have "should" work (and might
  + 312191 [shortcutter ] To explicitly state it: the issue is caused by not proper closing file
    312198 [michael.c.li] Good suggestions.

^ Lower verbosity in IRB?
312200 [kyleaschmitt] OK, this is probably a very basic question, but how do ou go about
+ 312201 [jcoglan goog] You need to get the statement to evaluate to something short, preferably
| + 312204 [Rob AgileCon] log = File.read('backup_08192008.log'); nil
| + 312206 [fred lacave.] irb prints the last statement, in fact.  Just adding ; nil at the end
|   312211 [kyleaschmitt] Fred, nice trick with .read I like that.
+ 312202 [stefano.croc] You need to create a .irbrc file in your home directory with the line
| 312205 [zhao.lu.us g] You can achieve the same effect at runtime without messing with .irbrc if
+ 312203 [patrickli_20] A simple workaround is to surround your code with begin/end statements.
+ 312208 [vjoel path.b] You can set up irb to limit the number of chars it prints. Put the
  312213 [vjoel path.b] I hadn't looked at that code in a long time. The following is cleaned up

^ Re: REXML (1.8.6-p110) backwards compatibility problem with
312210 [jdutil21 gma] ...prefix.../ruby/gems/1.8/gems/rspec-1.0.8/lib/spec/rake/verify_rcov.rb
327176 [josh.m.sharp] I'm having the same issues as Jeff but am running ruby 1.8.7

^ stop ruby service
312212 [msh_maryam y] I want to stop ruby service on my linux server.
312216 [damnbigman g] If ruby is running then you still have something running ruby.  You could
312217 [maryam.shoey] ld
+ 312218 [etaern yahoo] killall ruby
+ 312219 [damnbigman g] Something is running frequently that is spawning different ruby processes,
  312233 [msh_maryam y] Thanks guys, all your note was helpful.
  312234 [damnbigman g] Sorry can't help you on that one.  I'm not sure how your system is

^ Re: Ruby GC
312214 [rogerpack200] For the record, MRI 1.9 sorts its 'free' objects in ascending order,

^ Can install RedCloth
312220 [bjohnson con] This is a strange error, but I am getting this error on all of my
312613 [rogerpack200] Seems to be working here.  It even compiles straight up using mingw and

^ want to compare data in two files.
312221 [viupljindal ] I have two CSV files and i want to find the duplicates records.
+ 312224 [shortcutter ] Not sure what you want (or rather, why you are asking here if you just
+ 312242 [martindemell] if it's just one word per line and the files aren't huge
+ 312255 [kathe.mayure] I'm not a master of the language yet, but based on what I've learned,
  312261 [timrandg gma] To identify duplicates the 'array1 & array2' solution given above is

^ [ANN] ditz 0.5 distributed issue tracker released
312223 [wmorgan-ruby] Ditz version 0.5 has been released!

^ download britney spears videos http://gpirate.com/search?hl=en&q=britney+spears
312225 [olympicslove] download britney spears videos

^ What does :: mean at the beginning?
312227 [ibc aliax.ne] repo =3D ::Logging::Repository.instance
+ 312229 [jameskilton ] It's an "ensure you're pulling from the top level". Works exactly the
| 312231 [ibc aliax.ne] module A
+ 312230 [ara.t.howard] start a the 'top' namespace

^ [ANN] restarts 1.0.2 Released
312235 [architbaweja] restarts version 1.0.2 has been released!
312251 [ara.t.howard] using callcc?

^ Re: How to sort this hash?
312244 [adamtemporar] jobs.sort{|a,b|a[1][sort_by] <=> b[1][sort_by]}.each do |k, attributes|
312246 [adamtemporar] just found the answer to my question here

^ PARSER
312248 [hema angleri] What is Parser???
+ 312268 [shortcutter ] Ever heard of Goole or Wikipedia?
+ 312278 [phlip2005 gm] "Parse" means "cut into chunks".

^ using ruby from svn
312249 [jayeola gmai] I once built ruby 1.X from source and worked out that I needed to
312263 [roberto REMO] No, rubygems has been included in the 1.9 trunk for quite a while now.
threads.html
top