Archive for the ‘Life in Japan’ Category

How a Japanese Kid thinks.

Thursday, April 29th, 2010

I was talking to a friend these days about our childhoods, and I heard something that stuck to my mind.

There is a holiday in Japan for the birthday of the emperor. Currently, this day falls on December 23rd. However, during the previous emperor’s reign, of course, the holiday was in a different day. After that emperor died, however, that date remained as a holiday, and it’s name was changed to “Green Day” or “Nature’s day” (and if you never knew where “midori no hi” came from, now you know).

Now, when she was a kid, this friend thought that, since the former emperor’s birthday was still a holiday, eventually, after a number of emperors had passed, most of the year would be made of holidays! So, in her kid mind, she wanted the emperors to die as quickly as possible, so she could have more days off school.

I found this pretty amusing :-P

ETD Day 2 - A simple solution, elegant and wrong

Tuesday, November 24th, 2009

They say that for every problem there is a solution which is simple, elegant, and wrong. I found mine today while working on ETD, and I also find the correct solution (which is also elegant, although a bit less simple).

One of the rules of the “Tower Defense” games is that you cannot completely lock the path that the enemies take from the entrance to the exit of your maze. This path may be as long as it takes, but it must exist. In my implementation, I’m writing in each cell of the path the cost to go to the exit, so that each enemy does not need to calculate their exit paths all the time. Then I have to have a “locking detection” routine that detects if placing an aditional tower in a given location will lock down the maze or not, to prevent that tower from being put.

My first idea was to see what are the distance values of the cells the new tower is going to occupy. If those values were not repeated anywhere else in the maze, that means that that path is a bottleneck, and cannot be blocked. Thinking this solution for a bit while showed that it was wrong (exercise to the reader :-P). The new solution is thus: The entrance and the exit of the maze bissect the surrounding walls into two groups. I give each of this group a flag, and I check each tower when it is put down to see if it connects to one of the groups. If it does, I give it the same flag as the group. If a tower connects BOTH groups, then it means that it blocks the path from the entrance to the exit. I only have to deal with the special case of “island” towers, by giving them a third, “neutral”, group flag, which is painted 1 or 2 when one of the groups reaches the island.

I have not finished implementing the above, but I have implemented most everything else that I needed from the map. I did not have as much time to program today as I had yesterday because I used the bright sunny day to walk around a little bit, clean my home (including washing the dreaded bath), and meeting my friend Dionisio. All in all, I had about 4 hours to hack away at ETD today, and I think I managed quite a bit in this time. Tomorrow I’ll finish implementing the maps, then a bit of tower logic, then link the genome with the tower and the map :-) I hope!

ETD Day 1 - Productive Procrastination

Monday, November 23rd, 2009

I woke up 2 in the afternoon today. Even when I was staying awake for days at a time when I was writing that article last month, I never had crossed the AM/PM line for waking up. I wonder if it is the cold - today was a constant 8 degrees during the whole day, and everyone I called for a coffee out said they couldn’t go, so I end up staying the whole day at home…

Which means that I had plenty of time to keep hacking away at my Python problem :-). Today, I tried a more direct approach by try and coding directly the functions I needed, stopping to google a concept or another when I ran into something I did not understand. This worked surprisingly well, as I managed to intuitively use the list constructs and function in python to easily implement my genome, mutation, crossover operations, as well as population mechanics, like elite, sorting, tournament selection, etc. I did find my share of bizarre bugs, like once when I got confused about instance and class scopes, and that resulted in a constructor operator which generated bigger and bigger individuals in geometric progression and ate up all my computer’s memory in just 4 generations, but by the end of about 6 hours I managed to have a fully fledged evolutionary system (although with a dummy evaluation function). Tomorrow I’ll try writing the engine for my ETD game/evaluation function.

Besides that, I also read up two chapters in the new book I have started “Here Comes Everybody”, by Clay Shirky. The book talks about and tries to explain the phenomenon of the massive, loosely linked community actions, like wikipedia or flickr, based on the idea that the cost to maintaining social connections has collapsed in the past few years, which allowed non-profit actions which were too expensive for informal communities to organize, but too unprofitable for formal companies to tackle, to flourish. Reading the book I can’t help but feel that I had heard all this talk in many different blogs, forum/slashdot comments, and Free Software talks, but it is always nice to see everything put together in one cohesive, well argued text, and with plenty of interesting anecdotes to illustrate the concepts.

