176456-238729

176252-177968 subjects 176625-180183

[/QUIZ] #63: Grid Folding
176456 [luke@bl ns a] ...
+ 176459 [mjb@as la e.] ...
+ 176464 [ruby@an hr p] }  I can't help feeling there should be a direct numerical way to
| + 176472 [adudzik@gm i] ...
| + 176478 [james@gr yp ] But it has the downside of making Enumerable depend on a []() method,
| + 176959 [luke@bl ns a] ...
+ 176481 [SimonKroeger] i hope there is something new in my solution. Rather than folding my
| 176484 [adudzik@gm i] ...
+ 176482 [heron@jp .n ] My solution.
+ 176652 [Bill.Dolinar] to do the folding.  I see now I could have done it much more
+ 176829 [dbatml@gm .d] Here is mine.

Minimizing memory allocations
176457 [ilmari.heikk] So there I was this morning, staring at an ObjectSpace counter tellingme that I'm allocating 1500 Arrays and 10000 Floats per frame. Whichpretty much ground my framerate to ground by requiring a 0.2s GC runevery other frame. So I decided to get down and rid my code of as manyallocations as possible.
+ 176462 [ruby-forum-r] Nice! I wonder if this would be eligible for core patching?
+ 176463 [ilmari.heikk] Argh, sorry, magnitude error. The correct GC run time is 0.02s. Not sobad, but still a 60fps -> 20fps glitch.
| 176468 [gavin@re in ] In a completely separate world (Lua code running under a scene graph
| 176668 [interfecus@g] I don't know anything about Lua, but Ruby is unlikely to see and speed
| 177127 [pbrannan@at ] The marking time is proportional to the number of referenced objects,
+ 176512 [john.carter@] Good Stuff.

SwitchTower with public key authentication
176466 [pgquiles@el ] I am developing what we may call a "distributed video player" in Ruby (this is
176669 [interfecus@g] I don't know that switchtower is your best option here. Why not simply

file locking
176471 [r.mark.volkm] I'm trying to understand usage of file.flock(File::LOCK_SH) which
+ 176483 [ruby-forum-r] A shared lock is usually implemented as a read-lock; in
+ 176670 [jeremy@ch os] A shared lock locks out anyone who wants an exclusive lock.  Typically

Debugging endless loops
176474 [alex@ve k. n] Say, we have a Ruby app going into an endless loop (or perhaps a thread
+ 176486 [ruby-forum-r] Can you do ruby -rdebug program.rb instead of running it normally?
| 176497 [alex@ve k. n] By the conditions of our imaginary problem, we only reproduce our
| 176499 [florgro@gm i] Moin Alexey.
| 176501 [alex@ve k. n] As well as a thread dump default signal handler on "kill -3". In some
+ 176490 [florgro@gm i] This might work and give you a remote debugging back door. I'm just not
+ 176514 [john.carter@] Thread.abort_on_exception = true
| 176517 [alex@ve k. n] Neither endless loop, nor deadlock are exception conditions.
| 176577 [john.carter@] Yup, but if a thread dies and you don't have a handler of last resort nor
+ 176678 [bob.news@gm ] You can write a singnal handler that outputs current thread states.
+ 176719 [snail@ob me ] <alex@verk.info> writes

Fwd: [QUIZ] Grid Folding (#63)
176477 [james@gr yp ] ...

remove non-ASCII characters in a string
176479 [levin@gr nd ] I'd love to hear your comments. (or pointers to existing libraries forthis task)
176495 [ezmobius@gm ] I have a need for something like this as well. But I need to
+ 176496 [rubytalk@gm ] What is considered an ascii char? i used the
| + 176500 [levin@gr nd ] I use everything <127 because I want to preserve tabs and linebreaks
| + 176671 [dave@bu t. d] Your range excludes ASCII character 32, space.
|   176675 [pere.noel@la] i'd like not to remove no-ascii chars but replace all accentuated chars
|   + 176679 [dave@bu t. d] Try the code below, translated from
|   | + 176680 [pere.noel@la] thanks a lot this works great even with ligatures, i don't need speed
|   | | 176683 [dmitry.sever] , you say? What about these (incomplete list, and w/oligatures) :))))
|   | + 176685 [martindemell] # one time preprocessing
|   |   176689 [dave@bu t. d] Except that won't work, because tr only matches bytes, not multi-byte
|   |   176697 [martindemell] Oh - didn't know that! Pretty sad. Thanks for the correction.
|   + 176771 [chneukirchen] require 'iconv'
+ 176739 [levin@gr nd ] # basic usage  "schn".asciify #=> "sch?n"  # with mapping  map = Asciify::Mapping.new(:default)  "foo"".asciify(map)   #=> '"foo"'  Asciify.new(map).convert("schn")  #=> "schoen"  Asciify.new(Asciify::HTMLEntities.new).convert("schn") #=> "sch&#246;n"

