dgh is currently certified at Journeyer level.

Name: Dafydd Harries
Member since: 2003-11-11 18:28:09
Last Login: 2007-11-25 21:19:37

FOAF RDF Share This

Homepage: http://rhydd.org


Recent blog entries by dgh

Syndication: RSS 2.0

removing cartridge bearings

Finding advice on removing a cartridge bearing from a bicycle wheel proved surprisingly difficult recently. Even a fairly recent and comprehensive bicycle repair manual that I had to hand didn't say anything about it.

It turns out the way to do it is to remove any end caps and locknuts and washers and nuts and then bang the end of the axle really hard against a piece of wood. You will probably make dents in the piece of wood.

This works because cartridge bearings are pressure fit both to the hub and to the axle. (This is really neat!) Both the hub and the axle are stepped to hold the cartridge in place. A hard enough bang will simultaneously make the step on the upmost side of the axle pop the upmost cartridge from the hub and make the step on the downmost side of the hub pop the downmost cartridge from the axle. You can then pull the axle out and remove the other cartridge by poking through a screwdriver or similar and tapping with a mallet.

Syndicated 2011-03-31 04:37:43 from Dafydd

Breakdown: Markdown for presentations

Recently I've been giving a few talks, and anticipate giving several more in the near future, and have been getting annoyed at how time-consuming writing the slides is. My current preferred (read: least despised) tool for writing slides is LaTeX Beamer, which is a fairly good compromise between simplicity, control and quality. However, the markup is still somewhat verbose, and hence time-consuming to edit.

To make things easier, I wrote a tool, Breakdown, which converts Markdown to Beamer. Of course, Markdown only has limited text formatting capabilities, so Breakdown passes through LaTeX commands. This way, the easy things are easy and hard things are possible.

For example, the markup:


# Breakdown

Write your presentations in Markdown!

 * Quick and simple
 * Use \LaTeX syntax when you need to, e.g.
     * for equations: $e^{i\pi} + 1 = 0$
     * for ``quoting'' things
     * for images, code listings, tables, quotations\ldots

Gets converted to:

Conversion can be automated using a couple of Makefile rules:

  %.pdf: %.tex
        rubber -d $<

%.tex: %.mdwn
        breakdown < $< > $@

Thankfully, the excellent Pandoc Haskell library does msot of the work; most of the Breakdown code is for splitting the input into slides.

Breakdown has a competitor in wiki2beamer, but I like the fact that Breakdown uses a standard markup language and standard TeX commands with a very small amount of custom syntax, rather than a custom wiki-style markup. Each to their own.

The code is in a git repository.

Syndicated 2011-03-01 19:40:26 from Dafydd

dgh @ 2009-05-16T11:09:00

Futility Closet, ever edifying, notes that the word “ravine” is reversed when rot13 is applied. Are there other words that have the same property? We can easily find out with a bit of code:

> import qualified Data.ByteString.Char8 as B
> rot13 = B.map (toEnum . r . fromEnum)
>    where r c | (65 <= c) && (c <= 90)  = (c - 65 + 13) `mod` 26 + 65
>              | (97 <= c) && (c <= 122) = (c - 97 + 13) `mod` 26 + 97
>              | otherwise = c
> main = B.interact (B.unlines . filter (\x -> rot13 x == B.reverse x) . B.lines)

The answer: not many. Running this on /usr/share/dict/words yields a paltry 12 words; all of which, “ravine” excepted, are four letters or less. We get slightly better results running it on the 390,583-word british-english-huge file from 12dicts (which I keep installed for exactly this sort of tomfoolery). On the other hand, some of the extra words are quite obscure. The full list:

an anan cherup fans fobs fs gant gnat grivet na nana ravine re rebore rive robe serf tang thug uh

(This post can be compiled by saving it as a .lhs file and running ghc --make on it.)

Syndicated 2009-05-16 08:35:52 from Dafydd

3 May 2009 (updated 14 Aug 2009 at 09:18 UTC) »

recent hacking


I enjoy crosswords very much, and for a while I've been loading the free Houston Chronicle crosswords in Xword. Although they indulge in sports references (which I'm useless at) and tend to be a little repetitive, they have nice puns and they have a good variety of difficulties (they follow the US convention of easiest ones on Mondays and hardest ones on Sundays). Incidentally, the repetitiveness seems common to US crosswords — perhaps a side-effect of the US grid style?

However, I like the Guardian's crosswords a lot too. Unlike the Chronicle, they have cryptics, which I like to try my hand at from time to time. The problem is that the Guardian crosswords are only available online via an annoying Java applet or as PDFs. I managed to work around this using the fact that the input to the Java applet is encoded on a screen-scrapable HTML page, and wrote a tool to convert the HTML to the AcrossLite .puz format. To get the reulsting files to work in Xword, I had to write some patches to support British-style grids.


A crude command-line client for translate.google.com.


Like debi, but installs packages to a remote host over SSH. Useful when cross-compilating for Debian-based embedded systems.

Syndicated 2009-05-03 19:55:15 (Updated 2009-08-14 08:44:21) from Dafydd

25 Feb 2009 (updated 25 Feb 2009 at 20:09 UTC) »

Jingle interoperability day

Before FOSDEM this year, a bunch of people got together to test our various Jingle implementations with each other. Attendance was great: I think we had representatives from most implementations, and we almost ran out of chairs.

Paul Witty from Tandberg and Sjoerd from Collabora, testing Jingle calls to a Tandberg video conferencing endpoint.

I'd judge the event a great success: we found a number of bugs and even fixed some of them the same day. In particular for Collabora, we got to try out our new support for raw UDP transports and the latest ICE signalling. There was also good discussion about future directions for file transfer and relaying support in Jingle, as well as XTLS and its relationship to Jingle. Plus, the testing done on the day itself was continued afterwards, notably including working interoperability between our ICE library, libnice, with Paul's implementation.

Syndicated 2009-02-25 08:10:04 (Updated 2009-02-25 19:44:34) from Dafydd

22 older entries...


dgh certified others as follows:

  • dgh certified Telsa as Journeyer
  • dgh certified pjdowner as Apprentice
  • dgh certified dgh as Journeyer
  • dgh certified Rhys as Journeyer
  • dgh certified alan as Master
  • dgh certified Jordi as Journeyer
  • dgh certified menthos as Journeyer
  • dgh certified lkcl as Apprentice
  • dgh certified alp as Journeyer
  • dgh certified daniels as Journeyer
  • dgh certified thom as Journeyer

Others have certified dgh as follows:

  • dgh certified dgh as Journeyer
  • Telsa certified dgh as Journeyer
  • Rhys certified dgh as Journeyer
  • mako certified dgh as Journeyer
  • chakie certified dgh as Journeyer
  • hiddenpower certified dgh as Journeyer
  • alp certified dgh as Journeyer

[ Certification disabled because you're not logged in. ]

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!

Share this page