Andrew Ferrier

Economics; Travel; Film; and Technology.

Archive for the ‘technical’ tag

HTC Desire – Bad Points

with 16 comments

Recently I acquired an HTC Desire, when seems to be the de-facto Android phone of the moment. Generally, I love this phone – I wrote part of this blog post on it, and the quality of the hardware is frankly astonishing. Irritatingly, one can’t help but feel a little smug comparing it to the iPhone. However, I don’t want to become yet another mindless gushing fan. So instead of raving about it, I thought I’d provide some provide some constructive criticism on the aspects of the phone I don’t like so much:

  • The battery and power management needs some work. Like all smartphones, the Desire has plenty of battery-sucking components, such as GPS and WiFi. I spend more time than I should really have to turning these off and on manually to conserve power. For example, Google Maps should be able to turn the GPS on by itself, rather than rely on me to do it. Most software based solutions, such as Locale, JuiceDefender, and so on, simply don’t work reliably enough (for example, mobile data connections frequently won’t turn off or on): it’s obvious that Android isn’t exposing enough APIs and these applications therefore have to rely on hacks. Better built-in power management would be welcome.
  • The volume switch is really annoying. In theory, it’s nice to have a hardware control. But I find myself hitting it accidentally when holding the phone, and reducing the ring volume down to vibrate. Sometimes I don’t even notice. I’d prefer to see a soft volume control, less easy to hit accidentally.
  • The openness of the platform is in question. I can install whatever applications I want. However, I still have firmware on the phone that’s been mangled by both HTC and (in my case) Orange. The HTC modifications are fairly nice, but the pre-installed Orange applications are just irritating, and cannot be removed easily. Orange has a bad habit of mangling phones they ship; presumably they think they need to do this to ‘differentiate’ themselves.  Worse still, it turns out one can’t simply ‘reinstall’ the firmware: the closest process is to root the phone – an awkward and unsupported process I’ve yet to be brave enough to attempt.
  • Many of the pre-installed widgets are far too large (witness the SMS widget, which consumes an entire screen), with a lot of unnecessary chrome.
  • The Music app is a bit flaky and crashes once or twice a day.

Written by andrewferrier

July 8th, 2010 at 11:26 am

Logitech Presenter R800 with USB HID in Windows XP SP3

without comments

I recently acquired a Logitech Presenter R800. It’s a beautiful device – not particularly cheap, but very slick and easy-to-use. Unfortunately, Windows XP (Service Pack 3) on my system refused to recognise it – the device was listed as USB Receiver in Windows Device Manager, but Windows kept claiming it couldn’t find the driver. It is presented to the system as a standard USB HID device, so there is no Logitech-specific driver: it uses the standard Windows HID Driver. It worked perfectly out of the box on Ubuntu 9.10.

After 3-4 hours of research, I found the answer. Running a differencing tool between the C:\Windows\Inf folder on a colleague’s PC and mine showed that mine was missing the usb.inf and usb.PNF files from that folder. It wasn’t clear why they were missing, but having copied them over from his machine, the driver installation then worked perfectly. So that’s worth trying if you encounter a similar problem with this product (or indeed any USB HID device).

Written by andrewferrier

April 26th, 2010 at 1:55 pm

Connecting Google Reader and podget

with 2 comments

For some time, I’ve had a Perl script that runs regularly, backing up my Google Reader subscriptions using the standard OPML format:

#!/usr/bin/perl
#
# Usage:
#  backup-google-reader-opml file-to-write-to.opml google.user.name@domain google-password
 
use strict;
use warnings;
 
use WWW::Mechanize;
 
my $mech = WWW::Mechanize->new();
 
$mech->get("http://reader.google.com")
    or die "Cannot reach Google Reader Homepage";
 
$mech->submit_form(
    form_number => 1,
    fields =>
    {
        Email => $ARGV[1],
        Passwd => $ARGV[2]
    }
)
    or die "Cannot submit form";
 
$mech->get("http://www.google.com/reader/subscriptions/export");
$mech->save_content($ARGV[0]);

However, I recently wrote another script (this time Python) that then takes this OPML, parses out all the URLs that are tagged with ‘podcast’, and outputs a serverlist file for podget (an automated console-based podcast downloader). This enables me to subscribe to a podcast in Google Reader, and have the podcast automatically added to the download list. The script looks like this:

