banner

I’m not dead

Posted: April 13th, 2006 | Author: | Filed under: Uncategorized | No Comments »

I am pleased to announce that no, I am not dead. It’s been nearly two months since my last substantive update; I’d like to blame school, or the weather, or communists, but mostly I’m just lazy.

I’ve had some interesting things going on lately:

  • My computer was out of commission with a bad logic board for two weeks.
  • I was flown to sunny California for a series of interviews with a certain semiconductor etch company.
  • I got a request to interpret at a conference for a local company. Having never interpreted professionally, this was a major source of stress, but that mostly fell through.
  • Most importantly, I got accepted to JET as a CIR. I don’t know where I’ll be placed yet.
  • Oh yeah, and I got rejected by Starbucks for a summer job.

So my employment plate is pretty full, a state of being that is both reassuring and overwhelming for one with as short a work history as I.

Other things I’ve been doing are writing and drawing. It should be no surprise to people who know me well that I chose possibly the most inaccessible medium for my writing: Classical Japanese. I write tanka and add brief stories about them, in the vein of classics like Ise Monogatari.

I struggled with the best format for publishing the stories, and settled on this, for those of you who might be interested. I designed the whole thing from scratch (I even took the picture of the sakura used in the header) and I think it came out pretty damn good, if I do say so myself.

Incidentally, here’s how much of a nerd I am: You might notice that each each chapter in the table of contents is numbered with kanji numerals. I actually wrote a PHP function to convert standard Arabic numbers into kanji ones. Here’s the code:

function kanjiNumber($n) {
        $result = "";
        $units = array(
                "無量大数" => 1.0e68,
                "不可思議" => 1.0e64,
                "那由多" => 1.0e60,
                "阿僧祇" => 1.0e56,
                "恒河沙" => 1.0e52,
                "極" => 1.0e48,
                "載" => 1.0e44,
                "正" => 1.0e40,
                "澗" => 1.0e36,
                "溝" => 1.0e32,
                "穣" => 1.0e28,
                "杼" => 1.0e24,
                "垓" => 1.0e20,
                "京" => 1.0e16,
                "兆" => 1.0e12,
                "億" => 100000000,
                "万" => 10000,
                "千" => 1000,
                "百" => 100,
                "十" => 10,
                "" => 1);
        $integers = array(
                0 => "0",
                1 => "一",
                2 => "二",
                3 => "三",
                4 => "四",
                5 => "五",
                6 => "六",
                7 => "七",
                8 => "八",
                9 => "九");
        if ($n == 0) {
                return "零";
        }
        foreach ($units as $char => $value) {
                $append = floor($n / $value);
                if ($append > 0) {
                        if ($append > 9) {
                                $result = $result . Format::kanjiNumber($append);
                        }
                        if ($append != 1 || $value >= 10000 || $value == 1) {
                                $result = $result . $integers[$append];
                        }
                        $result = $result . $char;
                        $n = $n - ceil($append * $value);
                }
        }
        return $result;
}

The craziest part is that the Japanese language has names for numbers like 1068. Of course when you get that high, you’ve blown past ints and gotten into doubles, so my function loses accuracy with extremely large numbers. I don’t think I can possibly write that much, though. Incidentally, to test this function just visit the URL http://www.amake.us/mita/?n=x where x is some number. The output will show in the page title.



Leave a Reply