July 23rd, 2008
It looks like all cool kids except for IE5 know what to do with this:
if (some_condition) {
function f() { alert(”true”); }
} else {
function f() { alert(”false”); }
}
When calling f(), Firefox and Safari will show “true” when some_condition was TRUE at the load time, and “false” when it evaluated to FALSE. IE5 pays attention to the if-else construction (and no code will be executed in the else-block if the some_condition is FALSE), but it DOES redefine the function. Yes, even though it’s in that block that’s not being executed.
Be careful!
Posted in Personal | 3 Comments »
July 23rd, 2008
By no means this is a usual thing, but since there’s very little information (in fact only one link that gives no real answers) on what to do when you see the error below upon publishing a post, I decided to share the solution:
Fatal error: Maximum execution time of 30 seconds exceeded in /home/…/public_html/wp-includes/wp-db.php on line 170
The error points to an innocent line that removes single quotes from a database query, and it’s misleading. One of the real causes for this problem may lay in the slug (post name) field. You can see this field in the Permalink line below the Title field in your post editor; it’s emphasized.
In my case, there was an endless attempt to find a unique name for a post having an HTML entity (long dash) in its slug. Even though it was correctly encoded with %NN sequences, the database sever had hard time executing the query correctly. So, the first check on your list is:
Make sure your post slug (that symbolic part of the permalink) has no special symbols, but only letters, digits and dashes.
Posted in Tips | No Comments »
July 15th, 2008
Just noticed the release of the next Wordpress version — 2.6. Check out their release summary video to get an idea of what has improved and how. Good stuff.
Posted in Sites | No Comments »
July 8th, 2008
A minute ago I got this spam letter with the list of vacancies:
ИНФОРМАЦИЯ О ВАКАНСИЯХ!!
- ГЛАВНЫЙ БУХГАЛТЕР, з/пл от 60 000 руб. в месяц;
- БУХГАЛТЕР, з/пл от 35 000 руб. в месяц;
- СЕКРЕТАРЬ, з/пл от 24000 рублей в месяц;
- ПРОГРАММИСТ 1С, з/пл. высокая;
- КУРЬЕР, з/пл от 17000 рублей в месяц;
It translates:
Information about available positions:
- Chief accountant, salary from 60000 rubles / mo
- Accountant, salary from 35000 rubles / mo
- Secretary, salary from 24000 rubles / mo
- Programmer 1C*, salary is high
- Courier, salary from 17000 rubles / mo
* 1C is a very popular software tool for accountants and managers that is flexible enough to have a dedicated course in local universities and a position in organizations.
How many funny moments can you count?
Posted in Personal | 4 Comments »
June 16th, 2008
Last year we had a bicycle trip to Mangup that I covered with Google map routes, bells and whistles. This year we had the same trip but in a different company. Nonetheless, it wasn’t less interesting. I took less pictures as the nature of that region was already covered, but focused on the trip, the air and views.
See some interesting stuff in my Flickr photostream.

Posted in Personal, Photography | 2 Comments »
June 12th, 2008
Dreams eventually come true and I finally converted to Macs. I still have my 5-year old HP Compaq nx9005 with Win XP and Ubuntu running to my side for various tasks (like verifying the web sites I work on in IE), but all my ongoing work and music experiments shifted to a great Macbook Pro MB134 from the Apple’s latest line.

APPLE MacBook Pro MB134, 15.4″, Intel Core 2 Duo T9300 (2x 2.5GHz), 2×1024MB, 250GB, DVD±RW DL, nVidia GeForce 8600Md GT 512MB, 15.4″ WXGA+ (1440×900), LED-TFT, DVI, Gigabit-LAN, WLAN, Bluetooth 2.0, FireWire 400, FireWire 800, 2xUSB2.0, ExpressCard, WebCam, OSX 10.5 “Leopard”
There’s not much to say other than that I, as all migrants, feel like a huge army of nurses taking care of me all the time; so smooth Leopard’s interface and laptop hardware are. All these Spaces, Dashboards, Expose, Stacks, iCals, Frontrows and others feel like from a future. Even Rails, Apache, and PHP5 are pre-installed!
Well, hooray!
Posted in Personal | 2 Comments »
June 1st, 2008
My gosh, I can’t believe I missed this. On May 21 Brightbox has announced a happy marriage of a revolutionary mod_rails (Passenger) project from Phusion to the excellent user-friendly Linux for the mere mortals — Ubuntu.
It means that the deployment and management of Rails applications becomes a breeze. I personally still prefer my very custom deployment setup — Nginx-Mongrel (for Rails) + Nginx-Apache (for PHP), but for those planning to unroll massive Rails hosting, it may be a famous Red Pill.
Love Rails!
Posted in Programming | No Comments »
June 1st, 2008
3 hours ago Rails 2.1 was finally released into the wild, and there’s the officials report for your reading pleasure. I’m still a bit concerned about the RSpec compatibility, but since I already found a sufficient replacement — Shoulda and Mocha — there may not be as many worries.
So, let’s give it a round of aplause. Great job!
Posted in Programming | No Comments »
May 20th, 2008
Following the concise yet complete instructions on how to start using the Rails 2.1.0 release candidate from the awesome Getting Rails 2.1 RC1 podcast, I gave it a very quick spin today in one of my projects.
Right after the installation one of the gems refused to work. It was HAML — an excellent HTML builder extension — that blamed Rails for not having some hook registration function call. Taking the latest master copy from github of HAML (which is 1.9.0 there at the moment) solved the problem, but then something else jumped out. RSpec doesn’t work very well with Rails 2.1 at its present state, and every controller test was yelling at me.
Let’s say, it was a bad luck and hopefully I’ll do better next time when they finally release the thing. Got back to Rails 2.0.2 for now.
Posted in Programming | No Comments »
May 12th, 2008
I’m a huge fan of Firebug — the top notch JavaScript / CSS debugging plug-in for Firefox — but recently it became completely unusable to me.
With the release of Ubuntu 8.04 the main browser now is Firefox 3 that comes as the default. Official Firebug doesn’t work with FF3, but there’s a development branch that does, well kind of. There are many sharp corners and rough edges in this latest development, but it was fantastic. Several days away from the installation I noticed my FF3 to begin crashing every now and then.
Today I finally had to remove the extension since the browser could crash 2-5 times a minute. I literally spent half a day trying to work on the site for my client. That’s unaffordable luxury.
For now I’ll be using the excellent Web Developer extension (ah, I miss that sexy JavaScript console of Firebug), but will be monitoring the Firebug development progress with a hope to get back to it soon.
Posted in Programming | 2 Comments »