174137-175889

173909-178505 subjects 174367-175363

^ method &block question
174137 [SimonKroeger] could someone please put a finger on the point i'm missing?
174139 [SimonKroeger] It does not, the array is simply splashed when passed to 'p', so p

^ red cloth question
174142 [sean ardismg] can someone point me in the direction of documentation for tweaking red
174188 [rosco roscop] require 'redcloth'
174253 [sean ardismg] Thanks Ross,

^ fxri incomplete
174145 [x versatechs] I like fxri but why is it that some very essential libraries, e.g. the
174156 [tmorse gmail] Fxri is based on ri. Ri by default only contains documentation on the
174161 [x versatechs] I've just found out that the online "Ruby Standard Library
174201 [james_b neur] That page should also have a link for downloading a tarball or zip file

^ Re: Newbie tearing hair out
174157 [page77.offic] Many thanks to all who responded.  It turned out that the problem was

^ web examples
174159 [faruqfayaz g] i'm thinking about getting into Ruby. I want to build web browser based
+ 174162 [leavengood g] You seem to be one of the rare people who heard about Ruby before
| + 174169 [faruqfayaz g] Thanks. Ruby sounds good.
| | 174200 [james_b neur] Me too.  Better to look stupid than stay stupid.
| + 174226 [perrin apoth] I'm not so sure it's all that rare . . . it probably just isn't very
|   174342 [slitt earthl] I heard about Ruby years ago, but "so many languages, so little time", so I
+ 174164 [balcersk wsi] What do you mean by web browser based applications?
  + 174170 [faruqfayaz g] I'm from a Flash actionscript background so used to building rich media
  | 174180 [faruqfayaz g] Can Ruby produce something like space invaders delivered through a
  | + 174192 [rosco roscop] Probably. But whether anyone could actually use it is a different
  | + 174229 [perrin apoth] Technically . . . yes.  Realistically . . . not so much, at this time,
  |   174270 [faruqfayaz g] thanks guys,
  + 174227 [perrin apoth] I get the distinct impression that what's meant here is "a web

^ Newbie - Problem One - Ruby and MySQL
174160 [page77.offic] I have ruby, apache and MySQL installed via instantrailson Windows XP
+ 174196 [x versatechs] There is no native Ruby to MySQL adapter under Windows. That is why
+ 174215 [jonbaer gmai] require 'rubygems'

^ Newbie - Problem Two - Ruby and Form Variables, re-loading like PHP_SELF
174163 [page77.offic] I am attempting to copy a PHP project I did in Ruby.
174294 [ef alum.mit.] If I remember my PHP correctly, $_SERVER['PHP_SELF'] is simply the
174307 [ryansobol gm] Actually, you'll also need to call basename().  So,
174393 [page77.offic] Thanks for the replies, and yes PHP_SELF is the name of the running
174406 [ryansobol gm] basename() is a PHP function, not a Ruby one.
174409 [james graypr] $ ri -T File::basename
174413 [ryansobol gm] Thanks James.  :)

^ using irb
174202 [info jayeola] So far I've created a ~/bin/rb/dev/foo directory as a place to write and test scripts. After reading the "pick axe" book some more it seems as is irb is a better "place" or "way" to try out stuff. This correct?
+ 174211 [cyclists nc.] Many (perhaps most) Rubyists use irb to try out simple Ruby stuff. I
| + 174214 [james_b neur] I edit in gvim, with the Ruby menu and macro stuff,  and it's trivial to
| | 174255 [gregory.t.br] I use plain old vim and gvim and have both irb and the ruby
| | + 174268 [nbarnes gmai] After a great deal of annoyance getting started with Ruby, I'm getting
| | + 174273 [rasputnik gm] Nice, have you got any config snippets you wouldn't mind sharing?
| |   + 174335 [gregory.t.br] I'll paste in my .vimrc and my .irbrc file (the latter was lovingly
| |   | 174337 [ryansobol gm] charset=US-ASCII;
| |   | 174338 [james graypr] I was having trouble with IRb at some point and that was the fix.
| |   | 174400 [rosco roscop] Still useful though - I use something similar to allow symlinks to launch
| |   + 174336 [gregory.t.br] You probably just wanted this though: ;) (slap in .vimrc)
| + 174237 [hal9000 hype] But beware. You can get strange results 1% of the time... as a result
+ 174218 [pjlegato blu] irb is great for rapidly getting a feel for how things work, since you
  174235 [perrin apoth] Assuming you mean that using irb alone shouldn't give you the impression

