Archive for the ‘Open Source’ Category

Handling mail and mime in PHP using the Zend Framework

Friday, July 18th, 2008

Handling mail is a very common requirement in web applications. Even the most basic sites usually have a contact form that sends a mail through the server instead of putting a contact mail address for spam-spiders to find. Using PHP's built in function (aptly named mail() ) is relatively straightforward - until you need slightly more advanced features, such as adding and encoding email headers or sending multiple mails efficiently.
(more...)

Content syndication needs rebranding

Tuesday, July 1st, 2008

Content syndication or Feeds, is a mashup of technologies that provides an easy way to keep track of updates from multiple content sources. Despite being very useful, it has yet to find widespread acceptance amongst Internet users.

Direct usage statistics are hard to ascertain with great precision, but they revolve around 4%-6% of the total Internet population, which is not much. More feeds are being consumed indirectly by aggregation sites, such as my yahoo and iGoogle (as this Yahoo! paper shows), which shows that there is market ready to consume more feeds.

So why feed usage isn't more widespread? (more...)

jQuery and Prototype the choice of top websites

Saturday, June 14th, 2008

Pingdom has complied a list of the Javascript frameworks used by the top sites on the web (top 100 in Alexa US, Webware's top 100 web apps). jQuery and Prototype are the top choices, getting 11 and 13 respectively.

It's interesting to note that Dojo is not even featured on this list, though if you check the comments you'll see that it is used partially at the apple site (in the apple store). This makes me wonder even more regarding Zend's latest decision to integrate Dojo into their framework. As I commented in that release statement (comment #6 is mine), I feel that Dojo isn't appropriate as the default for the framework as it is more complex and much less documented than the other top frameworks.

As a long time jQuery developer I have no intentions of integrating a new Javascript library into my development environment, so I'm obviously biased. I still feel as though Zend missed an opportunity here to better cater to the needs of a broader user base and instead chose to prioritize its partners best interests.

Semi-colon mystery explained, jQuery UI released

Wednesday, June 11th, 2008

Javascript is a very mysterious language. Its prototypical inheritance structure and its function == object == function concepts are quite different compared to standard OO languages. As I did with PHP, I try my best to learn best good practices by studying frameworks I like, and in Javascript's case that would be jQuery.

I had believed I figured out most of the conventions used in the jQuery source code, however a recent addition has been bugging me and I could not find a reasonable explanation for it - I'm talking about the mysterious semi-colons appearing at the beginning of some of the source files in the library. What is its purpose? Does it make the closure invisible to giant robots from outer space? I had no leads to go on.

This blog post by the jQuery.rule team however, reveals the truth about the semi-colon debacle - apparently they're used for safe file concatenation (string join). Well that's a load off my chest. You learn something new every day.

In related news, jQuery UI 1.5 has been officially released, says the jQuery enquirer. jQuery 1.5 is an extensive UI oriented extension to jQuery, and version 1.5 bring forth many improvements such as a tighter API, an effects library called enchant, a skinning mechanism and plenty of bug fixes. I'm just excited they finally updated their documentation, as I've been using it for a while going only by source code.

Pagination with Zend_Db_Select

Wednesday, June 11th, 2008

Pages, by googleA common (web) interface feature is to divide a long list of items into numbered pages, a technique called pagination. I'll describe in brief some shortcuts I use with Zend_Db_Select to retrieve the row count and calculate the number of pages for complicated queries.
(more...)