Ruby Weekly News 27th March - 2nd April 2006


#1

http://www.rubyweeklynews.org/20060402.html

Ruby Weekly News 27th March - 2nd April 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
you
by Tim S…

[ Contribute to the next newsletter ]

Articles and Announcements

 * Italy on Rails - First Europe Ruby on Rails Conference
 --------------------------------------------------------

   Nathaniel B. announced the first Ruby on Rails Conference in
   Europe. It will be held in Rome in late 2006, and run by Open 

Source
Path.

 * Article: An Exercise in Metaprogramming with Ruby
 ---------------------------------------------------

   Hal F. wrote an article in February called An Exercise in
   Metaprogramming with Ruby, but neglected to post a link to it on
   ruby-talk.

   | My editor said it "didn't do that well" in terms of page views. 

And
| I said, well, I should have posted it to ruby-talk. And she
said: Do
| that now, and we’ll see what effect it has.
|
| So there you have it. No bots or artificial inflation, please.
:wink:

   The article was well received by the group.
   http://www.devsource.com/article2/0,1895,1928561,00.asp

 * Brazilian Portuguese Ruby Book
 --------------------------------

   Eustaquio Rangel de Oliveira J announced his Brazilian Portuguese 

Ruby
book, to be released on April 5.

   The book was added to the RubyGarden RubyBookList page.

   | Com um texto orientado para quem já programa em alguma outra
   | linguagem, este livro apresenta exemplos claros que podem ser
   | facilmente assimilados, servindo de guia para o conhecimento e
   | aprendizado da linguagem Ruby.

 * Ruby and RoR Book Roundup
 ---------------------------

   Rob S., "a big bookworm", put together a list of Ruby books
   coming up in 2006.

User Group News

 * The San Diego Ruby U. Group lives!
 ---------------------------------------

   Daniel A. claimed that the San Diego Ruby U. Group lives!
   "After some false starts, we've decided to do this thing for real 

now.
Calling all San Diego Rubyists!"

 * Ruby Social Club - 1st April Milan Meeting
 --------------------------------------------

   Chiaro Scuro: "The Ruby Social Club is getting up to speed and
   spreading fast. After the first two meetings in Rome we are going 

to
meet up in Milan on the evening of saturday the first of April."

 * April Meeting of the Phoenix Ruby U. Group
 -----------------------------------------------

   James B. announced that the Phoenix Ruby U. Group will be
   meeting on April 10, and will likely discuss new features in 

Rails
1.1, and old features in Ruby’s built-in unit testing library.
“And
I’m sure we’ll make stuff up as we go.”

Quote of the Week

 * Blixy Tee Bus Stop
 --------------------

 So I was wearing my chunky bacon Blixy Tee

   http://www.cafepress.com/blixytees.10116504

 at the School bus stop the other day, and my
 son (5yrs) gets up on his tip toes and starts
 trying to read foxspeak: "Chunky?... bacon?
 Chunky Bacon... Come on, seriously... Chunky.
 Bacon. Chunky Bacon. [repeated ad nauseam]"

 Pretty soon all the kids were chanting.

 It was fun.

 Thanks Why,

 Bil K.

Threads

ruby-dev summary 28274-28600

Furuhashi Apuri summarised the Japanese mailing list ruby-dev, which
had
ideas around regexp named captures, method to hold the name of
the
currently executing method, and a proposal for multi-method support.

The latter would allow you to write

class Bar
def foo(String x)
“a string”
end

def foo(Integer x)
“an integer”
end
end

b = Bar.new
b.foo(“hello”) # -> “a string”
b.foo(5) # -> “an integer”

The String or Integer or … is just anything that has an === method.
“Matz said he agrees and this can be committed to 1.9 if it is fast
implementation.”

Ruby Goes to the Sun

April Fools’ jokes. Hansson’s getting the band back together. Mmmbop.

