Infinite monkey theorem

I was just considering that perhaps the Infinite monkey theroem should instead be the Infinite Doozer theorem. Not only would this allow one to conjure a much more humorous mental image, the Doozers are obviously much more industrious than monkeys and therefore much more suited to toiling away in front of typewriters. There is also the fact that an infinite number of Doozers with an infinite number of Doozer-sized typewriters would take up far less physical space than an infinite number of monkeys.

ORM: Metadata mapping

Using Metadata – Martin Fowler

The most time spent working on a site under exhibition was the model or database layer. So before really getting into the rewrite I wanted to see what else was out there that could simplify this. Obviously I was turned to Fowler’s Patterns of Enterprise Application Architecture and ActiveRecord (rails), Hibernate (java) etc. One common element with every ORM solution I have run across is that they partially violate the DRY principle. Those that don’t, or that give you the option of completely defining your schema in a format native to the ORM are not expressive enough to use the full power offered by the database. This is when I remembered that PostgreSQL implements an extension to the SQL standard information schema that allows you to add an arbitrary comment to nearly any database object, tables and columns inclusive. After some poking around I found that MySQL supports the same, although it is not nearly as well documented. SQLite does not share this non-standard extension. So, my thought at current is to express whether relations are one-to-one, many-to-one or many-to-many directly in my table declarations. The only drawback I can see is a lack of portability, but when it comes to PHP, how many people use anything other than PostgreSQL or MySQL? SQLite should be used a great deal more, in my opinion, but in practice I do not believe it is. If at some point I must be portable to something other than the common case, well, in that event I guess I can always just do what all of the ORM’s are already doing.

References:
http://www.postgresql.org/docs/8.2/interactive/sql-comment.html
http://dev.mysql.com/doc/refman/5.0/en/information-schema.html
http://dev.mysql.com/doc/refman/5.0/en/alter-table.html

ZK, AJAX without JavaScript?

ZK Demo

ZK is a slick-looking presentation layer toolkit that seems to at least be growing in popularity on SourceForge. I do not know of any real sites using it. It looked very interesting at first glance, especially in conjunction with something like Hibernate. After some further digging, my second impression is that it suffers from roughly the same major flaw that afflicted the first iteration of exhibition. Namely, it presented some simple ways to do complex things, but when it really came down to it, the complexity was merely being moved elsewhere. Not just that, but the complexity was now being exposed using a technology few people know or understand. Am I missing something here, or is ZK just refactoring the complexities of developing an application for the web?

XSLT shorthand for PHP

As I trudge toward Exhibition v2, I am taking the templating in an entirely new direction. Exhibition deals with XML, a lot of XML. As a direct consequence there is a fairly substantial amount of XSLT. Noticing that XSLT has a very straightforward syntax, I decided to write a little preprocessor to save my fingers some walking later on. Most commands boil down to “command” or “command required_argument” (required_argument usually being an XPath expression). So, that’s exactly what I pruned it down to.

<@ for-each atom @>

versus

<xsl:for-each select=”atom”>

Check it out —

xsltemplate.phps

xsltemplate-test.tpl
xsltemplate-test.xml
xsltemplate-test.xsl
(examples stolen from W3Schools)

Tomshardware

Does anyone else remember when actual articles graced the pages of Tomshardware, rather than advertisement after blatant advertisement? I know, it was years ago…

DivX, where did that momentum go?

Back in February DivX graced us with their web player plugin for Windows and Mac. Apparantly to little fanfare, I didn’t even notice at the time. I have always been a fan of DivX; the codec mind you, not the company. The quality is superior and encoding time shorter than any other option out there, not to mention a relatively sane DRM implementation. On the other hand, the company was born on the media wings of online tv and movie pirates, and it all started out as a Windows Media Video hack. Coming from a background where the involved individuals seem to prefer and trend toward transparency rather than tight-assed corporations, it always seemed rather odd to me the way DivX attempted to capitalize on their momentum. Notice that they have long since lost the support of online pirates who are now using the more transparent (open source) XviD codec extensively.

This post isn’t so much about DivX’s failure to gain real end-user traction in years past, it’s more an open question as to why they seem to be unable to meet market demands NOW. On2, who we first heard about when they open sourced their VP3 codec, whom the astute reader will know is the codec Ogg Theora is based upon. Somehow, these On2 fellows in the past couple of years have managed to get Macromedia and now Adobe eating out of their hands, which in turn has granted them 95% or better market penetration through the web browser (bundled with Flash 8). Now they can be seen launching products left and right aimed at corporate licensee’s such as the On2 Video Publisher. Dare I pose the question, DivX, you went through all the trouble of creating a browser plugin for playback, why didn’t you take it the extra 10 yards?

