The Road Back To Tokyo

  • May. 14th, 2008 at 9:19 AM

The Shinkansen

We took the Shinkansen from Kyoto back to Tokyo and it’s fast, it’s OMG fast. The line going the opposite way passes you on rails six feet away and so quickly, just a rush of air, one heartbeat and gone, a quarter-mile of train snapping away like a rubber band.

It’s basically impossible to take pictures of it, but if you like I can show you my white blur collection. I’m used to travelling on ViaRail in Canada, and the Kyoto Shinkansen trip was a bit of a long slow shock. Both cities are huge, Tokyo in particular is vast and high-density and the rail line runs mostly parallel to the coast, so instead of spending your time looking out the window at hours of forests and farmland there’s only about twenty minutes on the three hour trip that don’t feel like you’re rocketing through the middle of a city, scattered around in five-minute chunks. On the trip out from Tokyo, I just kept staring out the window at the passing buildings thinking, Jeebus, does this place ever end?

I’ve never seen a city like Tokyo before, and it’s hard to believe that it can exist at all as it is. 12 million people or so, and it’s clean enough that you could eat off the roads, none of which are in straight lines and many of which don’t even have names or even unique identifiers. But every morning it seemed like a brand new city had been cut out of its shrinkwrap and carefully placed around us, pristine and barely used; I felt like I’d have to be a powerful man with powerful enemies and a shadowy past just to be able to find somebody willing to put gum on a sidewalk.

Tokyo Signage

The thing that kept reinforcing this impression was that a lot of the time Tokyo is quiet, eerily quiet. Step off a main road into any of the narrow, labyrinthine little streets that make up much of the city and you might as well have stepped onto the moon; the background hum you can hear in every city I’ve ever known is gone, baffled right down by the tall buildings and enthusiastically non-Roman road plan. So, is this when the ninjas jump out, I kept thinking? I can’t hear my theme music, so if they jump me now, I might not win.

Street Level Flora

Sadly I didn’t see any ninjas, but I suppose if I had they’d be sad ninjas indeed. Akihabara was enough of a letdown, I didn’t need to get randomly jumped by a bunch of second-rate martial artists. Next time, I’ll have to pack one of these, which I wouldn’t have thought would ever work, but now it’s hard to believe that it wouldn’t. I don’t think that I was more than twenty meters from a vending machine the entire trip.

Temple Gate Plus Vending Machine

But when we did find ourselves on a major road, near a train station or somewhere like Ginza or Harajuku, we’d find ourselves in the middle of a huge, noisy, frothing, enthusiastic mess of people, and every day it felt like I was in crowd surfing in the world’s most polite riot. Harajuku was particularly awesome, some of the finest people-watching in the world. There were weekend Elvises (one of whom had procured an enormous pink ‘57 Cadillac from somewhere), crunchy-looking Goth girls, elaborately coiffed Harajuku Maids, cosplayers and vending machines that served iced coffee and beer.

Harajuku

There was even what looked like an impromptu battle-of-the-bands going on, though whoever won that, it was a pyrrhic victory for sure. From what I could make out, there was some boy-band signing session going on nearby, so the cosplayers were out in force, hundreds where there would “normally” only be dozens. It hit me there that all fashion is a strict subset of cosplay, and that the people who embrace that will be able to push at boundaries the rest of us can’t even see, and make the world a lot more colorful, interesting and fun for all of us.

And it also occurred to me, as I was crossing a bridge beer in hand and patient wife in tow to take some pictures a horde of girls in goth-lolita outfits that life had somehow brought me to a point that I was in Japan with a beer in my hand and my wife humoring me as I went to take some pictures of a horde of girls in goth-lolita outfits, and I just started laughing , because being me is awesome.

dnalounge update

  • May. 14th, 2008 at 12:16 AM

DNA Lounge update, wherein we network with a socialness.

Tags:

ebb plans

  • May. 14th, 2008 at 8:38 AM
reimplement tempfiles for uploads (using libeio).

implement a sendfile function (for fun)

io binding

I just heard yesterday about a mongrel-parser based web server for IO called Volcano. cool :)

Tags:

The Debian OpenSSL bug

  • May. 13th, 2008 at 10:30 PM
I couldn't let today pass without making note of The Great Debian OpenSSL bug. It is a serious pain and it is going to bite so many people in the ass. I spent hours dealing with this on my own systems.