Talking about books, last week I also read “A Wizard of Earthsea”, by Ursula K. Le Guin, and I really really recommend this book. I devoured it in less than 2 days. This book is one of the precursors of Medieval Fantasy, and the wizards and how the magic works in Le Guin’s world is too charming. The concept that a Mage is just as powerful as he knows and understand the world around him draws you into her world. I hope I can make my own D&D world as mystical and still consistent as hers.

And that’s for a very cold and gray Sunday. I got one of my three bases covered :-)

Getting to know Akiba

Monday, November 9th, 2009

Recently I have become much more familiar with Tokyo’s electronic neighborhood Akihabara. A few months ago I would have problems finding the Star Kebab I liked so much (a small turkish shop for kebab based sandwiches), and I would have to run around the place three or four times whenever I wanted to find some used game or particular computer piece. But now I can orient myself much better around there.

This is probably because on the past week I have been to Akiba 3 or 4 times - each different guest from Hospitality Club of course wanted to go there, and since I can get there by bike, I would usually follow them and show them around. Then I went a few extra times when Anna and Bonnie were here - Bonnie wanted to hunt for junk shops to try and assemble new ideas for her design products, which I found really cool, and Anna had a broken notebook which took many visits to different shops before we could finally fix it.

Today I was there again, this time to buy this Wireless Headphone I had seen a few days ago for a very cheap price. This dodgy shop in a back street had this stall with 10 or 20 units, and I thought I could come the next day to pick one up. Turns out that if I see something really cheap in Akiba I should buy it right away, because when I went to check it today it was already gone. But while around, I found this cool model shop where they had a rather big section on Ghibli models - and they were pretty cool ones, large mechanical clocks with the characters of Hayao Miyazaki’s movies doing different things. The shop was in the underpass behind the Glass shop near the JR Denkigai entrance.

And then we get closer to the post-a-day goal :-P

Gotenshita Memorial Arena

Wednesday, October 21st, 2009

Today, after a long long while, I went back to the Gotenshita Memorial Arena, Tokyo University’s Gym.

Gotenshita is one of the nicest services Tokyo U. has for its students. It is a large gym with exercise machines, a pool, climbing wall, sports fields and aerobics classes. The equipment is not everything in top shape, but the price for students is 8.000Y a Year - compare that to private gyms, which is at least 8000Y a MONTH.

This is one thing that I like about the Japanese society. I have the impression that people here really value regular exercise - not professional sporting, but actually just getting out of your ass and running/walking/cycling/swimming every now and then. This custom seems to be implanted in their head from school - from what I heard from my Japanese colleagues, they are made to do a lot of physical exercise while they are young, and many of them carry on the custom well into adulthood - it is not unusual to se quite a few people jogging in the middle of the night in Tokyo.

Anyway, I’m out of shape. In past years I used to go wall climbing with a friend in Gotenshita, or doing regular machine exercise, but with the proximity of my thesis, I think I haven’t got close to the gym for a good six months now. So I was aiming for one hour swimming, but could barely make it 30 minutes - I was a bit disappointed because I thought all the walking and cycling I still do regularly to commute everywhere would count for something, but it seems that it didn’t.

My current goal is to try to go swimming at least twice weekly again (I need to go to the gym 26 times to make up for the investment of buying an year pass :-P).

====

So, why I’m back to the gym anyway? Thing is, Monday I ended up procrastinating a little too much, and decided to sleep in the lab to try and make up for it. While I still lived in Kashiwa, sleeping in the lab for late night programming binges was less of a pain, because there was a shower in the Kashiwa building that I could use. In Hongo, however, I have no such acessible shower, which greatly discourages sleep-ins (at least until my Thesis deadline get close enough for me to start ignoring things like basic hygiene). The closest thing is the gym showers - however, the gym only opens at 11:00AM (one of its negative aspects).

So I decided to put everything together - I would stay working in the lab until about 4, wake up at 10, head to the gym, do some exercise, shower, and head back for a new adrenalin charged study binge. Did it work out? Well, I got more done today than I did yesterday, sleeping late notwithstanding, so maybe I should look more into replacing caffeine with adrenalin.

I’m still behind the schedule, though, and this is getting me more stressed by the day :-(

  • Categories

  • Archives

  • Meta


  • "When you pirate music, the copyright you are breaching is not of the artist; the copyright for the recording typically is owned by their label."
    Chris Feran (a musician)