Newbie: Recursive deletion of files and dir
176491 [fredrik.cron] I'm designing (newbie level) a script to clean up empty directories and
176492 [ruby-forum-r] I did not read this code yet but take a look at ri FileUtils,

sending email body text based on form content
176505 [jpfeifer@sh ] As a noob to Rails and web development in general, I think I still need
176508 [logancapaldo] ...

[QUIZ][SOLUTION] Grid Folding (#63)
176510 [horndude77@g] I didn't use multidimensional arrays for my solution. I keep track of
176515 [bob_showalte] My solution is at

Net::HTTP post
176511 [r.mark.volkm] Can someone point me to an example of sending a POST request using Net::HTTP?
+ 176518 [james_b@ne r] What is your version of Ruby?
| 176530 [r.mark.volkm] It's 1.8.2 and I'm running under XP.
| + 176531 [matthias@kl ] I think, your code should work..
| | 176535 [r.mark.volkm] I figured out why it wasn't working. There were two problems.
| + 176690 [steve@up im ] Yep - see my other post.
|   176691 [steve@up im ] Oops, poor form to reply to self, etc....
+ 176687 [steve@up im ] 1) Looking at the URL you specified, I'm not sure you can POST to it; as

#define _ and #define __
176516 [brian.takita] ...
177129 [pbrannan@at ] These are provided so ruby can compile on old (pre-ANSI) compilers that lack