Why, Debian, Why!?

Take My Stuff!

  • May. 13th, 2008 at 10:29 PM

There are a bunch of good items (many of which are in very good shape, many of which aren't) at my house in Champaign. As I am not in Champaign anymore, I don't have access to them; but I want them out of the house ASAP. So, if you would like any of these, please give my mother (Margie) a call at 377-4554; they will be given away on Wednesday between 5 and 8pm:

  • Couch
  • dresser
  • washer and dryer
  • lawn mower (needs tune-up)
  • 2 wooden desks
  • 1 metal desk
  • blue stuffed chair
  • office chair
  • several stacking padded kitchen chairs
  • nightstand
  • 2 coffee tables
  • round end table
  • several plastic patio chairs
  • queen sized bed frame and headboard
  • queen sized mattress and box springs
  • double bed frame & headboard
  • small bookcase
  • black floor lamp
  • brass floor lamp
  • small artificial christmas tree
  • ladder
  • electric clothes steamer
  • various cleaning items - brooms, mops
  • garden tools

type-safe printf

  • May. 13th, 2008 at 10:05 PM
printf is a function with a complicated type. In C we used to just give up and tell the compiler "this function takes some other stuff that you shouldn't worry about" with the amusing "..." builtin. These days compilers have special support for annotating printf-like functions to provide type-checking. The other side of this is that an implementation of printf necessarily has a little tokenizer/parser for run-time processing of the format string, along with the associated performance penalty*.

Yet pretty much all programs that involve format strings ought to have the format strings known statically. Even a mini-language like printf turns out to have enough power to not be able to safely process untrusted input, as the "poke" instruction (named %n) demonstrated by creating a completely new class of security vulnerabilities. And without the compiler to help with type coercions, it's easy to write something invalid, especially when you're playing fast and loose with integer and pointer sizes across platforms.

Perl and Ruby neatly sidestep this problem by using string interpolation: at parse/compile time, the compiler scans the strings for bits to be expanded and just rewrites the "format" string to the equivalent concatenation of literal strings and variable values, which then uses the normal language's support for pasting strings together. (Prove it to yourself: perl -e 'use strict; print "$x";' aborts with a "compilation error".) But sometimes you really just want something like printf, and both those languages fall back on "figure it out at runtime" for that.


Supporting printf at all proves to be pretty difficult in more strict languages which generally require all types to be known. OCaml's compiler does some crazy hacks where sometimes a quoted string is interpreted as a format, a six-parameter type that, for example, needs its own concatenation operator. Haskell at least encodes it in the user-available language with some typeclass magic that gets you to more or less to feature parity with dynamic languages -- failure at runtime if the parameters don't properly line up.

But it turns out there's a nice paper that provides a type-safe encoding of printf that doesn't rely on any fancy language features. The paper is structured like this: (1) "wouldn't it be nice if printf worked like this?" (2) "oh wow check it out, here are the functions!" I've been staring at it for a week and though I can sorta see how it works, it's unclear to me how anyone would come up with it. Here's an overview from a person who lacks sufficient brain to say much smarter (me).


To start with, you don't use a string for the format string. This sorta seems like you've already given up, but you could imagine a macro expanding a format string into the proper expression here, much like how Perl/Ruby's interpolation works. Since this is functional code we're talking about, it ends up being an expression involving some functions. Format string concatenation ends up being encodable as composition, which means you end up with the same operator as Perl (.) for pasting them together.

The basic task then is that you need print (some magic here) to be able to give you a function of varying types, depending on what the magic is, so that print format1 3 "foo" can be type-checked that format expects an int and a string. So the type of printf must be (some magic type involving an a) -> a, where the polymorphic a is a function produced by the magic. And here's where the magic drops, painful in its simplicity:

lit :: String -> (String -> a) -> String -> a
lit text k s = k (s ++ text)

int :: (String -> a) -> String -> Int -> a
int k s val = k (s ++ show val)

printf :: ((String -> String) -> String -> a) -> a
printf fmt = fmt id ""


And that's it. lit is what converts a literal string into a format, while int is the placeholder for an int. So "my int is %d\n" would be expressed as lit "my int is " . int . lit "\n". If you drop this in to GHC you'll see that the type of printf (lit "my int is " . int . lit "\n") really is, as you'd expect, Int -> String -- it's waiting for you to give it an int so it can dump out the formatted string. The result of printf is just a plain function, so you do all the normal sorts of things you'd want, like partially apply it or pass it to map. The formatters are plain functions, too, so you can add your own formatter that, for example, can accept a list (as he does in the paper).


So how's it work?

Look at the two formatters, int and lit. The k parameter to the formatters is a continuation: it's where each formatter should pass the string constructed so far when the formatter is done. Then the s input parameter is the
string as constructed so far. You can mentally expand printf (lit "foo" . int) as (lit "foo" (int (id))) "", where that empty string is your starting string and id is the innermost continuation which just gives you back the string that's been
constructed.

You can also look at int like this, just with some added parens for clarity: (String -> a) -> (String -> (Int -> a)). It takes the continuation as a parameter, and the function it returns is sorta the same shape as the continuation but with Int -> a in place of a -- that's how it tacks on its need for an int to the greater formatting requirement.

But from there... uh, the types just work out. I don't know. It's pretty much magic.


* Though I'd argue you're in a pretty bad place if printf performance is your bottleneck.

So fucking cute

  • May. 13th, 2008 at 8:06 PM
Video link: Golden retriever fosters six stray kittens

Cutest. Thing. Ever. Six tiny little kittens nursing alongside six tiny little golden retriever pups! Awww!

(link from [info]elettaria)

Tags:

Minimal Mathematical Models For Human Categorization
Faculty Advisors: Rosa Arriaga and Santosh Vempala
http://www.cc.gatech.edu/~vempala/uroc.html

details )

