From: timsuth@... (Tim Sutherland) Date: 2005-02-06T11:30:15+09:00 Subject: Ruby Weekly News 31st January - 6th February 2005 http://www.rubygarden.org/ruby?RubyNews/2005-01-31 Ruby Weekly News 31st January - 6th February 2005 ------------------------------------------------- A summary of the week's activity on the ruby-talk mailing list / the comp.lang.ruby newsgroup. This summary is brought to you by Tim Sutherland (TimSuth). Articles and Announcements -------------------------- * [Toronto Ruby User Group meeting 6 Feb 2005] Michael Stok announced that the Toronto Ruby User Group would have their next meeting to eat and discuss Ruby on Sunday Feb 6, 2004. "This is our regular first Sunday of the month meeting at Sushi Rock in Toronto." * [Ruby Quiz Domain] James Edward Gray II has moved Ruby Quiz over to http://www.rubyquiz.com/ and intends to do some [Rails] development on the site in the future. He added "let me just take this chance to MASSIVELY thank EVERYONE who has helped Ruby Quiz in these first 18 weeks! It has been a much bigger success than I expected and that is completely due to the wonderful community forming around it. Every time you submit a quiz, a summary, or even just work one of the quizzes you make my job that much easier and I'm very grateful for that. " * [IBM developerWorks article about Cerise] Koen Vervloesem wrote an [article] for IBM developerWorks that introduces [Cerise], a Ruby web application framework. Quote of the Week ----------------- Matt Maycock was caught [saying] "Given that the OP mentioned Haskell, I think we should all try to come up with some language that has the wonderfulness of Haskell with the wonderful ness of Ruby. We could call it Rascal. Since Haskell cats are all about domain specific languages, we could call DSLs in Rascal "Little Rascals"... :-)" (Thanks to Dave Burt for suggesting this as the quote of the week.) Threads ------- Interesting threads this week included: [ruby, gtk and windows..] ------------------------- Tom Rathbone wanted to know if anyone had got Gtk+ and Ruby to work together under Windows. Joao Pedrosa said that it was easy to setup and linked to an install guide at http://ruby-gnome2.sourceforge.jp/hiki.cgi?Install+Guide. [Recommendable ruby books?] --------------------------- Tom Rathbone asked what Ruby books people recommend, especially any that give information on [Rails]. Brian McCallister suggested Programming Ruby, 2nd Ed (Pickaxe 2), Dave Thomas & Andy Hunt ("Most up to date and probably the best general reference available") and The Ruby Way, Hal Fulton ("Quite good in my opinion, captures the spirit of ruby very well"). Curt Hibbs confirmed the rumour that Dave Thomas is writing a [Rails] book. [Oracle Adapter For Rails -- About When?] ----------------------------------------- Matt Bowen had heard that an Oracle adaptor of ActiveRecord was being developed (to allow the use of Oracle with [Rails]), and wondered when this would be available. raymond capozzi replied with some good news - a patch has recently been submitted that adds preliminary Oracle support. [Default values for block parameters] ------------------------------------- Matt Mower was using define_method to dynamically create a method, but found that Ruby would not allow him to create a block having default values for some parameters. For example, the following results in a syntax error: define_method("name") { |x=1,y=2,z=3| f(x,y,z) } Robert Klemme suggested define_method("name") { |*a| f(a[0] || 1, a[1] || 2, a[2] || 3) } and guessed that default parameters were not supported since blocks are usually called from only one place (e.g. each) so default parameters are not useful. Mark Hubbart agreed with this assessment but suspected it would change in the future. The development version of Ruby (version 1.9) supports the &block syntax in block parameter lists, so we might expect that block and method parameter lists will be made more consistent in other ways. [Ruby/DL and functions that modify a pointer] --------------------------------------------- Ben Giddings had some C code like the following, and wanted to be able to call it from Ruby. He wasn't sure what to pass in for results_ptr to allow C to modify the structure. typdef struct { int status; int results[16]; } foo_t; int get_results(handle_t the_handle, foo_t *results_ptr) { results_ptr->status = 0; results_ptr->results[0] = 0xFF; return 0; } Takaaki Tateishi said that struct can be used to handle this, with the code below demonstrating the idea module MyLIB extend Importable dlload "...." MyStruct = struct [ "int foo[3]", ] extern "int get_data(void*)" end ptr = MyLIB::MyStruct.malloc() MyLIB.get_data(ptr) [symbols vs strings vs ?] ------------------------- Joe Van Dyk wondered about the point of Symbols - when it is an advantage to use them over Strings. Assaph Mehr explained that "Symbols are immutable strings. Every occurence of the same symbol correspondes to the same single object, while every occurence of the same string is a different object (with the same value). Thus symbols are a bit faster and cheaper to use in things like case statements, hash keys etc. It's also usually a bit nicer to read in the code, as it signifies that what you're looking it at is a unique identifier, rather than something that can have a dynamic content." [Ruby-muse Summary for Jan.] ---------------------------- trans posted a summary of January topics on the ruby-muse mailing list (aka ruby-suby), a list for "musing" about Ruby or "suggesting" improvements to the Ruby language. Topics covered include Aspect Oriented Programming (AOP), prototype-based OO and subclassing vs delegation. [[SUMMARY] To Excel (#17)] -------------------------- James Edward Gray II summarised last week's [Ruby Quiz], which was to write code to extract information from a report given in an inconsistent human-readable format. The summary describes the process you can go through to iteratively simplify the report. [[QUIZ] Solving Tactics (#18)] ------------------------------ Bob Sidebotham came up with this week's [Ruby Quiz]. "There's a little pencil and paper game, Tactics, played on a 4x4 grid. The play starts with an empty grid. On each turn, a player can fill in one to four adjacent squares, either horizontally or vertically. The player who fills in the last square loses." "Your task, should you choose to accept it, is to write a Ruby program which, given only these rules, determines whether the first or second player is bound to be the winner, assuming perfect play." [lack of reaction to latest ruby implementations] ------------------------------------------------- Alexander Kellett wondered why no-one seemed to be commenting on YARV (a Virtual Machine for Ruby) or Ruby2C (part of a project to implement Ruby in Ruby). Daniel came out with "Well, Alex, I kinda feel like a caveman who's just been given a wrench. You're screaming "Look! Look! Look at this awesome tool we've invented! And it's all yours!". I'm staring at the shiny new metal thing, and deep down I get the feeling it's pretty important, but I just don't know what to do with it." Aredridel added "I think it's a case of bated excitement. We dare not speak, for fear of disturbing progress. It's mostly for me, a combination of having work to get done at the moment and no time to help -- I can only watch from afar, and hope for the best." There was also some discussion about Cardinal (project to run Ruby in Parrot, which is the VM that will be used for Perl 6). gabriele renzi mentioned that "the python frontend has had quite a lot of work lately, mostly since Sam Ruby started hard hacking it, IIRC. Btw Ruby writing a python frontend for a perl VM sounds too much funny :)". [[OT] A public thank you...] ---------------------------- Tom Copeland issues a public thank you "to Dennis Oelkers, who recently provided another mirror for some of RubyForge's larger files. Now he and Austin Ziegler are splitting the bandwidth load of 100+ GB per month that RubyForge absorbs. Thanks guys!" [Need to create zip files] -------------------------- DaZoner wanted to create zip files through Ruby and wondered where he could find some documentation or examples for rubyzip. Nathaniel Talbott gave a link to http://rubyzip.sourceforge.net/doc/. New Releases ------------ * [XDCC-Fetch 1.386] martinus enhanced the GUI of XDCC-Fetch, a tool for searching, collecting and downloading XDCC announcements within IRC channels. * [Nitro + Og 0.9.3] [Nitro + Og 0.9.5 (BUGFIX VERSION)] George Moschovitis made some important changes to the [Nitro] web application framework. Fastcgi support was added, as was a new rendering pipeline (one of the benefits of which is easier unit testing). A few days later he released version 0.9.5 to fix some bugs. * [Arachno Ruby SUSE 9.1 Linux 0.1] [Arachno Ruby IDE 0.1.1 (for SUSE 9.1/9.2 and Ubuntu Linux)] Lothar Scholz released a public beta of the Linux version of [Arachno Ruby], a proprietary, commercial IDE. * [Pimki 1.5] Assaph Mehr improved [Pimki], a PIM (Personal Information Manager) based on the Instiki wiki server. * [Wee 0.7.0 + Tutorial Videos] Michael Neumann added some new features to the Wee web application framework. He also posted three tutorial videos. * [LXL (Like Excel) 0.1.1] Kevin Howe made the initial public release of [LXL], an evaluator for a mini-language that mimics Microsoft Excel formulas. * [eric3 snapshot released] Detlev Offenbach added initial Ruby support to his IDE [eric3]. * [PQA v1.5 released!] Tom Copeland fixed some bugs in [PQA], a database query analysis tool. (It gives information like which queries in your application take the most time to execute.) * [ParseTree 1.3.3 and ruby2c 1.0.0 beta 1] Ryan Davis announced the first public release of ruby2c, a tool that converts a restricted subset of Ruby into C. The idea is to allow Ruby internals to be written in Ruby rather than in C. * [aeditor-2.3 (darkmatter release)] Simon Strandgaard issued the latest release of AEditor, a programmers editor written in Ruby. * [net-mdns, multicast DNS and service discovery (aka "Rendezvous")] Sam Roberts posted an extension to the standard 'resolv' library that adds support for multicast DNS. An example of the use of multicast DNS is for service discovery in Apple's Rendezvous. * [Harmonium -- A distributed hash table implementation for Ruby] Dido Sevilla made the first public release of Harmonium, a distributed hash table implementation. * [SQLite3/Ruby 1.0.0] Jamis Buck declared that the Ruby binding for the SQLite3 database was ready. "Here it is, at last. Bright, shiny. I think I'm going to cry." Also announced is a "brand-spanking-new" [users manual]. * [mrplot-0.0.1] Malte Harder released his first Ruby project: a general purpose plotting library. It currently uses RMagick, but other backends like OpenGL may be added in the future.