Saturday, June 23, 2007

A safety warning

Don't buy Chinese cars.

Friday, June 22, 2007

Logic is something Westerners invented to win arguments with Japanese

Had another one of my rare, but still not non-existent, encounters with Japanese-style racism today.

Usually Japanese racism is defined by ignorance of outsiders (no surprises here), a healthy sense of contempt and self-superiority, followed with an active desire to exclude outsiders. Like much of Japanese aggression, its extremely passive-aggressive. For a tiny taste, here's a link to a famous case that came out a while ago, on the blog of the somewhat controversial anti-discrimination activist Arudou Debito.

So after applying to renew my "Spouse of National" Second Class Citizen visa for another 3 years, I was returning with a very pregnant looking M. on the subway. We went to use the elevator -- usually reserved for people in wheelchairs, carrying heavy luggage, or otherwise having some disability -- so M. could avoid the taxing climb up the 2 or 3 flights of stairs. I noticed that a 12 year old boy and a 40 year oldish Salary man had just walked inside the otherwise empty, largish elevator (which can easily serve 20 people). The salary man looks up at me, quickly looks down, and presses the button to close the door immediately, almost shutting it in my face.

The context of this is, you have to recall, Japan. The standard for public etiquette is rather high, even if it isn't always observed. Especially, any situation that might result in conflict is carefully handled. Conflict, in Japan, is BAD. The opposite of conflict is Wa - harmony, and its the first Chinese character for the name that Japanese call themselves. Very central. In the case of accidentally bumping into someone, or stepping on their feet, or poking them with your umbrella, one must always apologize, however brief or insincerely, in order to head off any potential conflict.

So as the door was closing in my face, because this selfish git of a salary man decided neither my wife nor I needed to take the elevator, I quickly reached out and stuck my hand in the car to stop the door from closing completely. After I got on board, I snorted in the sort of contemptuous manner that Japanese males often use in such situations, and put it out of my mind on the ride up. However, next thing I know, when the door is opening, this salary man comes riding up my ass as I'm waiting for my pregnant wife to waddle off the elevator, and proceeds to stick his umbrella into my legs. The first time he pokes me in the right heel, I write it off as an accident -- ignore it; but when he does it again, on the left, with pin-point accuracy. I spin around to confront him.

If this was all really just an accident, or even if he just didn't want the confrontation he started, he would have simply let off a gruff "oops", and sauntered off before I could do anything. But when I turn around he just stares at me with contempt.

Anyone who knows me knows I don't spoil for fights, but neither do I suffer assholes gladly. So I tear into him in English. That always puts them on the defensive.

"Whats your @#$%ing problem pal?! You wanna tell me something?!"

I was greeted with the ever-present reply to anything spoken in English: "huh?"

