Logitech Squeezebox and Podcasts

Just got a Logitech Squeezebox and I have to say that I’m very impressed. I was looking for a near-one-click solution for listening to music from the internet through the home stereo speakers.

Things that I like so far:

  1. Ease of setup. Although the jog wheel isn’t the most efficient way to enter an email address or password Logitech has made it as painless as possible. It’s a tradeoff between simplicity (jog wheel) vs speed (keyboard) but since the jog wheel is only painful in one-time setup tasks I think they’ve made the right call. I especially like the fact that the default selection is enter so when you’re done you just click the jog wheel and your entry is submitted.
  2. Breadth of app support. Facebook integration, Spotify and Pandora were a snap to add. I’m listening to one of my Spotify stations right now in fact Smile. Since I moved all of my music to amazon’s cloud player, let’s see if it has support for that.
  3. Podcast support! It would have been easy to overlook this in a mass market but there’s a Squeezebox app for it.
  4. WiFi and Ethernet support. I’m using Ethernet since I had one port left on a switch right next to the player. Switching from WiFi to Ethernet was easy enough to do with the well designed combination of the large jog wheel, bright display and simple menu structure.
  5. This thing is sturdy. It might look cheap but feels quite solid.
  6. The “take it outside” feature might come in handy one day.
  7. It’s at least $100 cheaper than Sonos. And has a built-in speakers.

Speaking of podcasts, I manage all of my podcast feeds through Google Listen. Google Listen uses Google Reader to manage the feeds. Wondering how to find out the URL of one of your feeds? Click the triangle to the right of the feed name in the left nav and a menu will appear. Click the “Details and Statistics” menu entry. The URL and a bunch of other information will be displayed.

Time zones and SQL databases

While working on a project I’ve encountered a need to store time and date information.

Over the past 15 years or so I’ve seen many different frameworks and libraries fail colossally when it comes to dates and times.To mitigate against these issues I went with what was considered best practice around the time I last looked into dates and times: store timestamps in UTC, render them in local time.

This makes date arithmetic easier since UTC doesn’t change during Daylight Savings Time (DST) whereas any given locale’s offset from UTC does change depending on the whether or not DST is in effect. And DST itself gets periodically redefined.

Out of curiosity I wondered when Microsoft’s SQL Server added time zone awareness? Was it much later than Oracle?

Oracle 9i, released in 2001, has the first reference I can find to time zone awareness in Oracle’s date and time formats.

SQL Server’s 2008 release has the first reference I can find to time zone awareness in its date and time formats.

That’s at least 7 years later. Seriously?

Parameter Games: Guessing For Profit

Suppose you’ve got a really nifty way to measure a certain physical property.  It could be height, weight, temperature, pressure, etc…  This measurement wows everyone that takes a few moments to get the gist of it.

Due to TANSTAAFL a measurement so nifty will of course have drawbacks.  In this case the drawback is that this measurement takes a pretty long time relative to other measurements of interest.
So what do you do when you want the benefit of the nifty measurement without the cost of waiting for it to be done everywhere you’d like to do it?

Enter interpolation.  In mathematics, interpolation “fills in” a function given N or more known values.  There are lots of ways to interpolate a function some of which perform better (that is, they more closely approximate the underlying function over the interval of interest) in some circumstances than others.  There are, among others, linear interpolation, quadratic interpolation (or more generally, polynomial interpolation), piecewise interpolation and splines.  Interpolation itself is a specific case of the more general concept of approximation.

In a sense neural networks perform approximation in that they are trained on existing data sets (these are the “known values”) and are later used to produce values on inputs where the outputs are not known.

A common theme with all of these approaches to “filling in” functions is the parameter game.  They’ve all got parameters, some more than others, and tuning those parameters for a specific application (the tuning game) is usually more art than science.

Asynchronous programming using the upcoming await C# 4.5 keyword

One of the features in the Base Class Library of the upcoming 4.5 .Net Framework is a new way to do asynchronous programming. While reading the “Walkthrough: Accessing the Web by Using Async and Await” I started to wonder: How are these method calls updating the UI (by appending to the textbox) from a non-UI thread?

The short answer? They’re not! Asynchronous methods (the ones you await) don’t run on their own thread. For a developer coming from a Windows Forms background (land of the Holy BackgroundWorker) I assumed that the whole await business was a new way of doing multithreading.

Apparently it’s not. It’s a new way of doing asynchronous programming. Until now I considered the two synonymous. await makes it clear that they’re not.

SA1202 All private fields must be placed after all public fields

Resharper’s default type members layout for C# doesn’t enforce the accessibility ordering on fields. So if you turn it on by checking the “Reorder type members” option and you’ve got private constants before public constants then you’ll run into SA1202.

The fix? Add the Access elements to the entry that matches fields and constants. The entire match should look like the following:

<!--fields and constants-->
<
Entry>
<
Match>
<
Or>
<
Kind Is="constant"/>
<
Kind Is="field"/>
</
Or>
</
Match>
<
Sort>
<
Access Order="public internal protected-internal protected private" />
<
Kind Order="constant field"/>
<
Readonly/>
<
Static/>
<
Name/>
</
Sort>
</
Entry>



And that’s it!