forrest is currently certified at Apprentice level.

Name: Forrest Cahoon
Member since: 2000-08-23 00:58:40
Last Login: 2010-05-18 14:47:49

FOAF RDF Share This



My one significant contribution to the free software universe is my Hanzi Quiz program.

I've got a few perl modules up on CPAN (ok, actually just one now).

I'm a VMS programmer by day, and I find that OS interesting. But I prefer the free stuff.

Recent blog entries by forrest

Syndication: RSS 2.0

Hello, Advogatans! Long time, no post. Maybe I can get to meet some of you at OSCON this year.

My new project -- which is no more than an idea at this point -- is inspired by my older son, who at 4 years old is confidently navigating to bookmarked websites to play flash games.

What better way to establish a "point system" to reward him for the things he should be doing than with a web app? I think it's time for me to write the "Helper to Establish and Nurture Responsibility in Youth", or "HENRY".

The basic features would be

  • a web page for the child which can be easily bookmarked, and shows the accumulation of points towards some pre-established goal in some easily understandable (and hopefully, inspiring) fashion
  • multiple administrators (e.g. both parents) with password-protected logins
  • an administrator interface to add tasks and assign point values to them
  • an administrator interface to mark tasks as being done, and so award points, which shows what tasks have been recently marked done by other administrators
  • all the administrator pages will point out in a hard-to-miss manner when the child has reached the goal
That's about it ... I can think of some advanced features I might like (for instance, tasks made out of sub-tasks) but starting with the basics and getting to "works" is good for now.

I do want to think about multi-lingual support in the design, though, so that if I could get my wife to enter the task translations in Chinese (a big if), Henry's grandparents could also be administrators.

I think this would be a nice little project for me to learn Ruby on Rails, but I'd also like to try to learn something else ... how to get help, and cooperate with other developers. I can't be the only geek who would want or use such a system, but how can I interest other developers? That's a mystery to me -- perhaps more difficult, and more rewarding, than learning the latest hot new web framework / language.

To innerHTML or not to innerHTML; that is the question

So I'm dinking along on my web gallery project "photopage", and I've gotten to the point where the administrator gets to add, delete, and re-order photo albums. I'm doing this all in DHTML, and will only send the information back to the server (somehow ... still foggy on that part) when all the changes have been made.

I really enjoyed DHTML programming way back when I did Hanzi Quiz, but in that project I always used document.getElementById() to manipulate the data displayed on a essentially static DHTML document set up at the start. Now I want to add (and delete) an indefinite number rows from a table in response to a user's clicks. Assigning a unique id to each node of interest is not the way to go here.

I'm just working on adding now. When the user clicks an "insert album here" button, a new <tbody> containing two rows (an "insert button" row and an album data row) is inserted just above the clicked button.

This would be easy to do with innerHTML, but that's not a W3C standard. Apparently innerHTML is usually faster that using the W3C DOM methods, but I'm not the only one who's uncomfortable using it.

I have to share this quote from one of the comments in the last-linked blog:

Oh, great. Now innerHTML will be forever personified in my mind as a smirking, raven-haired seductress in a dress cut down to here and slit up to there, throwing herself at me despite my best efforts to walk the straight and narrow of semantically correct code.

I think that sums it up nicely.

My current stab at adding this new <tbody> is to clone the first one in the document, then fish about with some ugly scripting for the textNodes whose values I want to change. I have a lot of code that looks something like this:

  var tr = new_node.lastChild;
   while (tr.nodeName.toLowerCase() != "tr") { tr = tr.previousSibling; }

At that point, I had to ask myself aren't there any javascript libraries out there to simplify this kind of DOM traversal? I thought there had to be, but searching around on freshmeat and sourceforge and google only turned up libraries that for very specific graphic effects and some convoluted XMLish stuff for AJAX.

I realized I could write a simple recursive function that would allow me to write the new DHTML subtrees I want to create as simple javascript objects -- almost as simple as innerHTML -- something like this:

new_node = createHTMLnode(
   tag : "tbody",
   contents : [ {
                  tag : "tr",
                  contents : [ {
                                  tag : "td"
                                  contents : [ "first cell" ]
                                  tag : "td"
                                  contents : [ "second cell" ]

That might be nice, but I have this feeling that I'm working in a vacuum. Is anyone else interested in this stuff? I could do all this work and it would be beautiful inside, but it would be stuck inside my obscure application that will probably only ever be my personal web gallery ...

... so why not just use innerHTML and be done with it?

My "Me Too" Project
I'm starting to develop a new "but hasn't everyone else done that already" program: a web photo gallery.

I looked on freshmeat, but amazingly I couldn't find any with the one "feature" I'm looking for: showing several photos together on the same page. All the programs I found were geared towards showing one photo at a time.

I was originally thinking about doing this in PHP; a language I don't know, but which seems to be a mishmash of languages I do know and is popular for webapps these days. I got the O'Reilly book Web Database Applications with PHP and MySQL, but when I got to the part which described (and praised) using the PEAR HTML_Template_IT templating package. That made me think "If you're going to use templates, why use PHP? The whole language was developed around the idea of mixing program code with HTML."

I knew that using templates is good advice; at work I'm doing jsp stuff. Some of the old code uses scriptlets while the newer stuff is all tag libraries. The pages with scriptlets are like a train wreck of java and html!

I recently discovered the HTML::Template perl module and I'm think I'll be using that (along with CGI::Application) to write my new app, which I've tenatively decided to call photopage.

It will be pretty easy to just generate the pages of photos, but I might want to do some AJAXy thing to get photos from the following page downloaded in advance. I'll just do the dumb thing first, though.

Input Methods and Mozilla
I continue to be frustrated by my inability to send Chinese e-mail from Mozilla without setting my entire environment to Chinese. The one time I managed to get chinput to come up it interfered so badly with my ability to enter plain English text (which is what I do 99% of the time) that I pretty much gave up.

I recently found this Firefox input method plugin for Indic languages, and I'm thinking that's a good approach for me. It would also be nice to just be able to enter accented characters and write peoples' European names correctly.

That's a much more interesting project than my dumb photopage one, but I don't have any pictures the most recent two months of my son's life online yet, and I don't want to get the real solution together instead of just putzing around with static html again (and again, and again ...) So photopage it is.

20 May 2005 (updated 20 May 2005 at 06:21 UTC) »

Well, mirwin's attempt to link to an essay my wife wrote finally got me to post here again (it's actually here; it ends in '.html' not '.htm'). It's a little stilted because her assignment required her to use specific terms from her Sociology class, but at least going to school can get her to write.

She has talked about writing some short stories to illuminate how China has changed in recent years. I hope she will.

I'm a temporary bachelor again, as my wife and half-year-old son went back to China to visit her parents. (Here are a few pictures.)

I'm a little disappointed my Hanzi Quiz program hasn't been more popular. It's popular in it's niche: it was number one in a Google search for "hanzi" for years, until it got beaten out by the venerable Hanzi Smatter.

The thing is, while I took special care to deal with the unique issues surrounding the use of Chinese characters, what I've written is a general purpose study program. The categories could be anything: a dozen different languages (see any one and guess any other), common names versus latin names for plants or animals, dates versus historical events ... absolutely anything. And nobody has taken advantage of this.

Even within the realm of Chinese characters, almost no one has changed the quiz data; many links to my site say "here's a very basic hanzi quiz", but none of these people even seems to realize they can take it and make it as advanced as they please.

Part of the problem is the difficulty of editing the utf-8 entries ... while I could enter the Chinese using emacs, I had to whip up a little perl program to convert "pinyin with trailing tone numbers" to "pinyin with (accent marks as) tone marks". I bundled that program in my tarball, but I don't think anyone else is going to use it.

A potential change for Hanzi Quiz, which I am half-done with but dropped becuase I doubted anyone else would be interested, is to translate that perl code into javascript, so the quiz entries (the "cards") can be written with tone numbers, helping somewhat with the data entry problem. That javascript's done, but that lets me do a second part:

Before the quiz begins, show a screen with all the accented characters used to display the pinyin. If the user can't see all of the characters correctly (which has been a problem in some environments) they can choose to use the tone numbers instead. Yay! What's more...

... using an intro page can allow the user to select which "quiz" to load (a trick I found that works on moz and ie, you have to do something like document.write("</SCR" + "IPT>") to keep the browser from getting confused, but you can choose which .js to load based on a choice from a dropdown list).

The problems are

  • The whole thing about the tone numbers pushes the code in the direction of being specifically about hanzi, especially with the "can you see these chars" intro page. (Although quizzes on any subject could still be run in it, and just not use the pinyin stuff.)
  • Being able to select many possible quizzes requires someone to come up with the quiz content. I was really hoping someone else would do this part, like a teacher or something. But I haven't had much luck getting anyone else interested.
So, that project languishes.

I could go on about other stuff (like should I try a new distro?) but I'm already up way too late as it is. Maybe later.

Hey everyone, I'm back.

I haven't been working on any projects lately; and I'm kind of wondering what I should do next. I've put some effort into trying to figure out why my Hanzi Quiz program is hosed in Safari (and Konqueror): that's led me to submit a couple of bug reports.

The second of those reports is so whack that I wonder if something must just be wrong with my system: I first discovered that some accented characters don't show up in utf-8 encoding (although chinese chars are fine), and then I tried iso-8859-1 ... and accented characters didn't appear then either!

I thought that had to be a mistake, so I went and found the link to the famous French newspaper Le Monde, and that showed accented characters just fine. But when I viewed the html source, I found that all the accented characters were numeric entities! Do you Europeans never use the actual iso-8859-1 byte values (or utf-8 byte sequences) for your accented characters?

It strikes me as near impossible that Konqueror, as a European project, would fail to catch this -- but that's what's happening on my (Debian unstable) system.

In any case, Konq (and therefore Safari) look so hopelessly hosed to me that I'm not too inclined to try to make any serious DHTML work on for them. I think I should find another project for a while.

On a personal note, my wife and I are expecting a son in late October. That's an exciting prospect, but also somewhat scary.

80 older entries...


forrest certified others as follows:

  • forrest certified alan as Master
  • forrest certified lpd as Master
  • forrest certified wichert as Master
  • forrest certified aigeek as Journeyer
  • forrest certified raph as Master
  • forrest certified bagder as Master
  • forrest certified fxn as Journeyer
  • forrest certified chromatic as Master
  • forrest certified zhaoway as Journeyer
  • forrest certified scrottie as Journeyer
  • forrest certified ghostgum as Master
  • forrest certified Spoon as Journeyer

Others have certified forrest as follows:

  • mobius certified forrest as Apprentice
  • nixnut certified forrest as Apprentice
  • welisc certified forrest as Apprentice
  • cannam certified forrest as Apprentice
  • jrf certified forrest as Apprentice
  • bagder certified forrest as Apprentice
  • neurogato certified forrest as Apprentice
  • splork certified forrest as Apprentice
  • fxn certified forrest as Apprentice
  • sdodji certified forrest as Apprentice
  • sye certified forrest as Journeyer
  • ghostgum certified forrest as Journeyer
  • scrottie certified forrest as Journeyer
  • realblades certified forrest as Apprentice
  • lerdsuwa certified forrest as Apprentice
  • mirwin certified forrest as Master

[ 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