Nibbles 0.1 released

April 2nd, 2008

I'm pleased to say that I've just released version 0.1 of Nibbles, an alternative RSS and Atom feed reader for Maemo. A big thanks to the people who were kind enough to help out with the pre-release testing, you've been (and hopefully continue to be!) a great help.

Nibbles screenshot

Nibbles is quite stable, can parse a wide variety of feeds and is pretty bandwidth efficient. Nibbles is finger-friendly and does aim to be a good mobile feed reader, but things like downloading of full offline articles didn't make it into this initial release (I have some working code for that, but it's not working enough!). New users might want to know that the zoom in/out hardware buttons hide and show the feed and article lists.

Of course, since this is a first release, things aren't perfect. The biggest problem for me that I think people should be aware of is that Nibbles uses too much battery power. This is detailed in bug #2342 and is really a problem with ruby-gtk2 rather than Nibbles. As I said, with some luck, the next ruby-gtk2 release will fix this.

You can install Nibbles from the project page.

Tom Swindell (AKA alterego) created the Maemo bindings for Ruby and they're great. I'm writing a couple of programs with them, including Nibbles, my feed reader. Unfortunately, Tom seems to have vanished and I've not been able to find the source code for the bindings anywhere. Does anyone have it? I'd really like a copy.

In other news, I hear that a new release of ruby-gtk2 is near. This is excellent as it will hopefully fix the battery life problem with the current bindings where Ruby/GTK programs (and, therefore, Ruby/Maemo programs) wake up 100 times a second regardless of what they're doing. Happy days.

Nibbles, a feed reader for Maemo

February 15th, 2008

I don't really get on with the supplied RSS reader on my N800. It doesn't work like I expect and it lacks mobile features like offline reading that I'd like. So, I'm writing a feed reader for Maemo called Nibbles. It's still very early stages, but there's enough for a development release now, I think. Below is a screenshot of the current preview version, 0.0.4:

Nibbles screenshot

It seems to cope nicely with a wide variety of RSS and Atom feeds, despite my proof-of-concept code somehow making it into the app ;).

Currently it's quite bare of features and can be considered the simplest app that could work (for example, the feeds update at a fixed 30 mins). It will likely stay that way until I get a few bugs worked out and 0.1, the first 'stable' version, released. After that, I'll work on some more interesting new features. I'm still very open to suggestions though and all feedback is welcome, so please don't be shy!

If you'd like to play along and help the development of a better feed reader for your internet tablet, use the .install file. Please report issues to the Maemo Garage tracker.

You can make Nibbles the default feed reader by editing /usr/share/applications/defaults.list. You need to set hildon-news_reader=nibbles.install. This will allow you to tap on the feed icon in a browser window and have the feed added to Nibbles.

I've only specified that the app will work in OS2008, but I'm pretty sure it'll work in OS2007 too. Since I only have an OS2008 machine, I can't test it easily. If anyone is still using OS2007 and would like to help, please do get in touch.

I'm writing an application (more on that sometime soon) using the very nice Ruby bindings for Maemo. I've got some dependencies that are packaged as RubyGems that I wanted to be managed through the Application Manager, so I created some .debs for them. Here is their temporary home The rake, hpricot, feed-normalizer, simple-rss, atom and htmlentities gems are available in my repository. I didn't create the rubygems and librubygems packages themselves - I was sent them, but couldn't find them hosted elsewhere.