[QUIZ][SOLUTION] Grid Folding (#63)
176519 [email55555@g] def fold(row, col, operations)
+ 176522 [ef@al m. it ] This is the kind of problem where it makes sense to trade off
| 176611 [bdolinar@xm ] Cleaned up the code in my previous solution.  Made check_fold not
+ 176532 [email55555@g] found a little bug on my script.

Two Lines of C in Ruby Source
176520 [brian.takita] ...
+ 176521 [nobu@ru y- a] See defines.h for _ and __.  Look for a tutorial of C for ...
+ 176610 [brian.takita] ...
  + 176615 [ml@gi el ba ] Are there still compilers that don't support function prototypes?
  + 176762 [chneukirchen] Christian Neukirchen  <chneukirchen@gmail.com>  http://chneukirchen.org
    176903 [brian.takita] ...
    176996 [chneukirchen] Christian Neukirchen  <chneukirchen@gmail.com>  http://chneukirchen.org
    177238 [brian.takita] ...

[ANN] TeensyWeb 0.2.0
176524 [jlsysinc@al ] TeensyWeb 0.2.0

Line breaking in Ruby can be dangerous
176525 [sky.yin@gm i] After programing in ruby for the past 3 months, I must say I'm
+ 176526 [flori@ni e. ] "1 * 2" and "+ 1" are both valid ruby expressions, the latter "(unary +)
| + 176527 [a.r.ferreira] Ruby would find it out because of the leading "(" or that would be
| | 176529 [sky.yin@gm i] Thanks. When I first found it out, it's really a *big* surprise. This
| | 176550 [chneukirchen] I recommend an intelligent-indenting editor.
| + 176593 [mental@ry ia] The parenthesis.  It shouldn't parse if they were treated as
| | 176594 [mental@ry ia] Okay, never mind.  Now I know the real answer.
| + 176686 [uval@rz un -] because of (
|   176764 [a.r.ferreira] A SyntaxError here may seem unnatural for Ruby syntax rules.
+ 176528 [chneukirchen] 1 * 2 +
  176591 [mental@ry ia] Whoa.

ruby-opengl glut on osx
176533 [tsuraan@gm i] I grabbed the port of ruby-opengl for OSX from
176537 [james.adam@g] I have an updated version of my patched OpenGL module - I'll post
176555 [tsuraan@gm i] Thanks!
176701 [anne@wj .h r] I would be interested.
177326 [james.adam@g] You should have the Developer Tools and the GLUT framework sources

Creating "windows binaries" on Linux
176538 [guslist@fr e] There was some discussion about packing Windows executable with
176939 [google@er kv] So, cross-compiling wihth RubyScript2Exe is possible? Nice! :)
177003 [guslist@fr e] Yeah, kind of cool. Thanks for your good work.

greetings
176539 [mage@ma e. u] some months ago I started to use Python and to see the light.
+ 176540 [joevandyk@gm] The second edition of the book was released two years ago or so and
| 176560 [mage@ma e. u] Thanx.
| + 176562 [zacharooni@c] I may be totally off base, being a Ruby Newbie myself, but I believe the
| | 176564 [r.mark.volkm] The fact that the right-hand side is surrounded by curly braces is
| | + 176568 [mage@ma e. u] I think I understand now, thanx.
| | | 176573 [zacharooni@c] Exactly. I see Rails using this especially in generating views from ERB.
| | + 176574 [zacharooni@c] "The fact that the right-hand side is surrounded by curly braces is
| |   176575 [r.mark.volkm] In your previous example, you ARE passing a Hash to the link_to
| |   176576 [zacharooni@c] Great, thanks for the clarification!
| + 176565 [rubyforum@mi] I think you mean colons ( : )  not semicolons ( ; ) !
| + 176699 [gene.tani@gm] ...
+ 176558 [james@gr yp ] I strongly recommend picking it up.

WeakRef Hash
176543 [james@gr yp ] I need a Hash-like structure, using WeakRef, so that the key value
+ 176557 [james@gr yp ] The following code, adapted from an old post by Guy Decoux seems to
| 176595 [ mfp@ac .o g] ==============================
| + 176596 [james@gr yp ] [snip sensational examples]
| + 176720 [jeff@sc wa c] I like your technique, but suppose the same value is stored for more
|   176778 [ mfp@ac .o g] You're very right, I should have written something like
+ 176696 [bob.news@gm ] Can't you just do something like this?
| 176750 [james@gr yp ] I didn't see this message while the gateway was down.  Sorry about that.
| 176785 [shortcutter@] What problem exactly do you have with it?
| 176792 [james@gr yp ] When I placed the code you posted in a file and tried to create
| 176809 [shortcutter@] Yep.
| 176892 [james@gr yp ] idiom.  I mainly copied it from Matz's usage in TempFile.  (I believe
+ 176820 [ mfp@ac .o g] I summarized the solutions seen in this thread so far, and presented a couple
  176825 [shortcutter@] Nice work. Btw, it's expected that my lookup code is slow because it

(none)
176552 [cremes@op nd] chaddr cremes@opendarwin.org cremes.devlist@mac.com

gstreamer tag usage
176553 [payton@fo lo] I'm working on a Ruby application which uses the GStreamer bindings, and

Raising my own exceptions with DRb
176554 [reto-ruby-ta] I'm looking for a way to raise my own exceptions over drb. It's no
176587 [drbrain@se m] You don't usually want to inherit exceptions from Exception.  If you

Ruby at O'Reilly Rough Cuts
176561 [makenai@gm i] Not sure if this is old news or not, but it would appear that both the
176566 [r.mark.volkm] Who are the authors of these books?
+ 176567 [makenai@gm i] Well, I know that the Ruby Cookbook is the one being worked on by
| 176572 [jonbaer@jo b] It does say it on the official roughcut site ...
+ 176569 [lyle.johnson] Amazon.com claims that Bruce Tate and David Geary are the authors of
+ 176570 [verbena1@gm ] ...
+ 176571 [james_b@ne r] Ruby Cookbook: Rough Cuts Version

Disk Free Space
176578 [faivrem@gm i] Is a way to know free disk space left other that using Win32 API or a
+ 176598 [m.fellinger@] for linux, it is the command dfno idea about easy ways to do that on windows - but there sure is someapi-call for that too...2006/1/24, Mickael Faivre-Macon <faivrem@gmail.com>:> Hi,>> Is a way to know free disk space left other that using Win32 API or a> system call on linux ?>> Mickael.>>
+ 176709 [interfecus@g] This is highly OS-specific so I sincerely doubt there is a general
+ 176721 [jeff@sc wa c] On {U,Li}n[iu]x, df.
| 176772 [vjoel@pa h. ] You can install the GnuWin32 tools on windows to get df working there, IIRC.
+ 176774 [edder@tk sp ] size = 64
  177279 [faivrem@gm i] I thought there would be a portable library to manage disk in general.

Unsubscribe?
176579 [mail@ch is -] How can I unsubscribe from this mailinglist?!
176588 [daniel.cedil] When you first registered, this list sent you an email with all you need
176590 [bianchi@gm i] ...

[ANN] flickr-ruby moved to Rubyforge
176586 [premshree.pi] Just wanted to inform that I moved flickr-ruby to rubyforge some days

Net::imap exceptions
176601 [r.fulton@au ] I have a program that I am using to do password auditing on various
176608 [stefan@ma li] and so on. Maybe it helps to rescue Net::IMAP::Error only, but can't
176783 [r.fulton@au ] Thanks for your response Stefan!
+ 176854 [r.fulton@au ] I have now tried this and it still throws the exception with an explicit
+ 177146 [stefan@ma li] No, it will only catch all Exceptions that are derived from
  177158 [r.fulton@au ] Ah! missed that, my bad!

Buffered IO and UDPSocket
176603 [guslist@fr e] This one is driving me nuts! What causes and IO object (more
+ 176605 [ysantoso-rub] You should not mix buffered methods (read, write, puts, etc.) with
| 176607 [guslist@fr e] But I don't. There is no call to any of read, write, puts, gets in the
+ 238729 [rajsahae@gm ] I am having a problem similar to this.  I have a reciever with a select

[ANN] Test::Unit::XML 0.1.4
176604 [henrik.marte] release adds Doctype comparisons, including comparisons of entity and

Making Array#uniq work
176612 [damphyr@fr e] OK, according to the Pickaxe 2nd. Edition, Array#uniq judges uniqueness
176613 [simon.kroege] you have to define a 'hash' method because Array uses a Hash to remove

class_eval(aString) vs class_eval(aBlock)
176614 [ml@gi el ba ] why does class_eval behave differently is you pass a string or a block to it?
177179 [ruby-ml@ma i] Reason for that is that all blocks are closures (they 'enclose' the

[QUIZ] Ruby Quiz Solutions (#63 Grid Folding)
176616 [james@gr yp ] Since the gateway is misbehaving, I have crawled the newsgroup

CR/LF in data read from a socket
176617 [mtscolony@gm] ...
176929 [pit@ca it in] outputFile = File.new( "test_image"+ind.to_s, "wb" )
177061 [mtscolony@gm] ...
177064 [gene.tani@gm] I had to respond to this.  I'm not sure if you're comparing to

Re: Any kind of source protection?
176618 [gene.tani@gm] there is 1 thing I haven't tried: newobfusc.rb in
176790 [drbrain@se m] the ruby_to_c project.  It is not publicly available, however.

Re: event-driven networking
176619 [x@ve sa ec s] Couldn't you use DRuby (require 'drb')? That's what I do in my Rails
176635 [alenpeacock@] You certainly could use the asynchronous completion token pattern, but
+ 176642 [gene.tani@gm] but this must be a very entertaining or informative list, or something
| 176644 [raims@do .c ] Oh yes I like ruby very much (I tried it for Rails, like many other people)
+ 176855 [cremes.devli] You might want to take a look at the Myriad framework [1] written by

Re: Grid Folding (#63)
176621 [mjb@as la e.] Matthew, thank you for sharing your results (and in the form of test
+ 176639 [morus.walter] me too :-)
| + 176653 [agafonkin@gm] Thanks for the test, passed.
| | + 176663 [morus.walter] 502.175 (~90 for the 1024x1024 and 411 for the 2048x2048)
| | | 176702 [morus.walter] I did another solution doing an unfold of the final stack.
| | + 176734 [matthew.moss] My solution took only 143 seconds to do all the tests...  of course,
| + 176654 [mjb@as la e.] Sorry, I missed this earlier, but as per my submission a few minutes
|   + 176656 [agafonkin@gm] Mike, you have an interesting concept for this quiz, but the script is
|   | 176657 [mjb@as la e.] Not 100% surprised, and it's longer than others too.  For the large
|   | 176658 [agafonkin@gm] Excuse me for a dumb question, but how do you preallocate the array?
|   | 176659 [mjb@as la e.] and if "preallocate" was the wrong word, I apologise!
|   | 176662 [agafonkin@gm] Thanks. I don't know how to apply it to my code, though. Lets say I
|   + 176664 [morus.walter] I don't see a problem, I was just curious how you understand validation
|     177193 [GENIE@pr di ] I was waiting to clean up my solution, but it's Thursday, so here it
+ 176727 [matthew.moss] Well, sure...  That's like setting the speed limit to 300mph and

About rant on Dave Thomas site, titled 'imitation...'
176622 [simonharriso] Couldn't post a reply on Daves site so thought i'd post one here. Here
+ 176624 [ oop@po .c m] In not so many words, publishers should commission Daves company
+ 176730 [ezmobius@gm ] I can attest to the great process Dave & Andy have going for their
+ 176768 [keith@or il ] Keith
+ 176816 [lists@tu ni ] This is something called competition which is generally considered to be
+ 176824 [james_b@ne r] How many people or companies create anything out of thin air?  How much
| + 176878 [wilsonb@gm i] Indeed. From what I've seen of Pragmatic Markup Language, I wouldn't
| | 176940 [alex.combas@] "For this reason, I honestly don't mind other publishers blatantly
| | 176997 [dale.martens] ground for others. They are the leaders (reluctant as they may be).
| + 176970 [steve@as la ] No, you can't steal but you might infringe.
|   177011 [sera@fh an .] Ideas can't be copyrighted; only their expression can be copyrighted.
|   177218 [Dave@Pr gP o] ...
|   + 177219 [alex.combas@] Well its good to hear you arent aiming for global monopoly! :)
|   | 177269 [Dave@Pr gP o] ...
|   | + 177272 [alex.combas@] I understand what you are saying regarding rails and I agree.
|   | | 177387 [drbrain@se m] I believe Dave is trying to say the inverse.  "We're not a big
|   | | 177389 [alex.combas@] I see where you are coming from now, thanks for clearing this up.
|   | | 177393 [jp@je fp it ] Reading through this thread as merely an interested bystander who only
|   | | 177395 [james_b@ne r] Any mechanism would need to consider that different people will have
|   | | 177422 [jp@je fp it ] Thanks James,
|   | | + 177462 [mental@ry ia] I'm not so sure.  I mean, just in the past few weeks, look at the
|   | | | + 177467 [jp@je fp it ] Mental,
|   | | | | 177471 [M.B.Smillie@] Ah, but what about when popular, marketing-savvy Ms Q "popularises"
|   | | | | + 177480 [mental@ry ia] There's also the situation where Mr. X and Mr. Y both independantly
|   | | | | | 177482 [M.B.Smillie@] Yep.  I've reinvented tons of things.  Generally it happens like
|   | | | | | 178102 [damphyr@fr e] Just look at my post about callbacks and events: me reinventing the
|   | | | | | 178174 [snail@ob me ] writes
|   | | | | | 178178 [kiaroskuro@g] ...
|   | | | | | 178181 [snail@ob me ] <dd533d4b0602030248o663df9c1s42914c58dfe2ef4b@mail.gmail.com>, chiaro
|   | | | | + 177594 [eeklund@gm i] To me, it's not clear that we can create a system where the average Mr
|   | | | + 177830 [kero@ch ll .] I'll try to stimulate thought a bit.
|   | | |   177932 [jp@je fp it ] Looking at both what came before and especially what came after my
|   | | + 177499 [arpan@ar fa ] I don't think that they would be considered acts of Genius. If they were
|   | + 177293 [mental@ry ia] Perhaps that is true, but imitation is often a prerequisite for new
|   | | 177300 [znmeb@ce ma ] Interesting thoughts ... I'm attempting to create a Rails-like framework
|   | + 177827 [Bil.Kleb@NA ] This mechanics behind this lack of vitality is well
|   + 177222 [henrik.marte] As you have proved yourself, there _is_ innovation in the publishing
+ 177073 [groups@gr nd] <snort>
threads.html
top