pwnt.be

Forgotten Glory

They don’t make them like this anymore. The keyboard player alone is genius.

And Now for Something Completely Different

You may be missing my annual 10 Days Off reviews. And rightly so. Everyone knows I am an undisputed expert when it comes to electronic music.

If you speak Dutch, however, this is your lucky day, as I wrote a review of day 5 for Gentblogt—which isn’t a blog as much as a webzine, but what’s in a name? If you don’t speak Dutch, try Babel Fish for a dadaist interpretation.

Richer Text, Poor Me

I missed a specific situation back when I hacked at Markdown.

Because Markdown syntax allows HTML in code blocks, encoding every < as &lt; would also affect those in code blocks. This resulted in double encoding, i.e. &amp;lt;, which is rendered by the browser as &lt;—not pretty.

After discovering this during a related discussion with Sander on #foxymonkies, someone there—I believe it was sdwilsh—pointed me to Safe Markdown. Unfortunately, when I finally got that working, it didn’t seem to solve my problem at all.

Determined to find a solution, I dug into Markdown a bit deeper and found that all the encoding of code happens in Markdown_Parser’s encodeCode() function, rather unsurprisingly. Consequently, if I changed that function to return its input unchanged and did all the escaping in advance—which I was already doing—, I’d be home free.

Obviously, I could easily achieve this by extending the Markdown_Parser class. I ended up throwing everything related to comment formatting in there, including emoticons. The result is in Pwnt_Blog_CommentFormatter.

Once again, feel free to hunt for any shortcomings I may have overlooked.

Update: Actually, it’s better to put the emoticon stuff in a separate class, so Markdown and SmartyPants don’t get loaded for no reason.

Timing is Everything

I can’t help but wonder what possessed the developers of PHP when they came up with the original implementation of the microtime() function. When are you ever going to need the current time represented as a string composed of the milliseconds part and the integer part, separated by a space? Preposterous.

Now, I’ll be the last to deny that PHP is full of these little mind-boggling “features”, but this one is just too crazy for words. If you’re going to be doing an explode() anyway, why can’t they just incorporate that into the damn command?

Also, explode() and implode() are terrible function names. I realize split() is a regex split, but about every other naming convention would have been better.

I’m going to shut up now, but the list goes on. PHP is a semantical nightmare on speed.

Incidentally, I just typed &rsquo; in an IM conversation—literally, the character sequence &rsquo;, not a right single quote. I’m taking this proper apostrophe thing a bit far. I guess I should at least go with Alt-0146.

Water under the Bridge

I’ve blogged about Taskbar Shuffle before. Since I discovered this little program, it’s quickly become one of my must-haves.

Taskbar Shuffle is a free utility that implements a feature that should have been there by default, and does so quite elegantly as well: ordering Windows’s taskbar buttons.

You may still be wondering what the use of this sort of thing is. Well, personally, I hate the way taskbar buttons are in “chronological” order by default. I don’t like Windows’s feature that groups similar taskbar buttons—having to click two times to get to a window is just too tedious—, yet I like to keep open windows somewhat organized. As a web developer, you quickly find yourself with a text editor, several imaging applications and a couple of web browsers open, and you really don’t want to start those in a particular order just to be able to perform some routines blindly.

Now, in addition, Taskbar Shuffle’s author recently implemented a similar feature. You can now perform the same sort of ordering with system tray icons. This is achieved by holding a hotkey of your choice and dragging the icons around. Beautiful.

In case you hadn’t noticed—the title, stupid—, this post’s raison d’être is, for the most part, to move my previous post and its emotional baggage down.

Disorientation
Continuity
Retributions
Koop eens een Nokia Lumia 800
Samuel Debruyn
Bizar Hairdressing & Beyond
Hanne, Hanne, Ruxi, Wim, Tim, Sarina, Lies, Lynn, erwin, Ano, Frederick, Jacqueline, Wazaaa, Tim, Rebecca, Charlie
Lplayer for the Rest of Us
fieryy-AA, jesus2099, Tim, jesus2099, Tim, jesus2099, Tim, PixelPirate
Automating OpenVPN Connection on Windows XP
blanky, sky, Tim, Geb, 12vpn, Tim, neecom
Simple Linear Regression with JFreeChart
Nicolas Machado, Sascha, Tim, Sascha, Tim, Sascha
Colophonics