Testing DiGraph (#73)

Robert F. posted this week’s Ruby Q…

“In this week’s Ruby Q. you will not only have fun and (hopefully)
learn
something; you will also contribute to a research project evaluating
automated testing techniques. So please read on and then take the
quiz!”

“The goal of this quiz is to write a good and extensive test suite
for a
Ruby DiGraph (directed graph) class.”

WIN32OLE#[] and WIN32OLE#[]= method in Ruby 1.9 (or later)

Win32OLE author Masaki S. said he was considering changing the
behaviour of WIN32OLE#[] and WIN32OLE#[]= “in Ruby 1.9 or later.”

“I have not commited the change yet. Before commiting it, I want
suggestions or opinions from Win32OLE users.”

Currently, [] and []= map to method calls, so that excel.visible =
true
and excel[‘visible’] = true are equivalent. The change is to make
them act
on properties, so you can write code like worksheet.cells[1,2] = 10.

Dave B.:
| Excellent! This makes a lot more sense than the existing function
of []
| and []=.
|
| When I first used WIN32OLE, I was surprised that you couldn’t use
[] to
| access index operations.

Rails 1.1

In a thread noting the release of Rails 1.1, Jim W. commented
“The
CVS head of rubygems will do incremental downloads of the index file.
We
are working out the details of testing this on a large site like
RubyForge.”

This will greatly improve the speed of the “Updating Gem source
index”
action when installing or upgrading gems.

Ruby Black Belt

Dmitry B. posted a draft Ruby exam, having decided to create a
Ruby
equivalent of JavaBlackBelt.com.

“What we need is a feedback of experienced Ruby enthusiasts (means
You).”

James Edward G. II posted a list of errors in the draft exam, while
Justin C. asked what the purpose of the exam was, given that
previously “most people expressed a strong dislike for anything
resembling
Ruby `certification’.”

Dmitry: “What we are talking here about is a bit different, than
traditional certification. The main purpose is learning. You pass the
exam
and see that You don’t know some answers.”

Listrecv: “One of the problems I’d have with a certification of this
sort
is that it focuses only on the least important aspects of the
language -
syntax, nomenclature, conventions, etc.”

Peter S. mentioned The Python Challenge - a set of programming
riddles
where you must apply some Python programming techniques to advance to
the
next level.

| I came to know a LOT of non-programmers through python challange -
i
| have been mailing on a (nearly) dayly basis with an US (non
programmer)
| girl (i think se was a lawyer) up to the 18th or something level.
When
| she begun she did nothing about programming at all, after 1 week he
has
| been posting about regexps, after 2 weeks about bzip2 from python,
after
| 3 weeks cookies and HTTP, well you get the idea… She was really
| enthusiastic to learn this stuff (which is IMHO not typical for a
non
| technical person) just to see the next screen… And she was not
the
| only one…

This made Bill K. think of _why’s Try Ruby! web-based interactive
interpreter. It has an on-line tutorial where you type code into your
web
browser and see what happens.

Pistos C.: “I tentatively agree with the others about official
certification, but this idea of some sort of online interface that
covers
all (or many) of the features, tools, libs, etc. of Ruby in an
interactive, educational fashion sounds appealing.”

Ruby Q. was mentioned several times as a resource for improving
your
Ruby skills.

Calling R from Ruby

AlexG created a simple bridge between Ruby and R (a statistical
package /
language), allowing him to use R libraries from Ruby.

The thread also discussed advantages and disadvantages of using
either of
the languages over the other, for example R has a fast matrix library
(but
so does Ruby, via NArray), R is “Procedural, with highly limited
function
support”, but

| Au contraire! R is at heart a functional language with a Lisp
ancestry!
| What’s different about R (and S) is two different ways of doing
objects
| and classes, neither one of which is remotely like a Java or Ruby
| programmer’s idea of objects and classes. [M. Edward Borasky]

Going back to the original topic, Thomas said that if you’re on
Windows
then you can access R through Win32OLE.

Round floats to N decimal places?

Pat M.:

| I’m doing some math that results in floats with ~10 decimal places,
but
| I’d like to round them to 2 places. Is there a built in way of
doing
| this? Right now I’m doing format("%0.2f", the_float).to_f, which
seems
| to work fine but it seems like an ugly way of doing it.

Dave B. said that the Facets project defines Numeric#round_at(d)
and
Numeric#round_to(n) methods for this purpose, and suggested that
Ruby’s
built-in Numeric#round method be altered to accept an optional
parameter
for degrees of rounding.

Karl B. suggested Pat take a look at the LongDecimal library,
which
is “specialized for doing calculations with a defined number of
digits
after the decimal point.”

B & E (#72)

Stephen W. created (last) week’s Ruby Q. - find the least number
of
security codes you need to try to break a system where the code
passes
whenever the last sequences of key-presses matches the codes, without
any
reset between.

Get the size in pixels for a string

Stéphane Thibaudeau asked how to get the pixel width and height of a
string rendered with a particular font.

Chris A.:

require ‘tk’

f = TkFont.new(‘Courier 10’)
width = f.measure(“Hi There!”)
height = f.metrics.assoc(‘linespace’)[1]

New Releases

JRuby 0.8.3

Thomas E Enebo said that JRuby 0.8.3 was released. “JRuby is a
project to
provide a Java implementation of the Ruby language and interpreter.”

jirb now works, using Java classes from Ruby is “dramatically”
faster,
several important bugs were fixed and more.

Mongrel Web Server 0.3.12 – Pre-Release

Zed S.: “Mongrel is due for a 0.3.12 release which will feature
some
pretty insane goodies for everyone. There’s talk of IOWA support,
lots of
speed improvements (including sendfile support), a great Configurator
which makes configuring Mongrel a snap (especially for framework
implementers), and a ton of debugging stuff.”

“DON’T CRY” (it’s a pre-release).

“Mongrel now has sponsorship from Eastmedia
(http://www.eastmedia.com) in
partnership with Verisign (http://www.verisign.com/) to make Mongrel
fast
and stable enough for enterprise class loads (meaning “gigantic”, not
“Java style”).”

Rake 0.7.1

Jim W. put out a new Rake release, fixing a bug on Windows and
adding
a few features.

Instant Rails 1.1

Curt H. announced Instant Rails 1.1 an update of the “one-stop
Rails
runtime solution containing Ruby, Rails, Apache, and MySQL, all
preconfigured and ready to run”. Unsurprisingly, this release
features
Rails 1.1.

ZenTest 3.1.0

Ryan D. exposed ZenTest 3.1.0, with updated versions of zentest,
unit_diff, autotest and multiruby.

RJS, Active Record++, respond_to, integration tests, and 500 other
things!

Hoho, it’s Rails 1.1.

“The biggest upgrade in Rails history has finally arrived. Rails 1.1
boasts more than 500 fixes, tweaks, and features from more than 100
contributors. Most of the updates just make everyday life a little
smoother, a little rounder, and a little more joyful.”-David
Heinemeier
Hansson.

Ruby-FLTK 0.9.3

Jeremy H. announced a new version of the Ruby-FLTK bindings, “Yes,
it’s
been a while!”.


#2

On Tue, Apr 04, 2006 at 07:33:48PM +0900, Tim S. wrote:

http://www.rubyweeklynews.org/20060402.html

Ruby Weekly News 27th March - 2nd April 2006
[…]
ruby-dev summary 28274-28600

Furuhashi Apuri summarised the Japanese mailing list ruby-dev, which had
ideas around regexp named captures, method to hold the name of the
currently executing method, and a proposal for multi-method support.

The latter would allow you to write
[…]
The String or Integer or … is just anything that has an === method.
“Matz said he agrees and this can be committed to 1.9 if it is fast
implementation.”

As I said under that thread, I think this (proposal for multi-method
support)
is yet another April 1st joke. I’m subscribed to ruby-dev and the
message
referred to in in that summary ([ruby-dev:28533]) doesn’t exist: indeed,
the
last message is [ruby-dev:28505] as of Wed, 5 Apr 2006 03:30:04 +0900.

Maybe it would be better to clarify that for the record.


#3

In article 20060404213120.GB3504@tux-chan, Mauricio F. wrote:

On Tue, Apr 04, 2006 at 07:33:48PM +0900, Tim S. wrote:

http://www.rubyweeklynews.org/20060402.html
[…]
As I said under that thread, I think this (proposal for multi-method support)
is yet another April 1st joke. I’m subscribed to ruby-dev and the message
referred to in in that summary ([ruby-dev:28533]) doesn’t exist: indeed, the
last message is [ruby-dev:28505] as of Wed, 5 Apr 2006 03:30:04 +0900.

Maybe it would be better to clarify that for the record.

I fell for it, doh! I’ve updated the site.


#4

Tim, thanks for writing the summaries!

When I came to Ruby, I found some mailing list summaries, and found
them very useful. I imagine it must take quite a while to put
together, so thank you for taking the time to do so!

Cheers,
Benjohn


#5

On 4 Apr 2006, at 23:13, Tim S. wrote:

last message is [ruby-dev:28505] as of Wed, 5 Apr 2006 03:30:04
+0900.

Maybe it would be better to clarify that for the record.

I fell for it, doh! I’ve updated the site.

Heh - I thought it sounded like an excellent approach! I particularly
liked the idea of using the === operator (that I’ve started to think
of as a predicate acceptance test - it makes the receiver behave as a
predicate, and the argument is matched for satisfying the predicate)
for the matching. Really very similar to a case statement, but
extensible, I suppose.


#6

Benjohn B. wrote:

Tim, thanks for writing the summaries!

When I came to Ruby, I found some mailing list summaries, and found
them very useful. I imagine it must take quite a while to put
together, so thank you for taking the time to do so!

+1

I have appreciated the Ruby Weekly News for some time now. We encourage
you to keep up the good work. :slight_smile:

Pistos


#7

Tim S. wrote:

Ruby Black Belt

Peter S. mentioned The Python Challenge - a set of programming riddles
where you must apply some Python programming techniques to advance to the
next level.

Btw, during the writing of this thread, we begun to work on
www.rubychallenge.com
with Alex C. - It will be a Ruby on Rails site stuffed with great
programming
puzzles, trying to fill the gap between the pickaxe (n00b) and ruby quiz
(advanced) levels. If we will manage to implement our ideas, it will be
way more cooler than pythonchallenge.com in every aspect, at least imho
;-).

After we reach a certain level, we would like to incorporate the Ruby
community as well, so stay tuned!

bw,
Peter


#8

On Apr 6, 2006, at 11:31 AM, Peter S. wrote:

ruby quiz (advanced) levels

Ruby Q. is your (the community’s) quiz. I take submissions:

removed_email_address@domain.invalid

Beginners, get those problems in!

After we reach a certain level, we would like to incorporate the
Ruby community as well

A Ruby Q. to add levels? :smiley:

James Edward G. II