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>

Extreme police powers introduced to protect Catholic feelings

Posted by Dan Milne Tue, 01 Jul 2008 12:16:00 GMT

Judging by the actions of the NSW government, Catholics are so thin skinned that they need extra police protection. Police have been granted special powers to deal with people who confront attendees of the WYD with ideas the Pope doesn’t agree with. According to some observers, wearing slogans or handing out condoms at WYD could get you in trouble. Group Think will probably be OK.

Thank God the media is on the case.

From the Age : http://news.theage.com.au/national/youth-day-protesters-to-offer-condoms-20080701-2zlj.html

Powers approved by the NSW government allow for people who continually annoy or inconvenience pilgrims during the event, to be staged in Sydney from July 15 to 20, to be arrested and possibly fined $5,500.

From the ABC : http://www.abc.net.au/news/stories/2008/07/01/2290617.htm

Draconian, repugnant and unnecessary. These are just a few of the criticisms of special regulations coming into force for the upcoming Catholic World Youth Day event in Sydney.

Civil libertarians and legal experts say the regulations could see situations such as someone deemed to be wearing an offensive T-shirt being arrested and given a hefty fine.

New South Wales Police say the measures are designed simply to ensure that World Youth Day is a peaceful and happy event.

From the BBC: http://news.bbc.co.uk/2/hi/asia-pacific/7482696.stm

Lawyers in Australia say that police powers introduced for a major gathering of young Roman Catholics later this month will undermine free speech. Under the powers, police will be able to arrest and fine people for “causing annoyance or inconvenience” to participants in World Youth Day.

From News.News.News.News.com: http://www.news.com.au/story/0,23599,23951245-5016937,00.html

NSW POLICE have been given extraordinary new powers for World Youth Day, including being able to arrest and fine people for “causing annoyance” to participants and conduct partial strip searches.

....

Critics say the new powers have the potential to make wearing a T-shirt with a slogan, a protest like handing out condoms or a Chaser-style stunt a crime, while civil libertarians believe the powers are more extreme and than those used during last year’s APEC summit.

Finished. For the moment.

Posted by Dan Milne Fri, 27 Jun 2008 13:16:00 GMT

Well, I’ve painted the shell and put the stickers on. Looks finished now.

DSC_2336.JPG

DSC_2340.JPG

Added an extra sticker. I’ve had so many of them lying about – this is the first time I’ve ever used one.

Another shop for Booko

Posted by Dan Milne Thu, 26 Jun 2008 13:25:00 GMT

Guys at the Ruby meeting tonight mentioned another online bookstore – Boomerang Books. I’ve added them to the roster. Let me know if there’s any issues.

New Girl Talk album

Posted by Dan Milne Wed, 25 Jun 2008 11:36:00 GMT

Girl Talk have released a new album “Feed the Animals”. They’ve released it in a similar fashion to Nine Inch Nails most resent release. You can pay any amount you think is fair. If you download for free, I understand they ask some questions about why you’re not paying. If you pay at least $5 you can get the FLAC version + a single track of the whole album. Over $10 and you can get a physical CD when they’re available. If you’re in Australia ( and you know, who isn’t? ) you’ll need to pay another $7 USD to get it shipped over here.

I’m up to track 4 of 14 and I’m enjoying it. I loved the previous album – Night Ripper. Well worth downloading.

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.

The parts arrived.

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

And we’re back in action. Nothing says we’re back in action like driving over a small obstacle slowly.

$500 Ethernet cable?

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

Migration to Passenger ( mod_rails )

Posted by Dan Milne Sun, 22 Jun 2008 05:49:00 GMT

Ruby On Rails apps are finally easy to install – mod_rails is here. Just installed it for the Blag ( Typo 5.0.1 on Gentoo Unstable ) and it looks to be working quite nicely. Only roadbump I encountered was problems getting static content to be served. Kept getting:

[error] [client 124.168.83.214] client denied by server configuration: /var/www/da.nmilne.com/htdocs/public/javascripts/typo.js

The problem was pretty straight forward – now that mongrel isn’t serving up the static content, I had to make sure that apache was configured to allow access. Added a this stanza:

  <Directory "/var/www/da.nmilne.com/htdocs/public">
        Options FollowSymLinks
        AllowOverride None
        Order allow,deny
        Allow from all
  </Directory>

Naturally it feels snappier. Nice.

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?

Booko Bugs

Posted by Dan Milne Sun, 15 Jun 2008 05:58:00 GMT

Fixed some Booko bugs/interface problems this weekend.

These ones were reported by Niall:
  1. Search results report ISBN, but that value is listed as EAN on the next page. Fixed this to be consistent. I use ISBN to mean the 10 digit version, and EAN to mean the post January 1st 2007 13 digit version, although they are both technically ISBNs.
  2. Searching for a valid ISBN which didn’t exist in Fishpond or The Nile doesn’t return any results. The spinning thing just kept spinning for ever. This bug was a bit surprising – thought I’d fixed this once before. Probably before a recent refactoring. Damn my lack of testing!

Made the message explaining when the price was last looked up more clear. Reported by Andy.

Improved a fragment caching problem reported by Joel. The problem was (as far as I can tell) that adding something to your cart, then moving to a different page before the cart is updated continued to show you the old version of the cart. This was because I was doing things in this order:
  1. Expire Cache for the cart
  2. Look up the book to add, then add the book to the cart and do a bunch of lookups and calculations,
  3. Regenerate the cart html and send it.

#2 takes a while. If the user navigates away before #2 is done, then the cart html is regenerated without the book being in the cart. Subsequent adding / removing of books will refresh the html and your book will be there. I’ve tried to fix this by shuffling the order things are done to this:

  1. Look up the book to add, then add the book to the cart and do a bunch of lookups and calculations,
  2. Expire Cache for the cart
  3. Regenerate the cart html and send it.

Hopefully this will reduce the problem, but it may not eliminate it.

Playing with RC cars

Posted by Dan Milne Sat, 14 Jun 2008 13:45:00 GMT

Went out driving RCs with Josh today. Found a nice half pipe. Weren’t too many pesky kids. Managed to snap the front right wheel off again. Then again. And Again. Then one last time before it really became tedious. Parts are ordered. Well, they were ordered last Sunday when it first happened. Still haven’t shipped.

Anyways, we had some pretty good fun while it lasted.

Business Time

Posted by Dan Milne Fri, 13 Jun 2008 23:14:00 GMT

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.

Older posts: 1 2 3 ... 9