Gnarls Barkley - Going On

  • May. 13th, 2008 at 6:21 PM
New, and rather good Gnarls Barkley video. I really should stop being lazy (and cheap), and hurry up and buy the album already.

And in writing this entry, I have realized there is a new Lyrics Born album that I didn't know about. I'm sleepin' on all the good stuff. Damn.

Cinder

  • May. 13th, 2008 at 6:08 PM
I thought that I would post some pictures of Cinder. My family has been visiting for a few days, and my mom has a digital camera... Of course this means massive lab pics spam.

Very cute. )

He's been doing well, even though he's recently lost his best buddy. I think that we are spoiling him a bit though... He is definatly in the house more often, and mum is buying him treats left right and center. He's sleeping in our room at night now, and I think that we're going to keep it that way.

We are taking him to the vet on Friday, to make sure that he doesn't have what Artaemus had. Also to just have a physical, since he's probably past due.

Things are going.. Well, as well as they can be with the loss of Art. We buried him under a tree on the hill behind our place. He grew up here, and I think that coming back made him very happy. So it was a suitable place to put him to rest. Cinder was with us when we buried him, and I think that he understands that he isn't coming back. He doesn't look for him, like you would expect a dog to do when something is missing. Originally, before Art got sick, we would talk about "When Artaemus goes, we'll probably get a new pal for Cinder..." but I don't think that we will any time soon. That wasn't something that we expected to do for years.

Anyway, babbling now. I know that I didn't reply to any comments in my last post. I'd just like to say thank you all for the well wishes, and kind thoughts. I hope that you and your puppies are doing well.

May. 13th, 2008

  • 4:05 PM
I just have a quick question about http://www.apartmentsapart.com/

I was just wondering if anyone has any experience with them or know of anyone who has? I've been searching around and am unable to find many reviews for it. They have apartments in all the places that I am traveling - Kiev, Krakow, Budapest, Vienna, Prague, and if I could find a cheap apartment rather than a hostel, I would prefer it.

Also, can anyone recommend some hostels in Kiev specifically, that have airport pick-up? All of the reviews have been mixed from what I can see.

Thanks.

New York/Canada

  • May. 13th, 2008 at 8:21 PM
Hi! I'm a 21 year old girl from the Netherlands. On the first of Sept this year I'm going to New York. I booked a flight back on the first of October so I'm staying a whole month. I wasn't planning on staying in New York all the time, I'd love to go to Canada as well.

Now,
- I was wondering where I can book a flight from NY to Canada?
- Where in Canada I should go.. What places do you recommend and why?
- Any tips and tricks? Hostels/food/money/safety/etc..
- I hear a lot of people say a week New York is enough, is it? And why?
- Maybe other places in America I should go (already been to California)? And how (train, plane, bus)?

