201720-204985

201505-202184 subjects 201866-203614

[SUMMARY] Panagrams (#86)
201720 [james@gr yp ] First, let me clear up the naming issue, since I missed it when created the
201726 [martin@sn wp] Note that the discussion of the different ways to solve this problem
201741 [james@gr yp ] Great info all around.

[ANN] attributes-3.0.0
201731 [ara.t.howard] NAME

Installing gems for a single user
201732 [jennyw@da ge] I'm used to using gems locally where I can install them systemwide. But
+ 201757 [ruby-talk@wh] mkdir ~/.gems
+ 201849 [gsinclair@gm] My solution: compile and install Ruby in ~/software (or similar) and

Gateway Test
201734 [james@gr yp ] Please ignore.
201736 [Daniel.Berge] Is something up?  I noticed that most threads seem to make it to
201737 [james@gr yp ] Yes, we were having trouble with the mail2news side of the Gateway.

Application Map and Navigation\Utility methods
201735 [aidy.rutter@] I have an ObjectMap Class

Negative Numbers
201738 [marston@ma s] Hey all,
+ 201739 [Daniel.Berge] Use the .abs method
+ 201740 [collinsj@se ] irb(main):001:0> -7.abs
| 201774 [lists@be tr ] Be careful. The minus sign is part of the constant. A minus
+ 201743 [gekko@bi ke ] -12345.abs
+ 201744 [schapht@gm i] irb(main):001:0> --7
  201750 [cjkim@jc ow ] You can always multiply it by negative one (-1), e.g.
  + 201752 [stmpjmpr@gm ] You can also call the abs method of a number to get its absolute
  + 201753 [marston@ma s] Hey everyone,

Application Map and Navigation\Utility methods
201746 [aidy.rutter@] I have an ObjectMap Class
201993 [collinsj@se ] Usually this means you have a deep recursive call somewhere, possibly

Checkbox TreeView availability ?
201748 [mikecourtney] Does anyone know of a RoR implementation of a TreeView in which you can
+ 201761 [ml@e4 et co ] I did something like this, which I describe in this blog entry.
| 202114 [mikecourtney] Thank you for the information Jim. Pls let me know if/when you add it to
| 202290 [ml@e4 et co ] I added the entry to my blog, it looks like this...
+ 201764 [drbrain@se m] Please ask Rails questions on the Rails mailing lists.

tls?
201755 [yottskry@gm ] I'm creating a ruby jabber client (I know there's a library for this,
201763 [drbrain@se m] OpenSSL is built-in.  You can probably find examples off in the net
201897 [yottskry@gm ] Ahh yes, thanks. Trouble is, I create an SSL socket but not a lot else

One class per test file (was [PATCH] --fqname option to test/unit/autorunner.rb)
201760 [Daniel.Berge] (Moved to ruby-talk from ruby-core since we're on a more general topic)

[ANN] Route plotter for the London Underground network
201770 [ezusbo@tr ns] I have a facility which uses css and ajax to perform live plotting of

Re: Route plotter for the London Underground network
201771 [mcyi2mr3@go ] Yeah thats cool david!
201776 [ezusbo@tr ns] Ajaxian.com has got some cool suggestions :-)

equivalent of attr_accessor for class variables?
201779 [jtprince@gm ] class Foo
+ 201780 [ara.t.howard] class C
| + 201783 [jtprince@gm ] For an intermediate ruby user, could you explain what is happening in
| | + 201786 [ara.t.howard] search the archives - this comes up about once per week.  for now, suffice it
| | + 201787 [dblack@wo bl] class << obj
| + 201784 [dblack@wo bl] That doesn't use class variables, though -- which is an asset, as far
| | 201789 [ara.t.howard] yeah - what he said ;-)
| + 201846 [transfire@gm] require 'facet/functor'
+ 201785 [dblack@wo bl] One way or another, if you want a class variable set when you call the
+ 201817 [rsanheim@gm ] Here's the Rails implementation if you just want to see one working

