Feb. 20th, 2011 04:41 pm
marnanel: (Default)
A cat on a bed

Rio has been learning poems by Eleanor Farjeon and A. A. Milne, and reciting them to me. Impressively, when she makes mistakes they are starting not to affect meaning or metre. I am very proud of her.

The spring is beginning to arrive, and I'm feeling quite a lot better than I was. I'm reminded of the stories about how a hundred years ago kids would be sewn into their winter underwear in the autumn and cut out again in spring; leaving the winter behind feels like finally getting free of your winter underclothes must have felt. I was talking to Sumana earlier about my poem May and how I think of it this time of year, and how people seem to like its description of seasonal change, even though they perhaps often miss the extra meanings about Revelation 22.

My grandfather was buried on Friday. They put my sonnet into the order of service.

We found his medal collection: I thought you might like to see it.

I spent far too long yesterday hacking: something I love to do, and in a way it defines me, but if left to my own devices I would spend the whole day doing nothing else. That would be bad. Yesterday I started adapting the imgur integration to use the new API, and built part of a test harness I had been daydreaming about, and made a start on debianising some fonts I need, and played around with an idea I had for a LiveJournal/Dreamwidth to Atom adaptor which allows you to read friends-only posts in a desktop feed reader. (I call it ljferea. I may be the only person amused by this.) I also tried to explain things to someone who was creating a new programming language, and told the story of where Firinel's name comes from.

There's much more I'd like to write, but little time, and it's only a half-formed wish anyway.


Feb. 19th, 2011 01:50 am
marnanel: (Default)
I wanted to write a post about a happy memory to do with programming and networks.

Many years ago I used to help teach programming on a Scripture Union camp called Transformers. Our lab was at the top of a hill, with a large window looking down the grassy slope and facing a similar window in the building at the bottom. That building was the radio studio. The radio show broadcast all day over our wired ethernet network, and was played by a spare machine in every lab. After several hours of broadcast there was a lag of several seconds.

One day, someone requested YMCA by the Village People. When the song started in the programming lab, we looked down the hill to the studio. The radio crew were dancing, so naturally we stopped talking about recursion and started dancing too. This repeated itself on several following days, until people elsewhere who weren't in on the joke kept complaining on IRC about the same song being played constantly.

The joke was to play it late in the afternoon so that there was a large lag. When you're dancing to the same music as people you can see, but with a lag of ten seconds or so from what they can hear, it's surprisingly amusing.

Fortunately, someone took a photo:


I think my favourite part of this picture is the kid on the right who is quietly getting on with his assignment.
marnanel: (Default)
In case it's useful to anyone else, here is a script to list translators of a program since the most recent release (defined as the most recent time you made a commit to NEWS). It goes in /usr/local/bin/git-translators, so that you can invoke it as git translators:

[marnanel@tinidril metacity]$ git translators
Khaled Hosny (ar); Jordi Mas, David Planella (ca); Carles Ferrando
(ca@valencia); Petr Kovar (cs); Christian Kirbach (de); Daniel Mustieles, Jorge
González (es); Ivar Smolin, Mattias Põldaru (et); Mahyar Moghimi (fa); Fran
Diéguez (gl); Yaron Shahrabani (he); Gabor Kelemen (hu); Kjartan Maraas (nb);
Og B. Maciel (pt_BR); Matej Urbančič (sl); Daniel Nylander (sv); Gheyret
T.Kenji (ug); Maxim V. Dziumanenko (uk); Nguyễn Thái Ngọc Duy (vi); Wei-Lun
Chao (zh_HK); Wei-Lun Chao (zh_TW).
[marnanel@tinidril metacity]$

I know there are other similar scripts out there; I wrote this a while ago when I couldn't find any of them quickly that still worked after we changed from using svn.
marnanel: (Default)
If you're not interested in coding nargery, you can skip this post.

Two things you need to know to read it:
  1. It's a lot simpler to pass lists of strings over DBus than it is to pass lists of pairs of strings.
  2. Images on imgur.com are identified by a five-character code, such as c7bC9. This gives us a URL of http://i.imgur.com/c7bC9.jpg , but you can also find a thumbnail by appending an "s" to the basename: http://i.imgur.com/c7bC9s.jpg .
