Glista 0.3 Released

Thanks to the very good holiday layout this year*, I finally got to release the next preview release of Glista - my super simple Gtk+ based to-do list manager for your desktop.

The major improvement in this release is category support. For a while, I didn’t want to add any features that will make the UI more complex than it is. Then I noticed that I tend to add ad-hoc categories to my tasks in order to sort them - that is instead of typing “Fix ZF bug #1234″ I type “ZF: Fix bug #1234″. This is a very natural way to organize your tasks for me, and I assume that it is for most people. So I decided to add category support by recognizing this colon-separated syntax and breaking any item typed in this way into a “cateogry: item” structure.
[more...]

ZendCon 2008 Slides

Well, ZendCon is over and it was much fun! I got home today (well, does 4:30 am count as “today” ?) and am still very tired - I had to stay around after the conference for some meetings (yes, the title “manager” causes some PITA even if you do not really manage anyone) which was a bit exhausting but fruitful never the less.

I gave this presentation about Zend Platform:

It’s the first time ever I’m giving a presentation about proprietary Zend technology in an open-source conference so I was a bit nervous - but to my surprise I got a full room (I estimate some ~100 people were there, and only a few Zenders) and there seemed to be a lot of interest. In general this ZendCon felt a bit more “business-oriented” than usual, but still had a good mix of community and hacker-spirit to it.

Another thing is that Siddhartha - our VP of Sales for North America actually HUGGED me after the talk. He was sitting in the room and the guy knows a lot about selling Zend Platform - but I suppose that hearing the value of the different features and some good example use cases for Zend Platform from a technical perspective gave him and the rest of the sales team some good insight into what customers are looking for in such a product.

Anyway enjoy the slides and if you have questions just post a comment. I will probably post some more about the previous week - if only I will be able to get my hands off my new iPod Touch ;)

Reminder: Open-source is great!

From time to time I get reminders to why I love open source so much, and why I see it as having little to do with software and a lot to do with promoting a culture of sharing and of openness.

A few days ago I released my first C open source app - Glista. It was a little tool I wrote to scratch an itch and to sharpen my hardly-existing C skills. Deciding to release it was natural, but I didn’t expect much attention from such a simple tool competing in a category where many alternatives exist.

However, it did get noticed and I had several people e-mailing suggestions, reporting bugs and generally commenting on it, giving mostly positive and useful feedback. I was able to fix several bugs in the last few days and I did learn a few things on creating better build scripts, which I was clueless about before.

And the best thing is that at less than a week after it’s initial release, Glista was ported to run on an iPaq PDA using the OpenEmbedded cross-compiler. I even got some screenshots to show off:

Glista on iPaq     Glista on iPaq

How cool is that?

This is done using the unstable branch of OpenEmbedded so there are no official builds yet - but the author, Dmitry, has attached a recipe file to this bug report in the OpenEmbedded tracker if you want to try it.

Introducing Glista: Yet another to-do applet for Gtk+

Yes, there are probably a dozen out there, but none of them was just the way I wanted it to be. So I went out and started writing one: Glista.

It’s terribly simple, and I spent not more than a weekend and a couple of evenings writing it. But I have been using it successfully for over a week now and for the first time I am tracking my tasks through a desktop tool - so I’ve decided to release it.

Visit the Glista page at http://prematureoptimization.org/glista for more information.

It is written in C/Gtk+ (so it runs well on GNOME but should work on other desktops, and should also be portable to Mac / Windows). Now, I must say that I am *not* a C programmer. I suck at it in fact. But I enjoy banging my head against the C memory management wall from time to time. If you look at my code and must run to wash your eyes, tell me about it because I want to improve.

I am using the 0.1 release available on the site (and through Google Code) for some time now. I don’t plan to expand it much but there are some fixes / additions I want to add if I find the time in the next few weeks.

Try it out and tell me what you think!

BTW: I used the name “Glista” because of the common “G” prefix for Gtk+/GNOME apps, joined with “list” and an “a” just to make it cooler. A couple of days later I found it it’s actually a word - in many Slavic languages it’s the word for an earthworm, and in Russian it’s sort of the plural form for Glist which is the word for intensinal parasitic worms. Cool!

The PHP Hierarchy of Needs

We had a lecture about Unit Testing in our local PHP user group last week. I really like these meetings because there is usually good interaction between some very experienced developers and some very inexperienced ones.

Following the usual “but why is it better then just running it in my browser and seeing that it works” question made by one of the younglings, we got into a discussion of why Unit Testing it so good, and especially, why is it such an addictive practice and why people who do it (including myself) tend to love it so much.

And then it hit me: [more...]

GNOME doesn’t detect MIME types anymore

After a recent upgrade (Gentoo being Gentoo) my GNOME desktop stopped detecting file MIME types. All files in Nautilus whould show as plain files with no type icons, and all application associations have stopped working.

I tried re-emerging a bunch of stuff like gnome-mime-data and mime-data and nothing helped.

After lots of research, I did this (as regular user):
$ update-mime-database .local/share/mime
This actually worked! It threw out some errors regarding specific files, but it did work! I’m not sure what it does, but after restarting Nautilus (by doing the usual killall nautilus) I got my desktop properly working again.