challenge
201788 [ara.t.howard] OPEN = File.method 'open'
+ 201790 [ara.t.howard] correction.  start here
| + 201795 [pit@ca it in] class << File; self; end.class_eval do
| | 201798 [ara.t.howard] wow.  learn something every day!
| | + 201802 [robert.dober] ...
| | | 201808 [ara.t.howard] duh - need more coffee.  so - back to original challenge!
| | + 201805 [lopx@ga et .] The open method is in fact defined in IO class which is extended by File
| | + 201806 [pit@ca it in] Ara, I just called
| + 201842 [transfire@gm] (class << File; self; end).instance_eval {
|   201848 [ara.t.howard] and the block?
|   201852 [sean.ohalpin] I had to cheat ;)
|   + 201889 [robert.dober] ...
|   | 201898 [sean.ohalpin] Excellent. Don't use the & to convert the Proc into a block - just use
|   | 201916 [robert.dober] ...
|   | 201919 [sean.ohalpin] Hmmm. I'm still getting "singleton method called for a different
|   | + 201923 [robert.dober] ...
|   | + 201926 [ara.t.howard] me too.
|   |   + 201928 [robert.dober] ...
|   |   + 202064 [sean.ohalpin] class Foo
|   |     202458 [ mfp@ac .o g] Open is a singleton method of IO, not File; this is why the call fails (in
|   |     + 202565 [sean.ohalpin] I think that certainly fits the description of enlightenment :)
|   |     | 202577 [ara.t.howard] yeah - i never solved satisfactorily...
|   |     | 202655 [robert.dober] ...
|   |     | + 202659 [ mfp@ac .o g] It'd require one constant per method call for Ara's intended use, in the
|   |     | + 202664 [sean.ohalpin] Nothing wrong with it - it's just not an answer to the challenge!
|   |     |   202680 [robert.dober] ...
|   |     + 202729 [pit@ca it in] The problem is, if you change the method of the superclass (IO), and
|   + 201918 [sean.ohalpin] Replying to myself to correct an error - it's the implicit to_proc (&)
+ 204985 [shortcutter@] It seems there's an "end" too much.  But to the real story: here's a

ActiveRecord alternatives
201793 [edgard.riba@] I have a database application running under sybase anywhere SQL server.
201794 [kashia.buch@] I don't think ActiveRecord is that stupid (but I've never tried it).
201800 [ruby@ph li .] set_primary_key()
201812 [lopx@ga et .] You can override table names and names of all your columns. There are
201819 [kashia.buch@] mh, ok. good to know.

Choosing among object/class/module/top-level methods...
201799 [sam.s.kong@g] Whenever I try to make a quick solution program,
201803 [ara.t.howard] <snip various methods i've used too>
201810 [sam.s.kong@g] I haven't checked out your library yet.
201813 [ara.t.howard] yes.

"Self" Reference
201811 [nathan.olber] Is it possible to define new classes that behave like standard datatypes
+ 201815 [lopx@ga et .] class ListOfBuddies < Array
| 201854 [logancapaldo] Ehhh, I wouldn't necessarily choose inheritance. It depends on what
+ 201843 [transfire@gm] My word, the possibilites if you could! You could change an object's

[ANN] Zerenity 0.8
201818 [farrel.lifso] = Zerenity
+ 201820 [farrel.lifso] Whoops, make that http://www.aimred.com/files/projects/zerenity
+ 201829 [collinsj@se ] Looks cool! Thanks!

