Monthly Archives:: August 2010

Stanza Catalog Update

Posted by & filed under code.

I’ve continued enhancing the Stanza catalog I created earlier. New features include purchase links and Google Analytics tracking. I reverse-engineered the FeedBooks API and the AllRomanceBooks.com feeds to figure out how to do some of these things. Also I’ve been reading the OPDS spec (an industry-standard successor to the Stanza format) to add support for […]

10 simple questions to evaluate a software development organization

Posted by & filed under development.

All credit and inspiration for the questions below goes to Joel Spolsky’s The Joel Test and Bill Tudor’s 2010 update. My version differs in two aspects:  First, has just ten questions ordered from highest to lowest priority (in my personal opinion).  Second, in addition to yes/no questions, it asks open-ended questions intended to give more informative answers […]

Bad developer ≠ novice developer

Posted by & filed under development.

Understanding anything complex requires the courage and integrity to engage in difficult, exhausting mental effort. It’s tempting to cheat yourself. It’s easier spend more time in endless copying and debugging that take the effort to understand and create. In the short run, it saves time. But in the long run, developers who understand their craft are magnitudes more productive than the monkey see-monkey do coders. This is the difference between the unprincipled kind of laziness that trades understanding for time and the principled kind of laziness which saves time by understanding.

Get the MD5 hash of a file in .Net

Posted by & filed under code.

MSDN has a page on how to get the MD5 hash of a string. Easy enough, but if you follow their example exactly for a file and use File.ReadAllText() to get the string, you will get the wrong MD5 string for binary files. Instead, use File.ReadAllBytes() to bypass encoding issues. (This also applies to SHA1 […]

Creating a Stanza Catalog with ASP.Net MVC 2.0

Posted by & filed under code.

Stanza is a book reader for the iPhone/iPad.  One of Stanza’s features is the ability to browse specially formatted book catalogs.  While it has a number of built-in catalogs, you can also add your own.  I have created such a catalog with ASP.Net MVC 2.0 (screenshots).  The Stanza catalog format is pretty simple – just AtomPub with some […]

Some lesser-known truths about programming

Posted by & filed under development.

My experience as a programmer  has taught me a few things about writing software. Here are some things that people might find surprising about writing code: Averaging over the lifetime of the project, a programmer spends about 10-20% of his time writing code, and most programmers write about 10-12 lines of code per day that goes […]

Add a Facebook Like button to your page

Posted by & filed under code.

Adding a “Like” button using the Facebook JavaScript API is easy: <div> &lt;fb:like href=&quot;"&gt; </div>   window.fbAsyncInit = function () { FB.init({ appId: ‘your app id’, status: true, cookie: true, xfbml: true }); }; (function () { var e = document.createElement(‘script’); e.async = true; e.src = document.location.protocol + ‘//connect.facebook.net/en_US/all.js’; document.getElementById(‘fb-root’).appendChild(e); } ());

Continuous paging in Windows Phone 7

Posted by & filed under code.

Here’s a quick and dirty implementation of continuous paging with Windows Phone 7. These code snippets are from a project using the GalaSoft MVVM Light Toolkit and Ninject, however you can adapt to fit your model. The paging and data binding functionality is abstracted in the base class PagedListViewModelBase so that the paging functionality can […]

Using Reflection to serialize DTO’s

Posted by & filed under code.

Suppose that you have a DTO (data transfer object) that you want to convert into a parameter array to be saved to file or sent over the web. You could serialize it and convert it to XML or JSON. But maybe you want to send it in an HTTP POST or GET and you don’t […]