2011年3月17日木曜日

Tips: Multiple Python Versions with MacPorts

I wanted to try python3 with MacPorts on my macbook, but wasn't sure if I want to remove older versions yet (for GAE and such).

Anyways I searched and installed the latest one available with MacPorts.
$ port search python3
which lists python versions 3.1.2 and 3.2.  I wanted the newer one, so I did:
$ sudo port install python32
to install python 3.2 successfully.

Then I checked the version:
$ python -V
Python 2.5.4

So python still pointed to an old version.  I could type "python3.2" and run the 3.2 version (actually I've managed to use other versions like that).

Then I found a discussion on this topic:
http://superuser.com/questions/35256/how-can-i-change-the-default-python-version-on-snow-leopard
 

OK, so the python_select package seems just what I wanted.
$ sudo port install python_select
$ python_select -l
gave me some output:
Available versions:
current none python26 python26-apple python27 python32
Now I tried:
$ python_select python32

which didn't work, because it modifies the macports system info...

A command that works:
$ sudo python_select python32
$ python -V
Python 3.2

2011年3月16日水曜日

Gas Shortage in Japan after Earthquake and Anxieties

It's been 5 days since huge earthquakes hit Japan.  My family and relatives live in Tohoku region.  Luckily they survived and the houses are ok.  For those who are in similar situations (who doesn't have to evacuate from their residense), there's a common anxiety growing larger and larger; they don't have enough gas to maintain their ordinary activities. 

Tohoku region is, generally speaking, a very rural area.  Most people can't commute or go buy groceries without cars.  Even most of public transportations like buses and trains (you know, in quite a few areas down there, they are not electric) need gases.  Of course grocery stores can't get items, which happens at especially small stores.  I guess in less populated areas, if this situation continues, there's going to be shortage of foods and economic activity will nearly halt.  In Tokyo too, either gas stations don't have enough supply or people are rushing into gas stations out of worries.   As in a press conference, it seems it's true that there's not enough gas for everyone to stock unnecessary amount. 

As you might already know, gas is also critical for helping those who are directly damaged in the disaster and waiting to be rescued.  To provide foods and water for evacuated people, gas is necessary.  Rescue vehicles need gas.   So for now, lack of gas affects severely damaged areas.

There's already a short term problem in effect.  In a long term, lack of gas affects those who have survived, which in turn may slow down the economy in Japan.  Everyone here needs to calm down a bit and help manage limited amounted of resource.

2011年2月6日日曜日

TopCoder Training in Shibuya, Tokyo

This month here's a series of TopCoder training lectures in Shibuya, Tokyo.   It was the first day, and there are 3 days to go (on coming Saturdays).  Luckily I could reserve a seat for myself.

The lecture series is organized by Application Planet Inc., and they are trying to double the number of "active" TopCoder members in Japan ("active" means to join competitions frequently enough... at least once in last 6 months).  They've been working on the lectures since last year (or so I've heard).

I hope there'll be more active members in Japan, and maybe better single round match schedules for members in Asia, at least once in a few months.  TopCoder single round matches are so great in that it's open to everyone, but it's virtually impossible to join one if it's held like at 11 am on a weekday..., especially if you work for a normal company (I mean, if you are a developer for certain companies, you might be able to manage to join a competition and still show up not so late for your average day...).

The lecturer is Naohiro Takahashi, a famous redcoder in Japan, who goes by "chokudai."  He's a junior student in a university and writer.   He's got so many great achievements (you can find a bunch of them if you just google it).

Lectures and labs there were great, and it's also really a good opportunity to actually be able to listen to red coders and to know they are also human :-) and (some part of ) how they've got so far.  It's mostly aimed at beginners and good for people looking for other folks who are struggling too, like me.

So I just need to practice more and more...