Open Source Flash Media Server: Red5

I have been following the development of red5 since very early on. It was the prime motivator behind flixn, as having a freely available flash media server would allow one to do things that were inconcievable previously due to the financial weight of licensing. Just to be clear I have never, not by any stretch of the imagination, been a proponent of flash. To be perfectly honest I am one of those geeks who will steer clear of a website entirely if flash is a hard requirement. That said, I would like to think that I am able to recognize the merits of a technology no matter how foul a taste it leaves in my mouth. Flixn exploits the heck out of one of those merits, there will be no punches pulled here.

Over the last couple of months flixn has gone from one of those little backburner projects that is slowly building steam to seeing near fulltime development by several individuals. As work has progressed it has become abundantly clear that no matter how far red5 has come in its short life it just wasn’t going to be ready for prime time on the same timetable as flixn.com. In our case, the final phases of development are currently underway, including a switch to Adobe’s Flash Media Server 2. It is quite unfortunate, but such is life. I wish to point out that this should not be taken the wrong way, red5 has proved itself to be extremely robust and stable as a development platform. The switch to FMS2 was not a light one by any means, and yes, that does mean we were very seriously considering a launch using red5.

As critical as I am of flash, I am extremely eager to see what the entrepreneurial web 2.0 crowd will do in the next 6-12 months as red5 becomes mature. That Adobe seems to have taken an interest in getting Flash9 out for Linux doesn’t hurt my feelings either.

PHP/AJAX file upload with progress bar, part 2

I made some good progress on implementing the server side of things as outlined in my prior post on this subject, but I got lazy as usual. I simply haven’t gotten around to finishing this up, so I decided to throw the code up and make a post about it in the hopes that someone will either badger me into completing it, or find some of what is already there useful. The code as of now implements what could be a reasonably useful (python asyn* inspired) set of utility classes for writing socket applications in PHP. Not that anyone would ever want to do anything like that, of course.

http://evilprojects.com/hacks/

OpenBSD’s financial situation

In typical form, Theo is once again ranting about for-profit corporations not living up to his personal ethical standards. Wait, wait, wait.. WHAT? Right, exactly, let me spell it out for those of you that missed it. For-profit corporations typically do not, nor should they in general operate under the guidance of some high and mighty code of ethics. That’s just not what they do! If you expect them to, you are a lunatic, profit margins are everything. Granted, there are some that do and kudos to them.

Theo, your pet OpenBSD is in some ways pushing the envelope to the extreme when compared to other open source operating systems. OpenSSH/SSL, bgpd, pf to name a few. You’re a bright guy Theo, I know you are, get with your guys and figure out how to monetize those good bits. Selling CD’s and DVD’s isn’t the way. Selling support services is a step in the right direction, but isn’t going to get you too far. Offer custom development services, for customization, etc? Ok, ok, sure, not bad. But you can do better than that, it all depends on how far you want to take it. Oh wait, there’s a thought. $10,000/year subscription service that gets your corporation fed security patches 72 hours before everyone else? How about a $30/year subscription service for individuals that gets you a login to download new releases 2 weeks before everyone else? Oh, right, but then one guy would grab it and setup a torrent or something. Think about it this way, though. At least then you’ll have something legitimate to rant about.

The Complete FreeBSD

One month ago, on February 26, 2006, I strong-armed Greg “grog” Lehey over IRC into letting me provide him an account on a machine to act as a download mirror for his book, The Complete FreeBSD. This while I was drafting the article submission to Slashdot, just in case. The announcement that the book was now available for free under the Creative Commons Share-Alike license was made several days prior and syndicated on a number of other more niche geek news sites. After the /. article went live on the 27’th, Greg decided to make use of the mirror, and switched the primary download site to Evilcode.net. Shortly thereafter traffic leveled off at around 7Mbit and slowly tapered off over the next few days. This from a post that did not even hit the main page.

Now, one month later, Evilcode.net is still acting as the primary download mirror for The Complete FreeBSD. By my rough count it has consumed so far in the neighborhood of 75GB of transfer, which breaks down as, roughly mind you… 7500 copies of the PDF version, 3400 copies of the PostScript version and 1000 copies of the book sources. Not too shabby!

I would like to extend my most sincere thanks to grog not for just disseminating this valuable resource openly as he has done, but also for its existence in paper form in the first place. I still have fond memories of receiving and reading my copy of the second edition some years ago when I was a FreeBSD novice. Not only that, but for years of valuable contributions to the FreeBSD project. The developer community would not be the same without you Greg, you are one of the good guys.

Direct link to The Complete FreeBSD page on lemis.com