222270-224308 subjects 222705-254716

[ANN] Ruby-VPI 9.0.0
222468 [skurapat@uc ] Version 9.0.0 (2006-10-28)

how to import variable from other .rb file?
222469 [vipeak@gm il] tool_mysql='X:/mysql.exe'
+ 222470 [jan.svitok@g] 1.
| + 222471 [jan.svitok@g] Except for the numbering ;-) Is seems I'm doing too many things at once...
| | 222473 [vipeak@gm il] Thanks so much for you professinalism.
| + 222474 [vipeak@gm il] Is here anyone who can help me?
|   + 222475 [dblack@wo bl] If by "help" you mean change the way eval works, then no :-)  Jan
|   + 222476 [shortcutter@] What exactly does not work?  Did you by chance test in IRB?  That cannot be
|     222513 [ruby-ml@ki t] be=20
+ 222527 [vjoel@pa h. ] Using $globals or CONSTANTS is fine for simple programs, but these
  222532 [vjoel@pa h. ] $ cat config.rb
  222568 [vipeak@gm il] Ruby didn't has import method

Saving an IRB Session
222477 [Matthew.A.Co] I'm learning Ruby from the pickaxe book and I'm using the IRB to try
+ 222483 [shortcutter@] I do not think so.  You certainly can store objects to disk (using Marshal
+ 222489 [Bil.Kleb@NA ] This comes up from time-to-time.  I don't know if
  + 222508 [shortcutter@] Cool!  That looks fairly easy.  /me makes mental note.
  + 222528 [james@gr yp ] Even better, Ben Bleything showed off his IRb enhancements for this
    222563 [ben@bl yt in] Thanks for the mention, James!
    223027 [pabs@pa lo r] =20
    223030 [ben@bl yt in] In the history realm, does wirble do more than just enabling readline?
    + 223082 [pabs@pa lo r] That's pretty much it.  I went through the Ruby Garden Irb page and
    | 223120 [james@gr yp ] Just FYI, there's a bug in Wirble's colorization I'm hitting pretty
    | 223160 [pabs@pa lo r] Ergh :/.
    + 223090 [pabs@pa lo r] I just checked through my spam folder from last month and I didn't see

Class attribute unique to subclasses but used in parent class
222487 [lcor1979@gm ] I'm new in the Ruby World and I have a question.
+ 222488 [dblack@wo bl] Actually it should be an instance variable, but an instance variable
+ 222503 [david@va ln ] Class variables and class instance variables sound way too much like
  222504 [dblack@wo bl] Instance variables don't involve shared state, though; they're

Problem with Amrita
222492 [ktalanet@ya ] I'm a ruby newbie and I'm trying to do something with templates using
+ 222495 [gsinclair@gm] It's been a while, but I'm pretty sure you can get Amrita to use
| 222507 [ktalanet@ya ] Are you telling me that I can use another "keyword" different than id
+ 222496 [jeff.barczew] ...

Lots of warnings after installing ruby185-21 one-click installer on WinXP
222497 [xapwing@gm i] I installed this version of Ruby. When I invoke either fxri or FreeRide
+ 222501 [jan.svitok@g] This was discussed before, IIRC fox extension is loaded twice and the
+ 222502 [lyle.johnson] Hope this helps,
  222520 [xapwing@gm i] Thanks a lot!

Eclipse Ruby 1.8.4 development tools and segmentation fault when debugging
222498 [nicolas.roll] For people encountering a segmentation fault when debugging with Ruby

FreeRIDE on Mac OS X (or anything with a working debugger)
222500 [work@as le m] A bit off-topic I suppose, but the FreeRIDE mailing lists are a bit

How to understand why object is not collected?
222521 [vshepelev@im] Here's a problem.
+ 222534 [vjoel@pa h. ] This is probably a situation where GC is being conservative. A simple
| 222536 [vshepelev@im] OK, I've got it.
| 222542 [vjoel@pa h. ] What about creating a lot of them in a loop, without keeping references?
| 222544 [vshepelev@im] They can't be created by .new, they created in correspondence to some HTML
+ 222540 [ruby-ml@ki t] Hard to say what is going wrong but the solution is simple. Whenever
  222541 [vshepelev@im] I know this (I was C++ guy foe many years, so RAII is my breath), but can't

symetrical encryption algo's ?
222535 [lister@pi kl] I need to encode some data with a userID and then also be able to
+ 222539 [jeff@sc wa c] Is "bitshiting" what happens when you eat one byte at a time? :)
| 222601 [lister@pi kl] I googled a bit and found something in this direction, but cant get
| 222832 [jeff@sc wa c] The point of the technique is that if you get it working one way, it
+ 222543 [ jupp@gm .d ] Simple obfuscation can be done by XORing a keyword. On a binary layer
| 222546 [jan.svitok@g] I'd say: if obfuscation is enough, do base64encode.reverse and if not,
| 222549 [ jupp@gm .d ] I wanted to provide a one-size-fits-it-all algorithm that can more or
| + 222559 [khaines@en g] AES, Blowfish, IDEA, Gost all supported with pure ruby.
| + 222589 [interfecus@g] OpenSSL extensions come with the Ruby standard library. Require
+ 222545 [jeremy@hi eg] I played around with the Tiny Encryption Algorithm[1] a year or so ago
+ 222603 [garbagecat10] ...
  + 222612 [khaines@en g] Maybe the URL he's obfusicating doesn't go to a machine under his control?
  | 222640 [garbagecat10] ...
  | 222644 [khaines@en g] Because encrypting the id and putting it into the URL is trivial to
  | 222653 [lister@pi kl] Thanks for all the help.
  + 222617 [lister@pi kl] symetrical encryption algo's ?
    + 222618 [rubytalk@ea ] ...
    + 222623 [khaines@en g] No.

