Ruby Weekly News 30th January - 5th February 2006

Ruby Weekly News 30th January - 5th February 2006

Ruby Weekly News is a summary of the week’s activity on the ruby-talk
mailing list / the comp.lang.ruby newsgroup / Ruby forum, brought to
by Tim S…

[ Contribute to the next newsletter ]

Articles and Announcements

 * Seeking Continuations Links

   `Playing Around with Continuations' is a project being put 

together by
James Edward G. II and some others. “As a start, we are
any resources we can find about them.”

   Some links were posted.

 * Rolling with Ruby on *Instant* Rails - "New" Tutorial

   Bill W., with permission, updated Curt Hibb's "Rolling with 

on Rails" tutorial “to make it 100% keystroke-for-keystroke,
window-for-window accurate for someone using this same tutorial
InstantRails Release 1.0”.

 * Rails Recipes Beta Book now available

   Dave T.: "I'm delighted to announce that Chad F.'s new 

Rails Recipes, is now available as a Beta Book."

   | This is a great title for folks who know Rails, and for folks 

| want to get the most out of Rails. It contains detailed recipes
| doing real-world things with Rails, all illustrated with
| code. Some examples are drawn from Rails 1.1, the rest from
| 1.0.
| If you’re used to other recipe-style books, you’ll be surprised
| the depth Chad goes to in this book. These aren’t the usual
“How to
| substitute a string into a template” recipes. Instead, you’ll
| code to solve the kinds of problems you face in real
| using multiple databases, handling sortable lists, using tags,
| many, many more.

   "If you also order the paper book, it'll ship just as soon as we 

it in stock (probably sometime in May or June, but you know what
authors are like…)"

   Thomas K.: "Quick and surprisingly receptive?"
   Pat Eyler: [...] "he forgot good looking."
   Dave: "and honest"

 * Press release: Ruby on Rails Bootcamp in Germany, April 10-14, 


   I haven't seen this posted to the list, but it has appeared in my
   inbox twice now on the day before I send out the RWN newsletter 


   Big Nerd Ranch Europe have a Ruby on Rails "Bootcamp" in Germany, 

April 10th - 14th.

   The course instructor is Rails core developer / 37signals 

Marcel Molina.

User Group News

 * BYU RUG (Utah): February 8 meeting

   Pat Eyler said that the BYU RUG (Brigham Young University, in 

are holding their February meeting on Wednesday 8th. It features
Hodel, who has come from Seattle to talk about all sorts of

   "We'd like to thank Sleep Inn of Provo, who've graciously 

this meeting, and are providing accomodations for Eric on the
night of
the meeting."

 * Ruby in Rome: First Meet-up of the Ruby Social Club in Rome

   Chiaro Scuro announced the first meeting of the Rome Ruby Social 

on February 9.

   "If anyone of you is planning to join, please let us know a 

couple of
days in advance so that we can arrange for a bigger table."

 * Call for Participants: Koeln (Cologne)/Bonn area Ruby U. Group

   Josef `Jupp' SCHUGT asked if anyone was interested in forming a
   Cologne/Bonn area Ruby U. Group (in Germany).

   Stephan Kämper said Germany also has Hamburg.rb, and a Munich group 

possibly in the formulation process.

 * Houston RoR/Rails Group

   Keith L. said some Houston users were trying to put 

together a
Ruby (and RubyOnRails) group.

   "If you are in town and would like to drop in, we are meeting at 

Daily Grind on Washington Ave. at 10:00AM Saturday 4 Feb."

 * Phoenix Ruby U. Group February Meeting

   James B. announced the February meeting of the Phoenix RUG: 

February 13.

 * Toronto RUG Meeting - 5 Feb 2006

   "Once again the Toronto Ruby U. Group is meeting at the Linux 

in Toronto at 1pm on Sunday 5 February 2006."-Mike S…

Quote of the Week

 * Indentation vs. "end"s

