261365-262991 subjects 261788-262438
261611 [ari@ar br wn] Ugh. ActiveRecord is giving me a hard time.
261612 [warlickt@op ] It's saying that it can't find the MySQL socket. Check your connection
261615 [ari@ar br wn] Thanks. Do you know why Mac OS X doesn't have /tmp/mysql.sock?
+ 261622 [grzm@se sp t] Maybe your MySQL server isn't started? Can you connect to the MySQL
+ 261624 [ben@bl yt in] The socket location is configurable, and I think by default it puts it
261641 [dangerwillro] did you install on OS X using the MySQL OS X installer?
261614 [ed@no ep y. ] Under most languages it pays to use a StringBuffer of sorts.
+ 261616 [marcel@ve ni] Strings are mutable in ruby so you just use the << method to append to a
| 261620 [ed@no ep y. ] Thanks, I will give that a go. My automatic knee-jerk reaction was to
+ 261618 [hhausman@gm ] Under most languages it pays to not do heinous things that cause the
261619 [ed@no ep y. ] Thanks very much, this looks like a very useful resource.
Re: Is there a replacement for sub?
261621 [renard@nc rr] You are absolutely correct!!! Your improvement does what you expect it
Preparing Data For Statistical Analysis and Reporting
261623 [irishhacker@] How much data munging is done by Ruby-ists?
261644 [znmeb@ce ma ] Thanks for the pointers! This is actually something I do a lot in my day
How do I build a tree of directories?
261628 [anilscuba@ya] directories and sub-directories on the server. The XML will look
261653 [skye.shaw@gm] You'd want to use one of the Dir methods; foreach(), glob()...
[ANN/PIMP] Ruby Certificate Program @ University of Washington This Fall
261629 [ryand-ruby@z] There is a certificate course at the UW starting this fall. It is 3
+ 261642 [znmeb@ce ma ] Sounds fantastic!! How is this to be delivered? Electronically? Or must
| + 261643 [has.sox@gm i] ...
| | 261646 [dangerwillro] Regardless, THIS along with the slew of Ruby (and Rails) books that
| + 261648 [ryand-ruby@z] Sorry, but this is a classroom (only) based curriculum. I don't know
| 261755 [al_batuul@ya] ...
+ 261813 [robert.dober] ++ breaking even already :)
rtrim and ltrim function for ruby: is this ok?
261630 [leon@ti -o l] class String
+ 261636 [caduceass@gm] I'm not sure this does what you want it to. The object referenced by
+ 261640 [nobu@ru y- a] Perhaps. See String#rstrip and #lstrip.
+ 262013 [transfire@gm] #chomp!
+ 262016 [robert.dober] Well there is, it is just sooo expensive ;)
+ 262516 [leon@ti -o l] Thanks! To bad for the missing left-chomp
FaerieMUD? (was Re: Problems with test cases and other things with Ruby-WordNet)
261647 [znmeb@ce ma ] Ah ... so MUES and FaerieMUD are alive and well? I stumbled across some
261650 [ged@Fa ri MU] They are. I don't get as much time to work on them as I'd like, but
Newbie question, writing to a file
261652 [dontspamme@s] I'm reading Learn To Program, which is based around Ruby code, and it
+ 261656 [raasdnil@gm ] Good on you for learning Jenny :)
| 261661 [dontspamme@s] I am trying, thanks for the encouragement!
+ 261658 [caduceass@gm] Here's one way to do it...
Refinement to facets/more/snapshot.rb
261654 [rubylearner@] ...
261657 [transfire@gm] Good idea.
Is there a way to move gems from 1.8.4 to 1.8.6?
261655 [weyus@at .n ] I am currently on Ruby 1.8.4 on Windows XP.
261659 [warlickt@op ] In my upgrades, I upgrade Ruby, then run
+ 261660 [james.britt@] Are you sure? I haven't installed on windows in a while, but last I
| 261663 [warlickt@op ] I didn't use the 1-click installer, I just downloaded the Binary version and
+ 261846 [weyus@at .n ] Under Windows, the gems are not separate from the Ruby installation,
261957 [phurley@gm i] Wes, don't forget that some gems install a binary component which if
command queue structure help?
261662 [kmouse@gm il] Greetings. I have been studying Ruby, have the pickaxe and Ruby Way
261738 [webs.dev@gm ] # you could do this
command queue structure help?
261664 [kmouse@gm il] Greetings. I have been studying Ruby, have the pickaxe and Ruby Way
Help: Get list of modules which are included in the class
261667 [chirag80bece] I want to get a list of modules which are included directly in the class
+ 261669 [robert.dober] Maybe my friend irb can help ;)
| 261674 [FireAphis@gm] I don't think that it answers the question. Look at the following
| + 261678 [fred@la av .] #! /usr/local/bin/ruby
| + 261682 [robert.dober] What!!! Do I have to read the post in oder to answer now???
| 261685 [botp@de mo t] # > I think that Chirag wanted to get only M2 and as you can
| 261723 [fred@la av .] Just Fred is all right, y'know... :)
+ 261670 [botp@de mo t] # only want a list which contains modules M1 and M2 for MyClass. If we
| 261672 [robert.dober] not stupid at all, you just overlooked a little detail, parent classes.
| 261676 [botp@de mo t] # p C2.ancestors - (Class.new.ancestors + [C2])
| + 261679 [dohzya@gm il] How about (C2.ancestors - [C2] - C2.superclass.ancestors) ?
| | 261683 [robert.dober] You got it, indeed it was not so chellanging after all :(
| | 261688 [dohzya@gm il] module M1 ; end
| | + 261691 [robert.dober] We have to ask OP, if he really wants to have M1 in this list I am
| | | 261718 [dohzya@gm il] You're right, but it can be fixed :)
| | | 261727 [robert.dober] no it cannot :(, look at C4 below
| | | 261733 [dohzya@gm il] This was the first and not fixable (with this solution) problem :)
| | | 261766 [robert.dober] yeah the information just is not in the ancestor array :(
| | + 261701 [FireAphis@gm] There is another problem. If C2 doesn't inherit another class but does
| + 261680 [botp@de mo t] # From: Robert Dober [mailto:email@example.com]
+ 262714 [wayneeseguin] ...
262816 [dohzya@gm il] There is a problem (him ! again ! Arrrrrrg (Monthy Python dixit (yeah
+ 262834 [wayneeseguin] ...
+ 262838 [wayneeseguin] ...
262842 [dohzya@gm il] Thanks :$
utf-16 little endian byte order mark with libxml-ruby
261684 [freestyle_ka] Hey all
261717 [freestyle_ka] It appears that the save() method on XML::Document will create files if
261686 [m.tyman@in e] Is there any way to format a string. I.E. I've got a variable which may
+ 261687 [shortcutter@] Please look for printf, sprintf and % in the docs. The last one might
| 261690 [m.tyman@in e] OK, Fine. But... I want to format the string not its output to redirect
| + 261692 [sepp2k@go gl] sprintf and % return a string, they don't print anything to the screen. You
| | 261722 [kaldrenon@gm] On Jul 25, 5:54 am, Sebastian Hungerecker <sep...@googlemail.com>
| + 261693 [shortcutter@] Now what? Do you want to output or not? I do not understand your
| + 261695 [botp@de mo t] # OK, Fine. But... I want to format the string not its output
+ 261689 [botp@de mo t] # Is there any way to format a string. I.E. I've got a variable
261694 [abhijithg@gm] ...
Help: Locomotive - error
261697 [tuaregue@gm ] In the browser I have this error, I'm a newbie.
261699 [lars.westerg] I have a fairly large and complex object graph of Value Objects created
+ 261702 [noodlet@gm i] (first post to this list, so get some salt)
+ 261703 [shortcutter@] If Singleton === obj
| 261707 [robert.dober] require 'singleton'
| 261708 [robert.dober] Did I do something stupid?
| + 261709 [shortcutter@] No, you seem to be dragged into the confusion between singleton and
| | 261711 [shortcutter@] Sorry for the noise. I should have checked.
| + 261710 [lars.westerg] Oh, good, so it wasn't just me then.
| 261712 [robert.dober] well seems you have to use my code then, it depends on a "feature"
| 261729 [lars.westerg] Not sure.... Your code works good in irb and catches singletons
| 261767 [robert.dober] OMG Rails, what do they do my Ruby? ;)
+ 261705 [robert.dober] The following should do the trick -- alas :(
261706 [robert.dober] gsub( "Class", "Object")
261714 [pbailey@bn .] Why is it that File.basename works for me for one single file, but, it
+ 261715 [robert.dober] I could not reproduce the error, just after touching 1.tif and 2.tif I ran
| 261949 [pbailey@bn .] Here I'm using Ruby 1.8.5 on Windows Server 2003.
+ 261716 [martindemell] Works for me - what ruby version and OS? Try
| 261953 [pbailey@bn .] Both lines yield the same TIFF files. The second one shows the same TIFF
| 261962 [robert.dober] Seems it is time to upgrade to 1.8.6, although I am not sure at all
| 261968 [pbailey@bn .] Thanks, Robert. I did upgrade to 1.8.6. But, using your suggestion here,
| + 261980 [robert.dober] That is a good thing anyway,
| | 262038 [nobu@ru y- a] Try File.basename(tiffile, ".*")
| + 261985 [gthiesfeld@g] => ["1_lower.tif", "1_upper.TIF", "2_lower.tif", "2_upper.TIF"]
| 262153 [pbailey@bn .] Yes! Thank you all! I did a File.rename to downcase and now it works
+ 261721 [peter@se an ] OSX 10.4.10 : ruby 1.8.5 (2006-12-25 patchlevel 12) [powerpc-darwin]
261951 [pbailey@bn .] I'm using Ruby 1.8.5 on Windows Server 2003.
Creating instance variables while looping over a hash
261719 [jangchub@gm ] I"m reading in a YAML file using the yaml library in Ruby. My YAML
261725 [dohzya@gm il] You should play with Object#instance_variable_set(name, value)
261726 [dohzya@gm il] # some representation of your data
261730 [jangchub@gm ] Your example really showed me, thank you so much Etienne. You have
[OT] licensing/copyright reading material (was: Ruby Editor)
261720 [caduceass@gm] have listened with strain
+ 261724 [phelan@tt ec] A quick search with "open source economics" at Amazon gives
| 261731 [caduceass@gm] Thanks, Brad. I'll check those out. I was sort of looking for
+ 261728 [aurelianocal] Google for "The cathedral and the bazar".
| 261732 [caduceass@gm] Yes! Resources along this vein are what I am looking for.
| 261901 [minciue@gm i] You might want to try "Producing Open Source Software" by Karl Fogel.
+ 261739 [ jupp@gm .d ] If you want unbiased information you at least need three independent
261758 [caduceass@gm] Basically, you're saying go out and read everything and make up my own
261886 [caduceass@gm] Thanks, Chad. There's certainly a lot of food for thought here. I
requiring multiple files
261734 [terry.dellin] I was wonder how one goes about requireing multiple files.
+ 261736 [kyleaschmitt] run.rb is a directory higher than require_me.rb, so you're require line would be
+ 261737 [alex@bl ck e] require 'sub/require_me'
+ 261769 [ccthiel@gm i] ...
A question of style...
261742 [kyleaschmitt] I just had a funny thing happen.
+ 261744 [tanner.burso] ...
| 261748 [kyleaschmitt] Tanner,
+ 261749 [cardboard42@] I think it's more standard to use String#dup rather than clone. If all
+ 261750 [cardboard42@] On Jul 25, 11:38 am, "cardboar...@gmail.com" <cardboar...@gmail.com>
+ 261752 [kyleaschmitt] That's a good option. Would it make sense though? Having it in the
read variables from string
261743 [daniel.leuen] I would like to extract an array of e.g. integers or floats from a
+ 261746 [cardboard42@] I don't really know how to use unpack, and I'm not positive it's
+ 261747 [list.push@gm] It depends on your rules for extracting data.
261824 [daniel.leuen] Thanks for your input. But I was looking for something like an inverse
+ 261828 [dblack@wo bl] irb(main):001:0> require 'scanf'
+ 261834 [TimHunter@nc] RMagick OS X Installer [http://rubyforge.org/projects/rmagick/]
Efficiency/runtime trouble - may not be Ruby-specific
261751 [kaldrenon@gm] Ruby issue, but I've written the program in Ruby and the community
+ 261776 [jan.svitok@g] hcf(14,35) == 1 which is wrong.
| 261820 [kaldrenon@gm] I try to do this in general, but am I correct in my thinking that it's
| + 261870 [m_goldberg@a] That's very close to what I did. However, the conditional clause of
| + 261900 [jan.svitok@g] In your script Math.sqrt was computed inside an each loop. Now it's
| 261964 [kaldrenon@gm] In other words, if the exact same calculation is needed in more than
| 261965 [jan.svitok@g] Right, but it depends on calculation's complexity. sometimes creating
+ 261791 [m_goldberg@a] Jano Svitok has already given you a good answer, but let me add my 2
Interesting research for Ruby implementors
261753 [znmeb@ce ma ] "Data Layouts for Object-Oriented Programs".
261994 [gregory.t.br] You may wish to read the source of some of the top 50 or so downloaded
Detecting the end of a text file...
261756 [sketchitup@g] I'm just beginning to learn the Ruby progamming language, although I
+ 261759 [fwmailinglis] charset="us-ascii"
+ 261760 [lparravi@gm ] As far as I know, all the IO methods return nil on EOF except for
261774 [sketchitup@g] Thanks for the responses Luis. I think I need to read a little more
Strange error installing RubyGems
261761 [vasudevram@g] I'm on Windows 2000 with Service Pack 4.
Ruby error - cannot find ruby gem active record
261763 [jmilunsky@ho] I get the following error message
261765 [caduceass@gm] Todd
261768 [jmilunsky@ho] Thanks for the quick response
261810 [caduceass@gm] I am not sure about your set up. Are you saying the command "gem
261878 [jmilunsky@ho] Things seem to have gotten worse for me. I had it working at one point
261880 [caduceass@gm] No, this is a connection error. I can reproduce this by establishing
+ 261884 [jmilunsky@ho] that could be it, i will check that right away, thanks
+ 261896 [jmilunsky@ho] I got it to work eventually, couple problems but the main thing is
Question - Passing parameters by reference
261764 [caof2005@gm ] How can I pass a reference to a method as an argument, so after
261770 [caduceass@gm] Assignment inside method scope is allowed, but creates a different
+ 261771 [ccthiel@gm i] ...
| 261775 [dblack@wo bl] def change_me(str)
| + 261780 [ccthiel@gm i] ...
| | + 261782 [ccthiel@gm i] ...
| | | 261786 [lionel-subsc] Ruby always pass references. The problem is that "number += 1" is
| | | 261795 [ccthiel@gm i] ...
| | + 261785 [damnbigman@g] ...
| + 261783 [ruby@ph li .] did you mean to say...
| | 261809 [dblack@wo bl] No; I meant to say change_me(s) :-)
| + 261790 [caof2005@gm ] Thanks for the response, although I was just wondering that using
| + 261797 [caduceass@gm] Yes, because a Fixnum object is immutable. Also, like David said, you
| + 261798 [jameskilton@] ...
| 261811 [okushi@gm il] I think it's the clearest explanation so far Jason.
| 261812 [dblack@wo bl] Or... you pass a reference by variable :-) I think it's useful to
| 263557 [gwtmp01@ma .] I go even farther and simply think of symbols and integers to also be
| 263559 [dblack@ru yp] 1 # textual representation of that object
| + 263581 [logancapaldo] ...
| | 263720 [gwtmp01@ma .] It is confusing to me to even think about methods returning objects
| | 263723 [dblack@ru yp] first, as a synonym for a literal constructor (the actual "ink on the
| | 263731 [gwtmp01@ma .] Perhaps that was just sloppiness on my part. I think of a 'reference'
| | 263734 [dblack@ru yp] No, I really meant to lump all expressions together, pretty much. I
| | 263762 [gwtmp01@ma .] <http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/20236>.
| | + 263784 [dblack@ru yp] I don't know -- in my case, I just always remember reading and
| | + 264140 [mlgaunnac@gm] *snip*
| + 263722 [gwtmp01@ma .] In the way I think about things those examples are not the same.
+ 261784 [caof2005@gm ] Although it did not change neither of both parameters and I suppose
261777 [phlip2005@gm] I don't like assert_raise because the first thing I wanted to check was the
261779 [james@gr yp ] message = assert_raise ... do
Initialization after YAML load?
261778 [lfast@md i. ] I'm saving and restoring a large tree structure using YAML. What I've
261789 [jan.svitok@g] you can use #to_yaml_properties() - return everything except the ones
261876 [lfast@md i. ] Thanks Jano,
opposite of [thing].flatten
261787 [phlip2005@gm] We all know this clever idiom to turn a variable that might be an Array into
+ 261792 [ruby@ph li .] This almost gets there...
+ 261799 [Rob@Ag le on] irb(main):001:0> nil.to_a
+ 261807 [gregory.t.br] I think
| 261818 [phlip2005@gm] Ruby is a strongly-typed language that permits you to write interfaces that
| + 261827 [gregory.t.br] "We all know this clever idiom to turn a variable that might be an Array into
| + 261831 [dblack@wo bl] There are certainly cases where the flattening is not accidental, but
+ 261815 [phlip2005@gm] Ouch. I should'a knowed that!!! Wow. Ouch!