#!/usr/bin/python
#
# Pass in the OPML file as the first command-line parameter. Will output the
# podget serverlist on stdout.
 
import re
import sys
import xml.dom.minidom
 
doc = xml.dom.minidom.parse(sys.argv[1])
 
body = doc.getElementsByTagName("body")[0]
 
p = re.compile('^\W+')
 
for outline in doc.getElementsByTagName("outline"):
    if outline.getAttribute("text") == "podcast":
        for subOutlines in outline.getElementsByTagName("outline"):
            title = subOutlines.getAttribute("title")
            title = p.sub("", title)
            print subOutlines.getAttribute("xmlUrl") + " NoCategory " + title

Feel free to use and adapt to your needs.

Written by andrewferrier

November 23rd, 2008 at 9:08 pm

Reinstalling The Thinkpad

without comments

My work Thinkpad (a T61) was becoming a little crufty, so I decided to reinstall it from scratch. Here are a few lessons I learnt along the way:

  • Making a hot copy of your entire drive onto a USB hard disk with VMWare Converter beforehand is a great idea. This basically means you have your entire previous installation still bootable, so you can rescue any data or settings you forgot about, after you’ve done the reformat and reinstall. VMWare Converter is free.
  • Windows XP won’t install if the BIOS has the SATA controller set to AHCI mode – it won’t find the HD to install to. Read the install instructions for the SATA driver before installing Windows. Doing this without a floppy drive involves installing Service Pack 2 first (see below).
  • Windows, surprisingly, does not contain a driver that can work with the Ethernet controller. Have a copy of it ready on a USB stick.
  • The redistributable version of Service Pack 3 isn’t standalone, despite claims to the contrary; it pre-reqs. at least Service Pack 1. Windows Update won’t take you the whole way there, so it’s easiest to get the SP2 and SP3 standalones.
  • The USB ports will not operate at high speed until you install the Intel Chipset Device Software.

Written by andrewferrier

October 10th, 2008 at 1:02 pm

New Delicious – For Mobile Once Again

with 2 comments

Used to be, I employed a cunning trick I found on the web to create a quick ‘n’ dirty homepage for my browser on my mobile – all the delicious bookmarks I’d tagged with mtag.

Then delicious went and released a new version and this trick broke.

After a bit of fiddling, I’ve found a reasonable alternative. feed.informer will take any RSS feed and turn it into fairly plain HTML. So take your RSS feed, which might look something like this:

http://feeds.delicious.com/v2/rss/andrewferrier/mtag?count=100

(the count increases the maximum number of items in the feed to 100)

Now plug it into feed.informer, and edit the options to make the result look how you want (hint: I modify the template, and set the Per-Item Template to <a href=”%URL%”>%TITLE%</a><br />, leaving the rest of the template blank – this prints one bookmark per line). You’ll also need to sign up and create a feed.informer account whilst you’re doing this (assuming you don’t already have one).

Once done, just view the ‘HTML’ version of the digest you created, and set that as your mobile homepage. Bingo.

Written by andrewferrier

August 7th, 2008 at 12:03 pm

LaTeX Tips

without comments

A general grab-bag of tips for using LaTeX, from the days when I still used it a lot:

  • To add nice headers and footers to each page use the fancyhdr package.
  • Use glosstex for most acronym and glossary needs.
  • Use the hyphenat package if you need monospace text (such as that set by the \texttt command) to wrap correctly, with hyphenation marks.
  • The varioref package provides easy-to-use cross referencing with automatic phrases such as ‘on the following page…’ etc.
  • To include EPS easily in both latex and pdflatex documents, use the following magic incantation in the document preamble:
  • \newif\ifpdf
    \ifx\pdfoutput\undefined
        \pdffalse
    \else
        \pdfoutput=1
        \pdftrue
    \fi
     
    \ifpdf
       \usepackage{hyperref}
       \usepackage[pdftex]{graphicx}
       \DeclareGraphicsExtensions{.pdf,.png,.jpg}
    \else
       \usepackage{graphicx}
       \DeclareGraphicsExtensions{.eps}
    \fi

Then refer to graphics files, when including them, without an extension. Use epstopdf to convert all EPS files to PDF for inclusion in the pdflatex version of the document.

  • Use the custom-bib package to easily create custom BiBTeX style files.
  • The following command produces a new environment which gives a nice way of having an introductory paragraph for each new chapter:
  • \newenvironment{intro}{\sffamily}
    {\vspace*{2ex minus 1.5ex}}

