Tuesday, April 13, 2010

Use your mp3 player to listen to podcasts instead of talk radio on your commute

I have a 15-minute commute by car to work – so that’s about 2.5 hours I spend in the car going to and from work on a typical week.  Occasionally I listen to music in the car, but most often I prefer listening to talk.  Historically, I would typically listen to AM radio on the commute: sports, news, or just whatever was on any station I could find that wasn’t on commercial.

For the past couple of years, though, I’ve listened to podcasts on the commute instead.  For anyone unfamiliar with the term, a typical podcast is essentially a talk radio show that you can download online for free, and listen to on an mp3 player.

Listening to podcasts have several significant advantages over AM radio:

  • Choice of Topic.  At any given time, there are only a few topics available to listen to on talk radio shows.  By contrast, there are a podcasts on a multitude of topics available for free download online.  I’ve replaced listening to general news and sports talk on my commute with topics that are specifically of interest to me, like software engineering, Christian apologetics, and video games. 
  • On-Demand / Pauseable.  With a podcast, the show starts exactly when I sit down in my car in the morning.  And when there’s something interesting being discussed as I arrive at work, instead of missing the end of the discussion, I can just pause my mp3 player, and pick up the show right where I left off when I begin my commute home in the afternoon.
  • Limited or No Commercials.  Whereas a typical radio station plays commercials as much as 15% of the time or more, many podcasts are produced on a volunteer basis and are totally commercial-free.  In my experience, in those podcasts that do run ads, the ads are fairly limited.  And as a last resort, you can always skip past any particularly intrusive commercials that do happen to be present using the fast-forward function on your mp3 player!

My current mp3 player is an Apple iPod, so I use Apple’s iTunes software to subscribe to podcasts, and have the latest episodes automatically download to my PC.  Then, when I sync my iPod with my PC (which I typically do once a week or so), I get several new episodes of my favorite podcasts to listen to on my commute over the next several days.  Easy!  (If you don’t have an iPod, there are several free RSS software packages out there that support audio files that you can use to subscribe to podcasts, and have the .mp3 files automatically download for you.)

The only remaining challenge, then, is how to get the mp3 player output to play through the car speakers (since it’s for obvious reasons dangerous, and apparently in many places illegal, to drive while wearing headphones).  With an older car, you can get an inexpensive device that converts an audio cassette player into a line-in jack for an mp3 player.  Many newer cars these days come with a line-in jack built directly into the stereo system.

However, I drive a model year 2005 car that has neither a line-in jack nor a cassette player.  The solution I landed on for listening to my iPod in my car was a Griffin iTrip FM Transmitter / Charger.  The device is essentially a short-range FM transmitter does a a short-range FM radio broadcast of whatever is playing on your iPod, using an FM frequency that is unused in your area (a frequency that you specify).  Then, you just tune your car radio to that same FM frequency, and you can hear your iPod podcast (or music) over your car’s stereo system! 

I’ve actually bought two copies of the iTrip device – one back in late 2007 for myself, and a second one a year ago for my wife.  Both devices are still in great working condition.  Although the iTrip has an MSRP of US $70, it’s currently going for about $34 shipped on Amazon.com as I write this.  Highly recommended, particularly at that reasonable price.

Finally, a brief plug for a specific podcast: If you’re into video games, check out the Gamers With Jobs podcast.  It’s a group of a few adult gamers that talk weekly about current games (across all of the major console platforms and the PC), and interesting gaming-related topics.  The group has great chemistry and the show is often pretty funny.  And it’s commercial-free!  It’s my favorite podcast.

So – try making your daily commute time more interesting and/or productive by listening to a podcast on a topic of interest to you while you’re driving back and forth to work, instead of just defaulting to whatever happens to be on the radio!

Thursday, March 11, 2010

Issue: Non-ASCII characters change to inverted question mark (“¿”) after save

I was recently entering some content into a Confluence wiki page that included some non-ASCII characters, such as “→” (U+2192, "RIGHTWARDS ARROW") and “←” (U+2190, LEFTWARDS ARROW).  (I can easily type those characters using Alt+Numpad 26 and Alt+Numpad 27 respectively, since my Windows XP machine is set to Code page 437.) However, after saving the document and coming back and looking at it later, all such characters had been changed to inverted (upside down) question mark characters, “¿”.

Investigation revealed that the problem was that the underlying Oracle database to which the content was being saved was set to use the Western European character set ISO-8859-1, as opposed to a more comprehensive character encoding such as UTF-8.  Since ISO-8859-1 doesn’t include the “leftwards arrow” or “rightwards arrow” characters, Oracle converted those characters to the inverted question mark instead.

I wanted to share this here since this information might be helpful to anyone encountering a similar issue in a variety of different possible applications, not necessarily just Confluence.

Wednesday, March 03, 2010

Fix: Error starting JBoss: “Please check that you are in the bin directory when running this script.”

I’m currently attending a developer training class on a Java application that runs on the JBoss application server.  When running a .bat script provided by the trainer on my Windows XP machine that is supposed to start JBoss (among other things), I and several others in the class were having the script fail with this error:

