<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Dr Jan's Tips From The Top &#187; software</title>
	<atom:link href="http://www.dr-jan.com/tips/category/software/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dr-jan.com/tips</link>
	<description>Handy hints and techy tips from Dr Jan.</description>
	<pubDate>Sat, 08 Nov 2008 15:13:04 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Fedora 9 and KDE 4</title>
		<link>http://www.dr-jan.com/tips/2008/09/25/fedora-9-and-kde-4/</link>
		<comments>http://www.dr-jan.com/tips/2008/09/25/fedora-9-and-kde-4/#comments</comments>
		<pubDate>Thu, 25 Sep 2008 21:10:18 +0000</pubDate>
		<dc:creator>drjan</dc:creator>
		
		<category><![CDATA[email]]></category>

		<category><![CDATA[howto]]></category>

		<category><![CDATA[kde]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[macintosh]]></category>

		<category><![CDATA[software]]></category>

		<category><![CDATA[thunderbird]]></category>

		<category><![CDATA[tutorial]]></category>

		<category><![CDATA[unix]]></category>

		<category><![CDATA[clock]]></category>

		<category><![CDATA[dual-screen]]></category>

		<category><![CDATA[Fedora]]></category>

		<category><![CDATA[Fedora 9]]></category>

		<category><![CDATA[fuzzy clock]]></category>

		<category><![CDATA[KDE 4]]></category>

		<category><![CDATA[KDE 4.0]]></category>

		<category><![CDATA[KDE 4.1]]></category>

		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://www.dr-jan.com/tips/?p=48</guid>
		<description><![CDATA[I&#8217;ve recently upgraded my home PC from Fedora 8 to Fedora 9. One of the big benefits (apart from getting the very latest Firefox and Thunderbird packages) is that F9 features KDE 4, the latest version of the KDE desktop window manager.
Fedora 9
To upgrade, I followed the excellent instructions at http://www.gagme.com/greg/linux/f9-tips.php. The key point is [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently upgraded my home PC from Fedora 8 to <a href="http://fedoraproject.org/" onclick="javascript:urchinTracker ('/outbound/article/fedoraproject.org');">Fedora 9</a>. One of the big benefits (apart from getting the very latest Firefox and Thunderbird packages) is that F9 features <a href="http://www.kde.org/" onclick="javascript:urchinTracker ('/outbound/article/www.kde.org');">KDE 4</a>, the latest version of the KDE desktop window manager.</p>
<p><strong>Fedora 9</strong><br />
To upgrade, I followed the <em>excellent</em> instructions at <a href="http://www.gagme.com/greg/linux/f9-tips.php" onclick="javascript:urchinTracker ('/outbound/article/www.gagme.com');">http://www.gagme.com/greg/linux/f9-tips.php</a>. The key point is to use the &#8216;preupgrade&#8217; package to sort everything out:</p>
<p><code>yum -y install preupgrade<br />
preupgrade</code></p>
<p>This downloads new F9 versions of all the RPM packages you have on your system and then sets everything up so that when you re-boot your machine it will start F9.</p>
<p>It&#8217;s an excellent idea, and for me It Just Worked.</p>
<p><strong>KDE 4</strong><br />
KDE version 4 is all rather new. Initially I had version 4.0 installed. The biggest drawback to this version was the absence of the <a href="http://www.dr-jan.com/tips/2008/03/24/kde/" >Fuzzy Clock</a>. However, I&#8217;m pleased to say that on my first &#8216;yum update&#8217;, my system was upgraded to KDE 4.1, complete with Fuzzy Clock. Whilst version 4.0 was looking a bit rough round the edges, 4.1 is a far more polished affair.</p>
<p>One of the new features (on System Settings, Desktop, General tab) is the ability to &#8216;Enable desktop effects&#8217;, which makes the whole machine much more Mac-like in the prettyness of the desktop. However, I noticed that with this turned on, even when nothing else was running, I was using about 50% of my CPU power just to run the desktop. So I turned that off <img src='http://www.dr-jan.com/tips/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>The other annoyance in KDE4 was the lack of launch buttons on the panel for my favourite applications. This was really getting on my nerves until I realised that the default &#8216;tab&#8217; shown initially when clicking on the &#8216;K&#8217; menu button is the Favourites tab. To add things to the Favourites tab just find the application in the labyrinth of menus on the &#8216;K&#8217; menu, click it with the secondary mouse button and select &#8216;Add to Favourites&#8217; from the context-sensitive menu. Now all your favourite applications are just 2 clicks away on the &#8216;K&#8217; menu button.</p>
<p><strong>UPDATE:</strong> Neither KDE 4.0 nor KDE 4.1 can cope with dual screen display systems! I&#8217;ve seen comments that imply dual screen configurations are very rare and so fixing the problems is not a priority. Boo : -( See my comments below for details.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dr-jan.com/tips/2008/09/25/fedora-9-and-kde-4/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Units</title>
		<link>http://www.dr-jan.com/tips/2008/06/11/units/</link>
		<comments>http://www.dr-jan.com/tips/2008/06/11/units/#comments</comments>
		<pubDate>Tue, 10 Jun 2008 23:07:29 +0000</pubDate>
		<dc:creator>drjan</dc:creator>
		
		<category><![CDATA[howto]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[software]]></category>

		<category><![CDATA[tutorial]]></category>

		<category><![CDATA[unix]]></category>

		<category><![CDATA[units unix command-line]]></category>

		<guid isPermaLink="false">http://www.dr-jan.com/tips/?p=45</guid>
		<description><![CDATA[I was recently reminded of the excellent &#8216;units&#8217; program, available with all good Unix systems.
Units will convert quantities expressed in one unit in to another unit. Here&#8217;s an example:

$ units
2439 units, 71 prefixes, 33 nonlinear units
You have: 12 miles
You want: kilometres
        * 19.312128
      [...]]]></description>
			<content:encoded><![CDATA[<p>I was recently reminded of the excellent &#8216;units&#8217; program, available with all good Unix systems.</p>
<p>Units will convert quantities expressed in one unit in to another unit. Here&#8217;s an example:</p>
<p><code><br />
$ units<br />
2439 units, 71 prefixes, 33 nonlinear units</p>
<p>You have: 12 miles<br />
You want: kilometres<br />
        * 19.312128<br />
        / 0.051780933<br />
You have:<br />
</code></p>
<p>So, 12 miles is equivalent to 19.312128 kilometres. OK, that was an easy one to warm up with. Units knows about all kinds of arcane measures and can happily convert between them all. Here&#8217;s an example from the man page:</p>
<p><code><br />
$ units<br />
2439 units, 71 prefixes, 33 nonlinear units</p>
<p>You have: furlongs per fortnight<br />
You want: m/s<br />
        * 0.00016630952<br />
        / 6012.8848<br />
You have:<br />
</code></p>
<p>I actually needed to use units to find out my weight in kilos:<br />
<code><br />
$ units<br />
2439 units, 71 prefixes, 33 nonlinear units</p>
<p>You have: 20 stone + 1 lb<br />
You want: kilos<br />
conformability error<br />
        127.45946 kg<br />
        1000<br />
You have:<br />
</code></p>
<p>My goodness, <a href="http://www.dr-jan.com/newblog/2008/06/10/im_thin/" >that&#8217;s a large number</a>!</p>
<p>Units should be available in most versions of Unix and Linux - just get a terminal session (telnet or ssh for example) and type in &#8216;units&#8217;. As usual, read the manual page by typing &#8216;man units&#8217;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dr-jan.com/tips/2008/06/11/units/feed/</wfw:commentRss>
		</item>
		<item>
		<title>What&#39;s RSS, and why do I need it?</title>
		<link>http://www.dr-jan.com/tips/2008/01/16/whats-rss-and-why-do-i-need-it/</link>
		<comments>http://www.dr-jan.com/tips/2008/01/16/whats-rss-and-why-do-i-need-it/#comments</comments>
		<pubDate>Tue, 15 Jan 2008 23:30:09 +0000</pubDate>
		<dc:creator>drjan</dc:creator>
		
		<category><![CDATA[blogs]]></category>

		<category><![CDATA[howto]]></category>

		<category><![CDATA[software]]></category>

		<category><![CDATA[tutorial]]></category>

		<category><![CDATA[feed reader]]></category>

		<category><![CDATA[google reader]]></category>

		<category><![CDATA[rss]]></category>

		<category><![CDATA[syndication]]></category>

		<guid isPermaLink="false">http://www.dr-jan.com/tips/2008/01/16/whats-rss-and-why-do-i-need-it/</guid>
		<description><![CDATA[RSS is short for Really Simple Syndication. It&#8217;s an easy way to keep up to date with frequently changing websites.
Let me give you an example. This web page changes every time I write a new post (admittedly not that often). Rather than periodically checking this page for updates (or, more likely, forgetting all about it [...]]]></description>
			<content:encoded><![CDATA[<p>RSS is short for Really Simple Syndication. It&#8217;s an easy way to keep up to date with frequently changing websites.</p>
<p>Let me give you an example. This web page changes every time I write a new post (admittedly not <em>that</em> often). Rather than periodically checking this page for updates (or, more likely, forgetting all about it until a year later), you can subscribe to it using a feed aggregator or feed reader. Then, whenever I post a new article on this page, it will automatically appear in your feed reader shortly after I publish it.</p>
<p>OK, this may seem to be a bit of a convoluted way to keep up to date with Dr Jan&#8217;s Tips From The Top, but when you subscribe to a number of different blogs, the feed reader starts to make a lot more sense.</p>
<p>Below, I&#8217;ll go through setting up a feed reader and subscribing to various feeds.</p>
<p>Of course, there are a whole raft of different feed readers available for free download, as well as several which are entirely web-based. Personally, I use Google Reader.</p>
<p>To get started with Google Reader, open a new browser window and navigate to <a href="http://www.google.com/reader" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');">http://www.google.com/reader</a>. </p>
<p>If you already have a Google account, login, otherwise create a new account. Once you have logged in, you should see the &#8216;Welcome to Google Reader!&#8217; page. You can take the tour or watch the video for further information. Or you can jump right in and click on &#8216;Get started by adding subscriptions&#8217;.</p>
<p>You can select from the bundles that Google offers by default, or, if you have a particular feed in mind, just scroll down the page to the Search and Browse section. In the box, copy and paste this feed address:</p>
<p><code>http://www.dr-jan.com/tips/feed/</code></p>
<p>then click the &#8216;Search for feeds&#8217; button.</p>
<p>Google should find one matching feed, &#8216;Dr Jan&#8217;s Tips From The Top&#8217;. Click the &#8216;Subscribe&#8217; button and, once you see the message confirming your subscription, click on the &#8216;All items&#8217; link on the top left hand side of the screen. You&#8217;ll be taken to the main Google Reader screen with the most recent posts from this blog shown.</p>
<p>As you scroll down the screen, reading the posts, the current post will be highlighted with a blue border. When you move down to the next post, the one you&#8217;ve just finished with is automatically marked as &#8216;read&#8217;, so you won&#8217;t see that post again in the normal course of events.</p>
<p>You can easily add more subscriptions by clicking the &#8216;Add subscriptions&#8217; link.</p>
<p>Lots of websites use a small orange icon like this <img src="/tips/wp-includes/images/rss.png" alt="Standard RSS Icon." /> or one of these (shown enlarged for clarity):<br />
<img src="/pix/rss.jpg" alt="XML and RSS icons." /><br />
to indicate that a feed is available. Normally, you can wrong-click on the icon and select &#8216;Copy Link Location&#8217; or equivalent command, then paste the results into the Google Reader &#8216;Add subscriptions&#8217; box.</p>
<p>There are lots of feeds for things other than blogs. For example, BBC News is available as a feed. Check out <a href="http://news.bbc.co.uk/1/hi/help/3223484.stm" onclick="javascript:urchinTracker ('/outbound/article/news.bbc.co.uk');">this page</a> for an introduction to RSS feeds along with a list of some of the feeds available from the BBC.</p>
<p>If you&#8217;re searching for a job, most job sites will let you create a feed containing jobs which match your search criteria, so you&#8217;ll always know about the very latest jobs as they appear.</p>
<p>Just look out for those small orange icons and you&#8217;ll be surprised at what you can subscribe to with your feed reader <img src='http://www.dr-jan.com/tips/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dr-jan.com/tips/2008/01/16/whats-rss-and-why-do-i-need-it/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Disabling Thunderbird Addons</title>
		<link>http://www.dr-jan.com/tips/2007/12/31/disabling-thunderbird-addons/</link>
		<comments>http://www.dr-jan.com/tips/2007/12/31/disabling-thunderbird-addons/#comments</comments>
		<pubDate>Sun, 30 Dec 2007 23:48:58 +0000</pubDate>
		<dc:creator>drjan</dc:creator>
		
		<category><![CDATA[calendars]]></category>

		<category><![CDATA[email]]></category>

		<category><![CDATA[howto]]></category>

		<category><![CDATA[software]]></category>

		<category><![CDATA[unix]]></category>

		<category><![CDATA[add-ons]]></category>

		<category><![CDATA[google data provider]]></category>

		<category><![CDATA[lightning]]></category>

		<category><![CDATA[safe mode]]></category>

		<category><![CDATA[thunderbird]]></category>

		<guid isPermaLink="false">http://www.dr-jan.com/tips/2007/12/31/disabling-thunderbird-addons/</guid>
		<description><![CDATA[Today I was in the unfortunate position of not being able to use Thunderbird to read my email. I recently installed the Lightning calendar addon together with the Provider for Google Calendar addon. What&#8217;s supposed to happen is the calendar within Thunderbird (provided by the Lightning addon) is automatically updated from (and updates) my Google [...]]]></description>
			<content:encoded><![CDATA[<p>Today I was in the unfortunate position of not being able to use Thunderbird to read my email. I recently installed the Lightning calendar addon together with the Provider for Google Calendar addon. What&#8217;s supposed to happen is the calendar within Thunderbird (provided by the Lightning addon) is automatically updated from (and updates) my Google Calendars.</p>
<p>In practice, what happens is that when Thunderbird starts, not much happens until I get a popup dialog box telling me that a script on this page is taking a long time to finish. Even if I try and cancel the script, nothing responds until I manually kill off Thunderbird completely.</p>
<p>Which is a shame.</p>
<p>So, Dr Jan&#8217;s Tip From The Top for today is&#8230;</p>
<p>You can start Thunderbird with all addons disabled by using the command line:<br />
<code><br />
thunderbird -safe-mode<br />
</code></p>
<p>Once Thunderbird has started it&#8217;s then a simple matter to use the Addons screen to disable or uninstall the offending addon.</p>
<p>It seems that the problem for me was the Provider for Google Calendar addon. The Lightning calendar is excellent, and getting better at a good rate too. Unfortunately, without the Google Calendar synchronisation it&#8217;s not much use to me at the moment.</p>
<p>I&#8217;ll probably try again when a new version is released <img src='http://www.dr-jan.com/tips/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dr-jan.com/tips/2007/12/31/disabling-thunderbird-addons/feed/</wfw:commentRss>
		</item>
		<item>
		<title>FogBugz World Tour Comes To London</title>
		<link>http://www.dr-jan.com/tips/2007/11/09/fogbugz-world-tour-comes-to-london/</link>
		<comments>http://www.dr-jan.com/tips/2007/11/09/fogbugz-world-tour-comes-to-london/#comments</comments>
		<pubDate>Fri, 09 Nov 2007 17:56:27 +0000</pubDate>
		<dc:creator>drjan</dc:creator>
		
		<category><![CDATA[software]]></category>

		<category><![CDATA[evidence based scheduling]]></category>

		<category><![CDATA[fogbugz]]></category>

		<category><![CDATA[joel spolsky]]></category>

		<guid isPermaLink="false">http://www.dr-jan.com/tips/2007/11/09/fogbugz-world-tour-comes-to-london/</guid>
		<description><![CDATA[I attended the FogBugz 6.0 World Tour presentation this morning at the British Library in Euston Road, London. Joel Spolsky was the speaker and he made an excellent job of describing some of the funky new features in FogBugz 6.0.
The Evidence Based Scheduling (EBS) is sufficiently similar to witchcraft to warrant further investigation  Joel [...]]]></description>
			<content:encoded><![CDATA[<p>I attended the <a href="http://worldtour.fogbugz.com/" onclick="javascript:urchinTracker ('/outbound/article/worldtour.fogbugz.com');">FogBugz 6.0 World Tour</a> presentation this morning at the British Library in Euston Road, London. <a href="http://www.joelonsoftware.com/" onclick="javascript:urchinTracker ('/outbound/article/www.joelonsoftware.com');">Joel Spolsky</a> was the speaker and he made an excellent job of describing some of the funky new features in <a href="http://www.fogcreek.com/FogBUGZ/" onclick="javascript:urchinTracker ('/outbound/article/www.fogcreek.com');">FogBugz 6.0</a>.</p>
<p>The Evidence Based Scheduling (EBS) is sufficiently similar to witchcraft to warrant further investigation <img src='http://www.dr-jan.com/tips/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> Joel has a good explanation <a href="http://www.joelonsoftware.com/items/2007/10/26.html" onclick="javascript:urchinTracker ('/outbound/article/www.joelonsoftware.com');">here</a> - it&#8217;s a long article but well worth reading.</p>
<p>I&#8217;ll attempt a summary here, in case you can&#8217;t follow the link above. EBS tracks developer estimates of time required to complete code and compares this to the actual time used. From this data it can work out how effective your estimating skills are. It doesn&#8217;t matter if your estimates are inaccurate, but if you are consistently inaccurate (say, you always underestimate by 100%) this can be taken in to account quite easily. A bigger problem is inconsistently poor estimates, where sometimes the estimate is 12 times too small, other times it&#8217;s twice as big as it needs to be.</p>
<p>FogBugz collects all this data and uses the information to produce a probability curve of your likelihood of shipping code on a particular date.</p>
<p>Check the link for more details with pretty graphs and everything <img src='http://www.dr-jan.com/tips/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Crucial things to know are:</p>
<ol>
<li>You can sign up for a free 45-day evaluation of FogBugz on the website.</li>
<li>There is a (not yet publicised) Student and Startups edition (for up to 2 users) which is free. Hurrah!</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.dr-jan.com/tips/2007/11/09/fogbugz-world-tour-comes-to-london/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Remotely Controlling Your Music Player</title>
		<link>http://www.dr-jan.com/tips/2007/10/19/remotely-controlling-your-music-player/</link>
		<comments>http://www.dr-jan.com/tips/2007/10/19/remotely-controlling-your-music-player/#comments</comments>
		<pubDate>Fri, 19 Oct 2007 22:35:55 +0000</pubDate>
		<dc:creator>drjan</dc:creator>
		
		<category><![CDATA[N95]]></category>

		<category><![CDATA[howto]]></category>

		<category><![CDATA[music]]></category>

		<category><![CDATA[phones]]></category>

		<category><![CDATA[software]]></category>

		<category><![CDATA[dev]]></category>

		<category><![CDATA[gui]]></category>

		<category><![CDATA[python]]></category>

		<category><![CDATA[s60]]></category>

		<category><![CDATA[script]]></category>

		<category><![CDATA[snackAmp]]></category>

		<category><![CDATA[tcp socket]]></category>

		<category><![CDATA[tkinter]]></category>

		<category><![CDATA[unicode]]></category>

		<category><![CDATA[wi-fi]]></category>

		<category><![CDATA[x-windows]]></category>

		<guid isPermaLink="false">http://www.dr-jan.com/tips/2007/10/19/remotely-controlling-your-music-player/</guid>
		<description><![CDATA[I have recently programmed my Nokia N95 phone to control my music player (the rather marvellous snackAmp) remotely.
SnackAmp sits on my Linux-based server box. It has a remote control feature (details here) which accepts control strings from a TCP socket. I wrote a Python script which runs on the phone to open a Wi-Fi connection [...]]]></description>
			<content:encoded><![CDATA[<p>I have recently programmed my <a href="http://www.nseries.com/products/n95/index.html#l=products,n95" onclick="javascript:urchinTracker ('/outbound/article/www.nseries.com');">Nokia N95</a> phone to control my music player (the rather marvellous <a href="http://snackamp.sourceforge.net/" onclick="javascript:urchinTracker ('/outbound/article/snackamp.sourceforge.net');">snackAmp</a>) remotely.</p>
<p>SnackAmp sits on my Linux-based server box. It has a remote control feature (details <a href="http://snackamp.sourceforge.net/user_manual/um_api.html" onclick="javascript:urchinTracker ('/outbound/article/snackamp.sourceforge.net');">here</a>) which accepts control strings from a TCP socket. I wrote a Python script which runs on the phone to open a Wi-Fi connection to my music server and send simple commands to control it.</p>
<p>I was pleasantly surprised at just how easy all this turned out to be <img src='http://www.dr-jan.com/tips/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>First, I installed <a href="http://www.python.org/" onclick="javascript:urchinTracker ('/outbound/article/www.python.org');">Python</a>. This is available from the <a href="http://opensource.nokia.com/projects/pythonfors60/" onclick="javascript:urchinTracker ('/outbound/article/opensource.nokia.com');">Nokia Opensource site</a>. The N95 uses the 3rd edition of the S60 operating system, so I downloaded these files:</p>
<ul>
<li>PythonForS60_1_4_1_3rdEd.SIS
</li>
<li>PythonScriptShell_1_4_1_3rdEd.sis
</li>
</ul>
<p>Then I wrote a small Python script to open a TCP socket on the music server and send the appropriate text strings to control the music player.</p>
<p>The script (see below) first defines some handy functions. send_command actually sends the specified command to the music player. play, pause, stop, next and prev call the send_command function with the appropriate command text.</p>
<p>The main section of the script first checks if there are any command line parameters. If there are, it tries to immediately send the appropriate command and then exits.</p>
<p>If not, it discovers which operating system it is running on, and uses that information to execute one of two sections. The S60 section uses a standard Nokia list GUI widget to enable the user to select a command. The script sends the command and exits. Note that the Nokia GUI requires you to specify all strings as Unicode. Python does this by prefixing each string with &#8216;u&#8217; - for example, u&#8217;Pause&#8217;.</p>
<p>The Linux section uses the standard Python Tkinter GUI library to generate a small X-windows based window with push buttons to select commands. This part of the script uses a loop to allow multiple commands to be sent. The window is active until you select the Quit option.</p>
<p>Here is the script:</p>
<div id="script" class="code">
<pre>
#!/usr/bin/python
import socket
import sys
import string

def send_command(command):
        # opens a socket to snackAmp, sends the appropriate command and
        # closes the socket.

        # create a socket
        s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

        # connect to server
        host = '192.168.1.20' # server address - bletchley is 192.168.1.20
        port = 8775 # server port
        s.connect((host, port))

        s.send(command) # send command

        # close the connection
        s.close()

def prev():
        print 'previous...'
        send_command('xmms_remote_playlist_prev')

def pause():
        print 'pause...'
        send_command('xmms_remote_pause')

def play():
        print 'play...'
        send_command('xmms_remote_play')

def stop():
        print 'stop...'
        send_command('xmms_remote_stop')

def next():
        print 'next...'
        send_command('xmms_remote_playlist_next')

args = sys.argv[1:]     # don&#8217;t keep the program name
if len(args) > 0:
        for a in args:
                found = 0
                a = string.lower(a)
                if a == &#8216;pause&#8217;:
                        found = 1
                        pause()
                if a == &#8216;prev&#8217;:
                        found = 1
                        prev()
                if a == &#8216;play&#8217;:
                        found = 1
                        play()
                if a == &#8217;stop&#8217;:
                        found = 1
                        stop()
                if a == &#8216;next&#8217;:
                        found = 1
                        next()
                if found == 0:
                        print &#8220;Command not recognised. Currently implemented are pause, prev, play, stop, next.&#8221;
else:
        if sys.platform == &#8217;symbian_s60&#8242;:
                # we are running on a Nokia phone
                import appuifw  # access to the user interface framework
                menu = [u'Pause', u'Prev', u'Next', u'Play', u'Stop']
                index = appuifw.selection_list(choices=menu, search_field=0)

                if index == 0:
                        pause()

                if index == 1:
                        prev()

                if index == 2:
                        next()

                if index == 3:
                        play()

                if index == 4:
                        stop()
        else:
                # we are running on a standard computer (i.e. not a phone)
                from Tkinter import *

                class Application(Frame):
                        def __init__(self, master=None):
                                Frame.__init__(self, master)
                                self.grid()
                                self.createWidgets()

                        def createWidgets(self):
                                self.pauseButton = Button (self, text=&#8221;Pause&#8221;, underline = 0, command=pause)
                                self.pauseButton.grid(row=0, column=0, columnspan=4, sticky=E+W)
                                self.prevButton = Button (self, text=&#8221;Prev&#8221;, underline = 1, command=prev)
                                self.prevButton.grid(row=1, column=0)
                                self.playButton = Button (self, text=&#8221;Go&#8221;, underline = 0, command=play)
                                self.playButton.grid(row=1, column=1)
                                self.stopButton = Button (self, text=&#8221;Stop&#8221;, underline = 0, command=stop)
                                self.stopButton.grid(row=1, column=2)
                                self.nextButton = Button (self, text=&#8221;Next&#8221;, underline = 0, command=next)
                                self.nextButton.grid(row=1, column=3)
                                self.quitButton = Button (self, text=&#8221;Quit&#8221;, underline = 0, command=self.quit)
                                self.quitButton.grid(row=2, column=0, columnspan=4, sticky=E+W)

                app = Application()
                app.master.title(&#8221;snackAmp Control&#8221;)
                app.mainloop()
</pre>
</div>
<p>You&#8217;ll need to create the script in your favourite text editor on your PC and then transfer it to the phone. I used a USB cable to connect the phone to the PC and selected the mass storage option on the phone. Once the file is transferred, you&#8217;ll need to disconnect the USB cable so the phone can access the memory card again.</p>
<p>In theory you can use Bluetooth to transfer the script, but I&#8217;ve seen reports that it doesn&#8217;t work with S60 3rd edition. I don&#8217;t have Bluetooth on my Linux server, so I can&#8217;t tell you <img src='http://www.dr-jan.com/tips/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>In use, start Python on the phone, then run a script. Select the script name and the command list appears. Choose a command. The &#8216;Select access point&#8217; screen appears and I choose my Wi-Fi router connection. Then magic happens and the music obeys my commands <img src='http://www.dr-jan.com/tips/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dr-jan.com/tips/2007/10/19/remotely-controlling-your-music-player/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.825 seconds -->