Written by andrewferrier

March 24th, 2008 at 9:50 am

Picasa and RAW Bug

with 2 comments

Note to self and others: never use Picasa to download photos direct from the camera when using RAW+JPEG. It has a nasty habit of downloading the JPEGs, then deleting the RAWs. Ouch. Always use a card reader on the Compact Flash card instead.

Written by andrewferrier

March 2nd, 2008 at 9:48 am

Tagged with ,

More Flexible Firefly Smart Playlists with Perl, sqlite3 and m3u

with 5 comments

I use Firefly (previously called mt-daapd) as a media server for my Roku Soundbridge. It has a feature called ‘Smart Playlists’ that dynamically create playlists based on certain criteria, but they aren’t that powerful – they don’t support sorting or other more advanced query features.

Fortunately, underlying Firefly is a sqlite database, which can be queried using standard SQL syntax. This enables a technique of creating static playlists that are automatically re-generated periodically instead.

The prerequisites for the following technique are:

  • Perl, with the File::Spec module (to convert from absolute paths to relative ones, which is what Firefly expects).
  • The sqlite3 command-line interface.

The three commands that follow will create a standard .m3u playlist with the top 100 most-played songs from Firefly’s database, and another playlist with all the non-Podcasts added in the last month, ordered by the time they were added. Neither of these are possible using Firefly’s query language.

sqlite3 /var/cache/mt-daapd/songs3.db 'select path from songs order by play_count desc limit 100' | perl -nle 'require File::Spec; $_ = File::Spec->abs2rel($_, "$PLAYLIST_DIR"); print;' > "$PLAYLIST_DIR/Most-played songs.m3u"
 
MONTHAGO=$(perl -e 'use Date::Calc::Object qw(:all); $date = Date::Calc>now(); $date += [0,-1,0,0,0,0]; print $date->mktime();')
 
sqlite3 var/cache/mt-daapd/songs3.db "select path from songs where genre!='Podcast' and time_added &gt; $MONTHAGO order by time_added desc" | perl -nle 'require File::Spec; $_ = File::Spec->abs2rel($_, "$PLAYLIST_DIR"); print;' > "$PLAYLIST_DIR/Music added in last month by most recent.m3u"

(obviously, if you use these, you’ll need to alter paths to suit, make sure the correct Perl modules are installed, remove line breaks to make it easier to read, etc.)

Firefly will read these .m3us if configured correctly during its next rescan, and use them as it would any other playlists. You can force a rescan with the following wget command:

wget --delete-after -q --http-user noone --http-password yourpasswd "http://localhost:3689/config-update.html?action=rescan"

Although not fully dynamic (they are not generated on request from the Soundbridge), if these commands are called from cron or similar, the playlist can be kept up-to-date ‘enough’.

Written by andrewferrier

January 5th, 2008 at 3:30 pm

Subscribers on Google Reader

without comments

Tip for anyone who blogs and uses Google Reader:  the new ‘Discover’ feature of Google Reader enables you to see how many people are subscribed to your blog. Select ‘Browse’ and search for your blog using keywords. When you’ve found it, it’ll show how many subscribers there are. Take the number with a pinch of salt: it is, of course, only one of many blog readers, albeit a popular one.

Written by andrewferrier

December 25th, 2007 at 1:12 pm

Tagged with ,

Getting WPA Working with a Thinkpad T42 and Knoppix 5.1.1

without comments

Thinkpad problems mean that I’m currently borrowing a T42 from work. It took me a while to get WPA working with Knoppix 5.1.1. Here are the magic incantations required:

wpa_passphrase YOURSSID YourWPAPassPhrase > /etc/wpa_supplicant/wpa_supplicant.conf
wpa_supplicant -ieth1 -c /etc/wpa_supplicant/wpa_supplicant.conf &amp;
ifup eth1
pump -i eth1

Replace eth1 in the list above with whatever network interface name Knoppix has assigned to your wireless card (reading through the output of dmesg should help you with this). Don’t forget to double-check that your router has the MAC address of the card (use ifconfig to find this) if you’re using MAC address filtering.

Written by andrewferrier

November 10th, 2007 at 8:52 am

Tagged with ,