I think we can learn a lot from programming languages and Python.
First off, we should be writing in a fixed space font so we
can take visual cues from spacing more easily.
Next, why do we need periods at the end of a sentence
when we know that two spaces after a word mean
that the previous sentence just ended Doesn’t
that make sense And do we really need caps at
the beginning of a sentence we know all sentences
are capitalized and we have just defined that
two spaces before a word means that it is at the
beginning of a sentence next we should look at
spelling double consonants don’t realy add to
the meaning so begining now we spel words by
droping repeated consonants just look at al
these great benefits we can learn from python
self.we self.just self.need self.learn self.ignore self.certain self.aspects
self.that self.may self.cary self.over

   -- Jim F.

   [Don't be mean to our Pythonista friends :-) ]

   This "indentation vs end" thread actually featured a surprising 

of interesting posts, including a recollection by Hal F. that
“really old” (pre- August 1994) versions of Ruby let you
write “end def”, “end class”, etc. instead of just “end”, “end”.

   "When modifiers were introduced (x if y, x while y, etc.) parsing
   became difficult and they were dropped."


Splitting the Loot (#65)

James Edward G. II created this week’s Ruby Q…

“You, and your trusty band of adventurers, have stumbled upon a
cache of rubies! (What luck, eh?) Not all gems are created equal, so
sneak them home and take your time evaluating the stones. The find
was an
equal effort, and you’re all horribly greedy, so you must find a fair
system for dividing up the gems.”

Work around for “Bignum out of Float range”?

Sam K.:

def calc(n)
(2 ** n) * (5 ** 0.5)

puts calc(10000)

=> warning: Bignum out of Float range

Axel said that the square root of 5 has infinitely many decimal
however BigDecimal can be used if you limit the precision:

require ‘bigdecimal’
def calc(n, precision)
(BigDecimal(‘2’) ** n) * BigDecimal(‘5’).sqrt(precision)

puts calc(10000, 10) # => 0.44610[several lines of digits]*10^3011

Axel added that “continued fractions” can be used if accurate
multiplication by square roots is necessary.

ruby-dev summary 28206-28273

Minero A. summarised the Japanese list ruby-dev.

An interesting item is Nobu’s “ANDCALL operator” proposal. (This was
discussed on ruby-dev’s English equivalent, ruby-core.)

Having a notation like “&?”, it would be used as follows:

if a[1] and a[1].strip.empty?
if a[1] &? strip.empty?

 h["key"] and h["key"].dispatch
 h["key"] &? dispatch


“The motivation of this operator is to avoid duplication of

Takaaki T. proposed having the nil? method take a block,
instead of
adding more syntax.

ruby-talk readers followed up with their feelings.

Daniel B.: “Yuck. Looks like a hack from Perl6. Not Ruby-ish.”

Eric H. said Takaaki’s method should be not_nil?', while your editor quite likes and’:

@h[‘key’].and { |v| v.dispatch }

Joel VanderWerf suggested h[“key”].?dispatch as the syntax. “It’s
visually similar to the ordinary method call”.

Ruby Syntax: ‘initialize’ versus ‘init’

Clint Checketts wondered why Ruby uses initialize' instead of the shorter init’?

Matz: “It can be very critical when the name of initializing method
conflicts with others, so that I chose “initialize” to avoid
problems. Besides that, the name was derived from T language (Scheme

Hardcore Ruby kurser i Danmark (Ruby courses in Demark) ?

mortench: "Jeg leder efter et kursus i Ruby for erfarne udviklere,
kender java/c++/c# el. lign. og som gerne vil komme hurtigt og
igang med Ruby. Jeg har dog ikke hørt om nogle kurser i Danmark. Er der
nogle ? "

baalbek replied, "Hvis du kjenner allerede C++/Java etc, så skulle Ruby
være enkelt å lære seg selv, bare få tak i Programming Ruby (Dave T.),
så burde du være på vei! "

foo.h → foo.rb

Ara T. Howard pondered whether someone had created a parser for
Ruby DL bindings from .h files (C header files).

DL is a Ruby library that makes it easy to call C code from Ruby.
aim is to automatically convert C header code like

struct timeval {
time_t tv_sec; /* seconds /
suseconds_t tv_usec; /
microseconds */

into Ruby code

require “dl/import”
require “dl/struct”
module LIBC
extend DL::Importable
Timeval = struct [
“long tv_sec”,
“long tv_usec”,

MenTaLguY: "Well, you’d need more than just a parser, since you’d
have to pick up on typedefs and other type information.

I wonder whether writing an alternate swig backend or something might

Proposal For New R. Mailing List Subjects

Zed S. `proposed’ new subject indicators for ruby-talk.
A couple of quotes:

“Why not Sailor Moon styled bura-sera?”

“ruby-rails-sheep-No, not a place for former Java sheep to come and
their brains off again, but rather a place for people to discuss the
constant topic of table pluralization.”

Torn in two - Pythonist

Doug B.: " I’ve been hovering in this mailing list for a time
just to
get a feel for the community. I must say I’m pretty impressed. Its
friendly, very active and I’ve learnt a lot."

“However”, Doug continued, as a Pythonist he finds some of Ruby’s
unusual. “Should I jump ship? Has anyone else been in my position and
taken the plunge by converting?”

Phil T.:

| Don’t think of it as jumping ship. Think of it as going over to
| out the other side of the catamaran.
| This dynamic-language catamaran has many pontoons and you are free
| move about them. Just remember to keep your lifejacket on.

Ruby jargon and slang

Hal F. announced that he is putting together a list of jargon
used by
the Ruby community, and asked for contributions.

“I have such things as: duck typing, threequal, spaceship operator,
singleton method, singleton class, splat or unary unarray, multiple
parallel assignment, and (ehh) eigenclass.”

mental: “You’ve neglected chunky bacon.”

Daniel N.: “Chunky Bacon isn’t jargon, it’s a battle cry.”