It took me a little while to suss out how to create the .debs so I've included the steps here in case anyone finds themselves in the same boat. This works for native Ruby gems and compiled C extensions.

  1. Install the gem inside Scratchbox. Irritatingly, "gem install example" doesn't always want to do very much, so you may need to dowload the gem file and "gem install example-0.1.gem".
  2. Make a new directory with the rubygems-<package>-<version> syntax (the rubygems- prefix seemed to make sense to me): mkdir rubygems-example-0.1
  3. cd rubygems-example-0.1/ ; mkdir gems specifications bin
  4. cp -r /targets/CHINOOK_ARMEL/var/lib/gems/1.8/gems/example-0.1/ gems
  5. cp /targets/CHINOOK_ARMEL/var/lib/gems/1.8/specifications/example-0.1.gemspec specifications/
  6. cp /targets/CHINOOK_ARMEL/var/lib/gems/1.8/bin/example bin/ (if there are any bins)
  7. Create a Makefile with this content (you will need to replace the spaces at the start of the lines with tabs):
    all:
    clean:
    install:
            mkdir -p $(DESTDIR)/var/lib/gems/1.8/gems/
            mkdir -p $(DESTDIR)/var/lib/gems/1.8/bin/     <------ REMOVE THIS LINE IF THERE ARE NO BINS
            mkdir -p $(DESTDIR)/var/lib/gems/1.8/specifications/
            cp -r gems/* $(DESTDIR)/var/lib/gems/1.8/gems/
            cp bin/* $(DESTDIR)/var/lib/gems/1.8/bin/     <------ REMOVE THIS LINE IF THERE ARE NO BINS
            cp specifications/* $(DESTDIR)/var/lib/gems/1.8/specifications/ 
    
  8. dh_make -e you@example.com then choose the type of package.
  9. Edit debian/control to suit. Make sure the section is something like user/Utilities, not just Utilities if you want the package to show in the Application Manager.
  10. dpkg-buildpackage -rfakeroot -b
  11. The parent directory should now contain rubygems-example_0.1-1_armel.deb

As a final note, /var/lib/gems/1.8/bin/ may not be in $PATH, so you'll need to deal with that if you have files in bin/.

A Ruby binding to cracklib

December 28th, 2007

Just released rubylibcrack as a gem (0.1.1). I developed this teeny-weeny binding to the *nix password strength checking library cracklib at my work. Big props to my work, they totally get open source and the way things should be done.

The gem has only been tested on Redhat, Fedora, Gentoo and Ubuntu (all 64bit, I think), but I'd love to hear how it fares on other platforms. Here's a Gentoo ebuild for the package.

Mercurial 0.9.5 for Maemo

December 1st, 2007

I'm using Mercurial to track changes in my latest project, a GTK mapping application. I couldn't find a build for my N800, so I made one myself. I'll host a .deb until I get around to putting it on the garage or creating a repository.

Edit: I've started a garage project.

To install python2.5-runtime I needed to add repository.maemo.org to the application catalogue to satisfy some dependencies. Tested with OS2008 beta on an N800 only.

I’m getting really into Rake, a build tool like Make written in (and therefore able to use the full power of) Ruby. Martin Fowler has a nice article about it.

I’ve been doing some PHP work again recently and, inspired by autotest, knocked together a Rake task which monitors directories and runs my tests when it notices a change. Unlike autotest, which checks for changes every few seconds, this task uses inotify and is rapido enough that it always manages to start the tests before I can switch consoles. Of course, this can be used for running anything, not just the PHP tests I’ve been using recently.

Aside: Simpletest is the nice PHP testing package that I use.

Requirements

  • Linux kernel with inotify (version 2.6.?+)
  • Ruby – only tested with 1.8.4
  • Rake – only tested with 0.7.1
  • ruby-inotify – only tested with 0.3.0, older versions will probably not work

 1 desc "Run the tests." 
 2 task :test do
 3   # assign "out" so that test errors don't cause an exit
 4   out = system "php test/init.php" 
 5 end
 6
 7 desc "Run tests automatically when files change" 
 8 task :keep_testing => [ :test ] do
 9   require 'io/INotify'
10   require 'find'
11
12   # allows us to re-run the tests
13   class Rake::Task
14     attr_accessor :already_invoked
15   end
16   Rake::Task[:test].already_invoked = false
17
18   inotify = INotify::INotify.new
19
20   thread = Thread.new do
21     inotify.each_event do |event|
22       # .swp files are used by Vim
23       if event.type == 'modify' and event.filename !~ /.swp$/
24         puts "#{event.filename} modified..." 
25         puts "===" 
26         Rake::Task[:test].invoke
27         Rake::Task[:test].already_invoked = false
28         puts "" 
29       end
30     end
31   end
32
33   # default list of directories
34   ENV["directories"] ||= 'lib test'
35
36   # start watching the directories
37   ENV["directories"].split.each do |directory|
38     Find.find(directory) do |file|
39       if ['.svn', 'CVS', 'RCS'].include? File.basename(file) or !File.directory? file
40         Find.prune
41       else
42         begin
43           puts "Adding #{file}" 
44           inotify.watch_dir(file)
45         rescue
46           puts "Skipping #{file}: #{$!}" 
47         end
48       end
49     end
50   end
51   puts "" 
52
53   thread.join
54 end

The default list of directories (relative to the current directory) is specified on line 34. You can override this at runtime by specifying the “directories” environment variable.

A new blog engine

April 19th, 2006

RSS readers may not have noticed, but I’ve finally migrated this site to Typo on our new server (Mike has too!). My old Wordpress 1.2 install desperately needed upgrading and I just fancied a change.

Comments are enabled again and hopefully I’ll be able to control the spam better now. No more gallery, I’m using my Flickr account now.

OK, next task is the SCWiki.

EDIT: it isn’t going well. The two Typo installs on this box are leaking memory like a bastard. It has been suggested to me that the problem lies in some compiled code somewhere, but I’m not so convinced. Running the Apache benchmark tool on the Typo installs on this box makes their memory usage shoot up from 29megs to 79megs (it doesn’t go down again). In contract, the unfinished ScottishClimbs rewrite code doesn’t budge in memory usage when hammered with the same benchmark command. It may not be as simple as this, but it certainly appears to be a Typo problem to me. Sod it, I’m off to the Lakes. I’ll worry about this when I get back.

The future of web apps summit

February 9th, 2006

My work were kind enough to send me to the Carson Workshops “The Future of Web Apps” conference in London yesterday. It was a really good day, with some excellent talks. I particularly enjoyed listening to Tom Coates (Yahoo) and Cal Henderson (Flickr). Although it was Steffen Meschkat from Google who took quote of the day for me when comparing software to music: “AJAX is pop software”.

Simon Willison seems to have taken better notes than me.

Update: the guys from Carson Workshops still haven’t made the podcasts available, but another attendee has:

I don’t think he bothered with the Flex advert from the guy from Adobe. Don’t blame him – Flash is dire pish.

If you only want to listen to one or two, I’d go for Cal Henderson and Tom Coates.

Update 2: there are also slides from Tom Coates’ talk available.

Although loads of editors have the ability, I’ve never used code folding before. I’ve seen the point, but clicking little arrows or plus signs with the mouse always seemed just a little too annoying. Like most things in Vim, code folding is very customisable, which allowed me to get it just the way I want it. The default behaviour folds code too much (at least when coding Ruby) to be useful for me, so I had to chuck a couple of lines into my .vimrc file to sort that out and tell Vim to automatically define folds by syntax:

set foldmethod=syntax set foldnestmax=5

Presumably, you need some Ruby syntax highlighting installed for that to work. I compiled in Ruby support when I built Vim.

This is all tickety-boo except that all the folds default to closed when you open a file. To make sure all folds are open when we open a new buffer, I added this auto-command:

autocmd BufEnter * exe "normal zR"

Sorted. The core folding commands for me are:

zo
Open the fold on the same line as the cursor
zc
Close the fold that the cursor is inside
zR
Open all folds
zM
Close all folds

As usual, the docs have way more.

Remapping caps lock in X

January 27th, 2006

Really just posting this so that I can find it again when I need it. I spend most of my day in Vim and never use the caps lock. I finally got round to re-mapping it to the escape button by using xmodmap like so:

xmodmap -e 'keysym Caps_Lock = Escape' -e 'clear Lock'

Just got to re-map my fingers now.

I’m working on a site at work that had a reasonably well laid out specification. At face value it seems like a pretty straightforward online shop, but when you delve deeper the complexity just keeps unfolding: different user types, wholesale accounts, special cases and little flags here, there and everywhere… A few weeks have gone by and we’ve made some important decisions about how things are going to work. It was OK though and we’ve got a nice user, products and permissions system in place. Everything was going to plan. Then we met the client again, partly to re-confirm some functionality. The project has undergone a meteoric shift, with most of the important parts having some major changes and more than half of the work so far has been made obsolete. Now, while this is without doubt a change to the original spec (and we can therefore re-spec and re-quote the work) it’s still incredibly frustrating to see wasted time and code.

Such massive spec changes are thankfully pretty rare, but it does highlight the inefficiencies in our traditional approach to developing applications and I’m wondering how much of a difference a more agile approach would make. Would showing initial builds of the application to the client much earlier and more often have caught these changes before now? I believe so. This may sound like we have some real problems with our approach, but I don’t think it’s really all that different to the large majority of other web development companies out there and, for a lot of projects, it works pretty well. Also, while we’re definitely becoming more convinced that it’s a better way to develop, implementing a more agile approach isn’t all that straightforward. It requires a big shift in attitude and process and I’m not sure there’s much value in trying to move over incrementally. Like any large change, there is some risk involved.

While our actual programming processes are improving all the time, one of the next, and possibly biggest, hurdles is getting over the fact that we would need to show clients not just unfinished code, but barely started code – and that’s intimidating! As developers, we’re happy working with a really empty shell of a site, understanding that it actually works much better under the hood than it appears and that making it look really nice is a pretty straightforward job. But would our clients understand that? Or would they just think it’s crap, freak out and get all jumpy? My own opinion is that they’d be quite happy with it, but probably only after having it all clearly explained to them – which makes this a client management problem as well as a technical one. Another aspect I haven’t quite got my head around is how quoting for work fits with the agile approach. Historically, I find accurate quoting difficult at the best of times and I’m keen to learn how it fits with the agile idea of being adaptive and reacting to change rather than predictive.

I’m not sure what I’m saying here other than “I think agile approaches are better and I would like us to move that way, but I realise it’s not as simple as just making a decision”, maybe I’m just thinking out loud.

SC3, again

November 23rd, 2005

After about a year of hardly thinking about SC3 at all, we seem to be fired up for it again! We’re still using it as a testbed for ideas that may or may not work, which is one of the interesting bits for me. I also enjoy the fact that I get to work on a project without the time and scope constraints (and the compromises that go with them) that need to be imposed on the projects at work.

Anyone interested in the development of SC should read what Mike has written.

Browser rant

June 16th, 2005

Hanno Boeck moans about browsers. I couldn’t agree more.

SVK

May 9th, 2005

I brought my laptop on this mountain biking trip because this seemed like the perfect opportunity to take SVK for a real test drive. How geek is that? I’m using SVK to get over one of the problems that had me a little puzzled about version control – on open source projects, like KDE, non developers sometimes like to help test (or just be on the bleeding edge) by running the latest CVS/SVN version, so it makes sense for developers to at least try to keep the repository code reasonably solid. But how do developers use version control while developing unstable codefor their applications? The obvious solution is to use a second, non-public repository and merge changes into the main repository when things are reasonably stable, but these merges seem like a real pain. I guess you could do the same sort of thing with branches, but that doesn’t seem like the right sort of use of them to me.

SVK is a pretty elegant solution for doing exactly that – it mirrors repositories on your local machine, allowing you to work locally, without a connection to the main repository, commit changes and generally mess about until you’re happy and then merge the changes back into the main repository using a single commit (and an auto message generated from your local commit messages). I’m no expert at version control (and I may be missing major stuff here…), but this seems like a really nice way to do this. Of course, the real test will be how well things work when I get back and merge the changes I’ve made tonight back into the main Subversion repository! I won’t be telling the designer/project manager at work about SVK, it adds a extra level of complexity to version control that he’s just getting to grips with now (after some prodding ;)).

Here is a very good three part SVK tutorial that desperately needs turned into a one part affair!