[English has no symbol for a gluttal-stop, you'll have to imagine that sound has an abrupt end, and the speaker has a slack-jawed blank stare that mixes mortal fear of English with utter incomprehension.]

After a few preliminary pleasantries of this form, lets say about 4 or 5 "huh?!"s worth, he regains his footing and gets into the Japanese curses. Unfortunately I don't really get what he is saying because he appears to be using some new foreigner-handling code I haven't yet seen before, that consists of either using words I don't know, or just mumbling quietly enough that I cannot actually hear them.

Sweet, now I get to use "huh?!" as a reply, in mockery. I also ask him what his age is, "5 years old, Mr. Umbrella-poker?"

I next fall back to the good old trusty "deteike" (get the @#$% out of here), and a few others that came too fast and furious to recall. Everyone is now staring at us, at rush hour. Probably hundreds of people. I don't care. I want to smash his head into the wall.

In order to understand my some of actions, you have to understand the Japanese practice of "Ijime", which is bullying, but also so much more. It is the culturally sanctioned form of forcefully establishing social hierarchy in many cases, and can be found among adults in the form on Sempai-Kouhai. Its used heavily in all Japanese pissing matches, and mostly consists of brow-beating someone until their Wa takes over, and they submit.

Next he asks me if I want to go out and see the police (I'm assuming he thinks this will scare me). I misunderstand him, because he's mumbling his words under his breath, and I think he's asking me to go out and fight. Now, I don't want to be arrested for beating an older (but not small or weak, mind you!) man, and the thought does occur to me that he's eager to fight because hes a karate master or some such; so initially I decline. But after the Nth challenge, I say "OK, yeah. Lets go!" He then suddenly drops the whole idea without so much as a mumble.

M. Doesn't know whats going one because she was facing away, so she is busily trying apologize for my brutish behavior and calm me down. I explain to her that he poked me in the legs, making sure to invade this guy's personal space as much as possible during my graphic demonstrations. She begins the laughable, but admirable job of translating my words from ape-@#$% to Japanese. He's not surprised to hear it though, because he did it on purpose, to get this reaction.

He then takes a new tack, and starts to try to say things directly to my wife. I think he realizes this is dangerous territory, because he won't speak loud enough for anyone to actually hear him clearly. I take a decided disliking to this idea, and get back in his face. "No, you'll talk to me, #$%^head." He says something that was probably meant to insult me and turns to leave, but since it was mumbled all I got was the intent, which was all I needed.

I smack him once, upside the head. This is ijime. You can see some of this on Japanese slapstick comedy shows. Its meant to be more demeaning than painful.

He turns, outraged, and tells me I just hit him. I explain that in this regard he is quite right. He tells me to "Go home, scumbag". He means go back to "America". All white people are from "America" in Japan. I misunderstand, and think he means my house, so I tell him to do the same. He seems legitimately confused and insulted that I implied he doesn't belong in Japan. Score another one for me.

After pointing towards the exit and commanding him to leave, in the same manner as one would command a dog, he seems to tire of the spectacle, and unhopeful of his chances at winning the pissing contest he started, leaves as commanded. I played the game and won.

It was very much a hollow victory though, as it was immediately followed by M. lecturing me in front of the rush hour mob on how to speak to people without literally sounding like a gangster. And then me being thoroughly angry about the matter, what truly little control I actually had over it, and wishing some form of moderated hand-to-hand combat was in fact a socially accepted method of dispute settlement among strangers.

If you managed this far, just be glad I never bothered to relate the time we were almost run-down by hoodlums on scooters while walking on a park footpath at 10 at night (M. insists they weren't real Bosozoku). That time I was physically attacked.

I didn't hear it very well at the time, but I'm told the guy making a valiant attempt to appear to be beating me up was shouting the distinctly uncool, but never the less nationalistic phrase "Are you making fun of Japan?!"

They have a name for it!!

There is a scientific name for that thing where idiots and ignorants, despite knowing practically nothing about what they are talking about, actually attempt to tell you something contradictory to your own knowledge, as if they had some sort of leg to stand on!

Next time someone someone starts in on some half-baked idiot-theory, just calmly and politely suggest they are suffering from the Dunning-Kruger effect, and quickly change the subject.

This also explains why so many religious people, with no scientific training whatsoever, feel so comfortable dismissing the collected work of some of the smartest minds of our time in order to prop up their flimsy faith in magic books. It also explains how a quick search of the internet can find people who can barely manage the English language to a coherent degree, yet have figured out the all the answers to the most perplexing mysteries of the universe, like time travel and limitless energy sources.

Silly scientists, you don't need an education, rigorous research methods, peer review, or ridiculously expensive instruments! It all becomes much more simple when you just do away with all those things.

A true tribute to the indominable human spirit

Even in the greatest of defeats, we find a way to rise up and hold on to the things which define us most as human beings.

Thursday, June 21, 2007

Holy faces batman

Someone tricked me into signing up for Facebook. Man what a blast from the past. I wonder if I can search for people I used to know in Elementary School?

O. M. F. G.

Just goes to show you some people will do anything to avoid having to work or sacrifice for their own benefit.

If you prefer to shit your pants over controlling what you eat, and getting some bloody exercise, is there anything you won't NOT do?!

Tuesday, June 19, 2007

On the difference between knowing syntax, and understanding a language

I think some readers missed a subtly embedded point near the heart of my last post, that by elucidating, only further goes to demonstrate the difference between knowing something and understanding it.

C++ is strongly typed language. This I understand. It means its the job of the compiler to track the types of variables, and refuse to compile statements that violate the declared types, and thus possibly do something dangerous. In fact this is the entire purpose of the const keyword: "this data should never change, so please don't compile any other statements that may change it".

Code refusing to compile due to incorrect syntax is exactly the required behavior. The purpose is to inform the programmer that they are doing something wrong. (Read closely now.) Even if one is entirely, completely, and utterly ignorant of the correct answer to the below question, the compiler will always give you the right answer, by design, while you are working.

So tell me what the point of the question was??

Saturday, June 16, 2007

On the severely misguided nature of programming tests

Part 2: Intermediate Questions

Question 6:

Consider the following function:

void foo(const char* name)

{

char* Name1 = name; // Statement 1

const char* Name2 = name; // Statement 2

char* const Name3 = name; // Statement 3

char const* Name4 = name; // Statement 4

}

Which of the following is true?

  1. Statement 1 fails to compile.
  2. Statement 1 and 3 fails to compile.
  3. Statement 3 and 4 fails to compile.
  4. Statement 2 fails to compile.
  5. Statement 3 and 4 fails to compile.
  6. If you answered any of the above you have no place being around computer code. A person who programs as a profession needs to first ask them self if they need: a variable pointer to something that is itself constant, a constant pointer to something that is itself variable, or a constant pointer to something that is itself constant, then look up the correct syntax in the book. And if you're still worried, finally test it on the compiler -- THEN NOTE IF IT DOESN'T COMPILE! Anything else is pure nerd dick-waving.
And if I ever catch anyone using such unnecessarily confusing, dusty corners of the C++ standard in my code, or my job interviews, I will consider it an intentional attempt to trick the reader, and toss you out the door for being deceptive and a danger to the code-base. Seriously, what sort of programming job requires you to outwit an adversarial co-worker?!

Because, if programming tests are an accurate reflection of the work you will do as a programmer, then it must follow that the programming test itself is an accurate reflection of the kind of people you will be working with, by virtue of being the kind of people who would pass such a test.

Bonus points for anyone that can translate the following from its current wording to some form that would make me care.

Question 15:

What best describes virtual inheritance?

  1. A derived class which does not implement abstract methods.
  2. A derived class which adds abstract methods to a concrete base class.
  3. A multiply inherited class with multiple copies of its base class.
  4. A multiply inherited class with one copy of its base class.
  5. All of the above
ps. (d)

Wednesday, June 13, 2007

It was the best of phone interviews, it was the blurst of ..? you stupid monkey!

I just had phone interview with one of software guys for one of the top two graphics companies. Sounded like an amazing job, with huge potential. The interview was going unbelievably good; I even thought to myself that I got the job.

But then he asked for me to restate one of my replies in Japanese, and my mind went blank.

I jabbered on incomprehensibly for a minute or so before I stopped to apologize and end our mutual suffering. Japanese ability was a hard requirement for the position.

Oh well...

But its not ok to beat your children

Sadly it appears as if this is no longer common sense anymore. Parents are so worried about saving their children from every hardship, they fail to notice its hardship that teaches us the most important lessons.

Monday, June 11, 2007

The various costs of reducing CO2 in graph form

Shows you what youre missing.

Sunday, June 10, 2007

It doesn't appear to have a penis

Its the 28th week and M. came back from the doctors appointment. They looked and they peered, they glared and the stared, but try as they might, they were unable to view the groundhog's shadow^w^w baby's man-marker, which means that its quite likely to be a girl.

Which means my psychic baby-gender-predicting powers are true, and everyone else was wrong. :)

Mini-review of Foundations of GTK+ Development

Foundations of GTK+ Development is definitely recommended for anyone doing any serious GTK+ development. The authors style is easy to read, and the book serves as both a decent tutorial for any programmer fluent in C looking to learn GTK+, and a reference for intermediate programmers who want to broaden their knowledge of GTK+.

The author wisely spends his chapters on the most useful and most often misunderstood parts of GTK+, leaving the hand-holding chapters to a blessed minimum. This means there is little fluff, and a lot of meat. Since its based on GTK+ 2.10, we are able to skip the deprecated, or just plain old crufty parts, and get straight to the modern usages, such as GtkTreeView, GtkUIManager, and Glade. There is even a couple pages on cairo, within the context of GTK+ 2.10's new printer support.

His entire chapter on deriving existing types, and creating new ones (in the often arcane GType system) is sure to be a god-send to beginning programmers, and a well worn reference point for programmers in code mode. Add in the over 100 pages of appendix material documenting GTK+ properties, signals, styles, stock icons, and error types, and you've got a handy resource.

While all the information in the book is available somewhere free online, including the indispensable devhelp, the GNOME website, and even the GTK+ website itself, having a coherent narrative in handy physical form, I think, is worth the purchase.

Even though the book weighs in at over 600 pages, given the degree to which GTK's abstractions leak, I would have liked it if the author spent a little bit more time explaining the design issues that lead to these leaks.

For example, the author briefly mentions GObject's inherent ability to support the Pimpl (pointer to private implementation) idiom, and gives the boiler-plate code to achieve it (which is good). But when reading the code, one notices that MyObject appears to contain no reference to MyObjectPrivate, while the class constructor for MyObjectClass contains the function

g_type_class_add_private (klass, sizeof (MyObjectPrivate));

(which is mysterious, to me at least). If abstractions are going to leak, I would like it if the author could spare a couple sentences to give me an idea why such a call is necessary, if only avoid a mild state of incongruous bewilderment.

Lastly, I would have liked to get a bit more insight into some of the more fringe, but related, technologies, such as cairo or D-bus; and more details into tricker parts like threading, or a full working example of how to integrate foreign sub-systems using Glib. However this may be asking too much for one book, so perhaps we will have to wait for the author to spring "Advanced GTK+ Development" upon us!

Saturday, June 9, 2007

There is life out there, really, you just have to look

Its times like these that I wish I could just point and click, and magically download a high quality mp3 of any song that caught my fancy.

how to add social bookmarking sites to your blogger footer

1. Click on Customize->Template->Edit HTML
2. Click the Expand Widget Templates button
3. Search for "post-footer-line-3" and place your links within the <p> tag
4. Your links would look something like this:
<a expr:href='"http://del.icio.us/post?url=" + data:post.url + "&title=" + data:post.title' title="del.icio.us">

note: the expr namespace is necessary for the engine to convert the data:post into dynamic content for each post.

change your ways young man

Some simple things to change your daily habits to improve the environment and your life

1. Go to bed early.
- Save the electricity cost (and the greenhouse gases they produce) of lighting necessary after dark, and TV, computers, etc. you use to keep yourself entertained.
- Sleep is an underrated factor in determining quality of life. Get yours, and live better.

2. Read a book.
- Save the electricity cost (and the greenhouse gases they produce) of TV, computers, etc. you use to keep yourself entertained.
- You might just learn something more valuable than what can be found on American Idol.

3. Eat more veggies.
- Save the carbon footprint of raising cattle.
- Enjoy the health benefits of eating more vegetables.

Take off your party hats an go outside

It would seem now that, not only is sunlight a underestimated regulator of moods, but also necessary for producing vitamin D, and underestimated agent for significantly reducing the risk of cancer.

http://www.theglobeandmail.com/servlet/story/RTGAM.20070608.wvitaminD08/BNStory/specialScienceandHealth/home

That means you need to wake up with the sun, and get outside to enjoy the mild morning sunshine!

Thursday, June 7, 2007

The Social Animal

Required reading for anyone who spends any time around other people.

http://www.amazon.com/Social-Animal-Elliot-Aronson/dp/071675715X
http://en.wikipedia.org/wiki/List_of_cognitive_biases

And while we're at it, I't tired of constantly finding these when talking to people:
http://en.wikipedia.org/wiki/Fallacy
http://en.wikipedia.org/wiki/List_of_fallacies

Wednesday, June 6, 2007

More Monkey^wTemplate Magic

From Bjarn's paper here.

Same idea as before, but perhaps more clear.

template <bool b, class X, class Y>
struct if_ {typedef X type; };

template <class X, class Y>
struct if_ <false,x,y> { typedef Y type; };

void f() { if_<sizeof(foobar)<40,Foo,Bar>::type xy; }

Apparently, template programming is Turing complete.

Tuesday, June 5, 2007

Sunday, June 3, 2007

On the Superiority of Questions over Answers

Answers can be wrong. Questions can only Be; they are a more pure, even if derivative, form of observation on reality. Moreover, answers require supposition and interpretation of reality, and thus the assertion of ego onto the objective world.

While both fall victim to the pitfalls of individual perception, it is the nature of questions to contain the ego within itself, and thus often serve to highlight it. Answers only server to disguise assumptions, or set up conflict with those who don't share them.

Consider:

Q: "Why are we here?"
A: "Because god put us here, made in his own image."

Which do you consider more profound, or likely to lead to an insight to existence?

Accumulating answers is the process of erecting walls, confining lines of reason into what one hopes is a gilded path to the Truth. Accumulating questions is the process of expanding new avenues of thought. Most importantly however, is the tendency, when one has gathered enough questions, for the correct path to fall naturally from observation, egolessly.

Saturday, June 2, 2007

On the Nature of Suffering

Suffering is what gives meaning to happiness. In this way suffering is as necessary to happiness as black is to white.

Without suffering, we could be the most fortunate people in existence, and never know it.

A hard road traveled is what makes the destination worth arriving at.

Today we went to Minato-mirai to celebrate the 150th anniversary of the opening of Yokohama harbor (and therefore all of Japan) to foreign traffic. The theme was "thanks to the harbor".

There was a lot of people there, and while we enjoyed the day-light festivities and sampled all the foreign festival cuisine, as the evening came, and the prospect of a serious fireworks display at 8:30pm, so did the people.

In principle, I like people. In practice however, whenever they manage into crowds, its a statistical certainty that they will start doing things that make them become, as a unit, stupid.
So for this reason, we decided to skip fighting with the crowd, and just pack it in early.

(If you want a visual, imagine a dad, gleefully video-taping the strapping young pride of his loins attempting to rip a branch off one of the carefully landscaped trees in the public park. Now imagine what I said to him.)

Its a shame, as we left there were some pretty amazing fireworks going up, but there was not much room, and little will for a fight with the crowds.