Maverick Happiness

So this weekend Ubuntu 10.10 Maverick Merkaat was released. And much happiness it brought onto my smaller Notebook. I've been using Mint before, which however had a standby degradation. So I moved it back to plain Ubuntu yesterday.

Coincidentally Canonical opened up AskUbuntu.com, a Q&A site, recently. And there was one thing I wanted to clear beforehand. My notebook only has a tiny 4GB flash disk (yes hdd not ram), so I wanted to use btrfs with compression. Atop an encrypted hard disk. Turns out you can have both, with some extra work:


Continue reading "Maverick Happiness"

Effective PHP Cargo Cult Programming

This is another (I'm doing this way too often) little rant I wanted to write for some time. There are multiple syntax patterns I see cropping up too frequently. It seems to me PHP programmers are very prone to adopt unreasoned syntax schemes.

[PDF]

Effective PHP Cargo Cult Programming


Continue reading "Effective PHP Cargo Cult Programming"

Simple HTML5 comment script

I've been pondering using DISQUS or coComment as embeddable comment system for another project. But in the end both were too flaky, so I ended up writing something up real quick. It's completely feature-less and just assembles collected postings in a simple file for any page it gets embedded from.

initially I wanted to use something ready and AJAX-enabled, but in the end writing it myself went quicker. Atop I could make it HTML5. As I've been asking a few month ago on the WHATWG discussion board, HTML5 has specific syntax recommendations to denominate bulletin board / forum discussions. Single postings are to be wrapped in <article>, and the poster name into a <footer>. So that's all it does, except escaping the received comments. Everything is stored as plain and single HTML file. This makes a management UI unneccessary, since you can just look in with a text editor. It's specifically nested and indented to make that feasible.

Anyway, here it is: http://milki.erphesfurt.de/ext/_comments.tgz
The idea and the stylesheet is partially stolen from a tutorial on toturialzone.

PHP Framework Matrix

There are zillions of web application frameworks for PHP. Most people know the big ones. But few people know them all. Neither do I. But you can try.

My latest project involves getting a better overview. And it's tritely called PHP Framework Matrix.
It's basically a mini database of feature categorizations. It goes a bit more in deep than the common overview lists and check mark tables.

Continue reading "PHP Framework Matrix"

jQuery plugin for saving function chains

$custom = $.save().show().toggleClass("two")
                               .find("a").css({color:"red"});

Defines a $custom jQuery function chain, without actually executing it on anything. This allows to reuse a list of effects at a later point and on multiple selections with:

$custom("article");


Continue reading "jQuery plugin for saving function chains"

Input sanitizing with object-oriented superglobals

Input filtering is a major security issue. PHP 5.2 introduced the filter API. Problem is, almost noone uses it. Not only was it introduced too late/recently, it also has an extremely cumbersome API.
You know, I'm all for procedural interfaces; but this is one case where it makes less sense. What I'm using instead for new projects is following scheme:


print $_REQUEST->name("var");

save($_POST->text->comment);

mysql_query("SELECT * FROM t WHERE name='{$_GET->sql[name]}' ";
 

Did I just use a bare input variable in a mysql_query?


Read the whitepaper. Download the reference implementation.


Oooops, there is now a completely new version 2.



Continue reading "Input sanitizing with object-oriented superglobals"

project roster

Today I've set up a project roster. It's mainly for posterity, but also to keep track of current involvements.

http://milki.erphesfurt.de/projects/

Continue reading "project roster"

XHTML hipsters

It's bad.

Many people are deploying XHTML without actually using it. Many years ago it was a hot topic for standard compliance. But even now as it's fading into technical irrelevance, people keep using it purposelessly.

Continue reading "XHTML hipsters"

Sensible use of PHP namespaces not catching on

PHP 5.3 introduced namespaces, a long overdue syntax feature. Let's not talk about how parser fixing lazyness lead to the questionable syntax. There is a bigger problem showing up. PHP developers are exceptionally prone to cargo cult programming.
There I said it.

I'm hereby complaining, because sooner or later it'll creep into code I have to maintain. Deeply nested namespaces seem to be the newest framework pandemic.

Continue reading "Sensible use of PHP namespaces not catching on"

Picking the least worst blog software

So, I didn't have a real homepage in quite a while. Jumping on the fading fad, I've been looking for a blog software the whole weekend. It seems my requirements are too quirky.

- Extensibility, yet unbloated core
- Configuration data doesn't belong into the database.
- Parameterized SQL, and keep the queries few
- XHTML is pointless unless you use other namespaces and app/+xml
- If I didn't need a spamsafe comment feature, I'd write it myself.
- Non-cumbersome templates would be nice.

Continue reading "Picking the least worst blog software"