^ Default block parameter?
174207 [mreed theree] Okay, this is probably a dumb question, but how do I declare an
+ 174212 [james graypr] ?>     lambda { puts "Default block" }.call
+ 174219 [pjlegato blu] def foo(block = lambda {|i| puts i})
+ 174221 [dblack wobbl] The &block thing is a special dispensation from Ruby, letting you grab
  174334 [lukfugl gmai] But keep in mind that assigning to block inside the method doesn't
  174340 [dblack wobbl] Right -- all that happens in my version is assignment to a variable.
  174491 [mreed theree] Thanks to all who posted.  The upshot seems to be that I need to declare

^ Uploading data to MS SQL Server - problem with quote character
174209 [sam.dela.cru] I'm a ruby newbie.  On one project I have, I need to upload data coming
174216 [warrenbrown ] Sam,
174420 [blargity gma] You'll also want to escape the usual SQL special characters, namely

^ win32ole and mci.mmcontrol failure
174228 [djberg96 gma] Windows XP, SP2
174283 [vanek acd.ne] irb(main):001:0> require 'win32ole'
174296 [djberg96 gma] I don't see it.
174301 [vanek acd.ne] i think the ocx is automatically installed with Visual C++, Visual Basic, and

^ Extreme dynamism examples for showing off Ruby power
174234 [dsymonds gma] I'm giving a presentation to my research group next month about Ruby
+ 174240 [ryansobol gm] Many solutions to the latest ruby quiz used breadth-first search, a
+ 174261 [bob.news gmx] I always like the interchangeability of lambda#[] and Hash#[] which allows
+ 174265 [rosco roscop] Well, I don't know how much they'll impress such old salts, but you can

^ Re: [RUSSELL] Proposed new rule
174239 [james_b neur] But of course!

^ net/ssh: corrupted mac detected
174242 [itsme213 hot] Never did quite get past this error when using net/ssh. Any suggestions?
174266 [rosco roscop] [... snip ...]