I have a call in the DBus service that forms the back end of the imgur integration: it lists all the images you have uploaded. Now, a thumbnail of each such image is held on disk with the same basename as the image's ID. So here, "/home/marnanel/.local/share/imgur/c7bC9.jpg" (note: not c7bC9s.jpg, even though it's the same file as the URL which ends that way).

Clients might want to know two things about each image: its ID, and where to find a thumbnail. We could just list IDs, but then the client would have to make a call for every ID, asking where the thumbnail was, and that would be wasteful. I could have passed pairs of strings, but that's a bit clunky. What I did instead was to say that a filename was considered a non-canonical form of ID. When you pass in a filename, it takes the basename and uses that as an ID instead. So we can just supply a list of filenames of thumbnails, and the client can use those filenames as IDs, and we still know what they mean. It works rather well.

Now I would like to extend this by allowing people to look up not only images they have stored locally, but also the popular images of the day. Clearly the filename trick could be extended to URLs. But as mentioned earlier, http://i.imgur.com/c7bC9.jpg is the address of the original image, not the thumbnail. So we have a choice between sending them a list of full-size images, and sending them thumbnails and having to rewrite the canonicalisation rules.

I could
  • say that six-character IDs ending in "s" are a non-canonical form of five-character IDs with the "s" removed. I am leaning towards this option. It keeps everything in line, but it's a bit of a hack, and after all we're receiving the actual thumbnail URL. On the other hand, we could always check that the actual thumbnail URL is what we expect, and discard the entry if it isn't.
  • supply five-character IDs, but expect the client to know how to turn the URL of an image into the URL of a thumbnail. This is also a bit of a hack, because it's specific to imgur.com and I expect it might be useful to run this program against other servers.
  • just give up on this thing and supply pairs of strings instead.
Your thoughts, gentle reader, are as welcome as ever they were.
marnanel: (Default)
Anyone fancy beta-testing imgur upload for Maemo? Let me know how you get on.

Deb: http://www.chiark.greenend.org.uk/~tthurman/imgur/tmp/imgur_0.50-1_armel.deb

Source: https://github.com/tthurman/imgur-integration




Instructions are included.

Update: Now in extras-testing.


Jan. 29th, 2011 10:53 pm
marnanel: (Default)
I spent perhaps too much of today coding. I didn't really mean to spend quite that long on it, though it was a lot of fun. Will Thompson's help fixing DBus problems was invaluable. Version 0.50 of imgur integration will be coming to a Maemo repository near you soon:

Later, since it's my birthday tomorrow, we went out for a curry. It was pretty good, but rather mild. I was amused that the people at the next table to us were clearly English as well. Then we went to the bookshop, came home, and had some coffee. A pretty good day, all told.
marnanel: (Default)
When people IM me out of the blue, so that I'm working in another program and a notification pops up, very often what they're sending me is a URL they want me to look at.

I would rather like it if notifications which contained only a URL had a "Follow" button, like this:

Then I could either dismiss the message, or go and see what they were talking about, without having to switch back to Empathy on the way.

I raised bug 640917 about this today, in case anyone else happens to agree with me that this would be nifty.
marnanel: (Default)
And on another issue: nobody on IRC seems to know a solution, so perhaps someone here does: is there a known issue that would cause libtool to add an X to the start of every line of its input? (The result looks like this.)

This is rather a nuisance, because it stops me doing things.

Update: autoreconf -f -i -v fixed it. Thanks, anonymous hacker!
marnanel: (Default)
It would be rather useful if there was a PermittedHours field in the .desktop file spec. It would list the hours during which the program could be run. That's not just for kids, it's also for me, in the manner of LeechBlock:

[Desktop Entry]
Name=Some Program I Use For Work
Comment=But let's say I don't want to be tempted to spend all evening working on it

[Desktop Entry]
Comment=And I definitely shouldn't be playing this during work hours

I wonder how best we could do per-user settings, though.

My idea is to prevent launching the program during those hours. What would happen if the system saw the program was still running when the time had expired, I'm not sure. Maybe nothing, or maybe it would put up a notification telling me I have five minutes to quit or the process gets it.

I know nanny does some of this, but I wonder whether it's generally something that should exist in application launchers.

What do you think? Worth suggesting to them?
marnanel: (Default)
A spot of lunchtime hackery brings you imgur integration v0.4.0, "Stieglitz". Here's the original announcement, in case you'd like the background.

