Archive for the 'Ruby' Category

Sun
6
Apr '08
Ruby demotivator
by Frank Spychalski filed under Fun, Ruby

I found the DIY page for demotivators and had to create one for Ruby. Enjoy!


Sun
30
Mar '08
EURUKO 2008 Day 2
by Frank Spychalski filed under EURUKO, Ruby

Second day has started. Today it starts with a few talks on testing…

George Malamidis — „Synthesized Testing“

Already 15min behind schedule, but so far interesting.

This has 4 lines of code. It is already a big ruby function.

Vassilis Rizopoulos — „rutema: One test tool to rule them all“

I’m thinking on how to write in a polite way “This talk was boring”. It was. And the tool uses XML :-( Hey, this is a Ruby conference- you should use YAML or even better a cool Ruby DSL.

Tomasz Stachewicz — „Sharing the load“

Sounded interesting but there was a question after the talk which suggested that the guys reinvented the wheel and that BackgroundDrb is a better solution for what he has done.

Petr Krontorád — „Building Rails Playground - using Ruby’s dynamic nature“

Mumble, mumble, small text, cannot read the slides, mumble… Sorry I don’t have a clue what this talk is about.

Tim Becker — „Lessons Learned Writing Native Extensions“

Type-along tutorial on how to write C extension for Ruby. Very interesting, this could actually make me write C code again… He has started talking on cats and tigers and it seems like he wants to teach us how arrays work in C. Booooooooring. Finally he is done with this and is back on the interesting topics like conversion of data types. Overall a really interesting talk. By far the best one today so far. Tim’s post with code samples and links.

Matt Ford — „Aspect Oriented Programming in Ruby“

It’s his birthday. Happy birthday Matt! He talks about Aquarium a neat aspect oriented programming solution for Ruby. Very nice. I have to play around with this when I’m back home.

Dushan Wegner — „Philosophy & Programming“

This first lightning talk. “Imagine I’m holding a beer and put out this ideas”. “Programmers are better philosophers”. A very cool talk about the similarities of programming and practicing philosophy.

Marcin Raczkowski — „Distributed programming with ruby“

Hard to understand but interesting. Sadly it is impossible to read his code when he is showing examples in the editor.

sorry missed name and title Akira Tanaka - „IO.copy_stream“

Interesting talk about IO in Ruby. Great final “status” slide:

Accepted by Matz yesterday @La fabrica
Submitted today to Ruby 1.9

Wow!

Gregor … — „Context-oriented programming for Ruby“

Took a long time to get to the point. Which part of lightning talk did you not understand.

Florian Gilcher — „Patterns (yet another) pattern matching library“

Interesting talk. Can be found at patterns.rubyforge.org.

Raimonds Simanovskis — „Using Ruby with Oracle“

Good quick talk. I never had to work with Oracle so I never had the problems he was talking about.

Daniel Liszka — „One RubyStack to Rule them All“

Strong accent, to much text on the slides. But sounds like a neat idea… www.bitnami.org/stack/rubystack

Ry Dahl — „Ebb Web Server“

Yet another Ruby web server, obviously it’s faster than all the others because what would be the point otherwise. ebb.rubyforge.org

Wouter de Bie — „Capistrano, Webistrano“

The final lightning talk. I’m hungry :-) off to find some food…

Dr Nic — Demo

So it wasn’t the last talk. They squeezed in a short demo on how to use his gem generator. Very cool! I have to use this to play around with native C extensions.

Final announcement

It seems like next year’s EURUKO will be in Madrid. Great! Never been there. See you next year! It’s not decided yet. Krakow and Warsaw are possible sites, too. Hm, I’m still for Madrid :-)

Sumary

I think I should have slept in today like Todd and would not have missed a bit. Here are some pictures from EURUKO 2008 on Flickr and even one with me. EURUKO was great. A big “thank you!” to all the people who have organized it. I’m sure I will be back next year, no matter where.


Sat
29
Mar '08
EURUKO 2008 Day 1
by Frank Spychalski filed under EURUKO, Ruby

The first day of EURUKO 2008 is over.

Yukihiro „Matz“ Matsumoto — „Keynote“

Matz talked about the future of Ruby. It was very interesting. He talked a little bit about the upcoming features (I will link to the slides when they become available) and about the design decisions behind Ruby. For me the most important quote was:

I designed Ruby not to work best but so that people can perform best

Koichi Sasada — „Ruby meets VM“

Koichi explained some details of YARV but some points were lost because a few of his slides were in Japanese.

Favorite quote:

(on his “No Ruby/No Life shirt”) for me it’s No Ruby / No Job

Charles Nutter and Thomas Enebo — „JRuby: Ready For Action!“

Made me download JRuby during the talk :-)

David A. Black — „Per-Object Behavior in Ruby“

I have to reread the slides, because I fell asleep (not due to the talk but to the fact that we are in Prague and had a few beer yesterday)

Nic Williams — „Meta-Meta-Programming with Ruby“

Memorable talk, very funny, great final slide (see @16:35)

Lightning talks session

Two talks on an agile white board and on a Ruby to PHP compiler.

VC with DHH

a little boring, bad sound quality and even worse video


Tue
26
Feb '08
EURUKO 2008 — European Ruby Conference
by Frank Spychalski filed under EURUKO, Ruby

I just found out about EURUKO 2008. It will take plaze in Prague, Czech Republic, on March 29th to 30th. From what I’ve heard are EURUKOs fun events and I would like to go this year if I can find the time especially because of this announcement:

