<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8877123</id><updated>2012-01-24T08:45:47.878Z</updated><category term='linux'/><category term='computational complexity'/><category term='grub'/><category term='javascript'/><category term='java'/><category term='programming'/><category term='development'/><category term='mount'/><category term='mac os x'/><category term='last.fm'/><category term='dvb'/><category term='mythtv'/><category term='upgrade'/><category term='equality'/><category term='xbmc'/><category term='NVIDIA'/><category term='google chrome'/><category term='stupidity'/><category term='twitter'/><category term='symbian'/><category term='samba'/><category term='lucid lynx'/><category term='ubuntu'/><category term='X11'/><category term='greasemonkey'/><category term='equals'/><title type='text'>The Wildebeest Plains</title><subtitle type='html'>100% guaranteed barren of any useful or interesting information.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://wildebeestplain.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8877123/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://wildebeestplain.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Toby Gray</name><uri>https://profiles.google.com/116466402565198528900</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-lIXtbL0DwRc/AAAAAAAAAAI/AAAAAAAACCk/vULuFMRIOfg/s512-c/photo.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>17</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8877123.post-9004140970404437674</id><published>2011-10-25T08:39:00.000+01:00</published><updated>2011-10-25T08:39:02.688+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='samba'/><category scheme='http://www.blogger.com/atom/ns#' term='mythtv'/><category scheme='http://www.blogger.com/atom/ns#' term='mount'/><title type='text'>Fixing Samba failing to find canonical path for autofs mounted share locations</title><content type='html'>Following on from &lt;a href="http://wildebeestplain.blogspot.com/2011/09/sharing-autofs-mount-point-over-samba.html"&gt;my previous post&lt;/a&gt; I was chatting with a friend and they pointed out that I could also make use of &lt;a href="http://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html#PREEXEC"&gt;&lt;tt&gt;preexec&lt;/tt&gt;&lt;/a&gt; to get my desired behaviour.&lt;br /&gt;&lt;br /&gt;So I removed the entries for &lt;tt&gt;wide links&lt;/tt&gt; and &lt;tt&gt;unix extensions&lt;/tt&gt; from my &lt;tt&gt;smb.conf&lt;/tt&gt;, allowing them to go back to being the default. I then changed my mythtv share to contain:&lt;br /&gt;&lt;pre&gt;[mythtv]&lt;br /&gt;        comment = Myth TV Recordings&lt;br /&gt;        path = /auto/mythtv&lt;br /&gt;        guest ok = Yes&lt;br /&gt;        preexec = ls /auto/mythtv&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This then solves the issue of Samba not allowing the share to be opened due to the "canonicalize_connect_path failed for service " error.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8877123-9004140970404437674?l=wildebeestplain.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wildebeestplain.blogspot.com/feeds/9004140970404437674/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8877123&amp;postID=9004140970404437674' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8877123/posts/default/9004140970404437674'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8877123/posts/default/9004140970404437674'/><link rel='alternate' type='text/html' href='http://wildebeestplain.blogspot.com/2011/10/fixing-samba-failing-to-find-canonical.html' title='Fixing Samba failing to find canonical path for autofs mounted share locations'/><author><name>Toby Gray</name><uri>https://profiles.google.com/116466402565198528900</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-lIXtbL0DwRc/AAAAAAAAAAI/AAAAAAAACCk/vULuFMRIOfg/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8877123.post-1910107911951180699</id><published>2011-09-27T08:10:00.000+01:00</published><updated>2011-10-18T08:58:41.384+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='samba'/><category scheme='http://www.blogger.com/atom/ns#' term='mythtv'/><category scheme='http://www.blogger.com/atom/ns#' term='mount'/><title type='text'>Sharing an autofs mount point over Samba</title><content type='html'>Since upgrading to Samba 2:3.5.11~dfsg-1 (or possibly slightly earlier) on my Debian based home server I found that some of the shares were no longer working. I could see them when browsing the network device, it just wouldn't let me access them.&lt;br /&gt;&lt;br /&gt;This seemed to only be happening to my Samba shares which were pointing directly at the root of an autofs mount point, which in my case was a mythtvfs mount at /auto/mythtv.&lt;br /&gt;&lt;br /&gt;What made this more puzzling was that if I ssh'ed into the machine then I could happily do &lt;br /&gt;&lt;pre&gt;ls /auto/mythtv&lt;/pre&gt;and see all my files. The final piece of the puzzle fitted into place when I realised that the Samba share would work if the mount was already mounted.&lt;br /&gt;&lt;br /&gt;A look at the samba logs indicated the following:&lt;br /&gt;&lt;pre&gt;smbd/service.c:988(make_connection_snum)&lt;br /&gt;  canonicalize_connect_path failed for service mythtv, path /auto/mythtv&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;On a hunch I tried the &lt;a href="http://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html#WIDELINKS"&gt;wide links&lt;/a&gt; option (which requires disabling &lt;a href="http://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html#WIDELINKS"&gt;unix extensions&lt;/a&gt;) by adding the following to the global section of my /etc/samba/smb.conf:&lt;br /&gt;&lt;pre&gt;[global]&lt;br /&gt;&lt;br /&gt;# Need to disable unix extensions and allow wide links to allow /auto to be mounted&lt;br /&gt;unix extensions = no&lt;br /&gt;wide links = yes&lt;br /&gt;&lt;/pre&gt;And then restarted samba with "/etc/init.d/samba restart". This then fixed the issue, allowing my autofs mount points to be mounted correctly. The big downside of this is that unix extensions which allow symlinks and hard links over samba are then disabled. If I get the time I might look into seeing if I can patch canonicalize_connect_path to work correctly with autofs mount points without exposing any security flaws.&lt;br /&gt;&lt;br /&gt;Possibly the most irritating thing about this issue was that searching for the terms "Samba" and "autofs" gives lots of hits for the other side of the situation; using autofs to mount Samba shares automatically.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8877123-1910107911951180699?l=wildebeestplain.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wildebeestplain.blogspot.com/feeds/1910107911951180699/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8877123&amp;postID=1910107911951180699' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8877123/posts/default/1910107911951180699'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8877123/posts/default/1910107911951180699'/><link rel='alternate' type='text/html' href='http://wildebeestplain.blogspot.com/2011/09/sharing-autofs-mount-point-over-samba.html' title='Sharing an autofs mount point over Samba'/><author><name>Toby Gray</name><uri>https://profiles.google.com/116466402565198528900</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-lIXtbL0DwRc/AAAAAAAAAAI/AAAAAAAACCk/vULuFMRIOfg/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8877123.post-1269528697108852589</id><published>2011-06-17T09:34:00.000+01:00</published><updated>2011-06-17T09:34:15.940+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='NVIDIA'/><category scheme='http://www.blogger.com/atom/ns#' term='xbmc'/><category scheme='http://www.blogger.com/atom/ns#' term='X11'/><title type='text'>Tearing screen even with VSyncing on NVIDIA ION</title><content type='html'>I've got a home media machine which I to watch MythTV and various online video streaming services. It's been annoying me for a while (possibly since I updated to Ubuntu 11.04) that there was tearing on the screen. It looked exactly like it wasn't vsyncing correctly, but I had vsyncing enabled in all the players I was trying.&lt;br /&gt;&lt;br /&gt;The machine I'm using is an Acer Revo with NVIDIA ION chipset, so it isn't the most powerful system. Searching the internet for 'tearing' turned up results which were mostly about people not being able to play 720p or 1080p videos. However that certainly wasn't my issue as I'd done all of the following:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Giving the graphics card 512MB of RAM (called UMA in the BIOS setting).&lt;/li&gt;&lt;li&gt;Enabling VDPAU acceleration.&lt;/li&gt;&lt;li&gt;Disabling the compiz window manager (selecting "Ubuntu classic (no effects)" as the session).&lt;/li&gt;&lt;li&gt;Setting &lt;tt&gt;export __GL_SYNC_TO_VBLANK=1&lt;/tt&gt; and ignoring issues with vsync occurring for the wrong display.&lt;/li&gt;&lt;li&gt;Checking the refresh rate was correctly setup with nvidia-settings utility.&lt;/li&gt;&lt;li&gt;Updating to the latest NVIDIA drivers&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;But none of this helped. I then realised that all rendering to the screen was suffering from this, not just video playback. I wondered if the ION couldn't handle the memory bandwidth, but turning down the resolution didn't help. I then thought that maybe it was my TV being a bit broken with HDMI, but testing that would require finding a VGA cable or moving a monitor downstairs, so I didn't try that.&lt;br /&gt;&lt;br /&gt;I even got to the point of thinking about installing Windows XP to see if it had the same issue and, if it didn't, giving up on Ubuntu. However after one last search I discovered a &lt;a href="http://forum.xbmc.org/showthread.php?t=64009"&gt;post on the XBMC forum&lt;/a&gt;. It contained the wisdom of adding the following to &lt;tt&gt;/etc/X11/xorg.conf&lt;/tt&gt;:&lt;br /&gt;&lt;pre&gt;Section "Extensions"&lt;br /&gt;    Option         "Composite" "Disable"&lt;br /&gt;EndSection&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;So I went ahead and did that, restarted X and all tearing was gone. I don't know where the bug is in the system, but I'm just glad of the ability in Linux to control things like this.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8877123-1269528697108852589?l=wildebeestplain.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wildebeestplain.blogspot.com/feeds/1269528697108852589/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8877123&amp;postID=1269528697108852589' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8877123/posts/default/1269528697108852589'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8877123/posts/default/1269528697108852589'/><link rel='alternate' type='text/html' href='http://wildebeestplain.blogspot.com/2011/06/tearing-screen-even-with-vsyncing-on.html' title='Tearing screen even with VSyncing on NVIDIA ION'/><author><name>Toby Gray</name><uri>https://profiles.google.com/116466402565198528900</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-lIXtbL0DwRc/AAAAAAAAAAI/AAAAAAAACCk/vULuFMRIOfg/s512-c/photo.jpg'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8877123.post-3864522768600750239</id><published>2011-05-16T09:04:00.000+01:00</published><updated>2011-05-16T09:04:19.282+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mythtv'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>MythTV not going fullscreen in Ubuntu 11.04 (Natty Narwhal)</title><content type='html'>Recently I started upgrading my various MythTV front-end machines to Ubuntu 11.04. I was disappointed to discover that the unity bar at the top of the screen is still there.&lt;br /&gt;&lt;br /&gt;In previous version of Ubuntu this would happen if you had the Appearance setting on anything other than basic (I forget exactly what it was called, but it was the first option in the last tab in the Appearance settings application).&lt;br /&gt;&lt;br /&gt;However in 11.04 the Appearance settings application no longer has this options (this appears to be due to 11.04 using the Compiz window manage if it's available).&lt;br /&gt;&lt;br /&gt;This is apparently a &lt;a href="https://bugs.launchpad.net/ubuntu/+source/mythtv/+bug/762679"&gt;well known issue&lt;/a&gt;, but luckily the fix is fairly simple. From &lt;a href="http://ubuntuforums.org/showthread.php?t=1743075&amp;page=2"&gt;here&lt;/a&gt; I discovered that it's just a case of installing the advanced appearance settings application (called CCSM) and selecting Utility-&amp;gt;Workaround-&amp;gt;Legacy Fullscreen Support.&lt;br /&gt;&lt;br /&gt;Quite what this workaround breaks and therefore why it isn't on by default isn't mentioned anywhere, but I'm happy for now as I can still watch TV.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8877123-3864522768600750239?l=wildebeestplain.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wildebeestplain.blogspot.com/feeds/3864522768600750239/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8877123&amp;postID=3864522768600750239' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8877123/posts/default/3864522768600750239'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8877123/posts/default/3864522768600750239'/><link rel='alternate' type='text/html' href='http://wildebeestplain.blogspot.com/2011/05/mythtv-not-going-fullscreen-in-ubuntu.html' title='MythTV not going fullscreen in Ubuntu 11.04 (Natty Narwhal)'/><author><name>Toby Gray</name><uri>https://profiles.google.com/116466402565198528900</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-lIXtbL0DwRc/AAAAAAAAAAI/AAAAAAAACCk/vULuFMRIOfg/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8877123.post-4379458571663339199</id><published>2011-04-23T21:36:00.000+01:00</published><updated>2011-04-23T21:36:44.164+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='twitter'/><category scheme='http://www.blogger.com/atom/ns#' term='google chrome'/><title type='text'>Updated Twitter Fixer</title><content type='html'>I've updated the &lt;a href="https://sites.google.com/site/wildebeestplains/twitter_column"&gt;twitter fixer user script&lt;/a&gt; so that now it doesn't cause some twitter information to be impossible to view. Previously if you clicked on a tweet or a twitter user to get further details then the box which contained the further details would be hidden on the right side of the screen.&lt;br /&gt;&lt;br /&gt;This new version fixes that issue by presenting it to you in (almost) full screen, in the middle of your display.&lt;br /&gt;&lt;br /&gt;If anyone sees any other issues then please let me know via a comment.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8877123-4379458571663339199?l=wildebeestplain.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wildebeestplain.blogspot.com/feeds/4379458571663339199/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8877123&amp;postID=4379458571663339199' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8877123/posts/default/4379458571663339199'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8877123/posts/default/4379458571663339199'/><link rel='alternate' type='text/html' href='http://wildebeestplain.blogspot.com/2011/04/updated-twitter-fixer.html' title='Updated Twitter Fixer'/><author><name>Toby Gray</name><uri>https://profiles.google.com/116466402565198528900</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-lIXtbL0DwRc/AAAAAAAAAAI/AAAAAAAACCk/vULuFMRIOfg/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8877123.post-4651800301472579687</id><published>2011-03-16T18:52:00.002Z</published><updated>2011-03-16T18:53:21.982Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='twitter'/><category scheme='http://www.blogger.com/atom/ns#' term='google chrome'/><title type='text'>Twitter Column Expander</title><content type='html'>A friend mentioned to me that they were annoyed with the way the new Twitter layout wasted lots of pixels to the left and the right of the timeline. So I knocked together a &lt;a href="http://sites.google.com/site/wildebeestplains/twitter_column"&gt; quick user script&lt;/a&gt; for Google Chrome to do this.&lt;br /&gt;&lt;br /&gt;I've had this sitting around for a while, but I've finally got around to setting up somewhere where I can put it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8877123-4651800301472579687?l=wildebeestplain.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wildebeestplain.blogspot.com/feeds/4651800301472579687/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8877123&amp;postID=4651800301472579687' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8877123/posts/default/4651800301472579687'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8877123/posts/default/4651800301472579687'/><link rel='alternate' type='text/html' href='http://wildebeestplain.blogspot.com/2011/03/twitter-column-expander.html' title='Twitter Column Expander'/><author><name>Toby Gray</name><uri>https://profiles.google.com/116466402565198528900</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-lIXtbL0DwRc/AAAAAAAAAAI/AAAAAAAACCk/vULuFMRIOfg/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8877123.post-1295216252899669815</id><published>2011-03-16T18:50:00.003Z</published><updated>2011-03-16T19:03:24.484Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><title type='text'>Newspaper Spin Javascript</title><content type='html'>Looking for any excuse to play around with javascript I've written &lt;a href="http://sites.google.com/site/wildebeestplains/newspaper_spinner"&gt;a newspaper spinning effect&lt;/a&gt; file which makes pages spin towards you like in the movies.&lt;br /&gt;&lt;br /&gt;You can get it to happen on any site by saving the following link as a bookmark (or dragging it to your bookmark bar) and clicking on it:&lt;br /&gt;&lt;a href="javascript:var s;s=document.createElement('script');s.src='http://sites.google.com/site/wildebeestplains/files/rotate_load.js';document.body.appendChild(s);void(0);"&gt;Newspaper Spin This!&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Turns out it's incredibly easy to do the transformations on the body element in HTML. It's just a case of setting the appropriate style value to the desired rotation amount.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8877123-1295216252899669815?l=wildebeestplain.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wildebeestplain.blogspot.com/feeds/1295216252899669815/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8877123&amp;postID=1295216252899669815' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8877123/posts/default/1295216252899669815'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8877123/posts/default/1295216252899669815'/><link rel='alternate' type='text/html' href='http://wildebeestplain.blogspot.com/2011/03/newspaper-spin-javascript.html' title='Newspaper Spin Javascript'/><author><name>Toby Gray</name><uri>https://profiles.google.com/116466402565198528900</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-lIXtbL0DwRc/AAAAAAAAAAI/AAAAAAAACCk/vULuFMRIOfg/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8877123.post-2579967692590704380</id><published>2011-01-31T08:57:00.000Z</published><updated>2011-01-31T08:57:54.555Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='greasemonkey'/><category scheme='http://www.blogger.com/atom/ns#' term='google chrome'/><title type='text'>User-scripts in Google Chrome aren't GreaseMonkey scripts</title><content type='html'>This weekend I was playing around with writing a &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/"&gt;GreaseMonkey&lt;/a&gt; script to force the new &lt;a href="http://twitter.com"&gt;Twitter&lt;/a&gt; layout to take up the full screen width for the list of tweets.&lt;br /&gt;&lt;br /&gt;What I expected to be a 5 minute job turned into an hour and a half. The main issue was that it turns out I wasn't writing a GreaseMonkey script. While the user-scripts in Google Chrome are very similar to GreaseMonkey scripts, they differ in how they handle security (as well as some other more minor differences such as no @require). Eventually I found a helpful &lt;a href="https://sites.google.com/a/chromium.org/dev/developers/design-documents/user-scripts"&gt;page on the Chromiumn wiki&lt;/a&gt; explaining the differences.&lt;br /&gt;&lt;br /&gt;For me the biggest difference was the absence of &lt;tt&gt;unsafeWindow&lt;/tt&gt;. The easiest way I found to workaround this limitation (which is just a sensible security protect) was to &lt;a href="http://erikvold.com/blog/index.cfm/2010/6/14/using-jquery-with-a-user-script"&gt;inject the javascript to execute into the document&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The resulting code isn't pretty and is a little harder to debug, but it works and I now don't have large areas of blank screen space when using Twitter.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8877123-2579967692590704380?l=wildebeestplain.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wildebeestplain.blogspot.com/feeds/2579967692590704380/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8877123&amp;postID=2579967692590704380' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8877123/posts/default/2579967692590704380'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8877123/posts/default/2579967692590704380'/><link rel='alternate' type='text/html' href='http://wildebeestplain.blogspot.com/2011/01/user-scripts-in-google-chrome-arent.html' title='User-scripts in Google Chrome aren&apos;t GreaseMonkey scripts'/><author><name>Toby Gray</name><uri>https://profiles.google.com/116466402565198528900</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-lIXtbL0DwRc/AAAAAAAAAAI/AAAAAAAACCk/vULuFMRIOfg/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8877123.post-4340296827187061538</id><published>2011-01-31T08:45:00.000Z</published><updated>2011-01-31T08:45:13.768Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='samba'/><category scheme='http://www.blogger.com/atom/ns#' term='mythtv'/><category scheme='http://www.blogger.com/atom/ns#' term='mount'/><title type='text'>MythTV and network mounts</title><content type='html'>After setting up a MythTv 0.24 frontend to use a samba share for files from the backend I discovered that I could no longer watch live TV on it. If I tried to watch live TV there would just be a pause and then a "&lt;tt&gt;Error opening jump program file buffer&lt;/tt&gt;" error message. Looking in the output on stdout wasn't much more helpful, with "&lt;tt&gt;Error: Took more than 10 seconds to be allowed to read, aborting&lt;/tt&gt;" being about the only meaningful message.&lt;br /&gt;&lt;br /&gt;It took me ages to track down that the problem is with cached IO on the network share. If the CIFS file system is caching the inode information (which includes the size attributes), then the MythTv frontend thinks that no live TV is being streamed and gives up after a while.&lt;br /&gt;&lt;br /&gt;The solution to this is to add the 'directio' option when mounting the network partition (e.g. '&lt;tt&gt;-o directio&lt;/tt&gt;' on the command line). If it's an NFS share then an alternative is to use '&lt;tt&gt;forcedirectio&lt;/tt&gt;' in the &lt;tt&gt;/etc/exports&lt;/tt&gt; on the server (which is useful if you don't want to change all your MythTv frontends).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8877123-4340296827187061538?l=wildebeestplain.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wildebeestplain.blogspot.com/feeds/4340296827187061538/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8877123&amp;postID=4340296827187061538' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8877123/posts/default/4340296827187061538'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8877123/posts/default/4340296827187061538'/><link rel='alternate' type='text/html' href='http://wildebeestplain.blogspot.com/2011/01/mythtv-and-network-mounts.html' title='MythTV and network mounts'/><author><name>Toby Gray</name><uri>https://profiles.google.com/116466402565198528900</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-lIXtbL0DwRc/AAAAAAAAAAI/AAAAAAAACCk/vULuFMRIOfg/s512-c/photo.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8877123.post-673042771925682668</id><published>2011-01-28T08:57:00.000Z</published><updated>2011-01-28T08:57:35.769Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='upgrade'/><category scheme='http://www.blogger.com/atom/ns#' term='mythtv'/><title type='text'>Upgrading MythTV 0.23 to 0.24 on Ubuntu</title><content type='html'>I recently upgraded MythTV 0.23 to 0.24 on both my backend (Debian testing) and the various front ends I use (Ubuntu with Mythbuntu auto-builds/MythTV-Updates).&lt;br /&gt;&lt;br /&gt;Everything went smoothly until I tried to watch some TV or recordings from within the frontends. The video would playback at about half speed and with no audio.&lt;br /&gt;&lt;br /&gt;After a while I managed to figure out that the problem was caused by using the default audio device. To fix this just update the audio device (in the frontend settings) to point to your actual audio device.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8877123-673042771925682668?l=wildebeestplain.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wildebeestplain.blogspot.com/feeds/673042771925682668/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8877123&amp;postID=673042771925682668' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8877123/posts/default/673042771925682668'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8877123/posts/default/673042771925682668'/><link rel='alternate' type='text/html' href='http://wildebeestplain.blogspot.com/2011/01/upgrading-mythtv-023-to-024-on-ubuntu.html' title='Upgrading MythTV 0.23 to 0.24 on Ubuntu'/><author><name>Toby Gray</name><uri>https://profiles.google.com/116466402565198528900</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-lIXtbL0DwRc/AAAAAAAAAAI/AAAAAAAACCk/vULuFMRIOfg/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8877123.post-8570778171175619982</id><published>2011-01-22T21:02:00.000Z</published><updated>2011-01-22T21:02:47.862Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='dvb'/><category scheme='http://www.blogger.com/atom/ns#' term='mythtv'/><title type='text'>Getting dual tuner KWorld U399 USB DVB-T working on linux 2.6.37</title><content type='html'>I recently upgraded the kernel version on my &lt;a href=http://www.mythtv.org/""&gt;MythTV&lt;/a&gt;. One side affect of this was that the second tuner for my DVB-T USB stick (an af9015 based KWorld U399) no longer existed in &lt;tt&gt;/dev/dvb&lt;/tt&gt;. In previous versions of the af9015 module it was just a case of explicitly enabling it with a module parameter of &lt;tt&gt;dual_mode=1&lt;/tt&gt; and possibly suffering some reception issues when both tuners are enabled.&lt;br /&gt;&lt;br /&gt;To get the second tuner working it's necessary to use the very latest firmware for the device. So download the firmware file from &lt;a href="http://palosaari.fi/linux/v4l-dvb/firmware/af9015/5.1.0.0/"&gt;here&lt;/a&gt; and place it in &lt;tt&gt;/lib/firmware&lt;/tt&gt;. From a quick look at the &lt;a href="http://lxr.linux.no/linux+v2.6.37/drivers/media/dvb/dvb-usb/af9015.c#L838"&gt;source code&lt;/a&gt; for af9015 it looks like the driver now checks a value in the EEPROM to see if dual mode is safe or not. I assume the clever developer for the af9015 driver has worked out that this is what determines if there will be reception issues with both tuners enabled and that the 5.1.0.0 firmware updates this EEPROM in a suitable way.&lt;br /&gt;&lt;br /&gt;You'll need to &lt;b&gt;unplug&lt;/b&gt; your USB stick and replug it in to get it to use the new firmware, but you should then get two DVB tuners.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8877123-8570778171175619982?l=wildebeestplain.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wildebeestplain.blogspot.com/feeds/8570778171175619982/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8877123&amp;postID=8570778171175619982' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8877123/posts/default/8570778171175619982'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8877123/posts/default/8570778171175619982'/><link rel='alternate' type='text/html' href='http://wildebeestplain.blogspot.com/2011/01/getting-dual-tuner-kworld-u399-usb-dvb.html' title='Getting dual tuner KWorld U399 USB DVB-T working on linux 2.6.37'/><author><name>Toby Gray</name><uri>https://profiles.google.com/116466402565198528900</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-lIXtbL0DwRc/AAAAAAAAAAI/AAAAAAAACCk/vULuFMRIOfg/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8877123.post-4951924626371585251</id><published>2010-09-16T18:56:00.000+01:00</published><updated>2010-09-16T18:56:09.146+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='grub'/><category scheme='http://www.blogger.com/atom/ns#' term='mac os x'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><category scheme='http://www.blogger.com/atom/ns#' term='stupidity'/><title type='text'>Accidentally installing Grub to /dev/sda on a Mac OS X machine</title><content type='html'>I managed to accidentally install GRUB to /dev/sda when setting up my MacBookPro to boot Ubuntu, WinXP and Mac OS X. I knew I shouldn't have, but I wasn't paying attention to the installer when it asked me. In my defence I was also slightly rushed as I wanted to get the installation running before I went to the pub...&lt;br /&gt;&lt;br /&gt;Anyway after much hunting and not being able to boot Linux or Windows XP, I finally discovered the solution in &lt;a href="http://claytron.com/blog/2009/09/20/macbook-pro-triple-boot-with-arch-linux-xp-and-os-x"&gt;this blog post&lt;/a&gt;. The author had, like me, managed to ignore all the warnings. Luckily recovery is just a simple case of sticking in the Mac OS X install CD, booting off it and running "fdisk -u /dev/rdisk0" in terminal. This will then restore the Mac OS X MBR to it's proper state.&lt;br /&gt;&lt;br /&gt;I did get a warning about not being able to find an MBR file, but it still let me update the MBR and it all seems to be working anyway. As well as fixing Linux and Windows XP booting (which previously would just sit there with a blinking cursor in the top left) it also fixed the slightly annoying issue of rEFIT having a 'Boot Linux from HD' option which I couldn't get rid of.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8877123-4951924626371585251?l=wildebeestplain.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wildebeestplain.blogspot.com/feeds/4951924626371585251/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8877123&amp;postID=4951924626371585251' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8877123/posts/default/4951924626371585251'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8877123/posts/default/4951924626371585251'/><link rel='alternate' type='text/html' href='http://wildebeestplain.blogspot.com/2010/09/accidentally-installing-grub-to-devsda.html' title='Accidentally installing Grub to /dev/sda on a Mac OS X machine'/><author><name>Toby Gray</name><uri>https://profiles.google.com/116466402565198528900</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-lIXtbL0DwRc/AAAAAAAAAAI/AAAAAAAACCk/vULuFMRIOfg/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8877123.post-1991178031044027971</id><published>2010-08-24T08:46:00.000+01:00</published><updated>2010-08-24T08:46:25.193+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='computational complexity'/><title type='text'>Packing is Hard</title><content type='html'>Recently there has been some talk about a computer science problem and a, possible, proof that &lt;a href="http://arstechnica.com/science/news/2010/08/new-proof-unlocks-answer-to-the-p-versus-np-problemmaybe.ars"&gt;P doesn't equal NP&lt;/a&gt;. The proof of if P and NP are the same is one which I think that every computer science student must have a vague suspicion that they could prove when they first hear about it in their computational complexity course. Perhaps as a consequence of this, undergrads are told that they're not going to work it out as "lots of very clever people have tried to show it and failed".&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.flickr.com/photos/mismisimos/2681381371/" title="Good for one week of backpacking? by mismisimos, on Flickr"&gt;&lt;img src="http://farm4.static.flickr.com/3084/2681381371_0898f0f66b_m.jpg" width="240" height="180" alt="Good for one week of backpacking?" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;As an aside, the work around showing P and NP being different or the same is a great example of the scientific method at it's best: all the experts generally agree that P isn't the same as NP, but that doesn't stop them from going through any proof which concurs with that belief with a fine-tooth comb. There is a such a clear separation of believe and the need for formal proof that there's a &lt;a href="http://www.claymath.org/millennium/P_vs_NP/"&gt;$1 million dollar prize&lt;/a&gt; available for a proof that shows P is the same as or different to NP.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.flickr.com/photos/kris247/119813344/" title="What's In My Bag by kris247, on Flickr"&gt;&lt;img src="http://farm1.static.flickr.com/43/119813344_f11d15a51e_m.jpg" width="240" height="180" alt="What's In My Bag - a Photo of the contents of a backpack, including spade and bottle of alcohol" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Given that few of us are likely to win that prize, why should everyday people care about if P is the same as NP. The simple answer is that it is applicable to many everyday problems, such as packing a bag. NP stands for 'nondeterministic polynomial time' which is a very complex way of saying that, when given a solution to an NP problem, you can easily show it is a correct solution to the problem. In the case of packing a bag this is as simple as seeing that they've fitted all the items into the bag.&lt;br /&gt;&lt;br /&gt;A problem which is 'P' is a 'polynomial time problem', which is to say that finding a solution from scratch is as easy to find as showing that a solution is correct to an NP problem. So if it was to be shown that P problems are not the same as NP problems then it would confirm that it really is sometimes easier to solve a problem when you've got the solution.&lt;br /&gt;&lt;br /&gt;On the other hand, showing that P isn't the same as NP doesn't help practical everyday computing. The vast majority of polynomial time problems still take too long to solve with current computing technology, so all a proof would show is that there are very very hard problems as well as very hard problems. Most importantly, showing P isn't the same as NP certainly won't stop your word processor crashing when you've forgotten to save for 10 minutes.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8877123-1991178031044027971?l=wildebeestplain.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wildebeestplain.blogspot.com/feeds/1991178031044027971/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8877123&amp;postID=1991178031044027971' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8877123/posts/default/1991178031044027971'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8877123/posts/default/1991178031044027971'/><link rel='alternate' type='text/html' href='http://wildebeestplain.blogspot.com/2010/08/packing-is-hard.html' title='Packing is Hard'/><author><name>Toby Gray</name><uri>https://profiles.google.com/116466402565198528900</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-lIXtbL0DwRc/AAAAAAAAAAI/AAAAAAAACCk/vULuFMRIOfg/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://farm4.static.flickr.com/3084/2681381371_0898f0f66b_t.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8877123.post-1656905651778835894</id><published>2010-05-23T18:29:00.001+01:00</published><updated>2010-05-26T13:32:19.197+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='last.fm'/><category scheme='http://www.blogger.com/atom/ns#' term='lucid lynx'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>Last.fm on Ubuntu Lucid Lynx (10.04)</title><content type='html'>Having recently got a nice shiny new netbook (an HP/Compaq 311c) I was trying to get &lt;a href="http://last.fm/"&gt;last.fm&lt;/a&gt; to compile on it. My netbook was running a reasonably fresh install of &lt;a href="https://wiki.ubuntu.com/LucidLynx"&gt;Ubuntu Lucid Lynx (10.04)&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;So I downloaded the source for last.fm-1.4.2.58240 and unzipped it into my source directory. Knowing that it needed qt4 I then ran:&lt;br /&gt;&lt;tt&gt;sudo apt-get install libqt4-dev&lt;/tt&gt;&lt;br /&gt;&lt;br /&gt;With that all installed I tried running &lt;tt&gt;./configure&lt;/tt&gt; in the source directory and it said everything was fine, so I went ahead and typed &lt;tt&gt;make&lt;/tt&gt;.&lt;br /&gt;&lt;br /&gt;After waiting while it compiled I was then greeted by the following error:&lt;br /&gt;&lt;tt&gt;make[1]: Entering directory `/home/marvin/src/last.fm-1.4.2.58240/src/libFingerprint/fplib/pro_qmake'&lt;br /&gt;g++ -c -pipe -O2 -w -fPIC -DNBREAKPAD -DLINUX -DNDEBUG -I/usr/share/qt4/mkspecs/linux-g++ -I. -I../../../../src -I../../../../build -I../../../libMoose -I../../../libUnicorn -I../include -I../src -I../../libs/fftw/src/api -I../../../../res/libsamplerate -o ../../../../build/fplib/release/FingerprintExtractor.o ../src/FingerprintExtractor.cpp&lt;br /&gt;../src/FingerprintExtractor.cpp: In member function ‘bool fingerprint::FingerprintExtractor::process(const short int*, size_t, bool)’:&lt;br /&gt;../src/FingerprintExtractor.cpp:445: error: ‘memcpy’ was not declared in this scope&lt;br /&gt;make[1]: *** [../../../../build/fplib/release/FingerprintExtractor.o] Error 1&lt;br /&gt;make[1]: Leaving directory `/home/marvin/src/last.fm-1.4.2.58240/src/libFingerprint/fplib/pro_qmake'&lt;br /&gt;make: *** [sub-src-libFingerprint-fplib-pro_qmake-fplib-pro-make_default-ordered] Error 2&lt;br /&gt;marvin@Anjie:~/src/last.fm-1.4.2.58240$ &lt;br /&gt;&lt;/tt&gt;&lt;br /&gt;&lt;br /&gt;Knowing that &lt;a href="http://www.cplusplus.com/reference/clibrary/cstring/memcpy/"&gt;memcpy&lt;/a&gt; is part of the standard C library I thought this seemed a little strange. So I opened up &lt;tt&gt;last.fm-1.4.2.58240/src/libFingerprint/fplib/src/FingerprintExtractor.cpp&lt;/tt&gt; and added the following line in bold:&lt;br /&gt;&lt;tt&gt;#include &amp;lt;cmath&amp;gt;&lt;br /&gt;&lt;b&gt;#include &amp;lt;string.h&amp;gt;&lt;/b&gt;&lt;br /&gt;&lt;/tt&gt;&lt;br /&gt;Then recompiled.&lt;br /&gt;&lt;br /&gt;The next error was the following:&lt;br /&gt;&lt;tt&gt;g++ -c -pipe -O2 -w -fPIC -DNBREAKPAD -DLINUX -DNDEBUG -I/usr/share/qt4/mkspecs/linux-g++ -I. -I../../../../src -I../../../../build -I../../../libMoose -I../../../libUnicorn -I../include -I../src -I../../libs/fftw/src/api -I../../../../res/libsamplerate -o ../../../../build/fplib/release/OptFFT.o ../src/OptFFT.cpp&lt;br /&gt;../src/OptFFT.cpp: In constructor ‘fingerprint::OptFFT::OptFFT(size_t)’:&lt;br /&gt;../src/OptFFT.cpp:262: error: ‘exit’ was not declared in this scope&lt;br /&gt;make[1]: *** [../../../../build/fplib/release/OptFFT.o] Error 1&lt;br /&gt;make[1]: Leaving directory `/home/marvin/src/last.fm-1.4.2.58240/src/libFingerprint/fplib/pro_qmake'&lt;br /&gt;make: *** [sub-src-libFingerprint-fplib-pro_qmake-fplib-pro-make_default-ordered] Error 2&lt;br /&gt;marvin@Anjie:~/src/last.fm-1.4.2.58240$ &lt;br /&gt;&lt;/tt&gt;&lt;br /&gt;&lt;br /&gt;Which I fixed by editing &lt;tt&gt;last.fm-1.4.2.58240/src/libFingerprint/fplib/src/OptFFT.cpp&lt;/tt&gt; to include the line in bold:&lt;br /&gt;&lt;tt&gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;#include &amp;lt;memory.h&amp;gt; // for memcopy&lt;br /&gt;&lt;b&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;/b&gt;&lt;br /&gt;&lt;/tt&gt;&lt;br /&gt;And then once again ran make.&lt;br /&gt;&lt;br /&gt;The next error was:&lt;br /&gt;&lt;tt&gt;g++ -c -pipe -O2 -w -D_REENTRANT -fPIC -DNBREAKPAD -DLINUX -DQT_NO_DEBUG -DQT_SQL_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtSql -I/usr/include/qt4 -I../../src -I../../build -I../libMoose -I../libUnicorn -Ifplib/include -I../src/ -I../../res/mad -I../../build/LastFmFingerprint/release -o ../../build/LastFmFingerprint/release/MP3_Source_Qt.o MP3_Source_Qt.cpp&lt;br /&gt;MP3_Source_Qt.cpp: In function ‘short int f2s(mad_fixed_t)’:&lt;br /&gt;MP3_Source_Qt.cpp:70: error: ‘SHRT_MAX’ was not declared in this scope&lt;br /&gt;MP3_Source_Qt.cpp:72: error: ‘SHRT_MAX’ was not declared in this scope&lt;br /&gt;MP3_Source_Qt.cpp: In member function ‘virtual void MP3_Source::skipSilence(double)’:&lt;br /&gt;MP3_Source_Qt.cpp:379: error: ‘abs’ was not declared in this scope&lt;br /&gt;MP3_Source_Qt.cpp:385: error: ‘abs’ was not declared in this scope&lt;br /&gt;make[1]: *** [../../build/LastFmFingerprint/release/MP3_Source_Qt.o] Error 1&lt;br /&gt;make[1]: Leaving directory `/home/marvin/src/last.fm-1.4.2.58240/src/libFingerprint'&lt;br /&gt;make: *** [sub-src-libFingerprint-make_default-ordered] Error 2&lt;br /&gt;&lt;/tt&gt;&lt;br /&gt;&lt;br /&gt;So I opened &lt;tt&gt;last.fm-1.4.2.58240/src/libFingerprint/MP3_Source_Qt.cpp&lt;/tt&gt; and added the lines in bold:&lt;br /&gt;&lt;tt&gt;#include &amp;lt;cassert&amp;gt;&lt;br /&gt;#include &amp;lt;stdexcept&amp;gt;&lt;br /&gt;&lt;b&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;#include &amp;lt;limits.h&amp;gt;&lt;/b&gt;&lt;br /&gt;&lt;/tt&gt;&lt;br /&gt;&lt;br /&gt;And ran make once more.&lt;br /&gt;&lt;br /&gt;This time it was a linking error:&lt;br /&gt;&lt;tt&gt;g++ -Wl,-O1 -shared -Wl,-soname,libLastFmFingerprint.so.1 -o libLastFmFingerprint.so.1.0.0 ../../build/LastFmFingerprint/release/Sha256File.o ../../build/LastFmFingerprint/release/Sha256.o ../../build/LastFmFingerprint/release/MP3_Source_Qt.o ../../build/LastFmFingerprint/release/Fingerprinter2.o ../../build/LastFmFingerprint/release/FingerprintCollector.o ../../build/LastFmFingerprint/release/FingerprintQueryer.o ../../build/LastFmFingerprint/release/moc_Fingerprinter2.o ../../build/LastFmFingerprint/release/moc_FingerprintCollector.o ../../build/LastFmFingerprint/release/moc_FingerprintQueryer.o   -L/home/marvin/src/last.fm-1.4.2.58240/bin -L/home/marvin/src/last.fm-1.4.2.58240/build/LastFmFingerprint/../fplib -L/usr/lib -lMoose -L/home/marvin/src/last.fm-1.4.2.58240/bin -lLastFmTools /home/marvin/src/last.fm-1.4.2.58240/build/fplib/libfplib.a -lsamplerate -lfftw3f -lQtSql -lQtXml -lQtGui -lQtNetwork -lQtCore -lpthread  &lt;br /&gt;/usr/bin/ld: cannot find -lsamplerate&lt;br /&gt;collect2: ld returned 1 exit status&lt;br /&gt;make[1]: *** [../../bin/libLastFmFingerprint.so.1.0.0] Error 1&lt;br /&gt;make[1]: Leaving directory `/home/marvin/src/last.fm-1.4.2.58240/src/libFingerprint'&lt;br /&gt;make: *** [sub-src-libFingerprint-make_default-ordered] Error 2&lt;br /&gt;marvin@Anjie:~/src/last.fm-1.4.2.58240$&lt;br /&gt;&lt;/tt&gt;&lt;br /&gt;&lt;br /&gt;So I ran &lt;tt&gt;sudo apt-get install libsamplerate0 libsamplerate0-dev libfftw3-dev libfftw3-3 libmad0-dev libmad0 libgpod-dev libgpod4 libasound2-dev&lt;/tt&gt; and then ran make again.&lt;br /&gt;&lt;br /&gt;If you're wondering how I came up with all the libraries above, it was just from running make several times and then using apt-cache search to search for the missing libraries. I didn't include these steps as they're a bit tedious.&lt;br /&gt;&lt;br /&gt;Having done all that it's possible to run last.fm with &lt;tt&gt;bin/last.fm.sh&lt;/tt&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8877123-1656905651778835894?l=wildebeestplain.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wildebeestplain.blogspot.com/feeds/1656905651778835894/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8877123&amp;postID=1656905651778835894' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8877123/posts/default/1656905651778835894'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8877123/posts/default/1656905651778835894'/><link rel='alternate' type='text/html' href='http://wildebeestplain.blogspot.com/2010/05/lastfm-on-ubuntu-lucid-lynx-1004.html' title='Last.fm on Ubuntu Lucid Lynx (10.04)'/><author><name>Toby Gray</name><uri>https://profiles.google.com/116466402565198528900</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-lIXtbL0DwRc/AAAAAAAAAAI/AAAAAAAACCk/vULuFMRIOfg/s512-c/photo.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8877123.post-1425907877019402804</id><published>2010-03-04T09:32:00.000Z</published><updated>2010-03-04T09:32:31.958Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='equality'/><category scheme='http://www.blogger.com/atom/ns#' term='equals'/><title type='text'>Not all equals are born equal</title><content type='html'>The relationship between two things is something that we learn early in life. It's quite an important thing to know about, especially for understanding the world we live in.&lt;br /&gt;&lt;br /&gt;However the question of 'are these the same' or 'are these equal' is surprisingly tricky. It might immediately seem rather obvious, but in actual fact there is a surprising amount of complex mathematics to do with &lt;a href="http://en.wikipedia.org/wiki/Equality_%28mathematics%29"&gt;equality&lt;/a&gt; and how you define it. As it turns out there are quite a few ways of saying that things are the same, leading to a description of all the different ways of comparing things being called an &lt;a href="http://en.wikipedia.org/wiki/Equivalence_relation"&gt;Equivalence relationship&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Equivalence relationships have three key properties:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;&lt;a href="http://en.wikipedia.org/wiki/Reflexive_relation"&gt;Reflexive&lt;/a&gt;&lt;/b&gt; - That everything is equal to itself.&lt;/li&gt;&lt;li&gt;&lt;b&gt;&lt;a href="http://en.wikipedia.org/wiki/Symmetric_relation"&gt;Symmetric&lt;/a&gt;&lt;/b&gt; - That if object A is equal to thing B then thing B must be equal to object A.&lt;/li&gt;&lt;li&gt;&lt;b&gt;&lt;a href="http://en.wikipedia.org/wiki/Transitive_relation"&gt;Transitive&lt;/a&gt;&lt;/b&gt; - That if A equals B and B equals C then A must equal C.&lt;/li&gt;&lt;/ul&gt;All of which might seem rather obvious, but mathematicians like to flip-flop between stating the massively obvious and the painfully complex.&lt;br /&gt;&lt;br /&gt;For example consider the following:&lt;br /&gt;&lt;table style="text-align:center;"&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;a href="http://www.flickr.com/photos/freewildebeest/526702620/" title="Maisy by Free Wildebeest, on Flickr"&gt;&lt;img src="http://farm2.static.flickr.com/1171/526702620_e7aead9680.jpg" width="200" alt="Maisy" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style="font-size:x-large;"&gt;&lt;b&gt;=&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;a href="http://www.flickr.com/photos/freewildebeest/526702620/" title="Maisy by Free Wildebeest, on Flickr"&gt;&lt;img src="http://farm2.static.flickr.com/1171/526702620_e7aead9680.jpg" width="200" alt="Maisy" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;Quite clearly, for most sensible definitions of equality these will be the same; mostly due to them being identical.&lt;br /&gt;&lt;br /&gt;Where it starts to get tricky is if there is some variation between the two things being compared. Initially the answer to this might appear to be "no, they aren't equal", but consider the following:&lt;br /&gt;&lt;table style="text-align:center;"&gt;&lt;tr&gt;&lt;td width="220"&gt;&lt;br /&gt;&lt;a href="http://www.flickr.com/photos/freewildebeest/526702620/" title="Maisy by Free Wildebeest, on Flickr"&gt;&lt;img src="http://farm2.static.flickr.com/1171/526702620_e7aead9680.jpg" width="200" alt="Maisy" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style="font-size:x-large;"&gt;&lt;b&gt;=&lt;/b&gt;&lt;/td&gt;&lt;td width="220"&gt;&lt;br /&gt;&lt;a href="http://www.flickr.com/photos/freewildebeest/526702620/" title="Maisy by Free Wildebeest, on Flickr"&gt;&lt;img src="http://farm2.static.flickr.com/1171/526702620_e7aead9680.jpg" width="133" height="200" alt="Maisy" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;If you took a poll of people to ask if these two were equal you'd probably come up with the following options in some proportion:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Yes, it's the same image.&lt;/li&gt;&lt;li&gt;Yes, apart from one is a bit distorted.&lt;/li&gt;&lt;li&gt;No, they look different.&lt;/li&gt;&lt;/ul&gt;All of which are acceptable answers, it just depends on how you define equality. The first answer assumes the comparison is about the contents of the image rather than how it's presented. The second answer is the middle ground, acknowledging that the images are the same but that there is a different in how they a presented. The final answer is the other extreme, the pictures aren't the same so they're not equal.&lt;br /&gt;&lt;br /&gt;This all ties in very deeply with one of the foundations of computer science; the distinction between comparing the concept represented by some data and the data itself. A clearer example of the distinction here would be to use two pictures where the idea of equality is even more fuzzy.&lt;br /&gt;&lt;table style="text-align:center;"&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;a href="http://www.flickr.com/photos/freewildebeest/526702620/" title="Maisy by Free Wildebeest, on Flickr"&gt;&lt;img src="http://farm2.static.flickr.com/1171/526702620_e7aead9680.jpg" width="200" alt="Maisy" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style="font-size:x-large;"&gt;&lt;b&gt;=&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;a href="http://www.flickr.com/photos/freewildebeest/526784815/" title="Maisy by Free Wildebeest, on Flickr"&gt;&lt;img src="http://farm2.static.flickr.com/1128/526784815_358f002f04.jpg" width="200" alt="Maisy" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;As before the answer to if these two are equal is yes and also no. If the question being asked is "are these the same cat?" then the answer is yes; if the question is instead "are these photos the same?" then the answer is no. Usually it's obvious which of these questions is being asked from the context and generally the question is phrased in the more explicit way.&lt;br /&gt;&lt;br /&gt;Computers are no different. Ever since &lt;a href="http://en.wikipedia.org/wiki/Ada_Lovelace"&gt;Ada Lovelace&lt;/a&gt; realised that numbers could be used to represent ideas, concepts and physical objects there has been the need to distinguish between the two types of equality. It's necessary to explicitly tell the computer if you're asking if the numbers are the same (asking if the photos are the same for the above example) or asking if the thing the numbers represent are the same (asking if it's the same cat).&lt;br /&gt;&lt;br /&gt;This distinction between the values and what the values are meant to represent occurs frequently in computer languages. For example in the Java language the operator '&lt;i&gt;==&lt;/i&gt;' is used to compare the number representing the object, where as the '&lt;i&gt;equals()&lt;/i&gt;' method is used to compare the concept/item that the object represents.&lt;br /&gt;&lt;br /&gt;Some languages complicate this further, such as JavaScript where there is the '&lt;i&gt;==&lt;/i&gt;' equality operator and the '&lt;i&gt;===&lt;/i&gt;' strict equality operator. The need for this arises because when JavaScript first came into existence the '&lt;i&gt;==&lt;/i&gt;' operator was defined in such a way that the number 5 was equal to a sequence of text which is the character 5. This is a little confusing, but for &lt;a href="http://www.asciitable.com/"&gt;various reasons&lt;/a&gt; computers choose to represent the character/digit of 5 as the number 53.&lt;br /&gt;&lt;br /&gt;This distinction between a character/digit of 5 and the number 5 (which you get from adding 2 and 3) might seem a little strange, but consider the phrase "I ate 5 strawberries". It's necessary for there to be some way to represent each character/letter as a number and the method of representation that has become standard has the digit 5 represented by the number 53.&lt;br /&gt;&lt;br /&gt;Coming back to the difference between '&lt;i&gt;==&lt;/i&gt;' and '&lt;i&gt;===&lt;/i&gt;', the former will say that "5" is equal to 5, where as the latter will say that they are not equal (due to the internal representation being different). This can be a little confusing when first coming to JavaScript and is the main reason for writing this post. I discovered the difference and thought I should share.&lt;br /&gt;&lt;br /&gt;So the next time you're trying to work out if two things are the same, just remember to think what you are wanting to compare.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8877123-1425907877019402804?l=wildebeestplain.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wildebeestplain.blogspot.com/feeds/1425907877019402804/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8877123&amp;postID=1425907877019402804' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8877123/posts/default/1425907877019402804'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8877123/posts/default/1425907877019402804'/><link rel='alternate' type='text/html' href='http://wildebeestplain.blogspot.com/2010/03/not-all-equals-are-born-equal.html' title='Not all equals are born equal'/><author><name>Toby Gray</name><uri>https://profiles.google.com/116466402565198528900</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-lIXtbL0DwRc/AAAAAAAAAAI/AAAAAAAACCk/vULuFMRIOfg/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://farm2.static.flickr.com/1171/526702620_e7aead9680_t.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8877123.post-7110010011241634157</id><published>2010-02-09T09:17:00.001Z</published><updated>2010-02-09T09:19:00.722Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='development'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='symbian'/><title type='text'>Adventures in S60 Web Runtime - Part 2</title><content type='html'>This is the second installment in a series on writing an S60 Web Runtime widget, &lt;a href="http://wildebeestplain.blogspot.com/2010/02/adventures-in-s60-web-runtime-part-1.html"&gt;here's the first&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;As I said in my last post, feedback is very important if you want to stay motivated. As well as being important for setting goals, this is very important for the actual writing of the code. To possibly state the obvious, software development follows a series or steps:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Think about the problem.&lt;/li&gt;&lt;li&gt;Think up a possible solution.&lt;/li&gt;&lt;li&gt;Write code expressing that solution.&lt;/li&gt;&lt;li&gt;Build the code you've written.&lt;/li&gt;&lt;li&gt;Test your built code.&lt;/li&gt;&lt;li&gt;Repeat from step 1.&lt;/li&gt;&lt;/ol&gt;The astute programmers among you will have realised that this is a never ending loop as there is no termination condition such as "On the 100th try give up and go home". The non-programmers will have thought that was a rather obvious implicit step. You're both write, it's a never ending cycle of improvement but every so often you have to stop and do something else.&lt;br /&gt;&lt;br /&gt;One of the key steps in this list is step 4 ("Build the code you've written"). This is the process of asking the computer to translate your program from the &lt;strike&gt;human&lt;/strike&gt; programmer readable code to something the computer can run. It also includes packaging up the built code in a way which means you can actually run it. It's roughly equivalent to taking the plans for a building (step 3) and building the house before you can live in it (step 5). It's very important to keep this step as short as possible, as if it takes more than a few seconds the programmer will lose focus, start thinking about if they need to buy more bread and milk on the way home and forget the intricate details of their solution from step 2.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.flickr.com/photos/luiscdiaz/154179152/" title="compiler by Maldita la hora, on Flickr"&gt;&lt;img src="http://farm1.static.flickr.com/48/154179152_62b20c6c41.jpg" width="300" alt="compiler" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="font-size:smaller;"&gt;Compiler by &lt;a href="http://www.flickr.com/photos/luiscdiaz"&gt;Luiscdiaz&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;S60 Web Runtime widgets are essentially an &lt;a href="http://en.wikipedia.org/wiki/Interpreted_language"&gt;interpreted language&lt;/a&gt;. This means that the computer can go straight from the code you've written to running it. This is different from a &lt;a href="http://en.wikipedia.org/wiki/Compiled_languages"&gt;compiled language&lt;/a&gt; which requires translating your textual code (saying something such as "&lt;tt&gt;add 1 to count of people&lt;/tt&gt;") to numbers that the computer can run (such as "&lt;tt&gt;07 A4 7E 1F&lt;/tt&gt;"). By being interpreted, a large part of step 4 is removed. However there is still the need to bundle up all the files in your program into one file and to install the application onto something that you can test it with. This can take a surprisingly long amount of time while also being tedious and dull.&lt;br /&gt;&lt;br /&gt;Luckily several people have worked to make this easier. A glance at the &lt;a href="http://developer.symbian.org/wiki/index.php/Web_Runtime_%28WRT%29_Quick_Start"&gt;quick start guide&lt;/a&gt; from the &lt;a href="http://www.symbian.org/"&gt;Symbian Foundation&lt;/a&gt; showed that there were several useful tools for speeding up this process. The one that they focus on (due to it being free) is &lt;a href="http://www.aptana.com/studio/download"&gt;Aptana&lt;/a&gt;. Aptana is an Integrated Development Environment (IDE) which means that it tries to have as many easy to use tools all integrated together in one place as possible.&lt;br /&gt;&lt;br /&gt;The big feature of Aptana which made me want to use it is that it makes it possible to go straight from writing code to testing it in one click (going from the "Source" view to the "Nokia Web Runtime (WRT)" view). This was going to make development much more streamlined and, most importantly, more fun.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_YAZPNfoTmck/S3EmLeLS4aI/AAAAAAAABMI/ZldBuDI7FoM/s1600-h/Screenshot.png" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_YAZPNfoTmck/S3EmLeLS4aI/AAAAAAAABMI/ZldBuDI7FoM/s320/Screenshot.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;So with Aptana installed and tested to check that it was working (by following the rest of the &lt;a href="http://developer.symbian.org/wiki/index.php/Web_Runtime_%28WRT%29_Quick_Start"&gt;quick start guide&lt;/a&gt;) I now had to get down to writing the actual code. In actual fact that's a bit of a lie as I first of all had a look at some of the example code and noticed that it was written in an apparently non-optimal way.&lt;br /&gt;&lt;br /&gt;Anyone who has used a WRT widget on a phone might have noticed that they're a bit slow to start-up. When programming for web pages it's common to put code which does complex things (and therefore takes a while) at the end of the page. This means that the user can at least see most of the page and start reading things while the computer is doing the complex things. This does require a bit of extra work, as you must divide the things you need to do into things you have to do now and things you can do later (further details on this can be found in the Episodes pattern in &lt;a href="http://www.amazon.co.uk/Common-Design-Patterns-Symbian-Foundations/dp/0470516356/"&gt;this book&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;However the example code wasn't doing this, instead of:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Perform just enough calculations for the first view.&lt;/li&gt;&lt;li&gt;Display the first view.&lt;/li&gt;&lt;li&gt;Do the other calculations.&lt;/li&gt;&lt;/ol&gt;The example code was doing:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Calculate everything and get it all set-up and ready to go.&lt;/li&gt;&lt;li&gt;Display the first view.&lt;/li&gt;&lt;/ol&gt;By doing the non-essential work first, the example application was unnecessarily slowing down the start-up of the application. After all, why do something now that you can put off doing until later!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8877123-7110010011241634157?l=wildebeestplain.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wildebeestplain.blogspot.com/feeds/7110010011241634157/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8877123&amp;postID=7110010011241634157' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8877123/posts/default/7110010011241634157'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8877123/posts/default/7110010011241634157'/><link rel='alternate' type='text/html' href='http://wildebeestplain.blogspot.com/2010/02/adventures-in-s60-web-runtime-part-2.html' title='Adventures in S60 Web Runtime - Part 2'/><author><name>Toby Gray</name><uri>https://profiles.google.com/116466402565198528900</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-lIXtbL0DwRc/AAAAAAAAAAI/AAAAAAAACCk/vULuFMRIOfg/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://farm1.static.flickr.com/48/154179152_62b20c6c41_t.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8877123.post-1791511857287564626</id><published>2010-02-06T12:19:00.001Z</published><updated>2010-02-09T09:21:09.459Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='development'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='symbian'/><title type='text'>Adventures in S60 Web Runtime - Part 1</title><content type='html'>&lt;div style="font-size: small; font-style: italic;"&gt;The further parts in this series of posts can be found here: &lt;a href="http://wildebeestplain.blogspot.com/2010/02/adventures-in-s60-web-runtime-part-2.html"&gt;part 2&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;To celebrate/commiserate (delete as appropriate) moving on from four and a half years of employment at &lt;a href="http://en.wikipedia.org/wiki/Symbian_Ltd."&gt;Symbian&lt;/a&gt; and then &lt;a href="http://en.wikipedia.org/wiki/Nokia"&gt;Nokia&lt;/a&gt; I've decided to try my hand at writing a mobile application.&lt;br /&gt;&lt;br /&gt;The first step in writing an application is deciding what to write. This is harder than it sounds as there are already quite a range of applications out there, both for the &lt;a href="http://horizon.symbian.org/"&gt;Symbian platform&lt;/a&gt; and for other &lt;a href="http://www.android.com/market/"&gt;mobile&lt;/a&gt; &lt;a href="http://www.apple.com/uk/itunes/#gamesapps"&gt;platforms&lt;/a&gt;. While there is nothing wrong with creating an application which has already been done, especially if you have a new and unique take on it, but you do have to ask yourself if the world really needs another &lt;a href="http://itunes.apple.com/gb/app/perfect-pour/id320457611?mt=8"&gt;glass&lt;/a&gt; &lt;a href="http://itunes.apple.com/gb/app/beertap/id343047826?mt=8"&gt;of&lt;/a&gt; &lt;a href="http://itunes.apple.com/gb/app/beer/id288017026?mt=8"&gt;beer&lt;/a&gt; &lt;a href="http://itunes.apple.com/gb/app/ibeer-special/id283914070?mt=8"&gt;simulator&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;After some thought I realised that I wanted to try to create a simple &lt;a href="http://en.wikipedia.org/wiki/Persistence_of_vision"&gt;persistence of vision&lt;/a&gt; (PoV) application. The basic idea with PoV is that in trying to make sense of the world, your brain merges together what your eyes see over a short period of time. This has been exploited to write messages in empty space.&lt;br /&gt;&lt;a href="http://www.flickr.com/photos/27164521@N00/1534860829/" title="MATT PoV on Arduino by syvwlch, on Flickr"&gt;&lt;img src="http://farm3.static.flickr.com/2130/1534860829_800cce3a59.jpg" width="500" height="273" alt="MATT PoV on Arduino" /&gt;&lt;/a&gt;&lt;br /&gt;This is typically done with a row of LEDs (as in the above example) and a small micro-controller like an &lt;a href="http://www.arduino.cc/"&gt;Arduino&lt;/a&gt; such as in the example above or &lt;a href="http://hackedgadgets.com/2007/08/20/arduino-pov/"&gt;like this&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;While I have dabbled in hardware before, I'm primarily a software person and as I was looking for a small mobile application to try writing, I thought a PoV application would be an ideal starting point. It's a fairly simple application which using a mobile phone has some extra possibilities, such as higher resolution (so better quality images) and more colours. I don't, however, foresee any practical use for it aside from perhaps using it to send multi-colour messages across a &lt;a href="http://www.flickr.com/photos/versiontwophotography/3946811151/"&gt;dark and noisy room&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Doing a PoV application also had the advantage that I could start small and add new features easily. This is very important for all software projects, whether developed as part of your job or just for fun. If it takes you a year of writing to create something which you would be proud to show people then you are quickly going to lose motivation and stop caring. Put simply, I wanted regular and meaningful milestones (or key points) where I could point at something that I could be pleased to have created. I think that this is an important aspect for any project, be it software or building a shed in your garden, human beings seem to work best when they have regular goals which they get clear feedback when they've achieved.&lt;br /&gt;&lt;br /&gt;In my mind two lists formed as a consequence of this. The first list was a list of things that I'd need to do to get the first version done. This list needs to be short so that I can easily achieve it. The second list was a list of possible future ideas. This list needs to be long enough for me to have some interesting features to add to the application.&lt;br /&gt;&lt;b&gt;First version features:&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Take some text as input.&lt;/li&gt;&lt;li&gt;Display it in a set time period.&lt;/li&gt;&lt;/ul&gt;&lt;b&gt;Future ideas:&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Accelerometer support - so it knows when to start displaying the message.&lt;/li&gt;&lt;li&gt;Colour selection - more than the plain LED red of hardware PoV.&lt;/li&gt;&lt;li&gt;Multi-coloured messages - because rainbow text would be awesome.&lt;/li&gt;&lt;li&gt;Image painting - is it possible to paint more than a single line of text in the air?&lt;/li&gt;&lt;/ul&gt;Happily the PoV application idea satisfied both criteria, having only two things to do in the first version and a number of varied things to do in the future.&lt;br /&gt;&lt;br /&gt;So that's is the first hurdle passed in software development; but knowing what I was going to write was worthless if it didn't have a name. Names are very important, especially for software projects. Some schools of thought subscribe to the theory that the name is &lt;b&gt;the&lt;/b&gt; most important thing about a project. I wouldn't go that far, but a good name is the first step in creating a good application. It's also a case with naming that thinking about it for too long, or being too clever about it, leads to a worse name. Not wanting to pick on Google in particular, but the first example of this that came to my mind was when Google decided to rename 'Froogle' to 'Google Product Search'. They renamed it as the &lt;a href="http://news.cnet.com/2100-1038_3-6177393.html"&gt;pun on the word frugal in the name wasn't obvious&lt;/a&gt;.  &lt;br /&gt;&lt;br /&gt;Immediately I decided that using the term PoV was a big no-no. I always read PoV as Point of View unless something about the context indicates that it's probably Persistence of Vision. If I, as someone who knows and understand the term, doesn't find it immediately conjuring up visions of text in the air then what hope has anyone else got? So my thought turned to other names and one which lead on almost directly from the anti-PoV viewpoint was to call it 'SkyWriter'.&lt;br /&gt;&lt;br /&gt;The name SkyWriter does almost exactly what it says on the tin and so seemed like a good name. Before getting too excited though, I wanted to check that there weren't any connotations for the name that I wasn't aware of. The easiest way to do this was to just do a web search for it, using &lt;a href="http://www.google.co.uk/search?hl=en&amp;q=skywriter&amp;meta="&gt;my favourite search engine&lt;/a&gt;. Sadly it turns out that there is already a mobile application called &lt;a href="http://www.skywritersoft.com/"&gt;SkyWriter for plane pilots&lt;/a&gt; and I wouldn't want to confuse pilots and be responsible for them crashing!&lt;br /&gt;&lt;br /&gt;So I tried &lt;a href="http://www.google.co.uk/search?hl=en&amp;q=AirWriter&amp;btnG=Search&amp;meta=&amp;aq=f&amp;oq="&gt;AirWriter&lt;/a&gt; and discovered, to my horror, that someone had already created a PoV application called &lt;a href="http://iphone.cursor.cl/AirWriter/"&gt;AirWriter&lt;/a&gt;. Slightly disheartened I tried a few other combinations and finally decided to settle on AirText.&lt;br /&gt;&lt;br /&gt;With all that decided I had to decide what devices and what programming language I would write AirText in. The device question was easy to answer, 'my current mobile'. I currently own a &lt;a href="http://www.forum.nokia.com/devices/5800_XpressMusic/"&gt;Nokia 5800 Xpressmusic&lt;/a&gt;. The choice of what language took only slightly longer; I'd been wanting to try writing an &lt;a href="http://www.forum.nokia.com/Technology_Topics/Web_Technologies/Web_Runtime/"&gt;S60 Web Runtime (WRT)&lt;/a&gt; for a while now and this seemed like the perfect chance.&lt;br /&gt;&lt;br /&gt;Another reason, and probably the most significant if I'm honest with myself, is that I've spent over four years dealing with C++ code and using the simpler language of HTML and JavaScript of WRT was very appealing. HTML and JavaScript are the languages used for web-pages and let you concentrate on describing what goes where on the screen. This makes it easier to use than C++, which requires dealing with all the complexities involved in controlling all the parts of the computer to do what you want.&lt;br /&gt;&lt;br /&gt;With that decision made, my final step in this instalment was therefore to go over the &lt;a href="http://www.forum.nokia.com/"&gt;Forum Nokia&lt;/a&gt; and to read up on their &lt;a href="http://www.forum.nokia.com/Technology_Topics/Web_Technologies/Web_Runtime/QuickStart.xhtml"&gt;quick start guide for widgets&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;In other news I've finally worked out that I'll keep this blog as a blog of &lt;i&gt;interesting&lt;/i&gt; things that I've done. I realised that I do spend quite a bit of time working out how to do things with technology or reading up on some information and that it'd be good to share. I can't promise regular posting, but I will try to keep the posts here as journal entries that are hopefully an interesting read.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8877123-1791511857287564626?l=wildebeestplain.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wildebeestplain.blogspot.com/feeds/1791511857287564626/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8877123&amp;postID=1791511857287564626' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8877123/posts/default/1791511857287564626'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8877123/posts/default/1791511857287564626'/><link rel='alternate' type='text/html' href='http://wildebeestplain.blogspot.com/2010/02/adventures-in-s60-web-runtime-part-1.html' title='Adventures in S60 Web Runtime - Part 1'/><author><name>Toby Gray</name><uri>https://profiles.google.com/116466402565198528900</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-lIXtbL0DwRc/AAAAAAAAAAI/AAAAAAAACCk/vULuFMRIOfg/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://farm3.static.flickr.com/2130/1534860829_800cce3a59_t.jpg' height='72' width='72'/><thr:total>2</thr:total></entry></feed>
