Apr. 2014

Last Modified: Tue May 6 09:50:24 UTC 2014

Note to Self 2014-05-06 [Tue] 18:29

How to compute a variance efficiently:
Var(X) = Σ[xi - μ]2 ÷ n =
Σ[xi2 - 2 xiμ + μ2] ÷ n =
[Σ(xi2) ÷ n] - [2 μ ⋅ Σ(xi) ÷ n] + [μ2 ⋅ Σ1 ÷ n] =
[Σ(xi2) ÷ n] - 2 μ2 + μ2 =
[Σ(xi2) ÷ n] - μ2

The point is that Σ(xi2) can be computed incrementaly, as well as Σ(xi), so that you only need one iteration.

def get_mean_and_variance(seq):
  (n,s1,s2) = (0,0,0)
  for x in seq:
    n += 1
    s1 += x
    s2 += x*x
  mean = s1/float(n)
  variance = s2/float(n) - mean*mean
  return (mean, variance)

Why I hate Objective-C 2014-05-02 [Fri] 17:57

UISomethingSomethingViewController *myViewController = [[UISomethingSomethingViewController alloc] initWithObviouslyVeryImportantOptionsEver:UISomethingSomethingViewControllerObviouslyVeryImportantOptionThingiesInTheWorldFirst];

Please tell me how I can fit this crap in an editor, *in a consistent way*.

Crunchy Time 2014-04-29 [Tue] 11:10

Here is what I've doing in the past four days.

Why I Hate RAD Tools 2014-04-23 [Wed] 21:14

I've been using Unity (for hobby) and XCode (at work) extensively, and constantly annoyed by both of them. Although the two systems are very different, they're similar in that, on both systems, you have to always use a "designer" editor to complete your job, be it the Scene Editor in Unity or Storyboard Editor in XCode. They are often called "RAD" (Rapid Application Development) tools, and I will explain whey I hate them. (In theory, you can make an app without using these features at all, but it's often painful.)

First, let me explain how they work. 1). write a piece of code or create a component, and 2). stitch them together using the design editor, mostly by clicking and drag-dropping. With GUI. The problem is that you have to get two entirely different systems right and match each other side by side, otherwise your app won't run because of missing pointers or invalid values. This is problematic because there are so many values/properties/switches scattered in different parts of the editor. Sometimes they're hidden under a tree control. You have to find them and set the proper value. Sometimes two related properties ends up in different panels so that you have to search the right place. Again, in GUI. They might be even located at a different corner of the editor.

This kind of systems might make sense in an environment where the UI designer/programmer job is clearly separated, but doing it alone is almost like that you have to learn two different languages. Also, there are so many things that can be overlooked or missed out, because there's no single place that has all the information. A source code is now only a small segment of the entire program, and everything is pretty much dispersed among different types of files, which are often not human-readable.

And here's my argument why this is bad. Basically, a software making tool (be it a programming language or RAD editor) has to meet two seemingly conflicting requirements:

  1. Its scope is nicely separated, so that the amount of brain work to take care of each is minimized.
  2. All the necessary things are put in one place, so that one can review or check its consistency or uniformity.

Obviously, having to use two (or three) different editors to finish the job is violating the rule 2, but it's also likely to violate the rule 1, because those "designs" (e.g. Storyboard) and the program code are often interlinked to each other. This is different from using a paint tool or music editor, which have a master-slave relationship to the program code. Forgetting to link an audio file might make your program crash, but the audio file itself plays fine. With RAD editors, you have to set up both of them correctly, or neither of them works.

I can understand the flexibility that RAD tools deliver, and I can see how it's faster of making software than traditional methods. But there's still a lot of need for software that is dependable for our everyday life, and the best way of making reliable software is still to make it strictly hierarchical (no matter how liberal you are politically). A bad thing is that using Storyboard is now the only official (i.e. blessed by Apple) way of making an iOS app. I hope this is not going to be a mainstream way of creating software.

Game Jams in 365 days 2014-04-19 [Sat] 19:12

The list of ongoing game jams. http://compohub.net/

What Are You Waiting For? 2014-04-10 [Thu] 06:38

Trying and failing is far better than not trying at all.

Bananality of Evil 2014-04-09 [Wed] 20:10

Most of the evil is not caused by some epic evil person.

It is mostly caused by groups. By accumulation of subtle things, like small lies or overlooks, bias and wishful thinking. Their change is so gradual that many insiders won't notice it. That's what is the scariest thing about groups. Their norms are sometimes so perverted, but no one has courage to point it out.

The most powerful things are often slowest things. The most harm is often done by something that makes a slow progress.

The Future Is Stupid 2014-04-07 [Mon] 18:45