^ Pulling XML from Amazon API
174247 [jonathan.ott] Take Amazon's API for example, returning a XML file. In my application
174248 [lyndon.samso] Heres a starter for .2  Note the use of a Proxy.
174249 [jonathan.ott] is that a common way of getting data from an API and manipulating it?
174250 [twifkak comc] Isn't amazon's API xmlrpc or soap?
174254 [jonathan.ott] OK, I see now how to use Amazon's through SOAP or XML RPC.... but let's
174274 [damphyr free] The use of the proxy is optional (if there is a proxy inbetween then you

^ Net::Telnet and sysread()
174251 [willshattuck] I'm trying establish a telnet connection to nethack.alt.org.  I canget a connection but Net::Telnet cannot seem to handle the output.  Inreading net/telnet.rb I found out about IO#sysread so i put thislittle tnet.rb file together

^ Demystifying Symbols.
174257 [groups grand] I was actually doing really well until the strange discussion involving
+ 174258 [perrin apoth] The integer value can be regarded as a side effect of the way symbols
| 174366 [slitt earthl] Internals question: Curious -- why don't they hash with the object id instead?
| 174370 [slitt earthl] Oh never mind -- a more careful reading of Evan's internals explanation makes
+ 174286 [dblack wobbl] That depends.  If you're calling a method that insists on a Symbol
| 174313 [perrin apoth] I guess that, if you want to compare them to "variables" (things that
+ 174302 [itsme213 hot] Yet another try ...
+ 174365 [slitt earthl] Yeah, that was quite a breakthrough for me too. I coded it to prove it to
| + 174402 [lyndon.samso] How about logging method names in a human readable manner using id2name ?
| + 174484 [groups grand] Exactly. So if I'm going to try explaining Symbols to somebody who's
| | + 174495 [jim weirichh] Hmmm ... see http://onestepback.org/index.cgi/Tech/Ruby/Shoeboxes.rdoc
| | | + 174701 [gavin refine] Good point in your article - shoeboxes (or pigeonholes, as I
| | | + 174739 [groups grand] Oh, I definitely agree. But again, my explanation is specifically for
| | |   174742 [gwtmp01 mac.] I think the keychain analogy has some possibilities.
| | |   174762 [alex.combas ] I'll be honest, as a rubynewbie I liked Jim's description of variables
| | |   174763 [lyndon.samso] In this dictionary more than one variable is permitted to be bound to
| | |   174770 [alex.combas ] I don't know if this is what you are looking for, but this is how I
| | + 174506 [rosco roscop] f = File.read(:"/etc/passwd")
| |   174728 [groups grand] Hmm. But that's the opposite of what I said. I'm not too dismayed if
| |   174731 [dblack wobbl] A number of methods in the various Rails libraries only work with
| + 174687 [a.mcguinness] That's true, but only because attr_accessor can convert the Strings it
+ 174386 [jim weirichh] The problem with programming is that
+ 174631 [chris pine.f] This is why writing a decent tutorial is so hard.  Unless you really
  174736 [perrin apoth] I tend to assume one knows a little something about strings and variable

^ About The Pickaxe 2nd ed. and Ruby 2
174262 [biyokuantum ] I have just ordered the Pickaxe 2nd ed. from Amazon. But now I am
+ 174269 [ptkwt aracne] First off, I don't know if anyone really knows when Ruby 2.0 will actually be
+ 174468 [chneukirchen] Should the changes to Ruby 2 be significant enough to make code
+ 174655 [gene.tani gm] ...

^ Re: [ANN] Rio 0.3.7
174275 [wybo servaly] Great! That solved my problem with rio#mkdir with 0.3.4 under linux!
174297 [dave.m email] Very nice!
174325 [trashcan hot] Bravo !
174326 [duane.johnso] impressed!  I have a few interface questions for you--things that

^ String utf8 size in kilobytes
174276 [dewie itxl.n] I have a mimemessage in a string.
174284 [f andreas-s.] String#size returns the size in bytes. String#jsize returns the number
174285 [dewie itxl.n] Thanks, then my method is valid, i want to know the bytes, so that's

^ Redirecting CGI#out to a string
174277 [zyzygy telst] For my first "production" ruby app, I'm writing a self contained web
174278 [rosco roscop] require 'cgi'

^ Vim two space indentation
174279 [info jayeola] This has probably been done before but I've looked through 5000+ emails and I've not seen a simple solution. I'd like to have two space indentation for *.rb files or those whose first line begins with !#/usr/bin/ruby. At the moment vim gives me eight spaces, (or is it a tab?).
+ 174281 [ruby anthrop] } Hi guys,
| + 174289 [rosco roscop] set nocompatible
| + 174293 [info jayeola] Thanks!
+ 174299 [oliver.andri] I use a setting like that in my .vimrc file.
+ 174430 [gsinclair gm] The best answer is to create a file ~/.vim/ftplugin/ruby.vim with the
  174432 [eban os.rim.] In this case, it might be better to use setlocal instead of set.

^ Field Scope
174282 [forest.aa gm] what is the scope of @run field in the code below.  Is it module static
174292 [rosco roscop] Forget about static and all that, and remember that modules are objects
174298 [forest.aa gm] Thanks a lot, it explains everything.
174300 [rosco roscop] I feel the same way, but I realise now that I feel that way because I

^ [SUMMARY] Numeric Maze (#60)
174288 [james graypr] As with so many of our Ruby Quiz problems, this is another pathfinding
+ 174308 [kero chello.] Are they really faster? Ruby bits are not directly in CPU registers.
| + 174310 [james graypr] Good point.  Thanks for showing us the real story.
| + 174317 [ryansobol gm] As I suspected.  Stupid C idioms.  :)
| + 174322 [vanek acd.ne] The shift operator comes in handy and can save a lot of time.
| | 174372 [SimonKroeger] This is an implementation detail,
| | 174412 [vanek acd.ne] Then I guess I just love implementation details.
| + 174466 [chneukirchen] IIRC, a bitshift on modern Intel processors is extremely inefficient
+ 174330 [steve waits.] I think that the purely binary pattern/bit-twiddling based solutions

^ need create RTF-type file and DOC-type file
174305 [keal21 mail.] i need library to create RTF-type file and DOC-type file.
174319 [mblondel gma] huh?

^ how remove puts inside method?
174312 [  k eboy.com] I have a method (process_transaction) that uses puts to output a result.
174314 [  k eboy.com] For example I would like to remove puts from the process_transaction
+ 174316 [bob.news gmx] I'm not really sure what you're up to.  Can you elaborate?  The only thing
| 174352 [  k eboy.com] I'd like the output of process_transaction as a long string. But I don't
| + 174435 [bob.news gmx] The parts after "or" will never be called because each returns the
| | 174459 [  k eboy.com] thanks Robert ... but it did not work out ...
| | + 174460 [lyndon.samso] A simple solution is you can allways stuff your output in an array.
| | + 174479 [bob.news gmx] Somehow I find your design a bit contrived: you store your meta data in
| |   174592 [  k eboy.com] Thanks Robert! This works beautifull!
| + 174461 [kevin.olbric] Just put this type of structure in whichever function you are trying to
|   174476 [  k eboy.com] thanks a lot, now it works: http://rafb.net/paste/results/8FsA6E62.html
|   174514 [kevin.olbric] "output" is just a string variable with a confusing name, you could call
+ 174320 [kevin.olbric] You could just mash the output into one long string...
+ 174321 [ara.t.howard] require "yaml"

^ Trapping errors, a simple example
174318 [info jayeola] Hey Chaps,
174324 [bob.news gmx] p.chomp!
174327 [james graypr] You might also want to take a look at HighLine[1], which can make

^ Snakes and Rubies Video and Audio Online!
174323 [ng johnwlong] It is my pleasure to announce that the video and audio from the Snakes
174449 [Bil.Kleb NAS] Thank you.
+ 174516 [dan danshafe] Those videos were interesting. Thanks for the pointer.
| 174517 [ryansobol gm] An event like this would _probably_ interest those who already know
| 174586 [ng johnwlong] And there is a nice list of other blog entries at the bottom of David's
+ 174584 [ng johnwlong] Enjoy! :-)
  175179 [Bil.Kleb NAS] Excellent.
  175268 [david vallne] Oooh, now there's a great gimmick to annoy anyone at uni that restricts

^ Ruby equivalent of Lex (or Flex)?
174329 [thp cs.ucr.e] I'm interested in writing compilers in Ruby.  It appears that Racc is
+ 174362 [collinsj sea] Rex?
+ 174382 [doug00 gmail] ANTLR 3.0 (still in alpha and likely to remain so for another year or

^ [ANN] Instant Rails 1.0 Final has been released!
174331 [curt.hibbs g] This release is unchanged from release candidate 1 other than to update the
+ 174369 [slitt earthl] When?
| 174397 [ml.chibbs gm] Hard to say.
+ 175873 [james_b neur] Curt, can you explain how I configure Instant Rails to run MySQL on a
  175886 [ml.chibbs gm] When you're editing the MySQL config file (from the "I" menu, as you
  175889 [james_b neur] Perfect.

^ Inherit, Delegate, or Forwarding?
174341 [netghost gma] When do you guys choose to inherit from a class, use a delegate, or
174390 [james graypr] As the saying goes, "Favor composition over inheritance."  The theory
174395 [Daniel.Berge] Note that, with some help, I revamped forwardable.rb and it has been

^ Initialization using the Singleton design pattern
174343 [lists turnip] I have a singleton class, as in one that does "include Singleton". I
+ 174345 [james graypr] => true
| 174375 [lists turnip] Okay thanks, I've got it sorted now. I had tried using initialize()
+ 174346 [halostatue g] Right. Just use #initialize as normal, though.

^ net/imap idle
174348 [payton foolo] Perhaps there's another way to do this without polling, but I added the

^  =?euc-kr?B?T3ZlcnJpZGRlbiBBcnJheSNbXT0gbWV0aG9kIHJldHVybnMgdW5leHBlY3RlZCB2YWx1ZQ==?=
174349 [ladylazy ter] I overrode Array#[]= like this on irb

^ Re: Overridden Array#[]= method returns unexpected value
174350 [james graypr] Assignment always results in the value that was assigned in Ruby.  We

^ Can't find ruby after installation
174351 [nirav.dani g] I skipped ruby selection while installing mandrake 10.1 with an
+ 174353 [tibbettj ver] It's probably in your current working directory (i.e. from wherever you
| 174354 [zacharooni c] During the .configure you can pass the parameters to set that at runtime
+ 174356 [elmo home.hj] You might need to run 'make install' as root to actually install it,
  174371 [nirav.dani g] Strange!! last time I kept the distro version, and

^  =?euc-kr?B?UmU6IE92ZXJyaWRkZW4gQXJyYXkjW109IG1ldGhvZCByZXR1cm5zIHVuZXhwZWN0ZWQgdmFsdWU=?=
174355 [ladylazy ter] I'm just studying now .Thank you.

^ Is it possible to create a GUI/TUI toolkit using ruby?
174357 [simonharriso] this may be a daft question, but is it possible to create a widget
+ 174363 [dan danshafe] I suspect it would be possible but I also suspect it would be quite
| 174723 [znmeb cesmai] In addition to Gtk and Fox, Qt is supported, as is Tk. I'm not sure but
| 174869 [tsumeruby ts] Qt widgets best looking? The GTK widgets look like candy as well when you use
+ 174381 [alec arlross] simonh <simonharrison@fastmail.co.uk> writes
+ 174383 [hynek usenet] It is possible. You'd just need an interface to the low-level graphical
| 174407 [kero chello.] (but it's been ages since I worked on it; Xlib is a beast, a monster; lots
+ 174385 [ilmari.heikk] Sure. All you need is a drawing backend and way to get input events.OpenGL for drawing and GLUT / SDL for input & windowsystem handlingwould work I guess.
+ 174415 [hutch recurs] It certainly can be done. The thing is it is a huge never-ending

^ Daemonize like fetchmail
174360 [payton foolo] Has anyone used the Daemons library (http://daemons.rubyforge.org/)
+ 174378 [ara.t.howard] ruby queue and dirwatch both do this.
+ 175168 [payton foolo] -Payton
  + 175174 [ara.t.howard] it does look useful.  few comments/suggestions though
  | 175190 [payton foolo] Would this be correct usage of the file, then?
  | 175194 [ara.t.howard] def pid
  + 175196 [jos catnook.] Instead of putting this logic in (every) application, have you considered
  + 175301 [snowzone5 ho] it certainly is :)
threads.html
top