apache2.2  and ruby script
222537 [chen_li3@ya ] Before I post the question I already search the forum about how to
222547 [nospam@no it] / ...
222551 [chen_li3@ya ] After I remove this line

222553 [joeat303@ya ] h = {'a'=>'1', 'b'=>'2'}
+ 222557 [vjoel@pa h. ] The Hash class includes the Enumerable module, which defines #collect in
+ 222565 [collinsj@se ] No, no real magic: "collect" is part of the Enumerable module, which is
+ 222566 [matt@ti bi s] def method_report(klass)

JOB: Ruby on Rails Back-End Developer Job (Champaign-Urbana, IL)
222554 [finsignia@gm] A small boutique consulting firm is seeking an experienced OO developer

REXML question
222560 [pgquiles@el ] charset="iso-8859-15"
222583 [invalid@gm .] parent = REXML::Element.new('parent')

Here's a way to use bookmarks on RubyForge
222567 [efine145-nos] RubyForge has a Bookmarks section on each user's home page, but no easy

Define a hash using %q?
222569 [joeat303@ya ] Is there a way for us lazy typists to define a hash using %q? I tried
+ 222570 [snacktime@gm] h = {:a => b, :c => d}
| 222572 [snacktime@gm] Hehe, never mind, no I don't know how to do that...
+ 222571 [vjoel@pa h. ] irb(main):006:0> Hash[*%w{ a b c d }]
  + 222573 [logancapaldo] class Array
  | + 222575 [vjoel@pa h. ] Injecting hash may be your idea of decadence, but it's too much hard
  | | 222634 [logancapaldo] See when I usually write this code it's because it's coming out of a
  | + 222588 [transfire@gm] Logan, I love you! Just the kind of example I've been looking for
  | + 222594 [shortcutter@] This seems a bit inefficient.  If you write a method then I'd prefer
  |   + 222605 [david@va ln ] Well, if Ruby had clean blocks, the method using #inject might be more
  |   | 222670 [shortcutter@] I am not sure what you are at here.  Object creation always costs - even
  |   | 222676 [david@va ln ] =2E
  |   | 222715 [shortcutter@] Ah, thanks for the explanation!  Only remark: the block for #inject
  |   + 222716 [martindemell] Never thought I'd see you speak out *against* inject :)
  |     222734 [shortcutter@] Yeah, I must have been out of my mind. :-) I mean, the obvious remedy is
  + 222636 [louis.j.scor] %s/decadent/obfuscated/g