Ahh.. got to love Gentoo - no other distro gives you these challenges and the satisfaction that comes with solving them - or as Gentoo folks say, “If it’s broken - fix it. If it ain’t broken, break it” ;)

Zend Framework Components Presentation @ DLW08

I’ve just finished my one hour talk at Dynamic Languages Europe titled “Zend Framework Components for Non-Framework Development”. Despite the long name, the presentation’s concept is quite simple: It’s an overview of some of the use-at-will, standalone components of ZF and how you can use them even in a non-ZF application.

The presentation went quite well and the room was full (and hot) - the fact that people actually stood throughout the presentation shows how popular ZF is nowdays (well, it was a small room - but still ;)

I didn’t have time to go through all the components I planned to (skipped Zend_Json and Zend_Log) but I still feel it was a good session.

You can download the slides here, or see it on Slideshare:

A small recommendation for those of you who present a lot: I used my newly-bought Logitech Cordless Presenter for the first time, and it really helped me. It doesn’t look so sexy (even for a shaver) but it has everything you need - remote control for the slides, laser pointer, timer to manage time (it will vibrate every 5 minutes if you want which I find very useful because I have hard time managing time when I present) and even a button to blank the screen. It connects through USB and is detected like any keyboard - so it worked perfectly with my Linux/OpenOffice and should work with Windows/MS Office and Mac (I suppose) as well.

Playing with CouchDB View Collations

I've been playing with CouchDB quite a lot lately. While it's still far from feature-complete, I think it's a cool project. Generally the concept of object databases is a new thing to me, growing up in the web where for most people "database" == "Relational Database".

Since CouchDB related documentation is still scarce, I decided to share a cool thing I managed to pull around today with CouchDB's view API.

For the purpose of playing with CouchDB, I decided to write a PHP-implemented CouchDB interface (yes, I know there are exiting ones) I currently dub "Sopha" and a Wiki using CouchDB and Sopha as backend (if I ever get those to a stage where they would actually work, I will probably release them as open source).

One of the design goals of my Wiki, was that previous revisions of each page are kept and can be accessed. While CouchDB keeps track of object revisions, access to old revisions is not guarantees as those eventually get deleted - So I had to implement my own revision tracking of pages. The design I went for was simple: each revision in it's own document in the DB. They all have the same "title" field - but an incrementing revision number, starting from 1 (for new pages) and going up.

This design poses one major problem: how do you easily access the single most recent revision?

I started by creating 3 different view functions for accessing wiki pages: one to access the most recent revision of a page by it's title, one to access a specific revision of a page by title and revision number, and another one - to fetch all the revisions of a specific page by it's title.

This was a mistake, and it resulted from my years of thinking relational (keys, indexes, SQL, etc.). As I worked my way through, I started understanding the power and magic of CouchDB's views and view collations. With proper collation use, it turns out it only takes one view function to rule them all:

CODE:
  1. function(doc) {
  2.   if (doc.doctype == "WikiPage") {
  3.     map([doc.title, doc.revision], doc);
  4.   }
  5. }

Using this view function, I could do the following ("titlerev" is the name of my view function, URLs are decoded for readability):

Access the specific revision 123 of a specific page titled "My Page":
GET /database/_view/wikipage/titlerev?key=["My Page", 123]

Access all the revisions of "My Page":
GET /database/_view/wikipage/titlerev?startkey=["My Page"]&endkey=["My Page", "Z"]
This will work because CouchDB orders the results according to their key - and has strictly defined ordering rules - so ["My Page"] will always come before ["My Page", 1] and ["My Page", "Z"] will always be after ["My Page", n] as long as n is a number.

Access the latest revision of "My Page":
GET /database/_view/wikipage/titlerev?startkey=["My Page", "Z"]&endkey=["My Page", 0]&decending=true&count=1
This works as well - because records are selected in reverse order from ["My Page", "Z"] to ["My Page", 0] - but only the first one is returned - so it will always be the one with highest revision number.

How cool is that?

BTW there is a good article which also explains CouchDB view collations at cmlenz's (one of the contributors to CouchDB) blog.

Security By Obscurity - “Not to Stand Up”

I am giving a security lecture at the local PHP users group tomorrow, and one of the topics is, ahm, security by obscurity. In fact, it's not really a topic - I just mention it and say that it's not really an approach to security, and should generally only be used as an extra measure and should not to be relied on.

This got me thinking about one of my old-time favorite Monty Python sketches:

The first rule of not being seen: not to stand up!

Reducing your bandwidth for benchmarking purposes

In the last few days I've been busy doing allot of web application performance benchmarks. For some of these benchmarks, it was important to simulate a real end-user's average effective bandwidth (real-world download / upload speed from the end user's perspective).

Since we used a fast, clean LAN for our benchmarks (you can't get consistent numbers otherwise), we had to find a way to somehow limit the bandwidth of our LAN so that it would resemble "real Internet" throughputs. Since it took some research and reading to find the best way to do that, I've decided to write a quick HOWTO to describe what we've done.

[more...]