Shazam + iPhone is really, really cool.

Posted by Dan Milne Wed, 23 Jul 2008 06:06:00 GMT

I found an amazing bit of free software on the iTunes App store called Shazam. The idea of the software is that you send them a sample of some music, and they’ll figure out the Artist, Album, Trackname and so on. On the iPhone, what you do is fireup the Shazam App, click “Tag Now” button which starts the program recording music. It records between 8 – 15 seconds ( depending on how you configure it ) then sends that sample ( or maybe just a fingerprint of the sample ) off to the Shazam service on the internetz. A few seconds later, the program displays the artist, album, track and coverart. It it has any, it’ll also send links to listen to/buy the song on iTunes and links to YouTube to watch the filmclip.

In the few times I’ve used it, the hit rate has been very high. It has missed some tracks ( mostly Finnish tracks ) but overall it’s been quite amazing. I gave it a road test today standing in a café wondering what the music playing was. Fired up Shazam, and less than 30 seconds later, I’ve got all the track details, artist and album art. This track had no links to iTunes or YouTube unfortunately. Really quite a remarkable service.

Flying RC planes with wireless Video.

Posted by Dan Milne Mon, 14 Jul 2008 13:11:00 GMT

Ian introduced me to this concept. I have to say it looks like fun. These guys are flying their planes via a wireless camera and a set of video googles. They also have gyros on their heads, such that when they move their head right, the camera pans right.

Apologies in advance for the terrible music.

This is the first video I saw – so cool.

No more onload="javascript..." for Booko

Posted by Dan Milne Wed, 02 Jul 2008 13:15:00 GMT

I’ve taken Phil’s advice and removed the Javascript from the body’s onload event handler, replacing it with Prototype’s event handler.

    <script type="text/javascript">
    Event.observe(
             window, 
             "load", 
         <%=  remote_function :url => { :action => "get_prices", :isbn13 => @book.isbn13  },:method => :get %> 
        );
    </script>

USB2 Vs FW400 Vs FW800

Posted by Dan Milne Wed, 25 Jun 2008 07:55:00 GMT

Had access to a 1TB WD drive recently. Comes with USB2, FireWire 400 & FireWire 800. Thought I’d check out the performance of the various connection methods. It had two internal 500GB drives arranged in RAID 0 (striped). I tested it by running:

$ time cp Movies/Parallel.avi /Volumes/MYBOOK/

The movie was 525MB and I did each test 3 times. The very first run was slowest – presumably the file (or parts of it) was in the disk cache for subsequent runs. Here’s the times:

FW800:  12.5 seconds
FW400: 16.9 seconds 
USB2:  21.6 seconds

Just to make sure my laptop drive wasn’t affecting the test, I also performed this test (several times for each):

dd if=/dev/zero of=/Volumes/MYBOOK/test.file.fw800 bs=1m count=1024
FW800: 24.8 seconds
FW400: 32.4 seconds 
USB2: 40.9 seconds

For comparison: Local SATA drive: 20.3 seconds

My laptop hard drives results were a bit erratic – peaking up to 27 seconds and down to 20. No doubt due in part to the 21 applications I’m currently running. Stopping iTunes playing helped things ;-)

I was surprised that FireWire 400 was that much faster than USB2 – I’d always assumed they were on par. Anyway, looks like FW800 is clearly the king for connecting external HD.

$500 Ethernet cable?

Posted by Dan Milne Mon, 23 Jun 2008 11:36:00 GMT

Frustrating

Posted by Dan Milne Sun, 22 Jun 2008 03:55:00 GMT

I spent several hours yesterday fighting with RubyGems – I’d even written a vitriolic post about it – but I … did something … and bam, like that it was gone. RubyGem is Ruby’s version of Perl’s CPAN. It’s got a very annoying trait – its prodigious use of memory. For each gem ( a gem is a Ruby module – like rails or hpricot for example ) RubyGem would load the spec into memory in order ( I’m guessing after reading a bunch of forum posts ) to build a dependency tree. On a 256MB slice host, this pushes you into swap hell. On a 512MB host it would use up to 68% of memory.

So what can you do but rent a bigger slicehost? Moe Sizlack said it best: “I’m choking on my own rage over here!”

Naturally, it’s been fixed. Today.

