275148-328306 subjects 275539-284407
another (simple!) eval question!
275317 [kmouse@gm il] greetings Rubyists,
275344 [shortcutter@] I have no idea why you think there should be an eval in there.
275324 [significants] the inconsistency in naming bothers me. :P I would imagine that it
+ 275334 [konrad@ty er] charset="utf-8"
| 275367 [rhkramer@gm ] buffet.
| 275368 [shortcutter@] I'm not sure what exactly you mean. #push and #pop just work as one
| + 275373 [rhkramer@gm ] want
| | 275375 [dblack@ru yp] Have a look at #shift and #unshift.
| | 275437 [rhkramer@gm ] Thanks! (I did notice those later.)
| + 275569 [hawat.thufir] Perhaps he means to work with a FIFO?
| 275847 [rick.denatal] Or, in a similar vein perhaps Disney.
+ 275337 [hawat.thufir] <http://en.wikipedia.org/wiki/Stack_%28data_structure%29#Operations>
+ 275338 [shortcutter@] I think you just should get used to the terminology. Whatever naming is
| 275354 [significants] *yawn* oh, what? people have been using these terms for a long time?
| 275360 [richard.j.da] One of the strengths of Ruby is that it borrows good things from
| 275396 [jgabrielygal] class Array
| + 275400 [dblack@ru yp] ...
| | + 275408 [jgabrielygal] Fair enough, although the idea was to use such an object using just
| | | 275411 [dblack@ru yp] ...
| | | 275416 [hutch@re ur ] This is potentially a troublesome implementation. I believe that the
| | | 275421 [jgabrielygal] T24gMTAvMjMvMDcsIEJvYiBIdXRjaGlzb24gPGh1dGNoQHJlY3Vyc2l2ZS5jYT4gd3JvdGU6Cj4g
| | + 275579 [caduceass@gm] Not only that, but enqueue and dequeue return different objects.
| | 275582 [caduceass@gm] Hmm. I guess shift/unshift are like that too. Sorry for the noise.
| | + 275594 [jgabrielygal] Well, I answered to this thread not because I had any problem with the
| | | 275600 [caduceass@gm] You want to -- as mentioned elsewhere in this thread -- push it in the
| | | + 275602 [hutch@re ur ] def dequeue
| | | | 275605 [caduceass@gm] Bob, I can only guess that the grief you are talking about has
| | | | + 275621 [caduceass@gm] Okay, I guess I can answer my own question. Binding is resolved when
| | | | | 275687 [dblack@ru yp] irb(main):014:0> a = 1,2,3
| | | | | 275701 [caduceass@gm] You're right David. That was supposed to be b = a and _not_ b = a.
| | | | + 275630 [hutch@re ur ] It has to do with an optimisation in the implementation of shift
| | | | 275685 [robert.dober] Sorry for replying to my own post, can somebody confirm please that
| | | | 275704 [hutch@re ur ] class Thing
| | | | 275709 [robert.dober] Amazing Bob,
| | | | 275730 [hutch@re ur ] The code in Ruby that deals with the stuff before the start of the
| | | | 275795 [hutch@re ur ] How else would you describe the 10k Things left in memory after the
| | | | 275837 [eric.mahurin] The problem is that Ruby's COW (copy-on-write) scheme is messed up for
| | | | 275880 [hutch@re ur ] Eric, thanks for the information.
| | | | 275892 [eric.mahurin] I believe matz tried incorporating it about a year ago, but there were
| | | + 275628 [jgabrielygal] The truth is that I don't mind in which direction to go, because I
| | + 275596 [hutch@re ur ] I agree with you. I don't have any problem with the terminology, and
| + 275409 [hutch@re ur ] You have to be really careful here. Push/pop and shift/unshift are =20
| + 275413 [hutch@re ur ] Of course I forgot to mention the specific problem for your scheme. =20
| | 275418 [jgabrielygal] I understand your explanation, but this sounds like a bug to me. I
| | + 275423 [hutch@re ur ] unshift/pop seems to me to be a possibility. I think it'll have to be =20=
| | + 275426 [hutch@re ur ] I just did a quick test. It looks as though Ruby is now handling both =20=
| | 275430 [hutch@re ur ] cleanup the empty space left by shift. So your queue should be okay =20
| | 275431 [jgabrielygal] Thanks, it's good to know.
| + 275448 [renard@nc rr] It was my understanding that unshift was the leaky method. There was a
| + 275570 [hawat.thufir] Could this lead to a security problem down the road?
| 275597 [hutch@re ur ] I don't think so in the cases I mentioned. The objects in front of
+ 275379 [transfire@gm] Some things you just have to get used to. And some things are worth
275389 [shortcutter@] If you do bourne shell programming then "shift" will be familiar.
275326 [significants] 207:0> a = [1,2,3,4]
+ 275327 [significants] also, I'm interested in what is going on "behind the scenes" here. is
| + 275331 [alexg@ku cr ] It calls Array# 5 times if that's what you mean? But all on the
| + 275332 [dido.sevilla] Well, what seems to have happened here is you created what amounts to
| + 275336 [vjoel@pa h. ] Just for fun...
| | + 275353 [significants] so... is this practical because it's fucking awesome? or not practical
| | + 275518 [eric.promisl] I'm impressed, but the name "FSM" raised my expectations.
| | + 275526 [ed.odanow@wo] Well, if you use the object_ids, you can construct a graph.
| | + 275553 [ed.odanow@wo] This can be a very first step into readability...
| | + 275661 [vjoel@pa h. ] I'm afraid I have not been touched by the noodly appendage, and I only
| + 275520 [significants] could you provide some code to exemplify this?
+ 275335 [botp@de mo t] # 207:0> a = [1,2,3,4]
regex replace on a file
275343 [eggie5@gm il] I want to do a simple regex replace on a file. I want to replace this
+ 275346 [shortcutter@] Please show us what you have already.
+ 275366 [lists@be tr ] As far as I see for multilines the -i option doesn't work.
how can I print the string in different color?
275347 [hariharan.sp] Hai Friends,
+ 275357 [stephane.wir] gem install colorize
+ 275523 [ari@ar br wn] Does the word "color" looked very strange to anyone else?
How to send a file from the http client to the server?
275348 [abboura84@ya] I've a http server built with ruby based on Mongrel, it must receive a
275356 [abboura84@ya] Thanks for response
275358 [robert.dober] Well actually it is difficult to give the correct response if one does
275376 [abboura84@ya] I created a form wich allows to select a file and send it to the server
275398 [richard.conr] Abir,
275410 [abboura84@ya] I used Ruby (Mongrel) to code the server, and for the client I must use
+ 275417 [robert.dober] strange I'd rather thought that the req object in your upload should
+ 275443 [richard.conr] I feel your pain. I don't know httpclient directly, but net/http is very
+ 275668 [phil.meier@g] By googling for "class Net::HTTP::Post multipart" you can find an
293324 [dan.stevens.] The direct URL for this article is
Read mp3 tags
275351 [hoaxuongrong] I'm a newbie for Ruby. I am reading an application to read mp3 tags.
Re: ID3 Tags (#136)
275363 [hoaxuongrong] Please tell me how to run it on command line. When I run it, it appears
275384 [james@gr yp ] The file you show is probably part of a Rails project. For someone
passing a variable as a pointer to a windows DLL method
275371 [kungfu.grip@] i'm having a problem with a DLL method call which requires a few
to_yaml and international characters
275378 [h3rald@gm il] I noticed some weird behavior when converting a string containing
+ 275383 [lparravi@gm ] \225\227\212 is the same as \x95\x97\x8A, the former in octal, and the
| + 275391 [h3rald@gm il] Thanks a lot, this solves part of the mystery!
| + 276545 [jamal@fu ky ] Sorry but I do not get it. Plus I am not sure it is only related to
| + 276566 [konrad@ty er] charset="utf-8"
| | 276641 [jamal@fu ky ] Thanks a lot for your help. I thought I will be going mad with this. I
| | + 276652 [koflerjim@ma] It should be possible to convert CP437 -
| | | 276678 [jamal@fu ky ] Thanks, I am going to try with html entities.
| | + 276677 [konrad@ty er] charset="utf-8"
| | 278758 [jamal@fu ky ] I am not sure about that, I'll have to check. What I noticed though is
| + 276569 [mortee.lists] I guess that your understanding is just wrong. I'm not really sure from
| 276639 [jamal@fu ky ] Probably. I am a beginner in ruby.
| 276766 [mortee.lists] When converting some accented characters to \nnn then it doesn't use any
| 278757 [jamal@fu ky ] Sorry for the delay,
+ 275392 [richard.conr] IIRC the various YAML implementations in each language can choose
Problems with setup.rb and metaconfig
275380 [matt-lists@r] I'm doing some fiddling around with a setup.rb package, and wanted to
Strange behavior with Sequel + RSS::Parser
275381 [lparravi@gm ] I'm having a strange behavior when using RSS::Parser after requiring
275403 [ciconia@gm i] I've traced this problem down to the ruby2ruby gem, which is used by
275442 [lparravi@gm ] I've mailed Ryan about it, thanks Sharon!
275382 [pjcarvalho@g] I am having a problem with IO.pipe
issue in faster_csv
275395 [surjit.meite] I wanted to read a csv file and do some manipulation on it so i tried
275399 [james@gr yp ] require "rubygems"
275401 [surjit.meite] I am a new to Ruby... Does FasterCSV comes by default with Ruby gems
+ 275404 [james@gr yp ] It's not included with RubyGems, no. But you can use gems to install
| 275406 [surjit.meite] I am working on windows OS can you please gimme the syntax i have to use
| 275407 [surjit.meite] Thanks a lot.... It is working now.. I am a newbie so i will be back
+ 275405 [surjit.meite] Posted via http://www.ruby-forum.com/.
275402 [kristoffer.l] ...
Time stamp on jpg
275414 [nicknewton@g] I am trying to find the time that a jpg was created. I am using the
275419 [kungfu.grip@] try mtime
+ 275432 [ben@bl yt in] Depending on where the JPEG came from, you might try extracting the EXIF
+ 275436 [nicknewton@g] On Oct 23, 9:54 am, Citizen Snips <kungfu.g...@internode.on.net>
How to install gsl in windows OS
275415 [surjit.meite] Help me in installing "gsl" in windows OS
275420 [surjit.meite] Posted via http://www.ruby-forum.com/.
275425 [surjit.meite] F5
275445 [surjit.meite] Posted via http://www.ruby-forum.com/.
275447 [mo_mail@on h] That seems to be your 4th message in a relatively short period of time.
How to search for ascii char sequence in binary file
275422 [eclubb@va co] So I'm trying to convert e.g. 'RIFF' to e.g. '52494646'. What's the
275428 [gthiesfeld@g] Here's a way to do the conversion. No ideas on the search.
Quick sockets question
275434 [vasyl.smirno] I wonder if it is sufficient to use read/write methods on a TCP/
275567 [shortcutter@] Off the top of my head I believe #recvfrom is for UDP while you want
Why "Kernel#fork" on windows
275438 [goal1860@ho ] Kernel methods are usually able to be called directly, like gets, gsub,
275441 [vasyl.smirno] Windows does not support fork, hence Ruby on Windows does not support
275444 [shortcutter@] ... unless of course you are on cygwin. :-)
Scattered I/O (on MS Windows)
275439 [djberg96@gm ] Park Heesob and I came up with a custom implementation for
275564 [shortcutter@] Can't test it at the moment. But I wonder how a scattered read can
275611 [djberg96@gm ] On Oct 24, 2:34 am, "Robert Klemme" <shortcut...@googlemail.com>
275617 [shortcutter@] Ah, I see! So the "scatter" does not refer to the user request but to
275440 [fernando.cac] help
bash to ruby
275446 [fernando.cac] I'm not a ruby developer just yet, but I've been reading a couple of
+ 275451 [shortcutter@] I guess this happens rarely if ever - Unix like operating systems
| 275472 [devi.webmast] A while back I considered writing some of the unix commands (and
| + 275473 [thomas.adam2] It's an interesting idea, and one that I would be willing to help
| | 275486 [shevegen@li ] Well the basic functionality of mkdir or cd is all there in std ruby.
| | 275495 [fernando.cac] Not yet, because I haven't started :)
| + 275525 [ari@ar br wn] So rewrite basic commands in Ruby? Sounds good. i'm in :-D
+ 275506 [TimHunter@nc] You might find it useful to look at Ruby's un.rb library. It implements
+ 276003 [phrexianreap] Having done this a time or two (with my own scripts, nothing major),
| 276053 [devi.webmast] Well, I went ahead and setup a rubyforge project and mailing list available at
+ 278869 [hawat.thufir] Interesting idea....
278914 [fedzor@gm il] one could extract some more speed out of it with a Ruby to C (ANSI C)
278955 [ryand-ruby@z] it'll never work
good language reference under linux
275449 [ivorpaul@gm ] ...
+ 275455 [barryahanna@] ...
| 275458 [ivorpaul@gm ] ...
| 275474 [peter@ru yr ] I am using xchm under Kubuntu and it works flawlessly!
| 275488 [shevegen@li ] Actually, anyone knows when the newer pickaxe will be released?
| 275508 [TimHunter@nc] Only the PragProgs know for sure, but why wait? Serious Rubyists will
| 275961 [ivorpaul@gm ] ...
| 275982 [reid.thompso] try
| 275988 [reid.thompso] sorry,
| 276022 [perrin@ap th] Does the rubybook package install a CHM format book? I thought it just
+ 275469 [fwmailinglis] charset="us-ascii"
New Free Online Gallery OnRails
275453 [pedrof.costa] ...
Watir and Inheritance
275456 [tcblues@gm i] require 'Watir'
+ 275457 [kyleaschmitt] Without looking at this too indepth...
| 275573 [mario@be wa ] If I write the class without inheriting, how can I get the 'url' outside
+ 275460 [olsonas@gm i] You want to call the url method on the @iex object, not the navigator
| 275574 [mario@be wa ] This is not working.
+ 275575 [jgabrielygal] I think what you are doing wrong is having a Watir::IE object inside
+ 275576 [mario@be wa ] I'm sorry but it doesn't work because the class doesn't understand the
| 275580 [mario@be wa ] `LocationURL' for nil:NilClass (NoMethodError)
+ 275598 [kyleaschmitt] Watir's ie object allows you to get at things like the url using
275601 [elrubensoncr] ...
275614 [mario@be wa ] Now it works fine.
OT: Is C# just Java renamed? WAS: IronRuby...will it be like J++?
275462 [jflam@mi ro ] Since I don't think that most folks on this list are tracking what's happening in C#, and that many folks appreciate beautiful code, here's something that I hacked up in the latest version of C# (3.0) that we're shipping by the end of the year (betas of this are currently available).
275489 [charles.nutt] Both are possible, along with other weird and wild things, through many
275540 [jflam@mi ro ] Wow. I had no idea that Java now has libraries that expose a generic query syntax that can be used over arbitrary data sources (in memory, database, web service data sources via custom providers). Do you support dynamic Intellisense for the data sources in the IDEs as well? Do you have a pointer to this?
275691 [charles.nutt] Nothing so unified; there's a "linq-like" library that either
Monitoring Excel varabiles
275471 [nicknewton@g] I am trying to monitor a cell in excel, however when the value of this
275481 [nicknewton@g] I have found out that it will only crash the program if the cell that
type mismatch with ruby-db2 when using set_primary_key
275475 [mhubbard@se ] I have successfully installed ruby-db2-0.4.4.
ruby-ldap 0.9.7 build failure
275479 [djberg96@gm ] Solaris 10
[ANN] Ruby-Traits 0.2 released (sorry long)
275480 [robert.dober] after some very interesting input I decided to rewrite Ruby-Traits completely.
terminology: class methods versus kernel methods
275500 [hawat.thufir] "One secret about kernel methods like print: they are
+ 275503 [rick.denatal] No, and I don't understand what why means.
| 275505 [hawat.thufir] Kernel is a class, sub-class, of Object?
| + 275509 [pergesu@gm i] No, it's a module, and it's included into Object.
| + 275510 [dblack@ru yp] class Object
| 275572 [hawat.thufir] Ok. Is this composition? A work around for multiple inheritance?
+ 275504 [hawat.thufir] I've got a lot to learn.
Re: [QUIZ] Time Window (#144)
275532 [jamesbkoppel] Here's my solution. It converts a time window into an array of arrays of ra=
+ 275559 [jgabrielygal] Isn't this the same as Enumerable#any?
| + 275561 [gattster@gm ] That's the same thought that I had. Assuming that any? didn't exist, =20=
| | + 275563 [jgabrielygal] Well, first of all it depends if you are building a library that
| | + 275593 [james@gr yp ] Like most things, it's just another tool in your belt. You'll need
| + 275592 [james@gr yp ] It sure is.
+ 275607 [kbloom@gm il] I suggest using a constant rather than a global variable for this. You
275608 [james@gr yp ] This is also just an Array disguised as a Hash.
275715 [jamesbkoppel] Thanks; I wasn't aware of that method's existence.=0A=0AActually, I wasn't =
275718 [gattster@gm ] This raises one of my few frustrations with ruby. I find ruby far =20
tracking down an application
275535 [subjerk@ya o] Does anyone know what program DHH is using to manage his MySQL tables in
275537 [james@gr yp ] James Edward Gray II
275538 [subjerk@ya o] Great! Thanks!
[ANN] polyglot 0.1.0 Released
275536 [no@sp m. le ] Polyglot version 0.1.0 has been released!