Preferred monkeypatching technique
201821 [tom@he me st] class Firetruck
+ 201824 [drbrain@se m] class BigNozzleFiretruck < Firetruck
| + 201828 [djberg96@gm ] Or that. :)
| + 201835 [banshee@ba s] Sounded to me that perhaps he was talking about the problems that I normally
+ 201825 [djberg96@gm ] Perhaps add a namespace?
| 201831 [tom@he me st] Well, the idea is that the 3rd party software is going to be using
| 201862 [drbrain@se m] Can you give a concrete example where this takes place?
| 201968 [tom@he me st] My specific purpose is to write a plugin for Rails that adds an option
| 201971 [drbrain@se m] module X
| 201977 [logancapaldo] Rails does "funny" things. These helpers are usually used from within
| + 201998 [tom@he me st] That's quite true, it does work wonderfully in application_helper.rb.
| | 202002 [ezmobius@gm ] Tom-
| + 202041 [drbrain@se m] This is what ActionController::Base::helper is for.
|   202071 [logancapaldo] Did you miss the rest of my post where I told him to use helpers? Did
+ 201827 [sean.ohalpin] class Firetruck
+ 201837 [dblack@wo bl] I don't know whether it qualifies as "monkeypatching" (I always
| + 201853 [hal9000@hy e] Actually it was only last week that I first saw this term
| | + 201856 [botp@de mo t] # Actually it was only last week that I first saw this term
| | | 202048 [hal9000@hy e] No, I saw that thread. But it was used in a Python
| | | 202141 [ruby-talk@wh] The term "hacking" used to have a negative slant on it, too.  It's not the term,
| | | 202146 [dblack@wo bl] But why dance, in the first place, to the tune of whoever says
| | | 202562 [james.britt@] Being called a hacker was a badge of honor, an still is among certain
| | | 202593 [ mfp@ac .o g] Or, if you want to surround it with an even more positive aura, maybe even
| | | 202594 [dblack@wo bl] Awww, I was hoping someone would pick up on the "scopes" part :-)
| | | 202599 [hal9000@hy e] I try not to shoot fish in a barrel... not till they evolve
| | | 202604 [sean.ohalpin] If it walks like a fish....?
| | | 202615 [transfire@gm] cut SeaDuck < Duck
| | + 201860 [rubyfan@gm i] I think the term "monkypatching" as applied to this context (the
| | | 201893 [dblack@wo bl] The badge looks an awful lot like the criticism....  :-)
| | + 202527 [james.britt@] Let's hope not.
| |   + 202528 [ezmobius@gm ] Aparenhtly the term originated as Guerilla patch. As in Guerilla
| |   | 202563 [james.britt@] Ah, thank you.  Quite informative.
| |   + 202530 [transfire@gm] I don't think it's quite that bad and tend to agree with _why. If
| |   + 202533 [tom@he me st] Not necessarily. For me, the term "monkeypatch" establishes a
| |     202546 [dblack@wo bl] How about we call the whole thing "programming", and at the same time
| |     202583 [james.adam@g] I say go to the opposite end of the spectrum - let every subtly
| |     202587 [tom@he me st] Well, I guess we should prepare ourselves to have a lot of threads here
| + 202025 [tom@he me st] This is a bit unrelated, but is there a way to give the block parameter
+ 201838 [dan-ml@da 42] module FastFiretruck
| + 201855 [logancapaldo] And I thought the blah = instance_method closure trick was cool, but
| + 201859 [transfire@gm] That only works because there is no initialize method defined in
| + 201861 [transfire@gm] Hey, thanks Daniel! You actaully led me to a new potential approach.
+ 201900 [martin@sn wp] It seems to me that you're asking for a ruby version of gensym.  (See
| 201960 [logancapaldo] % cat gensym.rb
| 201969 [drbrain@se m] You don't need a mutex.
| + 201973 [logancapaldo] Do you not need a Mutex _now_, since @gensym_count += 1 is
| + 202096 [martin@sn wp] Okay, but now if two different files include this exact code, you're
|   + 202102 [transfire@gm] What if the symbol is already used?
|   + 202123 [ara.t.howard] if two different files have this exact same code inlined the programmer should
|     202137 [drbrain@se m] Indeed, but I think you're being too kind.
+ 202010 [daniel.schie] <http://rcrchive.net/rcr/show/321>
  + 202020 [transfire@gm] Sure. Although, the name provides a handle if you need to dynamically
  | 202031 [daniel.schie] Neat-o.
  + 202021 [tom@he me st] I looked at that RCR a while back, but only glanced over it as it was
    + 202028 [sean.ohalpin] I can't remember if I've posted this before, but here is my "poor
    + 202030 [daniel.schie] +1

[ANN] prototype-0.2.0
201823 [ara.t.howard] NAME

Initialize a variable in an extended class
201826 [Eric.Armstro] Interesting problem. There is undoubtedly much to
+ 201830 [sean.ohalpin] class REXML::Element
| 201833 [Eric.Armstro] Yup. Another good alernative. Do I then I share that
+ 201832 [dblack@wo bl] I'm not sure what you mean by "somewhere".  It gets talked about and
| 201834 [Eric.Armstro] Thanks for the smiley. I haven't been spending enough time
+ 201841 [ara.t.howard] why not a module?
  201845 [Eric.Armstro] Yes! That is indeed clever. I overlooked

Problem with HTree installation
201836 [Eric.Armstro] I added HTree to my installation at

Module Definition Idioms
201840 [Eric.Armstro] Looking at HTree, I see a few more things
201857 [rsanheim@gm ] Probably to define the module HTree as the top level namespace.
+ 201869 [Eric.Armstro] Aha. Module as namespace. That rings a bell.
+ 201873 [Eric.Armstro] Ok. I get that using a module lets you establish
  201880 [M.B.Smillie@] This question sounds to me an awful lot like "why organise your code
  202046 [Eric.Armstro] You are kidding, right? I am just not grokking this