Interesting trival example of why open classes are good?
222580 [petermichaux] I am trying to explain why the fact that Ruby's classes are never
+ 222581 [nospam@no it] That is way too easy.
| + 222582 [petermichaux] Thanks for the example. I like it and I'll use it.
| | + 222586 [transfire@gm] 'ello --
| | + 222599 [dblack@wo bl] class C
| | | 222627 [wilsonb@gm i] A side-effect of this is that when working with a team, you are less
| | + 222602 [vincent.four] I can give you that: in a meta system I'm writing, I want to be able
| | + 222629 [hutch@re ur ] It isn't little, but xampl in Ruby makes heavy use of this capability
| + 222606 [vincent.four] Not for long ;-) -> RCR337
| + 222638 [tbray@te tu ] I have some code where I'm unpacking utf-8 text into arrays of
+ 222584 [invalid@gm .] You may want to have a look at the facets code to get some ideas.
+ 222621 [louis.j.scor] Open classes also are a real boon when you're coding something
+ 222637 [rossrt@ro co] The example below probably isn't what you're after, but as David said
+ 222639 [ruby-talk@wh] Have you heard of the `cgi_multipart_eof_fix' gem?  It was recently released to
+ 222649 [erikveen@gm ] Suppose you have written a word processor. Or at least

Memory crush somewhere in Socket
222587 [vshepelev@im] I have a very strange and uncommon problem.
+ 222593 [shortcutter@] Sounds like a reasonable guess.  Also, I do not understand why a HTML
| 222600 [vshepelev@im] You can look at the lib at http://terrainformatica.com/htmlayout/
+ 222604 [vincent.four] Just out of curiosity, what happens when you swap these two calls ?
  222608 [vshepelev@im] The case is more general: almost each call to SomeLibrary.almost_any_method
  222609 [vincent.four] Somehow puzzling... You're sure you don't have memory allocation
  222613 [vshepelev@im] Yep, I almost sure. I use this library alongside with wrapper last few
  222635 [vincent.four] Well, just rub your program until it triggers a memory fault, and

parse error, unexpected $, expecting kEND instantrails
222591 [raju_drg@ho ] I have come to this "parse error, unexpected $, expecting kEND" error
222595 [shortcutter@] You have a syntax error probably missing a matching "end".

keeping a hash' sort order?
222592 [lister@pi kl] sure this is a common question...
+ 222597 [shortcutter@] Yes, and that is the exact reason why I suggest you search through the
+ 222610 [ara.t.howard] require 'rbtree' # rubyforge or raa
  + 222616 [transfire@gm] Facets' Dictionary class can handle arbitray order via #insert(i,k,v),
  + 222647 [vjoel@pa h. ] What's the 'arbitrary' part for? The Key#<=> method is not called. The

Two rails questions
222611 [george.palme] I've been trying to work out answers to the following problems for hours

Tight coupling vs. complete abstraction
222614 [transfire@gm] On n' off I've been thinking about something Ruby allows one to do more

passing parameter to WATIR through command line
222615 [csamigroup@g] I have below code that beautifully calls RUBY, WATIR code through
222656 [alex_f_il@ho] You can also try SWExplorerAutomation SWEA (http://webunittesting.com).

using ruby with photoshop - p objectroblem using the SaveAs
222619 [somers.marti] ...
222787 [tirado.carlo] saveme = cs.ActiveDocument
222847 [somers.marti] ...
222852 [tirado.carlo] WinXP Pro SP2, Photoshop CS (8.0). Works here! :}
222854 [gavin.kistne] In case it helps, I used to do JS scripting of PS a lot, so I parsed out

How can i do 'foreach (reverse sort { $hasref->{$a} <=> $hasref->{$b} } keys %{$hasref})..' in ruby
222622 [al-rubylang@] I'am new with ruby and want to migrate some of my perlscripts to ruby ;-).
222624 [shortcutter@] Both of these sort values only!
222625 [al-rubylang@] Yep, ;-).
222679 [daniels@pr n] For the simple case (such as yours) where the values being sorted are
222789 [al-rubylang@] [snipp]

ruby's build system
222628 [cies.breijs@] right now autotools, make and shell scripts are used to build ruby.
+ 222630 [wilsonb@gm i] There was interest at RubyConf in converting the Ruby build system to
+ 222673 [david@va ln ] Selfhosting is a nice exercise in brain self-surgery, but I think it's
  + 222674 [znmeb@ce ma ] Yeah, but ... "an external environment that's most likely to be present"
  | 222680 [david@va ln ] Short of implementing a C compiler in Ruby (I give it a month or two
  | 222684 [cies.breijs@] shipping rake.rb with the ruby source, and using it rake as build
  | 222697 [wilsonb@gm i] This is already how it works.
  + 222678 [wilsonb@gm i] It already builds a miniruby that can probably run rake.  This would

newbie question
222633 [lercordeiro@] Are there ports of qtruby and kde-ruby for FreeBSD?

backtick and %x{} not the same?
222643 [andreas_s@ho] I can't any information about this, so I dare myself to post here. I have
+ 222651 [shortcutter@] IMHO without #! all bets are off.  AFAIK every shell tries to execute a
| 222655 [andreas_s@ho] Just seconds after I posted I found I made a fool of myself. %x{testme.sh}
| 222661 [logancapaldo] `simple` # Ruby thinks, I can handle this myself
+ 222671 [matt@ti bi s] Isn't it better to use an absolute pathname, rather than use a bare
  222690 [andreas_s@ho] I tried that and it doesn't work either. Apparently the issue wasn't search
  + 222722 [louis.j.scor] `sh testme.sh`
  + 222749 [logancapaldo] It does a straight fork+exec instead of invoking a shell interpreter

!x.include? y
222645 [gilesb@gm il] basically, I need to filter list A to match list B. list A is a list
+ 222650 [vincent.four] list.select {|thing| list_of_acceptable_values.include? thing.attribute
| 222652 [dblack@wo bl] This would be a nice use for delete_unless.
| 222844 [gilesb@gm il] Cheers, I didn't know about delete_unless. (I did find delete_if.)
+ 222658 [wardies@gm i] You could modify the Array class to include an accept! method that
| 222846 [gilesb@gm il] this is a very tempting solution. a filter method could be cool too.
| 222953 [louis.j.scor] class Proc
+ 222976 [gavin@re in ] irb(main):001:0> requested = %w|a b c x z|
  223168 [gavin@re in ] The reason that what I posted didn't work is because I mispelled 'eql?'

Interesting (and useful) exercise with the Ruby grammar by Nick Sieger
222648 [znmeb@ce ma ] Nick Sieger just posted (well ... I just found out about it) a graph of
222692 [nicksieger@g] ...
+ 222694 [znmeb@ce ma ] It wasn't clear from my poking around the web site ... is ANTLRWorks
| 222754 [nicksieger@g] ...
+ 223428 [tomasz.wegrz] If you need an example of ANTLR 3 for Ruby in action,

open-uri and redirection
222659 [rtilley@vt e] According to the Pick Axe Book, open-uri automatically handles
222708 [aaron_patter] Try using WWW::Mechanize.  It will handle the redirects automatically

Caching method calls - Is this of interest to anyone?
222662 [farrel.lifso] I've been trying to improve my metaprogramming skills the past two
222664 [shortcutter@] robert
222729 [transfire@gm] It would be of interest to compare implimentations. There are a few out

PP / PrettyPrint annoyances
222666 [elliot.winkl] ...
+ 222709 [collinsj@se ] <snip long array
| 222802 [elliot.winkl] ...
| 222856 [jan.svitok@g] I thought that changing Array#pretty_print would be sufficient, after
+ 223288 [dale.martens] The problem with 'pp' in my opinion is the mysterious 'breakable'. What
+ 223362 [chen_li3@ya ] 1)

Ruby Interface to NaNoWriMo Stats...
222667 [michael.gors] ...
+ 222669 [znmeb@ce ma ] Is there a National Ruby Technical Book Writing Month?
+ 222695 [gregory.t.br] hmm... NaNoWriMo sounds neat.

Fwd: Please Forward: Ruby Quiz Submission
222675 [james@gr yp ] ...

ipv6 connection attempted before ipv4
222681 [snacktime@gm] I've noticed that when using net/http, and probably with any ip/udp
222683 [snacktime@gm] Forgot to mention this was when using 'localhost' instead of
222686 [drosihn@gm i] It has to do with the order of 'localhost' lines in the /etc/hosts file.
222688 [snacktime@gm] Ah I didn't even notice that.  Makes sense now.

net/http PUT/POST versus GET performance
222685 [snacktime@gm] I've found the performance difference between the PUT/POST and GET

PDF-writer and MS word document
222698 [chen_li3@ya ] I just wonder if anyone out there ever uses PDF::Writer to create a PDF
+ 222704 [totalharmoni] You might want have to write some sort of a macro or script file which
| + 222707 [znmeb@ce ma ] There are some filters available on most open-source platforms that will
| + 222742 [chen_li3@ya ] Do you know which is most popular and compatible with in Ruby?
|   222772 [halostatue@g] You're not looking for something to run from Ruby. You're looking for
+ 222723 [jeremymcanal] If you are on Mac, simply print to the Adobe PDF printer.

how to reset and how to undefine a class
222699 [adriano.mitr] Does any one know how to reset a class in Ruby? Subsequent class
+ 222700 [wilsonb@gm i] The first question is (a little) straightforward, once you get a
| 223811 [adriano.mitr] I want to remove ("undef") all methods, no only a single one. That is
+ 222730 [transfire@gm] You can redefine a class entirely by giving it a new subclass.
  222731 [transfire@gm] s/subclass/superclass/
  222739 [rossrt@ro co] class SomeClass < String
  222777 [transfire@gm] Hmph.... Looks like Ruby changed this at some point. It used to be able

Regex to transform java code to ecma script
222701 [pjakobsen@gm] I was hoping someone could provide me with a better way to accomplish
222702 [pjakobsen@gm] code = "public void myFunction(String foo);"