Ruby 1.8 dies in June 2012. This post shows some small examples, why this is good ;)
The Zucker gem has gotten some new features. Installation is as easy as
gem install zucker
A common Ruby experience on ubuntu: You get some stupid error, saying something would be missing – and you don’t know what to do…
Installing Ruby/Rails on ubuntu is not hard, but some little obstacles might be confusing.
This article is written for people with experience in programming in general, but who are new to Ruby.
A German version is published in the offline magazine #2, a magazine by some students of TU Dresden.
The intention is to demonstrate some features of Ruby and show, what is so great about Ruby:
A clean syntax combined with the possibility to adapt the language to given requirements flexibly.
Some days ago, I discovered a website – which is the most addicting one I know :) – codegolf.com. The goal is, to solve programming problems with as short code as possible.
As I said, it is addicting. You do not write better ruby code by golfing. But you can really improve the knowledge of the language. And it is fun :)
After doing some of the other challenges I tried the brainfuck challenge.
Brainfuck is a Turing-complete esoteric programming language consisting only of 8 letters, operating on a 30000 cells-array. This is the hello world program:
>+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.[-]>++++++++[<++++>-] <.>+++++++++++[<++++++++>-]<-.--------.+++.------.--------.[-]>++++++++[<++++>- ]<+.[-]++++++++++.
The goal is to build a interpreter.
At my last entry, a question arose about what is the most efficient way to convert integers between the bases 2 and 10: either using built-in ruby methods (and even do lightweight string-operations) or calculating it manually. I had to find out ;). So I have written a little benchmark program, which does the conversion in three different ways:
- using built-in to_i-magic
- calculating it by hand
- using sprintf
It stops the time each method needs to get the fastest. The result might be surprising. [Update: improved the custom methods]