miercuri, 10 februarie 2010

Seven essential WordPress plugins

Here are the plugins I recommend for use on a WordPress blog.

Most (not all) of these plugins are generic, meaning that they are not bound to a specific type of blog and may (or should) be used regardless of what you write.

All of these plugins are top quality (IMHO) and provide an invaluable service for any blogger. I wholeheartedly recommend that you use and support them. I think that all of these should be apart of a standard WordPress installation.

marți, 9 februarie 2010

@font-face for a programmer's blog?

[caption id="attachment_605" align="alignright" width="175" caption="See Consolas in action"][/caption]I'm sure that many of you are well aware of the exceptional @font-face CSS3 rule, which made life much easier for many designers, I would think. A few days ago I started wondering if it would be appropriate to use such an instrument on my blog... the site you're on! Yoopie!

And, why not!? I love the idea of making my source codes more readable by using some custom font (Consolas anyone?). Anyway, I started looking around for some fonts and was not pleased with any of them (well to be fair I did like DejaVu Sans Mono but not as much as Consolas, unfortunately).

miercuri, 3 februarie 2010

URI parsing using Bash built-in features

A bit of background


A while ago I posted an article describing how one could parse complete URIs in Bash using the [cci_bash]sed[/cci_bash] program. Since then, I have realized that there is a better way to do it, a much better way: via Bash built-in pattern matching! 
Here are some benefits of this improvement:


  • It no longer executes external programs (i.e. [cci_bash]sed[/cci_bash]) for pattern matching. This translates to higher speed and lower memory and CPU usages, which means that you could use this parser for much more intense URI crunching.

  • The new regular expressions are drastically simplified thanks to the [cci_bash]${BASH_REMATCH[*]}[/cci_bash] array that is able to hold more than 9 matched sub-expressions, unlike [cci_bash]sed[/cci_bash] that can only work with single-digit escapes: [cci_bash]\1-\9[/cci_bash] (yuck!).

  • The parsing algorithm is contained in a single Bash function, so no external file is needed to hold the regular expressions. This also means, obviously, that the pattern file is no longer loaded from disk on every execution (so HDD is saved as well).

  • The generated variables are named identically to the first version, so you should be able to upgrade your scripts to this version with absolutely minimal effort.

  • [Edit]
    No eval instruction is needed (unlike in the first version), further improving performance.


marți, 2 februarie 2010

Quality Coding Practices

This is a set of guidelines that I put together starting a while back, which I try to respect when I write code. It is mostly (at least for now) oriented towards programming in C, but any systems programming language could benefit. Be aware that these do not apply to everyone or every scenario, adaptation and clever compromises are essential!

Now, this is obviously only a humble start, so I would like to ask the community (yes, you!) to pitch in and help grow (and correct) this list of useful principles, so that, in time, it may actually become something used by folks around the web to better their coding practices. C'mon, this will be fun, fun, fun! :D

First impressions on Loomiere/Stream performance

As promised, here are some of the first monitoring statistics of Loomiere/Stream in a production environment after moving away from psstream. Only one server is considered, a Quad-core Xeon with 8GB RAM (not that they are used anymore).

This shows the memory usage over one week (the switch was made on the 29th as is obvious).