Twittering Again

Last year I tried out Twitter while attending SXSW, but I stopped using it when the conference was over.  Twitter was fun at SXSW, but it seemed kind of pointless afterwards.  It was too much useless information for me to handle.

A few weeks ago I decided to try Twitter again, and this time I changed how I used it.  At SXSW I followed too many prolific "A-listers," but this time around I’ve chosen to follow friends, co-workers, developers, and a random assortment of people I’ve met (online or otherwise).  And you know what?  I’m actually liking Twitter now.  I don’t know why, but I find it strangely fun to hear what the people I’m following are up to, without the pressure of having to reply to them all.

If you’d like to follow me, here’s a link to my Twitter profile page.  As you’ll discover, I rarely use Twitter for "serious" comments – most of my tweets are senseless remarks about the stuff going on around me.  But if you’re a fan of senseless remarks, feel free to listen in :)

The Joys of String Allocation

Note: This post will only be of interest to other software developers.  Feel free to skip it if you’re not a programmer :)

After a large corporate customer of ours upgraded to the latest version of FeedDemon, they complained that the "Subscription Home" report took a much longer time to display than it did in the previous version.

At first I was stumped by this, since nobody else had mentioned similar problems.  But then I discovered that they were subscribed to several thousand feeds – far more than most FeedDemon customers.  Most of these feeds had unread items, which meant that the subscription report was displaying pretty much every feed they were subscribed to.

After I got a copy of their feeds, I saw the problem right away: it turned out to be caused by the favicons that were added to this report in the latest version.  The way I had coded it, the string which held the contents of the report was being reallocated every single time a favicon was inserted into it.  So with this customer’s subscriptions, the report string was being reallocated several thousand times.  Ouch.

High-level programming languages usually handle memory allocation behind-the-scenes, so you’re often unaware that it’s happening, but I should’ve known better.  Many years ago I programmed in assembler, so I know what’s really going on when dealing with string operations.  Memory allocation is a big reason why many string operations are slow, and when you insert one string into another, the memory for the destination string has to be reallocated to allow enough room for the inserted characters.

Anyway, after chiding myself for my newbie mistake, I rewrote the code so that all memory was pre-allocated up front, and the favicons were simply copied directly into this pre-allocated memory (in other words, inserting favicons into the report string now requires a single memory allocation).  The code is significantly more complex than it was, but my profiler shows that it’s now 1137.81% faster than before.

That strikes me as a pretty good illustration of the performance cost of memory allocation :)

FlickrDemon: Viewing Flickr Photos in FeedDemon

One of FeedDemon’s lesser-known features is its support for Media RSS thumbnails, which are used in a number of RSS feeds, including those from Flickr.  When FeedDemon displays Media RSS feeds, it extracts the thumbnails and shows them in a banner along the top, like this:

Navigating to the full-size photo on Flickr’s site is as simple as clicking one of these thumbnails.

FeedDemon also makes it very simple to subscribe to a Flickr feed for a specific tag.  For example, to subscribe to a feed containing Flickr photos tagged "nature," just follow these steps:

  1. Click "Subscribe"
  2. Instead of entering a URL, type nature (screenshot)
  3. Click Next
  4. Select "Flickr Photo" from the list (screenshot)
  5. Click Next
  6. Choose the folder to add the feed to, then complete the wizard

That’s all there is to it.  Here’s a screenshot of FeedDemon which shows the Flickr feed we just added:

Bonus tip: This also works for YouTube feeds – just select "YouTube Video" instead of "Flickr Photo" in step 4.

Speed Read with FeedDemon’s "Next" Button

When people first use FeedDemon, they often treat their unread articles the same as they do their unread email.  They read every single article, and only mark them as read after they’ve actually looked at them.

But after they use FeedDemon for a while, it dawns on them that reading feeds isn’t the same as reading email.  They don’t have to read everything – in fact, they can’t read everything, because they’ve subscribed to so many feeds that they can’t possible read them all.

At this point, they start skimming the headlines looking for interesting articles, and just mark the rest of them as read without even reading them.  Before long, though, even this seems like too much work, and they look for a better way to blast through their unread articles.

This is when FeedDemon’s "Next" button becomes incredibly valuable.  This unassuming button – which resides on the toolbar above FeedDemon’s browser – marks every article on the current page as read, and then moves to the next page that contains unread articles.  If there aren’t anymore unread articles in the current feed, this button automatically moves to the next feed that has unread articles.

If you haven’t discovered this button yet, I encourage you to start using it.  You can power your way through hundreds of unread articles in a very short time by flagging the ones that look interesting (or opening them in a new browser tab), and then clicking "Next" to move to the next page.  Once you’ve finished going through your unread articles, you can then read just the ones that looked interesting.

This is how I deal with all the stuff I’m subscribed to (and it’s another reason why using great titles is so important).

Feed Retrieval Intervals and Non-Updating Feeds

Greg Reinacker recently blogged about NewsGator feed retrieval intervals.  For me, the money quote is this one:

"One of the more common questions/complaints we get is something about a feed not appearing to update in a timely manner. 99% of the time, it’s actually a problem with the feed."

I can certainly attest to the fact that we receive frequent complaints about a specific feed not updating, and when we check into the problem, it’s almost always due to the feed itself.  As Greg explains:

"These are feeds which have returned some kind of error, and they are “penalized” for it. For example – if a feed 404’s, it is immediately penalized for 24 hours. A 500 server error? 4 hours. Other kinds of errors (including parsing problems) cause penalties of varying lengths, taking into account how many consecutive errors we see."

