peteg's blog - AYAD

Trung Nguyên: 1 Nguyễn Thông, District 3.

/AYAD/HCMC/Cafes | Link

This "official" one is at the railway station. As the whole place is smoke-free, it is quite comfortable, albeit totally empty. I think the train users have other things on their minds than coffee. Perhaps it gets busy when the train comes in. The coffee is so-so.

Trung Nguyên: 26B-C Lê Lợi

/AYAD/HCMC/Cafes | Link

A brand-new tiny "official" cafe in the heart of the tourist district. The coffee wasn't great, the prices are the same as elsewhere, and there is little to attact me to this place.

Trung Nguyên: Corner of Trương Dịnh and Lý Tự Trọng.

/AYAD/HCMC/Cafes | Link

This one is new since my last visit. It is an "official" one, quite similar to the others, with a non-smoking floor. Quite near the tourist areas. There is no point drinking anything but the coffee as everything is expensive. I got a card and now have a few other new ones to check out.

Finally, xe ba bánh photos.

/AYAD | Link

Following Andrew T's advice I uploaded a bunch of photos to Google's Picasa. Enjoy. The quality is a lot lower than the originals but you get the idea.


I spent National Day with Loan in HCMC. The modern nation of Việt Nam is 35 years old now. We went to the zoo, to visit the elephants. Here I am feeding one of the old cows some sugar cane. I think she remembered me from two years ago.

Daz's water and sanitation project in the news

/AYAD | Link


The Poetry of Nguyễn Du.

/AYAD | Link


Trung Nguyên: 218B Pasteur, District 3.

/AYAD/HCMC/Cafes | Link




Bố của Sir Cử

/AYAD | Link

Bố của Sir Cử


Nhà hàng Việt Chay Vĩnh Nghiêm



Rounding up some press.

/AYAD/Project | Link

Chị Yến,


Website launch.

/AYAD/Project | Link


DRD Website Mới live.

/AYAD/Project | Link

Partly by accident, partly by design, the new DRD website is now live. It has some remaining rough edges which I'll be ironing out this week and next. We'll have a launch press conference this Sunday, June 29. Any and all feedback is very welcome.

Project blah blah.

/AYAD/Project | Link

I've been reading a lot of accessibility articles. Most are (at best) unscientific. If you can cope with the outmoded HTML advice, the best is Joe Clark's Building Accessible Websites. I feel his treatment of colour blindness is ... excessive, in a good way.

Finally someone has cooked up a good explanation of how to stuff Flash into a webpage, and why <embed> lurches forever onward. It has convinced me that if one decides to be evil and use Flash, one must necessarily also use JavaScript.

My goal of actually putting the XML part of XHTML to work by validating the comments and general content coming into HOPE with HaXml is mostly working, modulo some bugs here and there. Break it here: (soon to become the main DRD site, I hope.)

The I'm-in-a-hurry guide to accessibility.

/AYAD/Project | Link

I've been warmly surprised by some of the general-topics things I've found on the net recently; either Google's search results are tending away from waffle or I am becoming very adept at closing tabs and flushing the short-term memory buffer. Dive into Accessibility is straightfoward and the tips mostly directly applicable. Unfortunately it has dated a bit; I shudder to think that there are too many HTML 4 websites out there that people now want to make accessible...

I slightly quibble with his advice on access keys (Day 15, p32 of the PDF), where he suggests that a stroke survivor may make use of them. I expect there are many people who struggle to make key chords, especially those having the use of just one hand.

To accesskey or not to accesskey...

/AYAD/Project | Link

An accesskey is another of the W3's ways of muddling concerns; when you type something into a web browser, what does it mean? Does the browser get the keystroke or the page, or the form, and which form are we talking about anyway... It seems the prevailing wisdom is not to use accesskeys as the implementations are broken; in a nutshell, this misfeature is not compositional, a feature shared with all the very worst XHTML ideas.

Back in the real world we're stuck between doing something "many users will be familiar with" (yeah, I remember that) and leaving things alone. I've decided to follow the BBC's ambivalent lead here.

Lazy CSV Parsing in Haskell.

/AYAD/Project | Link

One of the fun bits about this project is the text munging that comes with it. The regexp libraries for Haskell have super-sophisticated do-what-I-think-you-mean interfaces and not enough (simple) use-cases in the docs. Couple that with my concerns about Unicode support and I'm stuck doing it the very old fashioned way.

OK, enough editorialising; I've written a mostly-{RFC 4810, Haskell 98}-compliant lazy CSV parser that appears to work OK on reasonable-sized inputs. Existing solutions use Parsec, whose return type seems to guarantee that more-or-less the entire output must reside in memory at some point. This might be OK for small files, but the 6Mb of Unicode data I need to import consumes a ridiculous amount of memory, even with GHC's optimiser going full-bore.

You can find it here. The licence is BSD. Couple it with the appropriate utf8-string for your GHC and it works well on UTF-8-encoded files.

Now, to track down a nasty memory leak somewhere in the database code... the profiler tells me SYSTEM is hanging onto some stuff, but not what SYSTEM actually is. Err, what did Fergus say again?

Simplifying the XHTML DTD for fun and profit.

/AYAD/Project | Link

For the usual reasons it seemed best to use FCKeditor as an input widget for HOPE. I had hoped to provide some kind of hacker-friendly markup but time is short and convincing FCKeditor to generate it would probably require some heart surgery. So XHTML everywhere it is.

Clearly this path should lead to paranoia; we can't allow users to submit arbitary strings, or even arbitary XHTML. My heavyweight solution is to validate such submissions against a stripped-down XHTML DTD using HaXml. So far I've removed forms, scripts and restricted the attributes of <a> to just href. I wish the DTD was readable; it is merely an algebraic data type afterall.

Combined with some thorough string-escaping for the other inputs and a tendency to cop-out (crash) on anything that doesn't completely conform to expectations, I think we will be all right.

You can try your hand here. Any and all feedback is much appreciated.

In related news I've uploaded my FCKeditor "server-side integration" Haskell library to Hackage. Find that here.

Trung Nguyên: 301B An Dương Vương, District 5.

/AYAD/HCMC/Cafes | Link

Fellow-and-soon-to-be-ex-AYAD Yen steered me to this seedy old man's café quite near my usual and increasingly dear 603. While ancient, I wasn't calcified enough to last long at this place. They only serve the one type of Trung Nguyên coffee, which is a bit punk.

Café Du Miên, 48/9A Hồ Biểu Chánh, District Phú Nhuận.

/AYAD/HCMC/Cafes | Link

Chị Lan (my AYAD In-Country Manager) took us to this café on our first morning in Hồ Chí Minh City, way back in July 2007. It's a friend of Cà Phê Thềm Xưa. I went there today with Loan. We played a few games of Carcassonne (which I'd given her for her birthday) and chatted about xe ba bánh.