Open Source I <3 iTextSharp
I’ve just started using iTextSharp, a .NET port of the Java iText library. It’s surprisingly good.
The library can create files or streams of PDF. I’m caching my output, so this example uses files:
// create a document
Document document = new Document();
// associate it with a file
String filepath = Request.MapPath("/Pdfs/test.pdf");
FileStream file = new FileStream(filepath, FileMode.Create);
PdfWriter.GetInstance(document, file);
// write the pdf
document.Open();
document.Add(new Paragraph("OMG this thing works"));
document.Close();
Software Database Models I Have Known And Endured
One thing you might have noticed that we do is SQL. We do a lot of SQL, so you’d think we would have figured out the best way of hooking up applications to databases.
To an extent, we have become so familiar with the requirements of database-driven development that we have come to accept the tools that we have as being adequate. Even ODBC.
Obviously we’ve long ago moved past PHP functions like mysql_fetch_row. We expect things like sanitizing and escaping, multiple vendor support, query abstraction, and so on. We look back fondly on the clumsy simplicity (and scope for injection) of things like this:
PHP
mysql_query( "SELECT * FROM T_Shirt WHERE color = '{$favorite_color}'" );Nowadays we’re more likely to fetch records through a framework API, such as this use of Zend Framework’s Zend_Db:
PHP / Zend Framework
$db = Page::getDb();
$select = $db->select();
$select->from( 'T_Shirts' );
$select->where( 'color = ?', $favorite_color );
return $db->fetchAll( $select );
Because the query is broken down into a set of calls we can pass the select object around before we do the fetch. This is surprisingly handy.
But what else is out there that might be better than what we’re doing now? What would be the next step, the thing that would make Zend_Db look like mysql_query?
Software Eclipse FTW!
Eclipse: when it rocks it rocks, but when it goes pear-shaped, it really does go pear-shaped.
Productivity This Explains Everything

Marketing How Having An Awesome Blog Is Really Cool
Many, many people keep blogs. Few, few people read them. Even this blog, which is part of a surprisingly successful business, has a readership that struggles to stay in single figures.
My new blog, on the other hand, is astonishingly successful. If I have fewer than 30 000 uniques in a day then I feel bad; the record so far is around 130K. I’ve been linked from boingboing, neatorama, gawker, all the cool well-edited places. I’ve been #1 on digg and #1 on reddit. Possibly at the same time, I’m not sure because I am constantly distracted by how awesome my blog is.
Success of this magnitude obligates me to convey some part of the genius involved to you, the less-successful bloggers. Here are my secrets.