If only I’d done something more constructive yesterday. Like played COD.

SSH Tricks 1

Posted by Dan Milne Mon, 16 Jun 2008 10:56:00 GMT

Read this tip here – if you add:

Host *
       ControlMaster auto
       ControlPath /tmp/%r@%h:%p

to your .ssh/config, ssh will reuse your network connections to hosts with already established ssh sessions – saving a bit of time and reducing the number of network sockets you’ve got.

$ man ssh_config

for the details. You learn something new every week eh?

I might be too old for Gentoo Unstable. It could be time for Debian. Or Ubuntu. Or Gentoo stable maybe. :-( 1

Posted by Dan Milne Thu, 12 Jun 2008 10:16:00 GMT

Perhaps my blood sugar is just too low.

Seeing this type of error in Gentoo?

 * ERROR: sys-apps/portage-2.1.5.5 failed.
 * Call stack:
 *               ebuild.sh, line 1792:  Called dyn_unpack
 *               ebuild.sh, line  686:  Called die
 * The specific snippet of code:
 *      touch "${PORTAGE_BUILDDIR}/.unpacked" || die "IO Failure -- Failed 'touch .unpacked' in ${PORTAGE_BUILDDIR}" 
 *  The die message:
 *   IO Failure -- Failed 'touch .unpacked' in /var/tmp/portage/sys-apps/portage-2.1.5.5
 

Apparently touch no longer works in my distro. Can’t build anything.

http://bugs.gentoo.org/show_bug.cgi?id=224483

It appears my kernel (2.6.21-gentoo-r3) is out of date compared with my linux-headers (2.6.25-r3) package and this screws up the latest version of touch which comes with coreutils. Update your kernel. But touch doesn’t work, so you need to go get an old version:

wget http://tinderbox.dev.gentoo.org/default-linux/x86/sys-apps/coreutils-6.10-r2.tbz2
mv coreutils-6.10-r2.tbz2 /usr/portage/distfiles/
emerge -k =sys-apps/coreutils-6.10-r2

Now go update your kernel.

XMPP

Posted by Dan Milne Wed, 11 Jun 2008 12:57:00 GMT

This Simple XMPP client for Ruby looks like a great way to get some IM loving into an application. I’d love a monitoring system which used IM to alert me to failures. Since IM is not exactly a perfect medium, sending a copy of the message via Email for critical alerts is probably a good idea too.

Could be fun to ask your monitoring IM buddy “Status?” and get a status report. X Emails delivered, Y Emails rejected, Z books looked up on Booko.

Fun. :-)

Consistency

Posted by Dan Milne Wed, 28 May 2008 13:20:00 GMT

Well, apparently I’ve not been consistent enough – an important quality when one bags out others for being inconsistent. So – I’ve updated all references to “Bookie” to the now correct “Booko”.

While I was at it I updated the scraping code for Fishpond who have again updated their site. At least they’ve updated it for the better. Compare and contrast the old and new Hpricot XPath code for grabbing the book title and author.

The Old:

book.title     = (doc/"table/tr/td/div/h1").inner_html
book.author    = (doc/"table/tr/td/p[2]/a/font/u").inner_html

The New:

book.title     = (doc/"h1#product_title").first.inner_html
book.author    = (doc/"p#product_author/a").first.inner_html

Much nicer!

Booko now with better sessions!