So, a spoiler of a fiction is obviously bad. But how about a true spoiler of one's real life? It is uncertainty that always gives a person hope. Knowing its future, there will be no hope beyond that point. In that sense dictating a person's life is almost as bad as a death penalty. This was a train of thought that occurred to me after finishing Year Walk. The game was pretty awesome, by the way. You should buy it (if you're an introspective type like me). It shows the sin of attempting to know the future, which would be unbearable to most people. Yet, so many of us are dying to know our own future. The fear of uncertainty is central to our life. There should be somehow a way to overcome this.

The Future Is Stupid 2014-04-07 [Mon] 00:25

Year Walk を終えた。 久しぶりにいいゲームだった。新山は、柄にもなく「artsyな」ゲームが好きである。 そしてこのような場合、ゲームの見た目うんぬんよりもむしろメッセージ性にこだわる。 でもこのゲームはただ artsy なだけでなく、内容もちゃんとあった。 ちなみにこの手のやつで他に好きなのは Thomas Was Alone である。 Papo Yo もわりとよい (ややしつこいけど)。 まあ、いかにも観念的で日本ウケしなそうだけど…。 個人的にはこういうゲームこそ泣けると思うのだが、日本でいう「泣ける」部類とは まったく違うんで、あまりわかってもらえる自信がない (Portal とかならわかりやすいんだろう)。 そもそも日本人でこういうゲームを好んでやっているやつを周囲ではまったく知らないので、 話す相手も非日本人ばかりになり、まるでマイナーな洋画ばかり見たがるエセ評論家のようになてしまう。 困ったもん田。

ps. いっぽうでひどくガッカリしたのは Fez。 物質的な部分はすんごくいいのにね…。

Why reinvention of the wheel is bad? 2014-04-05 [Sat] 14:54

What's the purpose of life?

For many people, it's reinventing the wheel. Do the same things as others, learn the same things as others, and die in the same manner as everyone else. Not all people are born creative or inspired. Life is, in its ultimate sense, a cool pastime at best. Now, why only in software industry reinvention of the wheel is considered bad? And let's admit it, some people can't even invent the wheel.

Damn Nature U Scary 2014-04-05 [Sat] 14:50

yeah yeah i forgot this was once a Nature paper.


and everyone should believe it

What Is Like to be Proud of Your Thesis 2014-04-05 [Sat] 14:27

When I was doing the academic research, I understood the importance of a thesis and spent a lot of time for writing it. But, at the same time, I felt that no one is really going to pay much attention to my thesis, because this is just a one-man's work which probably won't continue after I leave the university. Then, I got this email from one of the professors I respect:

Date: Fri, 30 Nov 2007 13:41:05 -0500 (EST)
Subject: Thesis project

Dear Yusuke,

Last week I discussed your thesis work in a lecture on information
extraction in my web search engines.  Looking it over again, I'm more
impressed than ever by the quality of the work.  It seemed to me a lot
more sophisticated and a much better direction for research than most of
the similar kinds of work, such as ********

-- E

Frankly this made my whole PhD experience worthwhile. The fact that someone you respect spent some time for *really* reading your thesis and gave a comment like this, to me, is more than getting funding or having a nice paying job. I know this probably sounds highfalutin, but my current workplace doesn't value my degree at all so this is kinda my reconciliation now.

I Don't Think Virtual Reality Can Beat a Bottle of Wine 2014-04-03 [Thu] 23:48

So I've seen many people went batshit about the Occulus thingamabob news, and today I found this quote.

"If you use Oculus to look at a panoramic photo, it feels like you're there," Mr. Dixon said. "Who wouldn't want to do that after a long day of work -- to change your mental state by escaping into a photo?"

He added, "In some ways, the biggest competitor to virtual reality might be a bottle of wine."

Quite frankly, I don't think VR can ever beat a bottle of wine. The thing is that people normally don't want to completely immerse themselves to the other world in a living room, because there are still a lot of realities that they have to handle, e.g. they have to answer a phone, wait for family members or go to bed early. Also, if you shut off your senses completely from the real world (VR does that pretty well), it's a perfect opportunity for bad guys. People tend to see the problems of VR is mostly technical, but I think the biggest obstacle in VR is a social one. Even there are other family at home, it's hard not to look like an idiot when you're wearing that thingy around your head, and no one want to feel that much alienated. VR just doesn't work with family (just like 3D glasses) and that's the reason why it isn't going to be the mainstream.

...is Cancelled. 2014-04-03 [Thu] 23:42

This is not a mistake! This is NOT a mistake!

Yusuke Shinyama
Document ID: ce8634b9c79558dfdaf2697c046daa10