Category Archives: Programming

Never Fast Enough

Today’s post over on Coding Horror is called There Ain’t No Such Thing as the Fastest Code. The post discusses the idea that no matter how much you manage to hyper-optimize your code, even down to the assembly level, it could always be faster. Strange that this topic should arise since there is currently a discussion over on ffmpeg-devel regarding a faster C-based fast Fourier transform (FFT).


Basic FFT graph

I guess I had just been taking it for granted that the matter of a fast C-based FFT was a closed issue. How wrong I was. It seems that there is an algorithm answering to the name of djbfft that offers some marked speedups over FFmpeg’s current C-based FFT.

The ensuing discussion for the Coding Horror article is a typical debate on optimization trade-offs (e.g., time investment vs. resulting speed-up). However, while the common argument is that computing hardware is so ridiculously cheap, powerful, and abundant that there is no reason to waste precious time on optimization, there is also the ironic trend back to less capable machines. Like my Asus Eee PC. Trust me, I am suddenly keenly aware of modern software bloat.

My favorite comment comes from no-fun:

…the more people which claim optimisation is worthless, well, that just means that I can charge more since my particular expertise is almost impossible to find. And I’ll take the big $$$, thank you very much. Yeah, I agree with y’all, optimisation is crap. Dont bother learning it.

We multimedia hackers tend to be quite secure in our reasoning for optimization. After all, I challenge anyone to decode 1080p H.264 video in realtime using pure Java or C# code (no platform-specific ASM allowed).

Working With Git

I want to be responsible and organized as I develop the FATE Server. To that end, I thought it would be good to get all of the project source code into a source control system. Since Git is building momentum, I thought this would be a great opportunity to get my feet wet (similar to how this exercise has been a good reason to learn Python).


Git logo

I’m pleased to report that Git is performing admirably. It’s important to remember, however, that I have low standards when it comes to source control. Indeed, any SCM is equally adequate when you’re working by yourself on one machine. Git still keeps the easy things easy: git init, git add, git commit, git diff, git log; that’s as deep as I have delved thus far. At least I will have a baseline of experience for when I get actively involved with a project that uses Git, which is where many would like FFmpeg to go one day.

Coping With Injections

I admit that a major issue I had with launching the second iteration of my build/test infrastructure was getting over my severe phobia of web database programming. I did a little web database programming circa 2001 but lost the thread shortly thereafter. Meanwhile, in the intervening years, I have read story after IT horror story about database-driven websites being subverted with something called SQL injection attacks. However, the problem is not quite as scary once you understand the key causes and what language features are in place to prevent abuse.

I now recognize that my web database programming from 2001 was probably vulnerable to a variety of SQL injections. I should dig up those old PHP scripts for an audit.

For the uninitiated, an SQL injection occurs when user input is passed to an SQL query without proper (or, indeed, any validation). If your program constructs an SQL query that looks like:

Continue reading

Too Smart Part 2

I was complaining not long ago about a common program that was growing too smart by default. It’s happening again. Is Mozilla Firefox your browser of choice? Did you think that version 2 already did everything you could possibly think of (except for maybe windowless plugins under Unix/X11)? I have been keeping up with version 3 (unflatteringly called ‘Minefield’) since the alphas. Take a look at what is coming:


Firefox 3 / Minefield Smart URLs

Firefox users might be used to the feature where typing in part of a URL autocompletes to recently-used URLs that begin the same way. The developers decided to take the feature one step further and start searching for the text string in any part of any recently used URL. Or its title, for that matter. Honestly, this could be useful in scenarios I have encountered, such as when I remember visiting a URL recently that lived somewhere under biguniversity.edu, but since the precise server was named www.foo-dept.biguniversity.edu, the autocomplete did not necessarily help. Still, in those cases, I could always fall back on the more sophisticated history panel.

And just to make the idea gaudy, a recent beta update added both the title and the site icon (favicon.ico) to the dropdown autocomplete system.

It’s a new behavior to learn. It is probably configurable through the extensive “about:config” browser page, but this will be the new default. Again, rather than being “smarter” and helping the user, the program is simply exhibiting a new behavior pattern that users will have to actively learn so they can again be productive with the same application.