Friday, October 16, 2009

Re: Python vs Clojure

Hi, it is NISHIO Hirokazu, a Python hacker.

In Python vs Clojure – Evolving « Best in Class I found a code:



What a mess!

Why you need icross. In Clojure it was written as (for [x (range 100 1000) y (range 100 1000)] (* x y)). It can be written (x * y for x in range(100, 1000) for y in range(100, 1000)) in Python too!

Why you need digits_from_num. In Clojure it was written as (= (seq s) (reverse s)). It can be written list(s) == list(reversed(s)) in Python too!!

And Why you need mul. In Clojure it was (* x y). Why you need new multiply function which takes arbitrary number of arguments?? Why didn't you write just (x * y)?

Finally, I concluded the messy python code is equivalent to the below:

print max(s for s in (x * y
for x in range(111, 1000)
for y in range(y, 1000))
if list(str(s)) == list(reversed(str(s))))


It is shorter than Clojure.



P.S. matz reported the original version of Python code takes 12.2 seconds, my version takes 4.9 seconds (both on Python2.6). And his ruby code (see first post) takes only 2.8 seconds on Ruby1.8.7 and 0.9 seconds on Ruby1.9.

http://twitter.com/yukihiro_matz/status/4901341641
http://twitter.com/yukihiro_matz/status/4901791131
http://twitter.com/yukihiro_matz/status/4901849726

Friday, October 9, 2009

My CG was selected as an excellent work on ASIAGRAPH 2009

Hi, I'm NISHIO Hirokazu. Today I announce a good news (for me!)

My CG artwork was selected as an excellent work by ASIAGRAPH 2009 committee. It will be displayed on 10/22-25 at Odaiba, Tokyo. See below, "Virtual Star" is mine. It shows recursive birth of 5 children of rings.


For more informations: http://www.asiagraph.jp/public/index.html

Friday, October 2, 2009

printed with EPSON's PX-5002

Hi, it is NISHIO Hirokazu. I was present at a blogger event yesterday. It is about EPSON's brandnew printer for professionals PX-5002. It was nice experience to print own graphics out and make a displayable object.





Cool! The printer has 3 grayish inks so it is good to print gray-scale image.

Professional photographer NAKAI Seiya said it is not strange if the display is sold in IKEA.



Here is a movie, but unfortunately compression made it dirty. I'm looking for a chance to display my works.