FOSCON II: The Ruby Rodeo!
201858 [rubyfan@gm i] Last year FOSCON was a big hit....  So mark your calendars, get your

How to speed up ruby and make it as fast as possible
201864 [bjohnson@co ] ...
+ 201865 [zengke@ce la] Maybe you can try rubyjit, a ruby just-in-time compiler
+ 201888 [buppcpp@ya o] Write it C.
| 202691 [phil@sh ll r] And first place for the most useless and un-helpful comment goes to...
| 202726 [Gennady.Byst] And first place for the slowest responce goes to... ;-)
| 202930 [xmlblog@gm i] I agree with the people who think the questions surrounding performance
| 202932 [jeff.avallon] ...
| + 202934 [jan.svitok@g] google for stefan kaes or stefen kaes ;-)
| + 202935 [phurley@gm i] ...
+ 201895 [peter@se an ] Profile your code, see where the bottlenecks are and refine the
| + 201929 [Jamal.Mazrui] Of Reggie Mr
| | + 201933 [ksruby@gm il] I find this attitude is quite amazing. We all know that Ruby is not a
| | | 201938 [mcgoverp@la ] "I find this answer to be unsatisfactory.  I do not know C and neither do
| | + 201935 [peter@se an ] We all want Ruby to be faster but if the speed at which your application
| | + 201943 [greg.kujawa@] I prefer to use Ruby for _most_ of my programming work, but still
| | | + 201944 [Jamal.Mazrui] Here we go again .... ... characterizing my preferences in the extreme
| | | + 202024 [jeremy@ch os] class LedZep < Rock::Default
| | |   202062 [greg.kujawa@] Ouch. That hurt :-/ Maybe I should've said a programmer not knowing C
| | + 201974 [collinsj@se ] ...
| + 201936 [jp@je fp it ] Peter,
|   + 201945 [peter@se an ] Given a program written from scratch. Profiling and reworking the
|   | 201950 [Jamal.Mazrui] In answer to the multiple messages recommending that I learn C or
|   | + 201951 [ola.bini@ki ] One, Rite seems to be what you're looking for, and it will come in time.
|   | | 201964 [james.britt@] C was taught at my college as part of a general program related to
|   | | + 201967 [Jamal.Mazrui] So, you choose to stoop to a lower level as well?  How unfortunate!  I
|   | | + 201975 [ola.bini@ki ] I'm sorry to say that I don't understand half of what you're saying,
|   | |   + 201979 [Jamal.Mazrui] [Please forgive my top posting.]
|   | |   | 201985 [Jamal.Mazrui] I am glad that Ruby 2 is being worked on, which will bring speed and
|   | |   | + 201986 [khaines@en g] You insist that this is a "problem".
|   | |   | | 201988 [mcgoverp@la ] The Goal of all programs and languages is to execute in O(0) Time ;-)
|   | |   | + 201989 [kevin.clark@] Jamal,
|   | |   |   201990 [Jamal.Mazrui] Certainly, Ruby performance is not always a problem.  It may not even be
|   | |   |   + 201992 [Jamal.Mazrui] You are mistaken.  Current, stable Perl and Python releases typically
|   | |   |   | 202004 [billk@ct .c ] I'm jumping into the middle of the thread, but, I do believe
|   | |   |   | + 202008 [greg.kujawa@] There are certain sore spots in language discussions which tend to get
|   | |   |   | + 202009 [SimonKroeger] Just because you asked: yes.
|   | |   |   |   + 202012 [jtregunna@bl] That's like saying if the moon was closer to the earth, the tides
|   | |   |   |   | 202013 [SimonKroeger] "Is there a ruby configuration file that I can change to help speed
|   | |   |   |   | 202017 [billk@ct .c ] It's not a holy war.  It's a spectrum of facts and
|   | |   |   |   + 202014 [billk@ct .c ] Yes... but the reason I stated it in terms of limits,
|   | |   |   |     202018 [SimonKroeger] Agreed.
|   | |   |   + 202000 [SimonKroeger] +1
|   | |   |   | + 202032 [jeremy@ch os] irb$ parent.value += 1
|   | |   |   | | 202053 [dbatml@gm .d] There is Ruby2CExtension (http://ruby2cext.rubyforge.org/), one of it's
|   | |   |   | | 202205 [halostatue@g] I'd love to hear what those changes are.
|   | |   |   | | 202257 [dbatml@gm .d] diff -ruw lib_orig/pdf/writer/fontmetrics.rb lib/pdf/writer/fontmetrics.rb
|   | |   |   | + 202192 [w_a_x_man@ya] gforth uses special features of gcc to achieve high speed.
|   | |   |   |   202194 [znmeb@ce ma ] 1. The "enable-force-reg" optimization has some risks on some
|   | |   |   + 202200 [halostatue@g] Performance concerns must *always* be quantified to be addressed. If
|   | |   |   | + 202203 [znmeb@ce ma ] There's actually more to it than that, as Zed Shaw pointed out in one of
|   | |   |   | + 202240 [jmg3000@gm i] TPFJ[1]
|   | |   |   + 202208 [wrecklass1@g] We agree on this point, completely.
|   | |   |   | 202213 [buppcpp@ya o] The speed issue has been discussed many times on this list.
|   | |   |   | 202220 [matz@ru y- a] Agreed.  Saying it's slow is far easier to make it fast.  I know it's
|   | |   |   | + 202231 [jeremy@ch os] Would that *all* managers knew this!  ;-)
|   | |   |   | + 202236 [the.mindstor] Firstly, I want to make clear that I agree with Matz's point here.
|   | |   |   | | + 202238 [james.britt@] There was more than one question in the OP.  The last question in the OP
|   | |   |   | | + 202248 [bjohnson@co ] ...
|   | |   |   | |   202287 [alex@bl ck e] Yes, but if you have a look through that thread, there was a specific
|   | |   |   | + 202255 [znmeb@ce ma ] One thing that would really help is a "standard Ruby benchmark suite"
|   | |   |   |   202288 [alex@bl ck e] I've never heard of one, but I can't think of anyone better than a
|   | |   |   |   202318 [znmeb@ce ma ] Well, I'm on the YARV mailing list, and I just saw a message go by on a
|   | |   |   + 202336 [invalid@in a] (sorry for my poor english)
|   | |   |     + 202369 [greg.kujawa@] Good points. But I think the overall progress of this thread tends to
|   | |   |     + 202384 [robert.dober] ...
|   | |   + 202026 [james.britt@] I was replying to a comment quoted in a previous post, not you, and the
|   | |     202029 [technel@gm i] "In the 2003-04 school year, Java was used as the programming language
|   | |     + 202034 [rubyfan@gm i] What happened to Scheme at MIT?  I thought Scheme was used as the
|   | |     | 202066 [ryand-ruby@z] 6.001 Structure and Interpretation of Computer Programs
|   | |     + 202036 [james.britt@] Not if they keep that up.
|   | |     + 202061 [greg.kujawa@] I think you are oversimplifying the MIT example. Just a month or two
|   | + 201952 [mcgoverp@la ] A university should not be the source of the languages you know.  I'm
|   | + 201953 [peter@se an ] Fine, use Ruby. But if performance is critical then you will be
|   | | 201957 [Jamal.Mazrui] Your misrepresentations of my position and attacks on me are unbecoming.
|   | | 201961 [asenchi@gm i] It is unnecessary to post such useless contributions to the
|   | + 201962 [estiforta@gm] ...
|   |   201987 [collinsj@se ] Thanks for pointing that out, it looks really interesting!
|   + 201972 [drbrain@se m] Eric Hodel - drbrain@segment7.net - http://blog.segment7.net
+ 202003 [snacktime@gm] Asking your question in such a general way is bound to produce more
  202005 [khaines@en g] The problem is that there really is no answer for the question.  Any
  202007 [snacktime@gm] There could be any number of things he could do to improve performance
  202015 [bjohnson@co ] My original post was to get a simple yes or no answer to my
  + 202016 [Jamal.Mazrui] I appreciate the more constructive tone.   By the way, I was unfamiliar
  + 202019 [billk@ct .c ] Assuming the algorithm itself isn't proprietary, you could
  | 202022 [Jamal.Mazrui] I think you've hit the nail on the head:  execution speed is apparently
  | + 202023 [khaines@en g] I don't think that's it.  The common speed complaint on this list stems
  | + 202051 [hal9000@hy e] The real point is: Speed is only a problem if you think it is.
  |   202235 [jeremy@ch os] Matz thinks it is.  He's said so elsewhere in this thread.
  + 202275 [foamdino@gm ] For Rails, I think there are some configuration options you can
threads.html
top