Ruby Weekly News 28th November - 4th December 2005


#1

Ruby Weekly News 28th November - 4th December 2005

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

[Contribute to the next newsletter.]

Articles and Announcements

 * RubyConf 05 Audio and Video files resurrected!
 ------------------------------------------------

   Ezra Z. restored the audio/video archive of RubyConf 

2005,
after the server they were stored on was broken into.

 * 4 December meeting - Toronto Ruby U. Group
 ----------------------------------------------

   Mike S. noted that the Toronto Ruby U. Group were having (did
   have) a meeting on December 4.

   Hampton:
   "I have an exam the next day, but I'm going to do my best to make 

it!"

   That's the spirit.

 * Ron J. implementing Extended Sets
 -----------------------------------------

   Ron J. is writing a series of Extreme Programming articles 

about
“Extended Set Theory”, with implementations in Ruby.

   James Edward G. II: "This is a great series of articles and he
   openly invites insights from Ruby Gurus reading along. Bring your
   thinking caps!"

 * Rails and Django Debate
 -------------------------

   John W. Long announced a "debate" between the main developers of 

Rails
and Django (a Python web framework), held in Chicago on December
3rd.

   See [Snakes and Rubies] and [RedHanded coverage].

 * December Ruby events in the SF Bay Area
 -----------------------------------------

   Rich M. announced a couple of December Ruby events in the San
   Francisco Bay area.

   The San Francisco Ruby Meetup Group is on the 13th, followed by 

The
Beer & Pizza SIG on the 28th.

Threads

String#to_rx ?

Alex F. asked if the following would be a useful addition to the
standard String class. It is intended to be used in place of
/#{Regexp.escape(a_string)}/.

class String
def to_rx
Regexp.new( Regexp.escape(self) )
end
end

Austin Z. said that the name to_rx is not “expressive” enough
for a
core method, and suggested escape_regexp.

The thread turned to looking at the changes to regular expression
syntax
and behaviour proposed for Perl 6.

Help getting around iconv on a PC

Anders got an error “No such file to load-iconv” on his Windows
machine,
and asked where he could find the library, compiled for Windows?

Dave B. posted a link.

is there a way to get or list all available classes?

Daniel Schüle asked how to write a program that lists all the classes it
knows of, and Wayne V. provided the answer:

ObjectSpace.each_object(Class) { |c| p c }

need some Ruby magic

Hammed M. wanted a way to shuffle an array into random order.

Jeff W. said the Facets project has some implementations, and David
A.
Black noted that the most common idiom is the beautifully succint

		array.sort_by { rand }

The code associates each value in the array with a random number in
[0.0, 1.0), then orders by the random numbers.

Mauricio Fernández said that the method has a (small) bias, since if by
chance the same random number turns up twice then the relative order
of
their elements will be preserved.

“This means that permutations preserving the relative order of one
(or
more) pair of elements of the original array are a bit more
probable.”

He also worked out of the probability of a collision for various
array
sizes (the Birthday Problem comes into play), with the “53 bits of
pseudo-randomness” you get from a call to rand:

	 array size  P(#rand() collision)
	  1000       5.54558e-11
	  10000      5.55056e-09
	  1000000    5.55096e-05
	  10000000   5.53574e-03

“A collision implies that the associated pair of elements has got the
same
ordering in the output array, instead of 50-50 chances of it being
reversed.”

Quality of Ruby Implementation ?

GJB:

| Much of the discussion concerning Ruby focuses on the language
itself
| and on how enjoyable it is to program in. I’m still a Ruby novice
but I
| agree with these sentiments. However, I have not heard much
discussion
| about the quality of the Ruby VM implementation. How
| good/mature/production ready is it? So far I’ve used it for simple
| development tasks/utilities but not in production.

Bill K. said that he wasn’t sure which measure of “quality” GJB
was
looking for, but that he had some software that provides
administration
for a Quake server, and has an uptime of hundreds of days.

| It uses TCP and UDP networking, and keeps a fairly large dynamic
| in-memory data structure (100 megs or so)… I also dynamically
reload
| code modules without quitting the application on a periodic basis,
when
| adding simple new features or making bug fixes.

Peter H. added many others use Ruby for production tasks.

Memory Leaks: How to see GC Roots?

Sven C. Koehler wanted to know if there’s a way to find all the
garbage
collector “roots” in his program, to help find the source of a memory
leak.

As an alternative, Robert K. gave a one liner that shows the
number of
instances of each class, e.g.

	  [[String, 582],
	  [Class, 185],
	  [Module, 18],
	  ...]

Joel VanderWerf pointed out a patch to the Ruby interpreter that
shows all
objects that are reachable, and the paths that can be used to reach
them.
This provides the information Sven was looking for, plus a lot more.

Stephen K. said that his (proprietary, currently Windows-only)
tool
Ruby Memory Validator can also show this information.

Weird Numbers (#57)

Martin DeMello posted this week’s Ruby Q…

| A weird number is defined as a number, n, such that the sum of all
its
| divisors (excluding n itself) is greater than n, but no subset of
its
| divisors sums up to exactly n.
|
| Write a program to find all the weird numbers less than a given
input.

New Releases

Ruby for Postioning Device

kleinman introduced Ruby for Positioning Device.

“The project allows retrieval of GPSr data and conversion into GPX
for use
with popular geomapping software like Google Earth and others.”

langhelp-0.9.0

rubikitch: “Langhelp may be the first tool written in EmacsRuby in
the
world. In other words, langhelp is an practical example of EmacsRuby
script.”

It provides a quick way of getting documentation on interfaces in a
variety of programming languages, inside Emacs.

See also [langhelp-0.9.1].

Ferret 0.3.0 (port of Apache Lucene to pure ruby)

David B. released version 0.3.0 of Ferret, a searching and
indexing
library based off Apache Lucene.

Performance has been improved, and bugs around locking fixed.

Rabbit 0.3.0

Rabbit 0.0.3 was released, improving theme support and fixing some
rendering bugs.

Rabbit is used to make presentation slides from text files formatted
as
RD.

ruby-postgres 0.8.0 (RC)

Dave L. posted a Release Candidate of ruby-postgres 0.8.0.

ruby-postgres is a library for connecting to PostgreSQL database
systems
from Ruby.

el4r-1.0.0 - EmacsLisp for Ruby

rubikitch released version 1.0.0 of el4r, which allows you to write
Emacs
programs in Ruby.

Komodo 3.5.1 – a professional Ruby IDE

ActiveState released Komodo 3.5.1, an IDE for dynamic languages.

Curt H.: “This version fully supports Ruby on all platforms (the
previous version was not available on Windows).” Curt also [blogged]
the
release.

KirbyBase 2.5

Jamey C. announced a new release of KirbyBase, a “small,
pure-Ruby
database management system that stores it’s data in plain-text
files.”

It is now available as a gem, and has a fix for a subtle indexing
bug,
plus a number of enhancements to assist Assaph M.'s work on writing
an
ActiveRecord adaptor for it.

Ruport 0.2.9: Taggable DataSets, FasterCSV integration, and Pretty
Printing,

Oh my!

Gregory B. added a “ton” of features to Ruport, a report
generating /
formatting framework and library.

He also asks if someone would write a tutorial.

See also [Ruby Reports Mailing List.]


#2

In article removed_email_address@domain.invalid, Tim S. wrote:

Ruby Weekly News 28th November - 4th December 2005

The Rt Hon The Earl of RWN:

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