196409-199088 subjects 196904-229557
limiting Ruby Numbers
196653 [ifxa3a@ya oo] is there any ways to limit ruby numbers up to certain bytes? all i've
+ 196658 [toalett@gm i] "A Fixnum holds Integer values that can be represented in a native
+ 196665 [james@gr yp ] Keep watching the Ruby Quiz... ;)
+ 196684 [skurapat@uc ] irb(main):011:0> ((2 ** 32) - 1)
[Fun] self nesting array [[...]]
196654 [meinrad.rech] Dear list,
+ 196657 [florgro@gm i] ...
| 196659 [meinrad.rech] you are right, it works for me too. must have made an error before.
+ 196943 [john.carter@] Since you have a taste for such things....
+ 196951 [john.carter@] While we having harmless, silly, gibbering fun, how about....
Cool Python utility
196660 [vshepelev@im] Look at this. Doesn't it cool? Doesn't we need something like it for our
196664 [M.B.Smillie@] (found via why, as usual: through http://redhanded.hobix.com/cult/
Getting a list of Processes
196670 [me@yo rh me ] How do you get a list of running Processes using Ruby?
+ 196671 [djberg96@gm ] require 'sys/proctable'
| 196688 [me@yo rh me ] This fails immediately for me with "no such file to load --
| 196689 [djberg96@gm ] The sys-proctable package is on the RAA (http://raa.ruby-lang.org).
| 196698 [ben@ia u. et] I don't know what you're trying to do, but here's some hackjob code to do it
| 196736 [djberg96@gm ] What I'm trying to do? For MS Windows, sys-proctable is a wrapper
+ 196711 [gene.tani@gm] one thing *not* to do: use "$$" to get PID, took me a long time to
+ 196731 [rtilley@vt e] def get_process_info()
196734 [me@yo rh me ] Thanks Brad...this is what I'm looking for, and it's extremely powerful!
196750 [rtilley@vt e] Sure, no problem... also, you can list more than the process name. I
196809 [botp@de mo t] # Sure, no problem... also, you can list more than the process name. I
+ 196830 [rtilley@vt e] c = wmi.WMI()
+ 196969 [buppcpp@ya o] Here it is...I think this is what you were looking for.
196990 [botp@de mo t] # Here it is...I think this is what you were looking for.
196994 [buppcpp@ya o] CIMType Type of this property.
Global not evaluated properly in 'if' statement modifier
196676 [bulliver@ba ] charset="us-ascii"
+ 196678 [M.B.Smillie@] I'm not able to generalise this result, my similar code (at bottom)
| 196683 [bulliver@ba ] charset="iso-8859-1"
+ 196680 [zoso@fo on e] 1) I would calculate the method name dinamically with $outtype, instead=
196682 [bulliver@ba ] charset="iso-8859-1"
Re: Global not evaluated properly in 'if' statement modifier [solved]
196677 [bulliver@ba ] charset="iso-8859-6"
Best way to parse Ruby code?
196681 [cohen.jeff@g] I'm trying to parse some Ruby code from C#... I just want to scrape out
196696 [zoso@fo on e] =20
196700 [ara.t.howard] check out the rdoc source.
196707 [drbrain@se m] Which I believe was derived from irb.
Colored syntax output
196685 [robmnl@gm il] ...
+ 196687 [curi@cu i. s] enscript --color --language=html -Eruby --output=blah.html blah.rb
+ 196690 [mike@st k. a] vim -f +"syn on" +"run! syntax/2html.vim" +"wq" +"q" file.rb
+ 196691 [ezmobius@gm ] Hey Robert-
+ 196709 [morris@wo fm] I have a blog entry on how I did this...
| 196714 [robmnl@gm il] ...
+ 196762 [stefan@ma li] SciTE is able to export the current file into RTF, HTML, XML and some
Which encoding causes fewest problems in Ruby 1.8.2?
196692 [nospam@no pa] I posted a similar question in the rails group but this is more specific
+ 196718 [hramrach@ce ] None. They all cause problems. With utf-8 most string functions won't
+ 196723 [matz@ru y- a] String and Regexp handles all of them for most of the cases. But
196811 [hramrach@ce ] Length and indexing do not work very well with utf-8.
196821 [matz@ru y- a] I know. Operations on characters should based on Regexp.
196841 [hramrach@ce ] I am sure you do know :)
196853 [matz@ru y- a] OK, then I'd say 'string handles them all most of the case if your
Dynamic class change?
196697 [mark@st ee l] I have a stream I'm listening to that lots of similar things speak on, each of which also identifies itself with a unique MAC.
+ 196701 [dave@bu t. d] You can deal with this by adding a copy constructor, at least to the
+ 196702 [ara.t.howard] google 'pimpl' : public interface private implimentation. a simple ruby
+ 196795 [vjoel@pa h. ] class Nic
Substrings by Position.
196703 [charliepeck@] Just a logic question about substrings by position.
196716 [shortcutter@] What version are you on?
196722 [charliepeck@] 1.8.4
+ 196729 [M.B.Smillie@] I don't think that having negative lengths reflect direction is at
| 196732 [charliepeck@] I gather your opinion. And I'm sure that you know, there's always
+ 196794 [shortcutter@] Right. But with assignment I would find it even more irritating to
196836 [charliepeck@] Thanks for your comments. I think you all got the gist of the idea, so I
Fwd: Ruby's role in future operating systems
196710 [dez@ds .p pe] I seem to remember seeing that someone was doing an MSH-a-like in
Ruby samples not working
196712 [djk_1200@ho ] I recently installed ruby on windows XP with the latest ruby one-click
196713 [ml.chibbs@gm] ...
196719 [daniel.schie] Am I the only one who thinks this would be a natural behavior for Hash#?
+ 196721 [daniel.schie] class Hash
| + 196724 [daniel.schie] This was much simpler in my head...
| | 196726 [daniel.schie] Hash#values_at does what I want. Never mind.
| + 196727 [foobar_pleas] Seems not too bad. Or am I missing something?
+ 196728 [sean.ohalpin] No, you're not. However, there is Hash#values_at() which already does
ANN: Madeleine 0.7.3
196733 [ndrsbngtssn@] What is Madeleine?
Getting a list of aliases
196740 [djberg96@gm ] Is there a way to get a list of instance method aliases somehow?
196974 [ryand-ruby@z] It is a little less relevant with the core classes (seeing how they
197022 [djberg96@gm ] Very interesting Ryan, thank you.
+ 197026 [pertl@gm .o ] require 'set'
| 197027 [pertl@gm .o ] sorry, wrong post :-(
+ 197045 [ryand-ruby@z] I think it is certainly doable and compact/fast enough if it is done
[ANN] RbYAML 0.2: Pure Ruby YAML 1.1 parser and emitter.
196745 [Ola.Bini@ki ] Announcing version 0.2 of RbYAML
Re: Why the lack of mixing-in support for Class methods? (with solution)
196753 [ara.t.howard] +1
196890 [transfire@gm] # = capsule.rb
Ruby for Highschoolers?
196754 [OwlManAtt@Ow] Howdy list,
+ 196756 [chneukirchen] I know this sounds heretic and probably is not what you expect from
| 196759 [OwlManAtt@Ow] I figured I'd be killing a few birds with one stone. I think Ruby is
| + 196772 [ruby@ph li .] I wouldn't be too worried about the ()'s, I'd be more worried that Ruby
| + 196831 [chneukirchen] Again, just a matter of taste. ;-)
+ 196757 [steviedizzle] I think non-technical High Schoolers would definitely benefit from learning Ruby before moving on to other statically-typed languages. I am a junior next year and we only have one Computer Science course that teaches Java. I have a couple friends who took it this year and some of the code they have written this year could have benefited from prior knowledge of any basic programming. I taught myself Ruby using the Pickaxe book among others and I would have to say it is just absolutely fun to program in Ruby.
| + 196760 [TimHunter@nc] I know this will be controversial, but...IDE? Why do you need an IDE?
| | + 196763 [OwlManAtt@Ow] I'm not after a full-blown IDE. They'd be working under Windows, and I'm
| | | + 196773 [james.britt@] A big part of programming is understanding the world you live in.
| | | | 196774 [hal9000@hy e] Agreed. Even in win32, I spend a lot of time at the command line. It's
| | | + 196818 [ml.chibbs@gm] ...
| | | 196900 [gilesb@gm il] I just want to second this. I definitely think Ruby is a useful
| | + 196799 [me@yo rh me ] For student just starting to learn a language, a good IDE would help
| | 196802 [TimHunter@nc] All right, I'm listening. How would an IDE help?
| | 196837 [keith@or il ] Well, if you're learning to program in Scheme and hear everyone say "Ew,
| | 196861 [ml.chibbs@gm] ...
| + 196798 [me@yo rh me ] I disagree.
| 196803 [james.britt@] A compelling argument against using C++.
+ 196758 [hal9000@hy e] Boy, do I envy you guys. When I was in high school, I learned
| 196761 [OwlManAtt@Ow] I'd find it difficult to not talk about it from the very start.
+ 196766 [sanderum@gm ] ...
+ 196778 [logancapaldo] Maybe you could base the curiculum/text on Chris Pine's Learn to
+ 196782 [M.B.Smillie@] Howdy Nicholas.
| 196796 [james.britt@] If accomplishing a given task is *not* the point of the learning
| 196806 [M.B.Smillie@] For introductory assignments, the results of the assignment are
| + 196812 [james.britt@] I appreciate the detailed post. I've only done a limited amount of
| | 196826 [M.B.Smillie@] [much elided, since a lot of it seems like specific examples of the
| | 196875 [ruby-talk@wh] Also, you will probably have to do a few sleights-of-hand. For example, many
| | + 196888 [phil@ha el .] I'm a bit curious about why you suggested this since writing a game
| | + 196926 [hal9000@hy e] Ahhh, now we're talking. Watch as I dip my Ruby code
| | + 196935 [OwlManAtt@Ow] Aye, that's something I agree with. Thermite paste is a bit more
| + 196832 [chneukirchen] Did I miss something?
| 196839 [M.B.Smillie@] I probably should have said "higher-order functions" or "first-class
| + 196867 [logancapaldo] I think what you're missing that he's missing is that Scheme has
| + 196884 [chneukirchen] Well, Ruby doesn't have first-class *functions*. It "just" has
| 196895 [M.B.Smillie@] This has slightly confused me, but I'll admit that it's been a while
| 196898 [logancapaldo] In a Lisp-2 you have to use special syntax (funcall, apply, #call) to
| 197013 [chneukirchen] Exactly. If there are two different syntaxes for a) method calling,
+ 196797 [garbagecat10] ...
| 196808 [znmeb@ce ma ] I believe the goals are stated in the original post. The first half of
| 196829 [garbagecat10] ...
+ 196800 [s450r1@gm il] Ruby and Scheme are both beautiful languages.
| 196801 [luckynas@gm ] ...
| 196804 [james.britt@] Hear hear!
| 196833 [chneukirchen] Once you *know* how a linked list/hash/sort/Delegate/Flyweight works,
| 196849 [james.britt@] Yes. One could use Ruby to show how various built-in features work,
| + 196856 [M.B.Smillie@] Or maybe not!
| + 196864 [coder68@ya o] Concerning the ide vs command line: nothing beats irb as a learning
| | 196873 [james.britt@] Really? OO is a gross simplification of real life, handy for code
| | 196903 [jtregunna@bl] People tend to abuse this point of object-oriented languages; they
| | 196910 [james.britt@] Oh, absolutly. But, by the same token, not every line of code needs to
| + 196891 [chneukirchen] Exactly.
| + 196892 [louis.j.scor] [ snip ]
+ 196817 [bguthrie@cc ] For what it's worth, I took an introductory CS course taught by one of
+ 196819 [shugotenshi@] Glad to hear you have that priviledge, as a student :)
| 196834 [lists@ac iv ] I thought I needed to add my $0.02 here. My background - Medical
+ 196822 [jtregunna@bl] If you can teach someone to program, learning a new language isn't
| + 196824 [benjohn@fy h] I completely agree with the above.
| | 196934 [OwlManAtt@Ow] Now that I think about it, I suppose that the language is not that
| | 197016 [james.britt@] Me too, but even *I* can still use the command line.
| | 197052 [gilesb@gm il] I think this is actually your greatest asset. Make it as fun as you
| + 196848 [tony@tw nc d] I have followed this thread now for a while, and cannot resist to add a f=
| + 196886 [chneukirchen] Funny you mention Smalltalk. I think it would make a great teaching
| | 196917 [tony@tw nc d] y the
| + 196936 [david@ko nt ] I am currently in finals week for two courses I am teaching using Ruby
| 197014 [chneukirchen] Now you mention it, I'd like to add one more thing: Don't do too much
| 197067 [david@ko nt ] Heh, yes I am very aware of the math-phobia in my students. The only
+ 196823 [leslieviljoe] I found a few errors but mostly I thought it was very good.
196847 [znmeb@ce ma ] See previous post on fun ... Scheme is just as much fun as Ruby IMNSHO.
gets problem - strange
196764 [jim@fr ez .o] ...
+ 196765 [marcel@ve ni] It works like perl in this regard, expecting the arguments on the command
| 196767 [jimfreeze@gm] So, I suppose that one needs to empty out ARGV before using gets?
| + 196769 [hal9000@hy e] ARGF really. This bites me sometimes. I have difficulty
| + 196771 [marcel@ve ni] You want IO#gets not Kernel#gets.
+ 196768 [M.B.Smillie@] "Returns (and assigns to $_) the next line from the list of files in
196779 [rdusong@gm i] ...
196781 [the.mindstor] system('logoff');
196983 [rdusong@gm i] ...
Is there a better way...
196784 [james2mccart] Is there an neater way to achieve this without using that clunky eval
+ 196787 [james@gr yp ] instance = Object.const_get(object).new(attributes)
+ 196788 [logancapaldo] test_confirmation(SomeClass, ...)
+ 196789 [vjoel@pa h. ] object.send(:new, attributes)
| 196792 [vjoel@pa h. ] Duh. Of course, as Logan said, you can just object.new(attributes). And
+ 196793 [ruby@an hr p] } Is there an neater way to achieve this without using that clunky eval
[ANN] Phoenix Ruby Users Group meeting this Monday, June 12
196807 [james.britt@] The Phoenix Ruby Users Group will have their June meeting this Monday,
Something inconsistent in ruby syntax??
196810 [uncutstone@s] Please take a look at some exemplary code first.
+ 196814 [logancapaldo] thing as writing
| 196816 [uncutstone@s] So I can say the reason is that define_method is a method and def isn't
+ 196908 [robert.dober] ...
[ANN] rcov 0.6.0: "differential code coverage", full (faster) cross-references, vim integration
196827 [ mfp@ac .o g] Source code, additional information, screenshots... available at
+ 196911 [neoneye@gm i] nice cross-referencing, when clicking on a method you can see who
| 197179 [ mfp@ac .o g] Mauricio Fernandez - http://eigenclass.org - singular Ruby
+ 196916 [seanhussey@g] It just keeps getting better and better!
197181 [ mfp@ac .o g] Do you have a patch to the CSS handy? (another option would be truncating
Using Win32API for GUI-construction
196838 [joakim@ve se] Im currently using Ruby Tk as a platform construction various GUI. I
196843 [chris.hulan@] Have a look at <a href=http://raa.ruby-lang.org/project/vruby/>vruby</a>
Instructions for downloading and installing win32-open3 module
196840 [jatinder.sau] ...
196842 [jatinder.sau] ...
196845 [phasis68@ho ] Same as win32-serivce.so, you can download "open3.so" at
196877 [jatinder.sau] ...
ANN: Columbia MD Ruby Codefest
196846 [jeffwaltzer@] ...
[resolv.rb, help] Can you give me an example?
196850 [DXpublica@te] I'm trying to write some code with Ruby. I need to write a DNS resolver.
Ruby 1.8.2 iconv and Windows
196852 [damphyr@fr e] I need a quick pointer to any FAQ/Installation guide in order to get
196863 [dave@bu t. d] Cheers,
ruby don't surf
196857 [chas@mu at c] I'm getting the following error. I've looked all over, and have found
196859 [decoux@mo lo] Well, probably I'm wrong
196869 [chas@mu at c] Ah! Good eyes. Somewhere along the line I had accidentally downloaded
Moving Files from a CGI Script
196868 [nathan.olber] I'm looking to use a CGI script to move / rename a directory. I can't
+ 196872 [ara.t.howard] ri FileUtils
+ 196874 [alex@bl ck e] Will FileUtils::mv do what you want?
196876 [nathan.olber] FileUtils looks perfect! Thanks. Every time I feel like I'm getting
196879 [ara.t.howard] download the source. look in the lib/ dir. it's all there. alternatively
196882 [nathan.olber] That's the first place I looked. I glossed over the modules listed below
Re: ruby don't surf (or maybe he do)
196883 [chas@mu at c] Ignored the test failures and installed anyway. It seems to work now.
IRB and Eclipse
196887 [buppcpp@ya o] How can I setup an Interactive Ruby (irb) console within Eclipse?
+ 196894 [schapht@gm i] If it exists as a view in radrails, you could very easily just open
| 196961 [buppcpp@ya o] I'm not using RadRails, I need one in regular Eclipse...how would I set
+ 196896 [briankbuckle] ...
Get file over web
196899 [judofyr@gm i] web into a string. Something like in PHP: $string =
+ 196901 [cremes.devli] require 'net/http'
+ 196902 [asbradbury@t] uri = URI.parse("http://php.net")