216678-220098

216550-276380 subjects 216923-232225

FXRuby and win32 events
216678 [A.Reith@gm i] I'm trying to build a small 'auto-copy' app with FXRuby (on windows). I

[ANN] Code Golf Challenge : Oblongular Number Spirals
216693 [carl@ca ld .] For those who found the 1,000 Digits of Pi problem too daunting, here's
+ 216844 [paul@ic no l] I've just spent since 4pm (it's now 22:40 local time) working on
| + 216846 [amos.l.king@] What is the problem?
| + 216858 [james@gr yp ] It is a hell of a problem.  I too lost a couple of hours to it this
+ 216963 [michael.ulm@] I finally found some time for golfing again. Here is my current solution.
  + 217030 [james@gr yp ] Does that work?  I thought the script received the numbers on STDIN.
  + 217033 [james@gr yp ] I haven't figured out completely how it works yet, but I did shave
    217041 [james@gr yp ] f=proc{|n,m,k,o|n*m==0?[]:(k>0?f[n-1,m-1,m-k-1,n+m-1+o].reverse<<n+k
    217092 [sander.land@] f=proc{|n,m,k,o|n*m<1?[]:k>0?f[n-1,m-=1,m-k,n+m+o].reverse<<n+k+o-1:[*o...n+o]}
    217177 [paul@ic no l] 2 tries to pass? It doesn't work for all cases then! Cheat! :-)
    217199 [sander.land@] Only for  x*y >= 100, which is true for the majority of the test cases
    + 217223 [paul@ic no l] Hmmmm... letter of the rules, rather than the spirit. I can tell
    + 217228 [martin@sn wp] Part of the problem here is that there isn't a long tradition of ruby
      217246 [SimonKroeger] 10**1000 == ?d**500
      + 217247 [james@gr yp ] I think this would be a great feature.
      + 217256 [paul@ic no l] Yup, my solution has the recursion but is bulked by iterating and

Northern VA Ruby user's group meeting tonight...
216698 [tom@in oe he] ...Stu Halloway, author of the newly released "Rails for Java

Ruby with Qt or GTK ?
216699 [gugui_sarubi] What the best way ? Qt or GTK ?
+ 216708 [Gemma.Camero] From what I have read it depends what platform or flavour of Linux your app is targetted at.
+ 216729 [greg.kujawa@] I'm sure you will get a variety of different takes. There are a few
  + 216740 [vincent.four] This is false. Qt is licensed under GPL.
  | 216742 [jameskilton@] ...
  | 216748 [vincent.four] Well, let's put it this way: Qt is dual licensed, one is commercial,
  | 216756 [nospam@no it] I read this earlier and wondered about it. Can a company really release
  | + 216764 [vito.detulli] no, infact Qt *don't* make such restriction.
  | + 216788 [tomp@ea th i] Someone using your software under the GPL does not have the right to
  | | + 216790 [amos.l.king@] I think Tom is entirely correct.  I took an Intellectual Property Law
  | | | 216812 [greg.kujawa@] Another tool I use has a similar dual licensing scenario. Cincom
  | | + 216810 [jmg3000@gm i] That sounds incorrect. You, the user, can use GPL'd software for
  | |   + 216867 [tomp@ea th i] Well, distributing it or selling products derived from the code *is*
  | |   + 216924 [znmeb@ce ma ] [ snip ]
  | + 216800 [ruby-ml@ki t] This is going OT but it has to do with copyright law and licencing.
  + 216872 [kbloom@gm il] You've gotta ask yourself, though: how would you protect a commerical
    + 216874 [nospam@no it] Qt works with Ruby, but it isn't written in Ruby.
    + 216922 [znmeb@ce ma ] The same way you protect *any* investment -- by soliciting the advice of
    + 216982 [greg.kujawa@] I realize that Ruby 1.8.x code can be at best only obfuscated, not

Re: Code Golf Challenge : Oblongular Number Spirals
216709 [mgreenly@gm ] I'm sure I'll give it a whirl on Sunday when I have a bit of spare
217028 [james@gr yp ] I'm curious how either of you did it!  I struggled and struggled only

problem with ".scan"
216730 [pbailey@bn .] RUBY's complaining about the following 3 lines of code. I've got it in a
+ 216732 [ara.t.howard] the modification is probably here.  can't you show us everything up through
| 216736 [pbailey@bn .] Sorry. It's a bit much. That's why I was holding back. Here's the whole
| 216745 [ara.t.howard] the modification is question
| 216772 [pbailey@bn .] Thanks. I ended the scan block before doing any file writing. That
| 216775 [ara.t.howard] probably because totalpages is always 1 - it's never even - in your new script
| 216781 [pbailey@bn .] Well, I know that they're not always odd or even. They've been a mix of
| 216783 [ara.t.howard] yup.  just remember to avoid this
| 216801 [pbailey@bn .] Thanks a lot, -a! I've cleaned up my code. But, if you notice way above,
| 216811 [shortcutter@] If you're referring to your original code, then no. You use File.read(name)
| 216821 [pbailey@bn .] Thanks, Robert. I'll look into that line-by-line technique. The reason I
| 216965 [shortcutter@] Yeah, in that case File.read is clearly superior (if the file fits into
+ 216739 [nospam@no it] Whoa. The error message suggests that the source string is being modified

[ANN] Missoula Users Group
216741 [jgarvin.list] The (as yet not very organized) Missoula Ruby & Ruby on Rails Users

Rails OSX Tiger RMagick Bus Error Abort trap
216749 [victorrosill] OSX Tiger version 10.4.7; Rubygems 0.9; Rails 1.1.6; RMagic 1.13.0
216875 [TimHunter@nc] Uninstall RMagick and install it again from source - not from the gem -

[OT] Re: Computer Language Popularity Trend
216753 [ara.t.howard] check out the ocaml list - it's completely empty.  the language is extrememly
216818 [jmg3000@gm i] signal/noise or noise/signal?

Passionate Development - interesting post by an ex-Microsoft developer moving to Ruby on Rails
216757 [vasudevram@g] Hey group,

how to determine if pipe is given
216759 [eegreg@gm il] To retrieve piped input to my program I can use something like
+ 216760 [vincent.four] You can check if $stdin is a terminal with
+ 216762 [ara.t.howard] you can do something like
  216819 [eegreg@gm il] thanks, a
  + 216825 [ara.t.howard] why?  is this hard?
  | + 216832 [nospam@no it] / ...
  | | 216851 [ara.t.howard] thanks - that's good to know.  larry++.
  | + 216833 [gwtmp01@ma .] While I understand the historical reason for such constructs, I much
  | | 216853 [ara.t.howard] agreed.
  | + 217095 [rick.denatal] Yes I agree with this, but...
  |   217172 [eegreg@gm il] Thanks for all the info guys.  Here is what I came up with.
  |   217181 [eegreg@gm il] small typo there, this is better...
  |   217207 [eegreg@gm il] should be
  + 216828 [gwtmp01@ma .] Normally I would just nod my head in agreement with Ara, but not this
  | 216848 [ara.t.howard] this is as easy to do as
  | 216907 [gwtmp01@ma .] Hmm. Doesn't cron arrange for stdin and stdout to be /dev/null, in
  | + 216920 [ara.t.howard] hmmm.  you are right.  i had to look back at what had given me trouble before
  | + 216932 [eegreg@gm il] I wanted the ability to optionally pipe a file, but the program would
  | | 216950 [robert.dober] ...
  | | 217022 [gwtmp01@ma .] Actually I think the 'normal' thing in Unix is to simply do blocking
  | | 217039 [ara.t.howard] not if they work on unix!  ;-)
  | | + 217043 [ara.t.howard] oh yeah - nearly forgot my favourite: curl.  it's takes about six billion bits
  | | + 217048 [gwtmp01@ma .] Huh?  That is like saying that grep at the end of a pipeline is expected
  | |   217059 [ara.t.howard] you are right.  i'm just saying it's but not uncommon to sentinal stdin via
  | + 216934 [eegreg@gm il] I wanted the ability to optionally pipe a file, but the program would
  | | 216940 [gwtmp01@ma .] I'm not sure I understand what you mean by 'pipe a file'.  Pipes and/or
  | | 216946 [eegreg@gm il] I guess the problem comes down to: can I determine if there is data
  | | 216949 [ara.t.howard] windows or *nix?
  | + 216944 [eegreg@gm il] I wanted the ability to optionally pipe a file, but the program would
  |   216948 [nospam@no it] But you can have both, it's done all the time. As has been explained, if the
  |   216953 [eegreg@gm il] so the answer is that I must rely on the user to indicate what they are
  |   216960 [ara.t.howard] it's so much more terrible than you realize.  you can tell if there is data
  |   216990 [robert.dober] ...
  + 216829 [nospam@no it] Why? One performs a test to determine if there is a pipe. That seems
    216839 [eegreg@gm il] sorry, misread some perl stuff.
    + 216849 [nospam@no it] Are you asking whether this is true, or whether it would be a good idea? If
    + 216854 [ara.t.howard] STDIN.tty?
      216880 [eegreg@gm il] Didn't you just say that this is a bad idea because of program & and

Threading and Deadlock
216761 [jmckible@gm ] I'm making the back end for a feed reader.  I plan to have a daemon
+ 216767 [vincent.four] I unfortunately can't really where your deadlock comes from. But the
| 216778 [jmckible@gm ] I don't think this is quite what I need.  The worker threads should
| 216816 [vincent.four] This is exactly what this scheme is doing. I was just mentionning the
+ 216774 [garbagecat10] ...
| 216776 [jmckible@gm ] Processing a feed entails an http request to retrieve it, parsing, and
+ 216777 [garbagecat10] ...
| 216780 [jmckible@gm ] ah, the loop, of course! The fill and crawl should be wrapped in loop do
| + 216784 [garbagecat10] ...
| + 216806 [ara.t.howard] even if true - consider that you are effectively re-writing Queue to
+ 216782 [ara.t.howard] require 'thread'

attachRecording method in WatirMaker script
216769 [matthew.hail] I modified the watirmaker script

Ruby/Git?
216785 [andre@di ir ] I've been working with subversion for some time now and thought I'd have
+ 216794 [Bil.Kleb@NA ] Later,
| 216808 [andre@di ir ] Yeah, I saw that... well at least he didn't have to wait the 2 centuries
| 216992 [chneukirchen] That's still nothing compared to darcs and GHC.  :-)
+ 216820 [chneukirchen] I gave it a try some months ago, but lost interest.

Bonjour and Socket::getaddrinfo
216791 [obrien.andre] I was having a problem with DRb coming from Socket::getaddrinfo not
+ 216792 [nospam@no it] If there is no IP associated with a particular network node, then no, you
| 216804 [obrien.andre] Thanks for the quick reply, Paul.
| 216824 [nospam@no it] I don't recommend this. In many cases, assigning 127.0.0.1 to the system
| 216835 [gwtmp01@ma .] 127.0.0.1       localhost
| 216838 [nospam@no it] / ...
| + 216842 [obrien.andre] something in my head was telling me that that wasn't really a good idea
| + 216852 [gwtmp01@ma .] DHCP assignment from my firewall/router.
+ 216798 [gwtmp01@ma .] Strange.  This worked just fine for me (Mac OS X 10.4.7, Ruby 1.8.5).
  216809 [obrien.andre] What was the value of your "host" variable in that line?  "radar" or
  216817 [gwtmp01@ma .] It was 'radar.local'.  When I run hostname I get 'radar.local' also.
  216826 [obrien.andre] Yep.
  + 216831 [nospam@no it] Yes, as long as you realize this change won't survive a reboot. Typically,
  + 216836 [gwtmp01@ma .] If you feel so inclined, I'd take a look at any startup scripts you may

Automatic globbing of ARGV
216797 [doktormadsen] I found a funny feature of Ruby tonight: if possible, commandline
+ 216802 [nospam@no it] The globbing isn't happening in Ruby, it's happening in the shell that
+ 216873 [kbloom@gm il] If a file matching the glob exists, then your shell globs it.
  217121 [doktormadsen] Just to clear things out, I am using win32.
  217140 [drnicwilliam] So is it that Ruby on Win32 is covering for limitations of DOS/Cmd?

StdLib Documentation Download
216807 [nospam@no it] I have a very slow connection, and I like to download documentation whenever

can't get the @ on fxri
216814 [longinos10@h] I'm trying several ways to write the @ at, but just can't;
+ 216822 [ara.t.howard] are you talking about shift+2 ?
+ 216823 [nospam@no it] Could you please explain a bit more fully? Are you having trouble typing the
| 216869 [longinos10@h] sorry for the dlay,
| 216871 [nospam@no it] Maybe there's no entry in ri for '@'. Umm, no, that's not the reason -- I
| 216883 [longinos10@h] irb(main):024:0> class Greeter
| 216903 [longinos10@h] I figure it out, sorry it was very easy, a friend that came over told
| 216939 [nospam@no it] Don't feel bad, it happens to all of us. In 1977 I got my first personal
| 217026 [rick.denatal] I guess that that was before the autostart ROM.
| 217038 [nospam@no it] / ...
+ 216843 [aledonne.lis] If you let us know your operating system and keyboard layout, we may

Problem returning a boolean to a dll
216830 [chabotrobert] Here is part of the code, manipulating an application (LaserFiche) API

Strange error in jcode.rb when converting range to array
216845 [hammed@gm il] ("a".."z").to_a
217054 [manfred@gm i] When I try this with jcode loaded it immediately breaks. It looks like
217108 [matz@ru y- a] No, it's about 1.9 and the OP was using 1.8.4.  I will examine it
217112 [hammed@gm il] The perplexing part for me was why jcode.rb was even being used by my
217119 [matz@ru y- a] I've heard Rails uses jcode to handle UTF-8.

CanvasPlot, createPlotAxis and createLinePlot.
216847 [lynchnco@pa ] Good afternoon,
+ 216862 [nospam@no it] / ...
| 216889 [lynchnco@pa ] I tried 'tk'...but it doesn't work...bummer...
+ 216901 [m_goldberg@a] AFIK, TK::CanvasPlot is Perl only and is not available in the Ruby/Tk
  216983 [lynchnco@pa ] Thanks Morton. Too bad, it does exactly what I need to do...what I'm
  + 217024 [m_goldberg@a] I'm afraid I can't help you. I don't do that kind of programming with
  + 217066 [nagai@ai ky ] Those seem Perl's simple subroutines.
    217070 [lynchnco@pa ] I've done that...can you tell me how to add tick marks and coordinate
    217116 [nagai@ai ky ] Do you want to use this from Ruby?
    217162 [lynchnco@pa ] Thank you, I shall try both techniques...
    220098 [lynchnco@pa ] I finally got the Perl version of Tk::CanvasPlot up an running -- see

Idiomatic file snarf
216856 [tbray@te tu ] I want to open a file, suck the contexts into a variable and close it
+ 216857 [james@gr yp ] text = File.read(fname)
| 216879 [john.carter@] Actually, the idiom I most use is
| 216925 [john.carter@] Just remembered, I have an old RCR lying around on this.
+ 216859 [thomas.adam2] some_variable = File.new(fname).readlines
+ 216866 [ruby-ml@ki t] text =3D File.read file_name
  216902 [twifkak@co c] To expand on that: the form that takes a block automatically calls

Injecting truth
216860 [kennethkunz@] I had a scenario arise today where I needed an iterator with similar
+ 216861 [rubytalk@ea ] ...
| 216878 [dblack@wo bl] The idea is that it's a case where you want the block to be executed,
+ 216863 [GENIE@pr di ] How about (1..5).map { |x| x < 3 }.all?
| + 216877 [dblack@wo bl] Whoops, I didn't see that before I (re)posted it :-)
| + 216930 [kennethkunz@] This approach is nice and concise... but I still prefer "truth
+ 216864 [GENIE@pr di ] Also, with #2, obviously your way works, but the &&= isn't neccesary, a
| 216967 [shortcutter@] In that case order should be reversed to avoid short circuiting altogether
| 217000 [GENIE@pr di ] Very good point, neglected to think about that, glossing over the fact
+ 216876 [dblack@wo bl] Cool.  I want to play too :-)

Embedding the Ruby interpreter in C# app
216894 [nkpart@gm il] in C#. I've got well through the basics of using p/invoke to load the

Multi-Module Alternative to the Factory Pattern?
216895 [transfire@gm] I've been using a factory pattern for a set of packaging classes
217001 [pit@ca it in] Tom, couldn't you pass the packager itself to the external modules and
217016 [transfire@gm] Yes. That would work too. And that might be the best way to do it.
217023 [ara.t.howard] module DEB
217057 [transfire@gm] Only becuase there are a lot of arguments to pass.
217062 [ara.t.howard] hash?  array?

Is object[x](y,z) always invalid?
216896 [alexg@ku cr ] I'm working on converting a Python module (RPy) to Ruby and am trying
+ 216899 [hal9000@hy e] I believe your summary of the situation is correct.
+ 216933 [kbloom@gm il] foo[x].call(y,z) may be further from the original python syntax, but it's
| 216952 [ruby-ml@ki t] =20
| 216957 [hal9000@hy e] I don't know what you mean. That is not valid in Ruby (unless
| 216959 [ruby-ml@ki t] It is valid if x is a method that foo responds to.
| 216961 [hal9000@hy e] I think he was merely striving to keep the code
| 216972 [alexg@ku cr ] Indeed. I am 99% certain that the
+ 217522 [invalid@gm .] Would it be a problem to write foo(x,y,z) or foo[x,y,z]?
  217600 [alexg@ku cr ] That is another option I had considered. However, in the library in
  217637 [interfecus@g] You could still use the r.sum(1,2) for 99% of your method calls. The
  217662 [noah.easterl] Yeah, it would be pretty easy to redefine method_missing to forward

Protecting your investment in a commercial ruby app. (was Re: Ruby with Qt or GTK ?)
216898 [kbloom@gm il] I know that. Obviously, there's no difficulty protecting your investment
216942 [nospam@no it] / ...

Alias for a class?
216913 [foamdino@gm ] Last night I was playing with some third-party lib and found myself
+ 216915 [twifkak@co c] SomeClass = SomeOtherClass
+ 216968 [shortcutter@] You can store that class in any variable or constant you like.  So all of
| + 216971 [foamdino@gm ] That's an amazingly intuitive comment - wish I'd made that /me == jealous...
| + 217008 [ara.t.howard] my favourite is
|   217014 [transfire@gm] w00t! Forget all those silly "constants"!
|   217049 [robert.dober] ...
+ 216976 [jan.svitok@g] include StupidlyLongLibName::LongModuleName
threads.html
top