Posted by Dan Milne Mon, 19 May 2008 12:57:00 GMT

  • Bug fixed which stopped Booko remembering which Book searching place you last used. ( Bug reported by teh timo )
  • Re-factored the functions which go and get the prices from the stores.
  • Added an attribute to “Book” such that it now remembers when its prices were last looked up. Accidentally introduced a bug where any new book initially had no idea when it was last looked up and crashed the “Recently Viewed” method.
  • Todo – better testing :-(

Windows Hatoraide 3

Posted by Dan Milne Wed, 07 May 2008 12:35:00 GMT

Before my current job, my last crack at using MS Windows as a desktop was in 2000. It lasted about 6 months before I decided Linux made a better desktop. Back then I was using Windows 2000. I didn’t have any particular gripe with it – just didn’t really get along with it. I found it to be reasonably stable – at least as stable as a Mac of that era but less stable than Linux. I used Linux until November 2005 when I moved back to Mac. The change was dramatic: when I left, I was running Mac OS 9 and I came back to Mac OS 10.4 – a modern Unix based OS which, after years on Linux, felt like a good mix of Unix and lickable buttons.

At my current job, I don’t have the benefit of choosing the OS of my desktop, and the imagined redtape involved in connecting my laptop to their network means that for the first time in a long time, I’ve got Windows on the desktop. I’ve been using Windows at work for almost 4 months. Windows XP, SP2.

After all this time, I figured Windows would have improved. Surely, I thought, after almost 8 years of development things must be good – after all, consider the improvements in Linux since Red Hat 6. Literally leaps and bounds in all possible measures. Mac OS also went from an OS with no preemptive multitasking ( they used cooperative multitasking) and no memory protection to a modern Unix with all associated goodness.

Windows XP, to me, doesn’t seem to have improved at all since 2000 aside from that annoying dark blue Crayola “theme”. It might be marginally more stable, although that could just me treating it with kid gloves.

When my PC started playing up recently, I called in tech support. They asked when I’d last rebooted it. I said, “Oh a week or two?” – Everyone looked at my like I was King of the Muppet people. I retorted to the laughter with “Seriously? I though that was a joke! It’s 2008!” They laughed, closed the ticket and told me to reboot. It didn’t fix the problem. Next they suggested I’d installed to many applications and that was slowing it down. I’d installed Safari and the related Apple stuff dragged in (iTunes, quicktime, Bonjour, Software Update), Firefox, Wireshark and a couple of Jabber clients to test a jabber server. That’s it.

I agreed to uninstall the stuff I wasn’t using or didn’t really need. The tech support guy opened up the add/remove program control panel and I deleted a few bits of software I’d been playing with (Safari for Windows). After removing software and rebooting again, the problem persisted. So I figured I’d uninstall some more software – but you need admin rights to open the add/remove programs control panel! So, you can install software, but you can’t uninstall software?! Apparently this is all you can do to fix problems. The next step, in the estimation of my Windows support guy, is to rebuilding the box from scratch.

Now, I admit, I’m no Windows administrator, but how can you seriously run websites or email servers or anything with a modicum of importance on this stuff? It’s garbage. No wonder MS are so into clustering – rather than fixing problems on servers, you simply rebuild them. Just take it out of the cluster and nuke it.

It doesn’t stop there. I’ve been documenting the more ridiculous aspects of life on Windows. Windows Explorer, one of the most used apps seems to have stood still. It does not keep the files on the right in alphabetical order. Copying or saving a file from an application into a directory simply adds that item to the end of the list. It seems you have to refresh the folder list to get them in order. Which is odd because the list of files & servers constantly flickers – I guess because of the attached network shares updating in the background. If you’re going to have an annoying, flickering explorer, at least it should be updating the file list to keep them correctly sorted. It’s kind of like an old fluorescent tube with a bad starter. It seems you can hide files beginning with a dot in the right hand side, but but not for folders on the left. Not only that, but Explorer doesn’t seem to be able to create a folder or file beginning with a “.”. To cap it off, the Explorer has no duplicate function, only copy/cut & paste.

Opening documents in Excel, Word or Visio sometimes opens them in separate windows, sometimes in the same parent window. This is some sort of brain dead MDI behaviour. I can’t figure out how to make individual documents consistently open in their own window. To top it off, in both cases there are two buttons in the task bar. Alt-Tab shows you two word icons – naturally they’re different – one probably represents the “Parent”.

Of course, both windows show up in the task bar, and naturally, each window from the same app respond differently to mouse-down / mouse-up. Sometimes you get the window on mouse-down, sometimes you have to wait for mouse-up. Sometimes, it works like you expect. Usually when you call someone over to show them.

Say you have Word open, then you open another word window, then a third. The layering of windows is inconsistent. Click and hold on each of the different windows in the task bar, and you’ll get different responses – sometimes the window jumps straight to the top, sometimes a different windows jumps to the top on mouse-down, only to disappear behind the correct window when you mouse-up.

The number of reboots is funny – like most jokes about Windows, this one is true. Ian just bought a new laptop – the first thing it did, after starting up, was to reboot. And then to reboot. And then one more reboot. Just in case. I think the total was higher than this, but I lost count. You have to reboot when upgrading Acrobat. I try not to use caps lock. Just in case.

Want to look for a file? I tried using the inbuilt search function for the file “services” and initially didn’t return any results. When I open the C:\WINDOWS\system32\drivers\etc directory – so I could see the services file, the next search found it. Naturally this file can exist in C:\WINDOWS\system32\drivers\etc\services or C:\WINNT\system32\drivers\etc\services. For consistency, they’ve capped it at two locations. Brilliant.

Windows Security sucks. You can have your ability to change the desktop image removed – however you can still set the desktop image with an application such as Paint which hasn’t been locked down. You can install applications, but have your access to “Add/Remove Programs” denied so you can’t uninstall them. Security in this sense seems to apply only to the method of doing something, rather than the result. So, instead of locking the desktop image, they lock the ways they know of changing it. Instead of stopping you installing software, they block access to the Add/Remove program.

I have this fond memory of Visio – the excellent drawing program. Doesn’t seem to have changed since I first saw it in 1999. Compared to OmniGraffle, it’s rubbish. Lines are never straight – they often seem to have kinks in them because the snap-to function doesn’t seem to consider a straight line as useful. Nothing seems to be anti-aliased. There’s jagged lines all over the shop. Fonts look especially craptacular – but I’ll accept that I’m just used to seeing them nicely anti-aliased on a Mac, and that you can “get used to it”. They do look better if you turn on the ClearType stuff ( just a simple download, install and reboot for smooth fonts. ) Ctrl-w doesn’t close a window in Visio – it zooms to fill the window with the document. You need good old alt-f4 or alt-f-c. Naturally neither of these are listed as short cuts are documented in the “File->Close” menu option.

It’s this inconsistency that really gets to me. Just when you think you’ve got it sorted, it randomly changes.

I hear tell that Vista may actually be better, but reports are conflicted. For the foreseeable future, Windows for me will be simply a boot loader for Call of Duty 4.

Booko improvements

Posted by Dan Milne Sat, 03 May 2008 05:56:00 GMT

I was contacted by a chap from The Nile to let me know that they not only have an Affiliate program I could join, but they have an API to access their site! I’ve spent the last couple of days adding the affiliate links. You’ll see that several stores now appear to link to clixGalore – but fear not, the links will still get you to the page you’re after.

You’ll also notice there’s now a new store to search – The Nile. It’s the fastest of the search engines by a considerable margin. ( Which isn’t really fair – at least one of the sites which is searched is just a fancy screen scraper.)

Additionally, I’ve cleaned up the CSS and layout some. Hopefully you won’t have the horizontal scroll bar on your browser, regardless of how wide you open the window.

You’ll also notice that there’s a context sensitive help message in the top right-hand corner. This should make it clear what you can do at which ever page you happen to be on.

Try out the updated Booko and let me know what you think.

EDIT: Added a tool tip style mouse over for the Most Popular/Recent list so you can see the full title. Thanks to Niall & Riina for their help & ideas.

Forest clearing machines

Posted by Dan Milne Sat, 26 Apr 2008 10:07:00 GMT

These are some pretty cool machines. The first one is a Valmet ( a Finnish brand ) shows an attachment for clearing trees – seems like a really effective piece of hardware. The second clip shows a machine I think was invented in Finland, then bought by John Deer. It shows a very similar machine but has replaced the tracks with 6 legs. Apparently legs don’t rip the soil up as much, meaning forests recover faster.

And the walking version…

Fragment Caching is go

Posted by Dan Milne Thu, 24 Apr 2008 14:07:00 GMT

I added fragment caching to Booko the other day. I’ve added caching to four sections, the Recent Searchs, Most Popular, Shopping Cart and the section which displays the prices of a book.

Now, instead of calculating the most popular books every time someone views a page, we look to see if that part of the site has been created recently – if it has, use it again. The Shopping cart is another good example – it only changes when you add or remove a book from it. Now Booko avoids having to calculate the cost of your shopping trolley at all shops every time you view a page – it regenerates that part of the page only when you add or remove a book.

Kinda wishing I’d bench marked it before and after. I think it’s faster now – but that’s because I’m looking for it. It feels snappier. Anyway – let me know what you think, faster or slower?

Older posts: 1 2 3 4