New in this version:
  • Configuration files.
  • A man page.
  • Recording of details of previous uploads, API to check them, and commandline switches to access this API.
  • Details are always printed to stdout, even if the browser is launched.
  • Extra column in stdout details, giving the ID of the whole record.
  • More tests.
  • Bugfixes.
Next version will concentrate on getting Maemo libsharing working, which will be of great interest to some of you and none at all to the rest.

Download the tarball of 0.4.0, or look at the source control.

There is no packaging yet except for Gentoo; thanks to Dean Matzkov for doing the Gentoo packaging. Deb and RPM will follow soon.

Unrelatedly, the planets may like to hear about an awesome review of my storybook.
marnanel: (Default)
This morning I finally got around to testing the rewritten MeeGo version of robotfindskitten on the N900. It works passably well:


You see that the text is missing.


There are a few other things wrong (we need to use Maemo banners, not dialogue boxes; the vibration at the end needs reimplementing) but I think it will be good to go in a week or so of snatched moments here and there. If you'd like to test, let me know.

(I'm thinking of making the title page dark grey, and losing the text across the top, to look more Maemo-like than MeeGo-like.)
marnanel: (Default)
Every contact database program I know has a "nickname" field. Today I was thinking that I use the same values in that field for EXIF tags, and what I'd like to see is a plugin (or better, to see it coming out of the box) with a button on each person's contact record. The button would query Tracker, and then launch gthumb or the local equivalent to show images of that person. The button would not display if there were no such images.

Something like this (on Maemo, though the principle is the same for GNOME):


(It's interesting to consider whether the plugin should assemble the list and then pass it to gthumb, or whether gthumb should be extended so that it can be passed a switch to display all pictures known to Tracker with a given tag.)

Of course, Tracker also tracks things other than images, so you could also have buttons for wordprocessor documents, emails, and so on. I could do this (in a while, when I have some time); would any of you want it?


Jan. 18th, 2011 02:12 pm
marnanel: (Default)
I keep most of my windows maximised, including the browser and the terminal. When I'm testing patches, I often have my browser open at a bug tracker. I like to test patches on a local branch named, say, bug156543, and obviously I also have to mention the bug number in the commit message. But I find it quite tricky to memorise arbitrary six-digit numbers, and it's a nuisance to keep switching windows to see the bug number. And of course it's impossible to automate this process.

Hence this program. It scans the titles of each open window and finds anything called "bug NNN", where NNN is a decimal number. It then prints the number. If there's more than one such, it separates them with spaces. If there are none, it prints none.

If you give it a single argument, it will replace %d wherever it occurs in that string with the relevant bug numbers.

Example of use:

$ git branch `bugid bug%d`

$ git commit -m "Added bouncy castle. Closes `bugid #%d`"

Well, it's useful to me, anyway, so I thought it might be useful to you.
marnanel: (Default)
I have had this sitting half-written in my projects directory for far too long, so I present: Imgur Integration version 0.20. imgur.com is a website which allows you to host arbitrary images without creating an account. This program includes a DBus service which allows posting of images to imgur.com, a command-line interface to the DBus service, and an Eye of Gnome plugin to do the same. It is not an official client, but I have talked to the imgur admins and they are happy about its existence.

So when you open a picture, you have a menu option that uploads it and opens a browser at the right page, with no configuration, thus:


You have to turn on the plugin in eog after installation (Edit > Preferences > Plugins > Post to imgur.com). If I package this, I may make it turn on automatically, since it's a little hard to find this.

As originally conceived, it would have also allowed you to use libsocialweb to tweet/dent the resulting URL. I took this out for now because libsocialweb also has API to post pictures, and I wasn't sure how best to do it. There is still a rather useless dependency on libsocialweb. Sorry about that.

eog seems not to look in /usr/local/share/eog/plugins, only /usr/share/eog/plugins. You may therefore have to set --prefix appropriately, or simply copy the files from /usr/local to /usr by hand after installation. Sorry about that, too.

There was a partially-written libsharing plugin for Maemo which used the imgur DBus service, but it's not finished. It could be finished, if people would like it.

Other thoughts on how the program could develop are in the README. You can download the program or look at the source control. This is quite a rough draft. Patches and suggestions are, as always, welcome.
marnanel: (Default)
I've been looking at QML today. Here's a little Christmas present for you all: an adventure game in QML.

This is probably really ugly QML because I'm still learning it. It uses the Gnusto just-in-time compiler as the back end.

You can download this and play with it here (please! play with it and extend it as you see fit): qml-gnusto-0.01.tar.bz2

(And if you like adventure games, you might also like today's poem.)


Dec. 17th, 2010 01:35 pm
marnanel: (Default)
There has been a lot of fuss about del.icio.us shutting down (along with AltaVista— my goodness, I used that when I was an undergrad. How weird to see it go).

I am worried that someone out there is going to go to all the effort of writing a new del.ici.ous. Or more likely several someones, and all the results will be incompatible. As Mark Pilgrim points out, this is a bad idea. Don't do it.

I'd like to offer a better suggestion. Write something that takes the not-really-XML of the del.icio.us backup format and uploads it line by line to a given identi.ca account. So, for example,

<DT><A HREF="http://www.paulmeier.com/ipa/charts.html" ADD_DATE="1104124425" PRIVATE="0" TAGS="flash,linguistics,phonetics">Flash-based IPA charts</A>


http://www.paulmeier.com/ipa/charts.html Flash-based IPA charts #flash #linguistics #phonetics

That way
  • you keep your bookmarks somewhere
  • that somewhere runs on free software
  • tags still work
  • you can make feeds
  • you can get daily dumps added to your blog
and so on.  If there's something it can't do, it's far better to do it in identi.ca and then extend identi.ca than to write a whole new site.

The main issue is that the string becomes longer than 140 characters, but there are ways around that.

If anyone writes such a script, let me know and I'll link it here.
marnanel: (Default)
Earlier this year, arising out of a conversation at GUADEC, I wrote a nautilus plugin to upload images to imgur.com. (This is useful because imgur doesn't require an account: you can just install, hit "upload", and off you go.)

Here is a copy of the same thing as a MeeGo RPM, suitable for use on the Lenovo machines distributed at the MeeGo conference. Once this is installed, you can select a .jpg image in the file browser, press the menu button, and choose "Post to imgur" from the resulting menu. Equivalently, you can choose the same option from the Edit menu. The image will be uploaded, and the web browser will pop up at the new URL.  Then you can send it to your friends, embed it in a blog post, or whatever you like.

The source is here.

Things I would like to do with this:
  • Add a similar menu option to the image viewer (which is currently Eye of GNOME).   I haven't looked into how easy it is to extend eog.
  • Add an icon to the launcher which brought up a file chooser.
  • Separate out the uploading part to a DBus service.
  • Do this as a libsharing plugin for Maemo.  I would do this, but I have broken my scratchbox and have no tuits to fix it.
  • Have some app which remembered the images you'd uploaded and helped you find them again.  Especially, if you try to upload the same image twice, it should just take you to the previous copy.
Let me know if you use this, what feedback you have, and whether any of the above would be useful to you.
marnanel: (Default)
Further to my previous post:

Here's a live AJAX-based version you can play with. It's not very fast unless the word is cached, and it only takes at most a word of context (unlike the real thing, where the context is everything you've ever typed), but it should serve to demonstrate the principle.

Now to release the code, and to look into patching existing VKB systems.
marnanel: (Default)
Funnily enough, someone was asking about virtual keyboards on gtk-list this morning.

Last week at the MeeGo Conference several people were talking about virtual keyboards, and the idea came up of doing predictive text, either by making more likely letters physically larger, or merely by increasing their sensitivity.

When I came home, I wrote a JavaScript mock-up based on a third-order Markov chain. It's quite fun to play with, especially on a touchscreen.

When I showed this to a few people at Collabora and elsewhere, Rob McQueen suggested avoiding reinventing the wheel by using the rather wonderful Dasher system as a back end. So, after a longish hacking session, here it is:

State of the keyboard after typing "FLO".

Click here to see a video of the keyboard in action

The front end shown here is just a custom GTK widget I threw together; in real life it would use an existing input method. I've exaggerated the differences between letter sizes for demonstration. (As I mentioned above, the physical letter sizes might not change at all.)

There is a wiki page about all this. Let me know if you'd be interested in helping work on this; I'll be releasing the code shortly, and adding a link on the wiki to it. (Odd thought: I wonder how useful another demonstration piece of JavaScript would be, pulling data from Dasher running as a CGI. Let me know.)

There is also an existing roughly similar system for Android, and, I hear, for the iPhone.

Update: An AJAX version you can play with.


marnanel: (Default)

October 2017

15 161718192021


RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Oct. 19th, 2017 09:35 pm
Powered by Dreamwidth Studios