To my shame as a rubyist, it was only a couple of hours ago that I found out, while reading Ruby Inside about mod_rails and the wonders it does for the Rails community.
(more…)
Posts Tagged ‘tutorial’
Dreamhost and mod_rails for your tiny Rails application
Thursday, May 29th, 2008Triburi – ghid pas cu pas pentru incepatori
Sunday, May 25th, 2008
V-am promis de multa vreme ca voi face o recenzie superficiala a jocului preferat de zeci de mii de internauti romani dintre cei care nu sunt deja fani Conquiztador.
Pentru a juca Triburile trbuie, evident, sa iti faci cont. Mergi frumusel pe http://www.triburile.ro/register.php?ref=start si iti alegi lumea. In functie de caracteristicile dorite de tine, vei putea opta pentru o “lume” (server de joc) mai dinamica, cu viteze mai mari de constructie si deplasare a unitatilor(ideala pentru jucatorii inraiti) sau mai lenta(pentru cei ce prefera sa joace cate un sfert de ora zilnic, de la birou).
Ruby for daily chores: Extracting most frequent loto numbers
Sunday, August 19th, 2007Here’s the quick story: I was hoping to win the Romanian lottery (6 winning numbers out of 49). On the website, they were having the list of the winning numbers from 1998 to now. So I copy-pasted them all into a text file, and wrote a quick and dirty script to count their appearances and sort them – thus getting the lists of the most frequent numbers and the least frequent ones.
First, the input text file – I’ll show you a brief excerpt:
Grepping in Ruby
Tuesday, April 3rd, 2007You can’t call yourself a programmer if you never used Grep (or diff, or wget, or regular expressions for the matter). I couldn’t call myself a programmer till the fourth year of college, btw..
Still, grep has a pretty big manual page, and being a casual grep user I never see the need to memorize it. The one and only grep command I use and abuse is
grep -Rn "my pattern" . which, for people not familiar with it, means “search my pattern in all files under the current dir, recursively, and if find then print out also the line number”. Seriously, this might be the one and only use I have for grep now.
What about more complicated tasks, involving regular expressions and the like?
Since my job involves Ruby and Rails, there’s basically no need for me to use grep anymore. I mean, my tasks don’t involve real-time text line extractions; from time to time, though, they involve writing scripts that extract specific patterns from some log file.
Here’s where Ruby is my best friend. And given that I’ve had a bit of trouble putting together the bits and pieces found on the internet, I’m sticking it all together here:
