Code Retreat Dublin

5 views
Skip to first unread message

qamir....@gmail.com

unread,
May 5, 2011, 11:26:44 AM5/5/11
to Ruby Ireland
Hi all,

Declan and me a few others form Python Ireland & Alt.Net are running a
code retreat in the science gallery
on Saturday, May 28. This is the first code retreat we're doing,
hopefully the first of many. The focus of the retreat is to spend a
day solving scientific problems.

So if you're interested it be great to see a strong turn out from from
Ruby Ireland, it's limited to 20 people so please sign up if you can
make it sign up at the link below where there's also more information
on the event itself:

http://coderetreatdublin.eventbrite.com/

Thanks & hope to see you there.
Q

Jairo

unread,
May 7, 2011, 6:18:51 AM5/7/11
to Ruby Ireland
Thanks Qamir and Declan,

I will be in Dublin for the weekend so I plan to attend.

See you at the end of the month.

/Jairo

On May 5, 4:26 pm, "qamir.huss...@gmail.com" <qamir.huss...@gmail.com>
wrote:

Jairo Diaz

unread,
May 7, 2011, 6:24:01 AM5/7/11
to Ruby Ireland
The Ruby London community is doing another event called "Ruby Golf".
This is the description, in case you want to organize your own
tournament at some point. I have included some ideas from the
community for possible holes at the end.

Andrew McDonough is going to lead a practical evening called "Ruby
Golf". He describes it as follows:

I started my career as a perl programmer. Perl, like ruby has a lot of
'syntactic sugar' to help developers write concise code. Perl
programmers sometimes play a game known as 'Perl Golf' to explore the
lesser-known features of the language. The aim of 'perl golf' is to
solve a problem using the fewest characters possible.

At this month's meeting Andrew will run a practical evening based
around 'ruby golf', an adaptation of perl golf for ruby developers.
People will be asked to form teams of 4-8 people, and solve nine short
ruby golf 'holes' using as few characters as possible. Each hole will
be defined by a set of RSpec examples describing a single method, and
the teams must write the method to pass all of the examples. At the
end, the solutions will be scored and the winning team will be
announced.

This evening should have something for everyone; beginners can pick up
some language tricks and learn how to write code to pass tests, while
experienced ruby developers will have the opportunity to show off
their skills and compete with their peers.

Note: This is going to be a full evening of practical activity. We'll
break up into small groups on the night to go through what Andrew has
prepared. You should bring your laptop so you can play along. Don't
worry if you don't know anyone, there will be plenty of groups to join
in on the night. Also, you should sign up to the mailing list to find
out about any further instructions.

-----
Sounds like fun. Here's some ideas for holes:

A method which replaces all unquoted new lines in a string into "<br/
>"
A CSV parser which handles single and double quotes and new lines
A method which, given a letter, returns the next letter in the
opposite case (e.g. "s" returns "T", "D" returns "e", "Z" returns "a")
A password generator which creates 8 character passwords which
contains no duplicate characters
An implementation of array sort

Kevin Noonan

unread,
May 7, 2011, 7:09:43 AM5/7/11
to ruby_i...@googlegroups.com
Hi Jairo,

Writing code in the fewest possible characters is a throwback to a
different century, when disks, memory cores and processor cycles were
expensive.

We live in an age of Gigabyte storage on pocket devices; and
disposable Cloud-hosted computing resources.

Ruby is the anti-Perl. I would never want to write Ruby code in a Perlish style.

How about a tournament to make the most elegant, readable and
maintainable implementation?

That is Ruby's forte.

Regards,

Kevin.

matt

unread,
May 7, 2011, 9:28:23 AM5/7/11
to Ruby Ireland
Nice idea, kinda like 'Vim Golf' http://vimgolf.com/

:)

m

José Domínguez

unread,
May 7, 2011, 11:53:31 AM5/7/11
to ruby_i...@googlegroups.com
Ruby golf sounds like fun! muddy, unreadable, and unmaintainable code
is OK for one evening when you are going to throw it away anyway,
right?

The description of the code retreat is quite different from other
retreats I've seen out there but in any case, it could be listed here
if you think it fits http://coderetreat.ning.com/
Although I don't think it needs any more publicity as all the tickets
are gone already!

cheers,
José

> --
> You received this message because you are subscribed to the Google Groups "Ruby Ireland" group.
> To post to this group, send email to ruby_i...@googlegroups.com.
> To unsubscribe from this group, send email to ruby_ireland...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/ruby_ireland?hl=en.
>
>

Jairo Diaz

unread,
May 10, 2011, 10:29:47 AM5/10/11
to Ruby Ireland
These are the results of yesterday's Ruby Golf in London.

The exercise focused on passing all nine holes without coming with
unreadable, and unmaintainable code.

More information below:

----- Forwarded Message -----
From: Andrew McDonough <and...@andrewmcdonough.co.uk>
To: London Ruby Users Group <ch...@lists.lrug.org>
Sent: Tuesday, May 10, 2011 3:03 PM
Subject: Re: [LRUG] ShRUG Golf update

Thanks James. I'm glad that ShRUG enjoyed it. We were a bit short on
time at LRUG, with less than an hour available for coding. Four teams
completed the course, and our winner was Tomasz Wegrzanowsk (@t_a_w),
who was working on his own, and managed 704 characters
(http://j.mp/lbcXV2). Second place was @zuppr, @jamiemill @morticed
and @aanand who came a close second in with 843 chars
http://j.mp/mBjfJU, third place was @danlucraft, @nfelger, Jordi,
Dan, Tony, Steve and Keith who completed the course in 883 chars
http://j.mp/jHhbWU and finally one other anonymous team completed the
course with 1208 characters (if this was you, please let us know who
you are). The winner, Tomasz (http://j.mp/lSsmJd), was presented with
a trophy (http://j.mp/iRFwGP) and the second placed team got medals.
There are still four medals left, which I will award at the next LRUG
to the four people who produce the best solutions (not necessarily the
shortest ones), so there's still something to play for if you didn't
come along on the evening.

There appears to have been a lot of work done since to get the
character counts down even further, in particular from Paul Battley
with some help from Tom Stuart. Their commit log is worth looking
through:

https://github.com/threedaymonk/rubygolf/commits/master

They got the solution down to 654 characters, before realising they
could exploit my "whitespace isn't counted" rule to encode their
solution in spaces and newlines, and then simply decode and exec.
This brought the solution down to 37 characters. He gets one of the
four medals. Genius:

https://github.com/threedaymonk/rubygolf/blob/master/lib/golf.rb

I have put the introductory presentation I made up on heroku:

http://rubygolf-presentation.heroku.com

Skills Matter have published some photos of the evening:

http://www.flickr.com/photos/skillsmatter/5704350908/in/set-72157626683669388/

I will follow up later with some analysis of the solutions and some of
the tricks and techniques used, but for now, you can look through the
various solutions that were submitted:

https://github.com/andrewmcdonough/rubygolf/network

Congratulations to ShRUG - you guys did really well completing the
course with so few characters.

Andrew

---
Andrew McDonough
CTO, Tribesports
http://tribesports.com
Reply all
Reply to author
Forward
0 new messages