Thanks in advance! :)

A: No. Q: Was this ever funny?

  • May. 13th, 2008 at 5:15 PM

Am I being singled out, or is there a new plague of AIM bots going around? I used to get prodded by these stupid things every couple of weeks, but I've blocked a dozen of them in the last week. This time it's usually a bot with "salmon" in its name.

Tags:

Home

  • May. 13th, 2008 at 11:16 PM

We’re home. No disrespect to our gracious hosts but two weeks away is slightly more than plenty, it turns out.

I’m well behind on my blogging, of course, and have to sort through several thousand pictures to figure out which ones are worthwhile, but the last few days in Japan and a week in Hong Kong are on the way.

Some Local Flora

Damned dirty apes

  • May. 13th, 2008 at 3:03 PM
I get the impression that a lot of people hate this fountain, but I think it's awesome. It reminds me of something that would have been in Planet of the Apes or Logan's Run: an early Seventies vision of the Grim Meathook Future.

yesterday

  • May. 13th, 2008 at 5:22 PM
Yesterday I walked like 8km, which might sound like alot, it is alot but it was not all in one go. I LOVE the warmer weather since it allows me to walk places.I have no idea how it got in my head but I believe once downtown, if you can walk there why take the bus.
But it did lead me to learn inner soles for your shoes are amazing, it saves your feet from so much pain.


Tonight, I am going to Nancy's to find a dress for the reception.


However, after saturday sugar high bratty-ness I have decided to *try* to cut back on some of the sugar I eat... however, you never realize how much sugar you eat in a day until you try to cut it out.

Reality testing

  • May. 13th, 2008 at 2:13 PM
Some new habits to practice!
Reality testing ... involves performing an action with results that will be different if the tester is dreaming. By practicing these tests during waking life, one may eventually decide to perform such a test while dreaming, which may fail and let the dreamer realize that they are dreaming. Common reality tests include:

* Looking at one's digital watch (remembering the time), looking away, and looking back. As with text, the time will probably have changed randomly and radically at the second glance or contain strange letters and characters. ...
* Flipping a light switch. Light levels rarely change as a result of the switch flipping in dreams.
* Looking into a mirror; in dreams, reflections from a mirror often appear to be blurred, distorted or incorrect.
* Looking at the ground beneath one's feet or at one's hands. If one does this within a dream the difference in appearance of the ground or one's hands from the normal waking state is often enough to alert the conscious to the dream state.
(wikipedia on Lucid Dream)

May. 13th, 2008

  • 4:27 PM
Poll #1187305
Open to: All, results viewable to: All

The ladybug Docs sold for $41.99.

View Answers

That's larceny!
3 (23.1%)

That's okay for gently used shoes.
4 (30.8%)

You'll take what you get and you'll be happy! Do you hear me?
6 (46.2%)

Dissertation Talk
Beyond the ABCs of AVCs : robust and adaptive strategies for future communication systems

Anand D. Sarwate
Advisor : Michael Gastpar
Department of Electrical Engineering and Computer Sciences
University of California, Berkeley

Thursday, May 15
1-2 PM
521 Cory Hall

abstract )

May. 13th, 2008

  • 3:55 PM
Gee whiz, there's only a half hour left on the ladybug boots and these 19 watchers are making me sweat it out...

oww

  • May. 13th, 2008 at 12:18 PM
Tough CrossFit yesterday evening[1] + late to bed + bad sleep 2nts/row + still haven't quite kicked my cold = slow, sore, sleepy Patri.

Managing to be somewhat productive, though. But it will be nice to not be sick.