Read the full post if you’re interested in more details.

My Rock Band/Guitar Hero Top 10 Wish List

If you’re a regular reader of this blog, you know that I’m hopelessly addicted to Rock Band and Guitar Hero.  I pretend that I bought those games for my kids, but we all know I really bought them for myself (and if the kids are nice, I’ll let them play, too).

It’s a sure sign that you’re addicted to these games if you see colored notes flying towards you when you listen to music.  In my case, it’s become so bad that when I hear one of my favorite songs on the radio, I often find myself wishing I could play it on my cheap plastic guitar.

So far, here are the top 10 songs that I wish I could play:

  1. Frank Zappa – Peaches en Regalia
  2. Stevie Ray Vaughan – Little Wing (Hendrix cover)
  3. Led Zeppelin – Black Dog
  4. Metallica – Master of Puppets
  5. Avenged Sevenfold – Bat Country (dumb video, but good song)
  6. Focus – Hocus Pocus (hat tip to Fake Steve Jobs)
  7. Red Hot Chili Peppers – Under the Bridge
  8. The Beatles – While My Guitar Gently Weeps
  9. Steve Vai – For the Love of God
  10. Pink Floyd – Comfortably Numb

Bonus wish: Metallica’s One and Rush’s YYZ are in the Guitar Hero series, but I wish they were available in Rock Band as well.  I’m a lousy vocalist, but I think I could do a decent job with the vocals on YYZ :)

Extending FeedDemon: Customize the "Send To" Menu

If you’ve used FeedDemon for a while, you’re probably familiar with the "Send To" menu, which enables sending a post to an external service such as Digg or del.icio.us.  But you probably don’t know that you can extend this menu (because, well, I’ve never mentioned it before!).

Each external service in this menu is contained in its own XML file which is located in FeedDemon’s \Data\SendTo subfolder.  Adding a new service is as easy as creating a new XML file in this folder which tells FeedDemon what to do with the post.

The format of these XML files is pretty simple.  Here’s the "Send To" file for del.icio.us, which is installed with FeedDemon:

<fdsendto service="del.icio.us" template="http://del.icio.us/{user}?title={title}&amp;url={url}" />

As you can see, there’s a single XML element named fdsendto which contains two attributes:

  1. service – the name of the service as it should appear in the menu
  2. template – the URL that FeedDemon should send the post to

The template relies on tokens which are translated to data from the actual post before FeedDemon passes it to the external service. Here’s a list of the supported tokens:

  • {url} = the URL the post links to
  • {title} = the title of the post
  • {description} = the full description of the post including HTML tags
  • {description-plain} = the full description of the post with HTML tags stripped
  • {summary} = the summary (excerpt) of the post including HTML tags
  • {summary-plain} = the summary with HTML tags strips

The del.icio.us example above also contains a {user} token, which tells FeedDemon to ask for the user’s name on the external service (this usually isn’t necessary, but some services do require a username before posting via a URL).  FeedDemon remembers the username after it’s supplied, but you can edit or remove this username by clicking the "Passwords" button in FeedDemon’s options then switching to the "Services" page.

Of course, you may not want to go through the effort of creating your own "Send To" XML files, in which case, check out these posts from two of FeedDemon’s power users:

Note: "Send To" menu items are cached at startup, so you’ll need to restart FeedDemon after adding an XML file to the \Data\SendTo folder before it will show up.

Tennessee Storms

My family can be counted among the lucky ones who escaped the full impact of last night’s storms here in Tennessee

For a while, we weren’t sure we’d be so lucky.  Just after 9pm, a tornado siren less than two miles from our subdivision sounded off, and stepping outside I heard what sounded like a jet plane roaring overhead.  We quickly brought our two children downstairs to the safest place in the house, where they stayed until morning.

The sirens continued sporadically until sometime after 2am, but somehow the worst of the storm passed right by us, leaving our area relatively unscathed.

Others weren’t so fortunate.  My heart goes out to those who lost their loved ones, homes and communities in the series of deadly tornadoes that tore through the region during the night.

Localizing FeedDemon

Among the trickier things in software development is getting your application translated into different languages.  Beyond making sure you provide enough white space in your UI for longer strings of translated text, simply getting your app localized can be an awful lot of effort, and it often causes your product to be delayed while the translators do their work.

The traditional Windows approach is to store displayed text in a separate resource DLL that's linked to your application at runtime.  Instead of taking this approach with FeedDemon, though, I chose to store language strings in an external XML file (an "FDLANG") which is parsed at startup.  This way, third parties can create translations using any editor they like, and no extra compilation is required.

FeedDemon is designed to recognize hyperlinks to FDLANG files, so installing a new language file is incredibly simple – just click the FDLANG hyperlink, and FeedDemon will download the language file and ask whether you want to use it right away.

If you'd like to try this yourself, stop by the FeedDemon Language Files Page to download and install additional languages.

All of these language files were created by individuals who simply wanted to see FeedDemon support their native language.  It's a tedious process translating so much text, and we owe these folks a great deal of thanks for spending their time doing this.

PS: If you're thinking about creating your own translation, be sure to modify the constant value named S_TranslatorCredit in the FDLANG file.  This value appears at the top of FeedDemon's "About" box so you can get some credit for your work.

PPS: If you change languages and want to switch back to English, look for the "Language" submenu: