Archive for the ‘Life in Japan’ Category

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 :-(

Rinkou

Saturday, October 17th, 2009

Today was my first Rinkou class in this semester (Rinkou actually started last week, but I was too sick last friday to attend).

Rinkou was probably one of the only constants since my second coming to Japan. From my two master years all the way to the end of my PhD, every friday morning during class terms we were attending it.

In the Rinkou (which english translation is “seminary”), each student is supposed to present the results of his past 6 months of research to the rest of the department. For master students, that means 3 rounds of rinkou - the first one a “survey”, the two following terms “results”, and the last term they get a reprieve to work on their Thesis. For PhD students, it means 4 rounds of rinkou - two surveys and two results, alternating, with the last year without rinkou for thesis writing.

Every Friday we have three presentations (with parallel rooms in case there are too many students in the department to go through everyone in one term). Each student has 25 minutes to make his presentation, plus 5 minutes for discussion. We are supposed to write a brief report (1 or 2 paragraphs) about each presentation, and turn it in by the end of the class.

The idea has its merits. Supposedly, it increases the exchange of ideas between different laboratories in the same department - so that you can see research topics outside of your immediate field, and you get to get input from people who do not hear about your research everyday. It makes new students get used to preparing presentations, presenting, and answering questions. It also makes students get used to listening to “presentation and question” kinds of sessions. The “one big presentation every six months” may help some students organize their time.

In practice, there are quite a few shortfalls. Very few students really pay attention or make an effort to seriously discuss the works. This is not surprising, for most presenters don’t take the effort to make a presentation that is understandable for people from other fields - this is specially bad in my department, which has laboratories of very radically different fields, like artificial learning and semiconductor research. So the questions come mostly only from the professors, and the comments limit themselves to “thanks for your presentation”. To “remedy” this, the departments have come with a bunch of bad solutions like taking the student number of each student who makes a question, and requesting all students to have made at least one question by the end of each term, defining minimal limits for the size of each written contribution, etc. The more requirements they make, the more the students find a way around those requirements.

It is really a waste. Today, for coincidence, I have talked to two different sets of friends about how would it be possible to improve the rinkou so that we could take more from it. To be honest, our conversations didn’t go very far. In fact, last year there was this big meeting of the PhD students of my department, where one of the big topics of the agenda was improving rinkou. Many people gave some suggestions, but as far as I can see, nothing serious has changed.

The rinkou is actually a pretty big part of most courses’ coursework. In my case, it counts as 60% of all my credits. It seems that every department in engineering in Tokyo University has its own version of the Rinkou - each with a few differences, but most with the same basic characteristics and problems (as far as I can see from talking to friends in other departments). I have no idea if the Medical and Humanities schools also have something similar or not.

  • Categories

  • Archives

  • Meta


  • "Muad'Dib learned rapidly because his first training was in how to learn. And the first lesson of all was the basic trust that he could learn. It's shocking to find how many people do not believe they can learn, and how many more believe learning to be difficult. Muad'Dib knew that every experience carries its lesson."
    from The Humanity of Muad'Dib by the Princess Irulan