[1] But still fun, of course. 5x (7 pullups, 7 thrusters 65#, 7 ring dips (assisted), 7 burpees), 12:47.

Process list for my new OS

  • May. 13th, 2008 at 12:09 PM
The web browser is the new operating system. My own computer is at this point little more than a glorified web browser, with a text editor, command prompt, python interpreter and svn thrown in for the occasional color.

Since the web browser is the new OS, it should really, really, have the equivalent of a process list. I almost always have a whole bunch of tabs open, and firefox is most of the time using a nontrivial amount of CPU doing not much of anything. I have to guess which tab is causing the problem when the CPU gets pegged, and sometimes it seems that even shutting down all tabs doesn't completely fix the problem. Could somebody please implement metrics on how much CPU each tab/window is using, and get the process separation right so that whenever a tab/window is shut down all remnants of it are completely toast?
  • If you are going to use and require a programming style which is necessitate extra whitespace for aesthetic or "readability" reasons, it is absolutely key that you be entirely consistent in the use of that style. Once somebody warps their brain to accept the bizarre infix indentation of expressions, it will be jarring for them to run into code within, say, the same translation unit (i.e. file) which is different. One of the key requirements for implementing non-jarring, reliable code style rules are to come up with rules that are aligned with the syntax of the language itself, and which can be explained in a breath or two. For example, "newline at the end of every statement, no excessive parentheses, whitespace after any reserved keyword not at the end of a line and after commas and between all pairs of non-comma operators and non-operators, indent nested statements and blocks" is fairly logical and straightforward. "Newline at the end of every statement, excessive parentheses, whitespace after any reserved keyword not at the end of a line and after commas (ideally newlines after commas, with indentation to the same level as the opening parenthesis or brace the commas are inside, but sometimes not), whitespace after and before parentheses that "do something" (i.e. which are used to invoke a function or which are part of an if statement) and indent some assignments and all declarations to the same level as nearby assignments and declarations," however, is a bunch of shit that people will screw up and which reflects all sorts of things other than syntax, like a lot of indecision about whether to write if statements like a function call.

  • Duplicated code has duplicated bugs. Duplicating code from a common code-path to an uncommon one leads to duplicated bugs that never get fixed in the uncommon path. You're old enough (i.e. over 12) to be able to architect your code to avoid duplication. Shim layers that always perform sets of calls to lower levels with a consistent set of checks in between, now single functions which are nearly identical can instead use systems of passing flags around, and an interface more granular, to require only implementing the real logic for each module. At the very least, reduce diffs between the common and uncommon code if possible. For example, don't do gratuitous variable renames (from the generic InfoPtr to the specific BlahBlahBlahBlahBlorkBlaxPtr) and reformatting of comments. Please. You'll thank yourself.

  • You can create wrappers for any system feature you want in the name of portability, but I beg of you: do not create your own threading model. Unless you are laughing at the memory of all the bad home-grown threading models you've seen, you aren't ready. If you don't realize how futile and perilous it is, you aren't ready. Especially don't do it within a kernel that's had a good threading model for a few years and which has had a wonderful process model that you could've used instead since inception. Oh hooray yet another "cooperative threading by way of lots of macros and you-don't-want-to-know under the surface." I thought those were banned in the Geneva Conventions.

  • Add an error code for "not yet implemented" for anything that can be triggered trivially by the remote end rather than an explicit panic of the system. Some of us don't like losing all of our work because (1) your tool didn't check its arguments (2) your kernel code didn't check its arguments (3) your kernel code has things unimplemented which it could fail on gracefully. Don't have a good error that it could return per the spec that you are so laboriously implementing? Have you met my friend SIGSYS? Fantastic! Much better than a panic. Kill the user process in a way that it can catch and turn into "huh, feature not yet implemented, chum" rather than fucking me over.

html with io

  • May. 13th, 2008 at 7:50 PM
As promised, here is the code of my Io-based HTML DSL. The syntax looks like this:
html(
  head(title("ryan's web page")) 
  body(
    h1("sign my guest book!")
    form(action="/guestbook",
      p(
        label(for="name", "name")
        input(name="name", type="text")
      )
      p(
        label(for="msg", "msg")
        textarea(name="msg", "")
      )
      input(type="submit",value="sign")
    )
    h2("here is a list of numbers!")
    ul( 5 repeat(j,
      li("item number #{j}" interpolate)
    ))
  )
)
Does anyone care? Probably not :)

Tags:

HP goes nom nom nom

  • May. 13th, 2008 at 10:21 AM
The company I work for, already a behemoth, keeps on getting bigger. We're buying EDS now. Crazy.

Tags:

May. 13th, 2008

  • 9:49 AM