19. 02. 2008 · Matz is coming to EURUKO!
We are very happy to announce that Matz (most probably accompanied by Koichi) is coming to EURUKO! There are currently more than 100 people registered to attend, so thank you all! We will update the website in next couple of days with more details on program, information about sponsors and other stuff.

It has been some time since I used Ruby but it is still my favorite language by far.

Update:

I just registered for EURUKO :-) I will probably go by car so if someone from the Munich area needs a ride, just leave a comment… And a bonus feature: I found this Tech Talk of Matz talking about Ruby 1.9 today…


Fri
14
Dec '07
JRuby on Android
by Frank Spychalski filed under Ruby, Work, android, google

a red robotToday I tried to run JRuby on Android. I failed. This article is more like a lab report so expect more boring details… Read the rest of this entry »


Sun
31
Dec '06
Tab-completion and syntax-highlighting for irb
by Frank Spychalski filed under Ruby
wirble shell example on dark background
wirble shell example on light background

Please forgive me if I state the obvious, but I just found out about this great gem called Wirble. Wirble adds tab-completion and syntax-highlighting to irb.

Installation is really simple, just install the gem (gem install wirble) and add this to your .irbrc:

require 'rubygems'
require 'wirble'

Wirble.init
Wirble.colorize

For a console with a dark background everything looks pretty good but I prefer a light background where yellow is not easy to read. Thanks to the really helpful README the solution was easy to find. I had to add a few more lines to my .irbrc to change some settings from yellow and white to something readable in my console.

require 'rubygems'
require 'wirble'

Wirble.init
Wirble.colorize

colors = Wirble::Colorize.colors.merge({
  :object_class => :purple,
  :symbol => :purple,
  :symbol_prefix => :purple
})
Wirble::Colorize.colors = colors


Tue
12
Dec '06
Magic Ruby Hacker mug
by Frank Spychalski filed under Fun, Ruby

ruby hacker logo in courier

There is a CafePress shop for RubyHacker stuff with a few nice thingies. But I wanted something else :-)

magic mug

A shop (fotokasten.de) sells all-black mugs which only reveal the image when something hot is inside. Therefore I needed my own RubyHacker image and couldn’t find one online. To save everybody else the work, here’s my result.

I will post images of the mug when I have it :-)

Update:
I made a mistake and put the wrong image online. Fotokasten does not accept gif (which is pretty lame but I cannot change it). Changed the image to a jpg.


Tue
24
Oct '06
Ruby search engine
by Frank Spychalski filed under Ruby

When I read that Google offers customizable search engines, I spent a few minutes to create one for my usual ruby searches. It can be found here. Right now, it doesn’t look very nice and I added only about a dozen sites, but I will add more and fine-tune the searches in the next few days. If anybody else wants to contribute, be my guest…

Update:
Google provides a bookmarklet called Google Marker, which helps adding new sites. This morning I added about 20 new sites and tweaked the searches.

Update:
This morning I added a few more pages and changed the default behavior from “Search the entire web but emphasize included sites.” to “Search only included sites.”.

Update:
3 contributors have signed up and I added a lot of new sites. Go visit Ruby & Rails Search and test it.


Mon
2
Oct '06
Profiling Rails Unittests
by Frank Spychalski filed under Rails, Ruby

Thanks to a hint by Chris Mear on the Ruby on Rails Mailinglist I had an idea how to add profiling my unittests. It’s a simple 3 step process and adds just 5 lines of code to your unittests:

Step 1:

require 'profiler'

Step 2:

 def setup
  # ...
  # your normal setup code
  # ...
  Profiler__::start_profile
 end

Step 2:

 def teardown
  Profiler__::stop_profile
  f=File::new("#{RAILS_ROOT}/log/profiler.#{name() + ' ' +
              Time.now.strftime('%Y-%m-%d %H:%M')}.log", 'w')
  Profiler__::print_profile(f)
  # ...
  # your normal teardown code
  # ...
 end

As you probably guessed from the code, this will log the profiling results into a file for each test. But beware: this is VERY SLOW! The tests I was profiling took 9s without profiling and 1267s with profiling… But slow profiling still beats no profiling :-)

If you are looking for memory profiling, there is a nice article by Scott Laird on Memory leak profiling with Rails.


Mon
7
Aug '06
Playing on the CodeGolf Range
by Frank Spychalski filed under Computer, Fun, Ruby, articles

picture by bigpru

I stumbled over this funny site called CodeGolf.com and tried my luck on the first problem (actually it’s the sixth, but it was the last and therefore appeared first on their page - confused?) Writing a Brainfuck Interpreter:

The brainfuck language uses a simple model of a computer consisting of an array of memory cells, a movable pointer into the array, an output stream, an input stream and the program itself. The program is formed from a sequence of the below commands :

  • > - Increment the pointer to point to the next cell to the right.
  • < - Decrement the pointer to point to the next cell to the left.
  • + - Increment the byte pointed to by the pointer.
  • - - Decrement the byte pointed to by the pointer.
  • [ - Jump forward to the command after the corresponding ] if the byte at the pointer is zero.
  • ] - Jump back to the command after the corresponding [ if the byte at the pointer is non-zero.
  • . - Output the value of the byte at the pointer.
  • , - Accept one byte of input, storing its value in the byte at the pointer.

It didn’t take me very long to write a running interpreter. My first version was more than a thousand characters. Even after renaming the variables and stripping all the whitespaces I still needed around 700 characters, which is huge compared to the best Ruby solution with only 142 characters. Read the rest of this entry »