Posts Tagged ‘tutorial’

Dreamhost and mod_rails for your tiny Rails application

Thursday, May 29th, 2008

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…)

Triburi – ghid pas cu pas pentru incepatori

Sunday, May 25th, 2008

Triburile, Browsergame în evul mediu
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).

(more…)

How to import Ultimate Warrior Tags into Wordpress 2.3+ and how to easily backup your Wordpress database

Monday, February 25th, 2008


If, like me, you had been using Ultimate Warrior Tags (UTW) to assign Technorati-compatible tags to your article, then you must have been as annoyed as I was when upgrading to Wordpress 2.3.2 or Wordpress 2.3.3. All of the sudden, Wordpress acquired tagging capabilities but disabled UTW along the way.

Don’t get me wrong, I love that Wordpress now knows tags natively, but I was pretty annoyed to discover that my previous ones had disappeared.
They didn’t, actually. As it turns out, importing the old UTW tags into the new Wordpress is an extremely simple built-in mechanism. All you have to do is open your Wordpress blog backend, log in as admin, go to the “Manage” menu, the “Import” page. There’s an “Import Ultimate Tag Warrior tags into the new native tagging structure” link in the bottom, that will start the 4-step no user action required process that worked perfectly for me.

Beware, though! The Wordpress builders give you the ferm warning: Don’t be stupid – backup your database before proceeding!.

In order to backup your Wordpress blog database, the simplest, easiest way, and the one I recommend, is to use WP’s built-in mechanism: just go to Manage->Export and click on “Download Export File“. This will save a pretty large xml file(1.3MB for a small blog, 6.8MB for a big blog) with data from WP’s tables – including custom fields set by plugins, but not the custom tables that some plugins create. Still, it’s the easiest, hassle-free backup procedure for your blog, so it would be a good idea to do it every once in a while, just in case.

Ruby for daily chores: Extracting most frequent loto numbers

Sunday, August 19th, 2007

Here’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:

(more…)

Grepping in Ruby

Tuesday, April 3rd, 2007

You 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:

(more…)