I've generally been annoyed by the fact that I can never seem to have my cellphone ring volume at the right level. Either it's too loud when I'm not in a noisy environment, or I miss calls when I'm walking down the street in the city. Here's the really annoying part: my cellphone has a mic. Why can't it monitor the ambient noise (at some reasonable interval, to not completely drain the battery), and change the ring volume based on that reading? That would be insanely useful, and doesn't seem like it would be that hard to do. And it would be even more useful if it was hooked up to an accelerometer: it could automatically silence the ringer when you're not moving (and turn on vibrate if it's off), and then you wouldn't have to remember to silence your phone. (My problem with having my phone on silent all the time is that I miss calls when I'm walking, since I don't feel the vibration.) Of course, these would be made options, like increasing ring is already an option. I need this badly.

If I have the time, I should look into implementing this for my phone, assuming I can actually get the access to the phone's settings and mic/accelerometer to do the proper determinations. I still don't know why it isn't already build in to any phone. Seems like a no-brainer to me.

Tags:

We have a leftover HP Kayak Desktop that will otherwise go into the dumpster. P3 with 512MB ram. Desktop model. To be fetched from Oakville or at some unknown point later in time from downtown Toronto.

As a side note, we also have an HP Itanium2 with 4GB of RAM and a dual cpu P3 (not dual core, dual chip) to give away. We prefer to give these (rackmounts) to an open source project, or another non-profit.

immune response

  • May. 13th, 2008 at 9:16 AM
00:00, May 13.
Achewood posts a comic showing wikipedia lying about Finland.


10:32, May 13.
Wikipedia begins to lie.


Minor edit-war follows.

13:55, May 13.
Wikieditor Wafulz semi-protects page.


All such edits are reverted.

Realtors Make Me Angsty

  • May. 13th, 2008 at 12:22 PM
So, as some of you may remember, I selected an awesome biker realtor off the internet to work with in Eau Claire. I did not want to ANGST over what realtor to work with the way I did when I moved to Houghton/Hancock, did not want to interview realtors over the phone, just wanted to pick someone and go with it. Awesome biker realtor's website inspired confidence, and when I called him initially, he seemed pretty straightforward and helpful. He said he could help us with finding a short-term place to live while we looked for a house, except that help turned out to be giving me the phone number of his mom's property management company, which called me back to say they don't do short-term rentals. He put us on a mailing list that would notify us when houses that fit our criteria came on the market, except the MLS system his company is using is new, has some bugs in it, and we wound up having to keep track of the houses we liked on edinarealty.com instead. When I commented to him in an email that bedrooms that are split between two floors won't work for us UNLESS there are three on one floor and a fourth on another, he responded that he would change our search to eliminate two-stories and search for only ranches, and I had to say NO, many two-stories are still OK, please don't change that search. When I asked him for further description of a property in an email, he responded with a few words, e.g. "galley kitchen, bad windows." He had previously said that all he needed was 24 hours notice before we would be in town and he could show us anything we wanted. He has availability issues on Memorial Day weekend when Hans can go to Eau Claire - which I can understand, since it's a holiday and his son's birthday, and he could clear at least half a day - but I emailed him yesterday morning to tell him I would be in town this coming weekend, and could look at houses Sat/Sun or Sun/Mon, so we could pare things down to just a few places to look at Memorial Day weekend - and he responded that Monday looks good but Sunday is "spotty".

I replied right away, explaining that I didn't think I could see everything in one day: we have over 20 properties on our "interested" list, although we could possibly pare that down with some more detailed feedback from him. (I included a list of all the places we are looking at, so that he could provide this feedback.) Plus, I will be traveling with a baby, so I can't keep up a frenetic pace, although my mom will be along to help. I asked him if he had at least a certain time period or two on Sunday that would work so that we would have more than one day.

Well, it's been over 24 hours and I haven't heard back from him. Am I HORRIBLY high-maintenance? Isn't working weekends a given when you are a realtor? Shouldn't I be planning more than one day to look at houses?

I emailed my contacts in Eau Claire, asking if they can recommend anyone in particular. I am about ready to jump ship. I hate to do it, but he hasn't spent too much time working with us, and he's not giving me what I need, and I need to MAKE SOME PLANS.

Badass!

  • May. 13th, 2008 at 8:48 AM

smason wrote:

I wrote a Missile Command clone for the multi-touch wall at Obscura Digital. Just like the original, except you can fire by touching the wall with your fingers. Save the Golden Gate Bridge from ICBMs. Fun for the whole family!

Dynamic Languages

  • May. 13th, 2008 at 8:42 AM