Posted by avsm
Fri, 24 Jun 2005 13:14:37 GMT
I bought a Nokia 7610 some time ago, and have taken hundreds of pictures using it. When creating the gallery section of my site, I ran into an annoying limitation: the pictures contained on the phone did not embed the date the picture was taken as part of the image. Manually copying the date and time for 350 images was a bit much as well...
The problem with sending images via Bluetooth to my laptop is that the OBEX transfer stamps the date of the transfer instead of the date the picture was taken. There turned out to be a conveniently easy answer to this problem though, as Nokia released a version of Python for Symbian Series 60. This suddenly elevates the phone from being a complete pain to program (due to the Symbian C++ libraries being amazingly badly documented), to something that's actually quite usable.
It took about an hour to come up with the first cut of imgcollect.py, which assembles a list of mtimes for each image on my phone, performs Bluetooth Device Discovery, and transmits the mtimes and all the pictures to my laptop. After that, a little shell script on the laptop is enough to stamp the pictures with the correct mtime:
#!/bin/sh
while read FNAME MTIME; do
DATE=`date -r $MTIME "+%G%m%d%H%M.%S"`
touch -t $DATE $FNAME
done
I'm actually quite impressed with Nokia at last! Next step is to work out a two-way synchronization so that I don't keep re-transmitting images which I already have on the phone (unfortunately, iSync is pretty useless with the Nokia 7610, even in Tiger).
Posted in hacking | no comments
Posted by avsm
Thu, 23 Jun 2005 20:40:18 GMT
Well ok, it wasn't the fastest game ever, but the graduate team assembled today to play the now-traditional summer cricket match against the staff of Robinson College. It had a moderately nail-biting finish, with the students clinching victory with one over to spare! Unfortunately, that put me on the losing side, as I was subbed to the staff since they were one short. But I reckon I can claim the moral victory!
 A formidable squad assembles... |
 ...and a glorious day to avoid writing thesis begins |
 This is a picture of us playing croquet a few days ago, in case you were bored of cricket. |
Posted in sport, cambridge | no comments
Posted by avsm
Tue, 21 Jun 2005 21:01:38 GMT
The Subethaedit syntax highlighting for OCaml is working nicely. I fixed up few minor bugs and packaged up version 1.1, available here. Have fun!
Posted in hacking | no comments
Posted by avsm
Tue, 21 Jun 2005 15:30:59 GMT
Summer is upon us, the sun is shining, the birds are singing, and ... the thesisometer has returned, courtesy of Andy Warfield!
It's going to be a long summer ...
Posted in research, cambridge | no comments
Posted by avsm
Sat, 04 Jun 2005 15:14:18 GMT
Finally had some time to get back from the OpenBSD hackathon and take stock of what I worked on. It was pretty interesting one this year, as I went without having much idea of what to work on (unlike last year, when I had a mad backlog to catch up on). Some stuff I did during the week included:
- Clean up the atomicio interface used in OpenSSH and nc(1) to provide simpler semantics. Error checking from read/write functions are a real headache in C, as the functions return -1 on error, which means a signed ssize_t is returned. However, they accept an unsigned value as the size of the buffer to process, which means they could potentially return a value outside the range of the return value. This means you have to check if the return is -1, which indicates an error, and otherwise cast to a size_t to correctly get the buffer size back. With the new atomicio, it always returns a size_t, and returns 0 to signal an error (with errno containing the error, and EPIPE being set for an EOF condition).
- Start looking at the Bluetooth stack to get L2CAP and RFCOMM support. We are half-way through un-netgraphing the FreeBSD stack and having a more traditional netbt socket interface (much like netinet or netinet6) to Bluetooth.
- Use CIL to implement a few fun kernel source->source transforms. kerneltrace just accepts a regular expression and inserts a printf in the function prologue which outputs the function name and any arguments passed into it. Had this idea when chatting with Marius, and it turned out to be very useful when trying to figure out dataflow in the Bluetooth stack (just compile with make CC="/usr/local/bin/cilly --dokerneltrace --trace-regexp='ubt|ng_blue'").
The second one was even simpler; randomvars assigns a non-zero value to every local variable in a function call to help track down uninitialized-local-variable bugs. Heres one Chad Loder found in mg(1).
- Other random signed/unsigned cleanups in OpenSSH. Boring but important I guess...
All in all, the hackathon re-motivated me to continue work on the OCaml-based daemons that Dave and I have been hacking on. I don't want to be fixing random buffer or integer overflows in an OpenBSD hackathon 5 years from now; we need to move on to more high-level issues.
Posted in openbsd, hacking | no comments
Posted by avsm
Wed, 25 May 2005 22:58:19 GMT
The hackathon is drumming along nicely, with all kinds of crazy diffs being committed. However, all of us have been rather worried about the lack of Royal appreciation for the hard work put in by the OpenBSD development team. Luckily, word of the hackathon has spread far and wide, and the photos below reveal exclusively how the Queen now endorses* OpenBSD!
* "Endorsement" does not imply actual endorsement, but rather "passing within 100 metres of project".
 A Royal Steed |
 The crowds gather excitedly |
 Yes!! That pixel is the Queen!! |
Posted in openbsd | no comments
Posted by avsm
Mon, 23 May 2005 20:00:04 GMT
I got tired of trying to combine the various blogging and gallery tools
into something that did what I wanted: take a simple directory of images,
blog entries, links, papers and output a nice HTML/RSS version of the
directory. So I hacked up a quick blog tool in OCaml that does the trick,
and put it live.
Its got quite a few rough edges at the moment, especially to do with
the lack of date archives and the large number of images on the front page
of the gallery.
Note that the location of the RSS links have changed as well, as I've
switched to using ocaml-rss for outputting
it instead of the homebrew format used before in blosxom.
One thing that has come out really well is the use of a flat tag namespace instead of the previous directory structure; it allows me to share stories and images among multiple categories without needing symlink hacks.
Posted in recoil, hacking | no comments
Posted by avsm
Wed, 04 May 2005 15:34:13 GMT
I got tired of using the older version of Subethaedit just for its OCaml syntax highlighting mode, so I ported the highlighter to the latest version of the editor. You can grab it from my projects page.
I think the only thing Subethaedit needs for perfection would be to be able to revert to a saved version more reliably; right now if I CVS commit a file, I need to close and re-open it in the editor or else the next save goes wrong. That, and a clean tabbed view for multiple document. And ... and ... I guess the list goes on, and it'll just be bloated like crazy!
Posted in hacking | no comments
|