Could not locate C:\path\bin\run.jar. Please check that you are in the bin directory when running this script.

The path from the error message was not the correct JBoss directory containing run.jar, jboss-4.2.0.GA\bin, but a different directory. Searching through the files on my local machine revealed that this error message was coming out of the run.bat file in that same jboss-4.2.0.GA\bin folder.

Looking at the source of run.bat, the script attempts to create and set a Windows environment variable named JBOSS_HOME. I noticed two lines in particular near the beginning of the file:

if "%OS%" == "Windows_NT" set DIRNAME=%~dp0%
...
if "%OS%" == "Windows_NT" set PROGNAME=%~nx0%

From other parts of run.bat, I suspected that the root cause of the problem was that DIRNAME was not being set correctly.

From a command prompt, I ran "echo %OS%" (no quotes) -- this returned a value of WINNT -- not a value of Windows_NT as expected by the script.

Oddly enough, in the Environment Variables dialog in the Control Panel, the OS variable is set to Windows_NT -- the value is apparently being overridden by something else running on my machine. From talking to others in the training class, who had the script work from home but not while at the office, the override is apparently being done by one of the login scripts that automatically runs at when we log in to the corporate network.

In any event, the solution/workaround that we came up with was simply to edit run.bat and remove the OS check in the two above-mentioned lines, resulting in the following:

set DIRNAME=%~dp0%
...
set PROGNAME=%~nx0%

This got JBoss up and running successfully, despite the "incorrect" OS environment variable value on our Windows workstations.

Monday, February 08, 2010

Confluence wiki: Linking to a diff against a specific old page version

At my office, we use the Confluence wiki for knowledge management.  We recently had some design specifications for a project delivered to us by a 3rd-party consultant; we imported this documentation into Confluence to allow easy tracking of future changes made to the content.

I wanted to be able to add a link to each page along the lines of “click here to see the Confluence diff between the current version of this page, and the 2009 version,” where the aforementioned “2009 version” would be a specific old page version of the page that I would specify when I set up the link on each page.

Unfortunately, Confluence doesn’t provide an “out-of-the-box” way to provide "one click" access such a diff of a specific old page version against the latest version of the page.  You can create a link to a Confluence diff between two specific versions by using the diffpages.action or diffpagesbyversion.action pages that come with Confluence, but both of those take two hard-coded version IDs or page IDs as parameters; they don’t take a parameter or otherwise allow you to specify “latest” as one of the versions to compare.  So you could create a link to a diff between (say) version 1 and version 5 of a page, but that link would become obsolete as new versions beyond 5 were created.

I asked for advice on how to do this (in this thread) on the Atlassian Confluence forum, and got a helpful suggestion from “Rob L.” involving setting up a Confluence user macro to emit the current version of a page, which could then be embedded in a link to a diff page; however, in my Confluence instance at work, I am unable to get a new user macro set up, so while a good solution, it didn’t solve the problem for me.

I then tinkered a bit more on my own, and came up with a way to do this without the need for a user macro. The approach involves using raw HTML (via the Confluence {html} macro) to create a hyperlink with a dummy target (“href”), and then using Javascript (again using the {html} macro) to edit the link target to include the pageId of the Confluence page, which is accessible via the Javascript DOM.

Here's the Confluence markup:

{html}
  <a id="mydiffLink" href="#">Click here to view the diff.</a> 
  <script> 
    document.getElementById('mydiffLink').href=
      "http://myConfluenceHost/confluence/pages/diffpages.action 
      ?originalId=12345678&pageId=" + document.getElementById('pageId').value; 
  </script> 
{html} 

This solution uses diffpages.action rather than diffpagesbyversion.action since the code uses the Confluence page ID, not version ID.

When using this solution, the hard-coded "12345678" in the above example should be replaced with the actual page ID of the old page to compare against.

"http://myConfluenceHost" in the above example should also be replaced with the actual hostname of your Confluence server, of course.

Caveats: This approach relies on (1) the Confluence {html} macro being enabled, and (2) on the user viewing the page having Javascript enabled.

Monday, January 25, 2010

Fix: Thinkpad using Wireless LAN even when connected via wire

This morning, I noticed that my work laptop, a Thinkpad T60 running Windows XP, was using its wireless network connection, even though the machine was docked and plugged in to the wired LAN.  In Control Panel | Network Connections, the “Wireless Network Connection” showed “Connected,” but the “Primary Network Connection” showed “Disabled.”

Right-clicking the “Primary Network Connection” and selecting “Enable” from the context menu resulted in a “Connection Failed!” message in a popup window, with no further details on the problem.

I’m not sure how my “Primary Network Connection” became disabled in the first place, but I was able to re-enable it as follows:

  • In Control Panel |  Network Connections, right-click on “Primary Network Connection” and choose “Properties”
  • In the “Primary Network Connection Properties” dialog that appears, click the Configure button (near the top of the dialog).
  • In the dialog that appears, if a message appears stating that the device is currently disabled, click the “Enable Device” button.

That fixed the problem for me.  The wired connection started successfully, and the wireless connection disconnected automatically (as it normally does when the wired connection is active).