power 2 in python using lshift

left shifting 1 in python does a pow 2 operation. I was just doing some performance comparison and here is an interesting result.

$ python -mtimeit 'pow(2,64)'
1000000 loops, best of 3: 1.18 usec per loop
12:31 AM:senthil@:~
$ python -mtimeit 'getattr(1,"__lshift__")(64)'
1000000 loops, best of 3: 0.356 usec per loop
12:32 AM:senthil@:~


I don't know the reason for this difference, I shall update the post when i find out why.

Py3k PEPS at APAC PyCon

I went to Singapore to attend APAC PyCon and also to meet Shalini. It was a good 4 days for me. I presented a talk on Py3K PEPS at APAC Pycon.

The Conference Experience was very good. I had a chance to meet Mark Hammond and discuss a lot of Windows Related things with him with. His presentation on raindrop, couch db and and his perspective on Windows development was very good. It was good to meet in person Liew Beng Keat, the organizer of the Conference who had done a lot of hard work to put this together. I also met Steve Holden, who was present along with his wife, I assume they had a good holiday time at SG, as it is a shopper's paradise. It was good to the warmth in Steve's welcome and this makes him a very good organizer, I guess.

On the first day, the talks I enjoyed the most were Mark's Couch DB talk, wherein I gained good knowledge of JSON based Non-Relational database and a javascript based map-reduce framework. The concept was very interesting. The final talk by Wesley Chun drew in a huge enthusiasm. Wesley did a very nice presentation on Py3k and explaining its features and kind of potrayed the picture that it would take long time for people to move to Py3k. Well, it could be true, but as I debated with him, it would be very good to just potray positively how Py3k is a more symmetrical in many ways that Py2k. His point of view was pragmatism and training for corporations. I tend to agree with him to an extent, but I still believe that for some "good programmer" to start learning Python, Python 3 is a very well designed a symmetrical one rather than Python 2. The libraries and packages will catch up soon.

I also enjoyed Graham Dumpleton's short pitch on mod_wsgi and flask. I still use mod_python and plan to move to more web-development related libraries soon.

My presentation on Py3k PEPS was on next day, it went well and was attended by a small interested audience. Following Presentation by Martin Faassen was very good too. He presented a perspecive on creating libraries, the creative aspect of development of software. Steve Holden's Metaclass Madness talk was enlightening too. It was short presentation and a consise one. It would good to write an article based on his presentation if its not already there. Because Python Metaclasses are something which does not have a lot of literature around in the web. The Q&A in the Metaclass'es talk was good one, as one person asked as when do the metaclasses take effective if we were to wrap teh private methods ( which was denoted by startswith('__') and and it turned out that Class mangles them to _Classname__privatemethod and the metaclass wrapper comes to affect later only). If I write an article, I shall discuss this in more detail. There are some interesting studies which can be done on Metaclass vs Class decorators.

I also attended Noufal's game related talk. It was good one which was attended by a sizable audience. He walked through the code and explained the physics of the game. It was good to see that if developing games we can use real world physics in games using libraries, Interesting. Also, I am not sure, how effective showing a lot of code in the talk is effective. It is very difficult to follow through. Somethings slides with less bullets and easily chew-able points make the presentation more grasping and provide useful inputs to the audience.

The singpass coder's tournament was good one too. I managed to come into Second round. My trials some with functional programming and mis-reading of problem statements cost me some time. But it was a very enjoyable game. A person by name 'Che' from China won the iPad and Noufal got the $100 Amazon Web-services coupon.

On Both days, Shalini came to pick me up from the conference and we went for a stroll in the nearby park of Fort Canning. It was good to talk, walking in the park and saw a lot of people practicing tai-chi. On Saturday we visited a lot of friends, inviting them for our marriage reception at Singapore, we also went to Jackie Chan movie, "The Karate Kid", it was fun. I liked the part where the kid shows his dancing skills on DDR to his girlfriend and she in turn amazes him after acting very shy. The concept of kung-fu as a way of life is also good. On Sunday we did some purchasing, spent a wonderful afternoon at home and in the evening I headed back to India.

Latin Characters in xterm

Pressing the ALT key and pressing the key gives the Latin characters


A - á Á
B - â Â
C - ã Ã
D - ä Ä
E - å Å
F - æ Æ
G - ç Ç
H - è È
I - é É
J - ê Ê
K - ë Ë
L - ì Ì
M - í Í
N - î Î
O - ï Ï
P - ð Ð
Q - ñ Ñ
R - ò Ò
S - ó Ó
T - ô Ô
U - õ Õ
V - ö Ö
W - ÷ ×
X - ø Ø
Y - ã Ù
Z - ú Ú

Martin Vön Löwis
Résumé