<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8823133891942040386</id><updated>2012-01-28T10:11:14.226-08:00</updated><category term='Houdini'/><category term='MotionBuilder'/><category term='tec'/><category term='Python'/><category term='math'/><category term='Maya'/><category term='other'/><category term='Shake'/><category term='offtopic'/><category term='CG'/><category term='Mac'/><title type='text'>Koichi Tamura's blog</title><subtitle type='html'>Random thoughts around programming and CG</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default?start-index=101&amp;max-results=100'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>201</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-2606719618664163383</id><published>2012-01-23T14:16:00.000-08:00</published><updated>2012-01-27T08:11:00.324-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='other'/><title type='text'>Photos</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();}   catch(e) {}" href="http://4.bp.blogspot.com/-R9RJ6eMWypI/Tx3c1eojFLI/AAAAAAAAAkM/dW_s6m_eK2E/s1600/IMG_20120124_064705.jpg"&gt;&lt;img style="float: left; margin: 0pt 10px 10px 0pt; cursor: pointer; width: 200px; height: 150px;" src="http://4.bp.blogspot.com/-R9RJ6eMWypI/Tx3c1eojFLI/AAAAAAAAAkM/dW_s6m_eK2E/s200/IMG_20120124_064705.jpg" alt="" id="BLOGGER_PHOTO_ID_5700955514635228338" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();}    catch(e) {}" href="http://3.bp.blogspot.com/-1QZQ5PStTvI/Tx3c03tkzCI/AAAAAAAAAkA/CQUNX2tA6So/s1600/IMG_20111008_163111.jpg"&gt;&lt;img style="float: left; margin: 0pt 10px 10px 0pt; cursor: pointer; width: 200px; height: 150px;" src="http://3.bp.blogspot.com/-1QZQ5PStTvI/Tx3c03tkzCI/AAAAAAAAAkA/CQUNX2tA6So/s200/IMG_20111008_163111.jpg" alt="" id="BLOGGER_PHOTO_ID_5700955504187329570" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();}    catch(e) {}" href="http://2.bp.blogspot.com/-s-o6lcAY-RI/Tx3c0k3g9bI/AAAAAAAAAj0/NA9AG4ibrlo/s1600/IMG_20110918_180351.jpg"&gt;&lt;img style="float: left; margin: 0pt 10px 10px 0pt; cursor: pointer; width: 200px; height: 150px;" src="http://2.bp.blogspot.com/-s-o6lcAY-RI/Tx3c0k3g9bI/AAAAAAAAAj0/NA9AG4ibrlo/s200/IMG_20110918_180351.jpg" alt="" id="BLOGGER_PHOTO_ID_5700955499128747442" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();}  catch(e) {}" href="http://4.bp.blogspot.com/-A9tDtI68wRA/TyLL_jel18I/AAAAAAAAAkY/SqwqAqNOlYU/s1600/IMG_20110918_191342.jpg"&gt;&lt;img style="float: left; margin: 0pt 10px 10px 0pt; cursor: pointer; width: 200px; height: 150px;" src="http://4.bp.blogspot.com/-A9tDtI68wRA/TyLL_jel18I/AAAAAAAAAkY/SqwqAqNOlYU/s200/IMG_20110918_191342.jpg" alt="" id="BLOGGER_PHOTO_ID_5702344370920216514" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();}  catch(e) {}" href="http://4.bp.blogspot.com/-xwt6WA7LBHk/TyLL_zH07QI/AAAAAAAAAkk/VBo8rS1Ygek/s1600/IMG_20111117_212357.jpg"&gt;&lt;img style="float: left; margin: 0pt 10px 10px 0pt; cursor: pointer; width: 150px; height: 200px;" src="http://4.bp.blogspot.com/-xwt6WA7LBHk/TyLL_zH07QI/AAAAAAAAAkk/VBo8rS1Ygek/s200/IMG_20111117_212357.jpg" alt="" id="BLOGGER_PHOTO_ID_5702344375119703298" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-2606719618664163383?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/2606719618664163383/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=2606719618664163383' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/2606719618664163383'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/2606719618664163383'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2012/01/photos.html' title='Photos'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-R9RJ6eMWypI/Tx3c1eojFLI/AAAAAAAAAkM/dW_s6m_eK2E/s72-c/IMG_20120124_064705.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-8624878126156829502</id><published>2012-01-19T08:10:00.000-08:00</published><updated>2012-01-19T08:15:04.828-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='other'/><title type='text'>C++ template tecnique</title><content type='html'>Now reading &lt;a href="http://www.amazon.co.jp/C-%E3%83%86%E3%83%B3%E3%83%97%E3%83%AC%E3%83%BC%E3%83%88%E3%83%86%E3%82%AF%E3%83%8B%E3%83%83%E3%82%AF-%CE%B5%CF%80%CE%B9%CF%83%CF%84%CE%B7%CE%BC%CE%B7/dp/4797354534"&gt;C++ template tecnique (Japanese)&lt;/a&gt; written by a C++ Standards Committee member and another guy. Template is not like a standard procedural language, it's more like a pure functional typeless language. I found it a very good book.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-8624878126156829502?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/8624878126156829502/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=8624878126156829502' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/8624878126156829502'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/8624878126156829502'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2012/01/c-template-tecnique.html' title='C++ template tecnique'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-1426840945467501224</id><published>2012-01-01T00:55:00.001-08:00</published><updated>2012-01-01T00:55:48.876-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='other'/><title type='text'>Merry Christmas and Happy new year</title><content type='html'>&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-1426840945467501224?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/1426840945467501224/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=1426840945467501224' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/1426840945467501224'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/1426840945467501224'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2012/01/merry-christmas-and-happy-new-year.html' title='Merry Christmas and Happy new year'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-6350935338736158295</id><published>2011-12-21T07:49:00.000-08:00</published><updated>2011-12-21T07:57:21.383-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='offtopic'/><title type='text'>Then only thing I expect to every programmer</title><content type='html'>is to know the difference between interface and implementation.&lt;br /&gt;It includes, but not limited to spec.&lt;br /&gt;Surprisingly many people  don't care or unaware of it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-6350935338736158295?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/6350935338736158295/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=6350935338736158295' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/6350935338736158295'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/6350935338736158295'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2011/12/then-only-thing-i-expect-to-every.html' title='Then only thing I expect to every programmer'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-7040467405475357936</id><published>2011-11-29T08:48:00.000-08:00</published><updated>2011-11-29T08:55:54.121-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='other'/><title type='text'>So what am I doing now?</title><content type='html'>Reading: Read a couple of papers, both reducing fluid sim calculation cost&lt;br /&gt;Work: Working at Havok&lt;br /&gt;Private: Will buy a motor bike&lt;br /&gt; Event: Went to Exotic Matter's NUGGET Japan 2011 and met Mr. Marcus Nordenstam&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-7040467405475357936?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/7040467405475357936/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=7040467405475357936' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/7040467405475357936'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/7040467405475357936'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2011/11/so-what-am-i-doing-now.html' title='So what am I doing now?'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-3814755880559268827</id><published>2011-11-29T06:55:00.000-08:00</published><updated>2011-11-29T06:58:04.178-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='offtopic'/><title type='text'>A slime draws near</title><content type='html'>Slime meat bun.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();}  catch(e) {}" href="http://4.bp.blogspot.com/-l6z4xLhk2aY/TtTynkLvgiI/AAAAAAAAAjc/FuudasNvA20/s1600/IMG_20111129_161022.jpg"&gt;&lt;img style="float: left; margin: 0pt 10px 10px 0pt; cursor: pointer; width: 150px; height: 200px;" src="http://4.bp.blogspot.com/-l6z4xLhk2aY/TtTynkLvgiI/AAAAAAAAAjc/FuudasNvA20/s200/IMG_20111129_161022.jpg" alt="" id="BLOGGER_PHOTO_ID_5680431791562785314" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ahhhh....&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();}  catch(e) {}" href="http://2.bp.blogspot.com/-uifnQan2N98/TtTynldRzDI/AAAAAAAAAjo/A5qwsjV5iPw/s1600/IMG_20111129_161155.jpg"&gt;&lt;img style="float: left; margin: 0pt 10px 10px 0pt; cursor: pointer; width: 150px; height: 200px;" src="http://2.bp.blogspot.com/-uifnQan2N98/TtTynldRzDI/AAAAAAAAAjo/A5qwsjV5iPw/s200/IMG_20111129_161155.jpg" alt="" id="BLOGGER_PHOTO_ID_5680431791904771122" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-3814755880559268827?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/3814755880559268827/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=3814755880559268827' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/3814755880559268827'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/3814755880559268827'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2011/11/slime-draws-near.html' title='A slime draws near'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-l6z4xLhk2aY/TtTynkLvgiI/AAAAAAAAAjc/FuudasNvA20/s72-c/IMG_20111129_161022.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-3592325820599213929</id><published>2011-08-06T00:55:00.000-07:00</published><updated>2011-08-06T01:04:40.448-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CG'/><title type='text'>Two-Scale Particle Simulation</title><content type='html'>&lt;a href="http://graphics.ethz.ch/publications/papers/paperSol11.php"&gt;Two-Scale Particle Simulation&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It's a straightforward, practical idea to reduce simulation time. First simulate fluid with roughly, and simulate again only within some regions (in the paper, water surface and camera frustum is taken as examples) that needs accracy which boudary conditions given by the rough simulation. Good for multi-threading.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-3592325820599213929?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/3592325820599213929/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=3592325820599213929' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/3592325820599213929'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/3592325820599213929'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2011/08/two-scale-particle-simulation.html' title='Two-Scale Particle Simulation'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-6789442551813525570</id><published>2011-07-25T19:31:00.000-07:00</published><updated>2011-07-25T19:37:56.333-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Maya'/><title type='text'>Maya API charts</title><content type='html'>These are a couple of charts that tells what methods you can use to get  an object you need. I wrote them when I was writing a Maya programming book (which ended up not being published), when Maya version was 5 so they're old  and the interface and behavior written there may be changed but most of  them are still valid.&lt;br /&gt;&lt;br /&gt;The first chart shows the relationship between MDagPath, MObject, MFn*,  etc. The second one focuses on plugs and attributes. The term  "attribute" and "plug" are distinguished strictly in the API. You can  say a node *type* has attributes, not a node, so&lt;br /&gt;&lt;br /&gt;correct: a mesh has an attribute translateX.&lt;br /&gt;wrong: pCone1 has an attribute translateX.&lt;br /&gt;&lt;br /&gt;It indicates you need two informations to get a plug for  "pCone1.translateX". First, the node is "pCone1", and second, the  attribute is "translateX". You'll see it on the second chart.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Disclaimer: I do not guarantee the accuracy of the information. Refer to it at your own risk.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/-VFQNcaabsZY/Ti4nBEG0gvI/AAAAAAAAAjM/_bNSnJR_y44/s1600/zu41.gif"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 400px; height: 259px;" src="http://1.bp.blogspot.com/-VFQNcaabsZY/Ti4nBEG0gvI/AAAAAAAAAjM/_bNSnJR_y44/s400/zu41.gif" alt="" id="BLOGGER_PHOTO_ID_5633483083122770674" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/-41J3zy_JR6Y/Ti4nG3znqBI/AAAAAAAAAjU/cf7_X9rlyk4/s1600/zu42.gif"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 400px; height: 278px;" src="http://3.bp.blogspot.com/-41J3zy_JR6Y/Ti4nG3znqBI/AAAAAAAAAjU/cf7_X9rlyk4/s400/zu42.gif" alt="" id="BLOGGER_PHOTO_ID_5633483182900226066" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-6789442551813525570?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/6789442551813525570/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=6789442551813525570' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/6789442551813525570'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/6789442551813525570'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2011/07/these-are-couple-of-charts-that-tells.html' title='Maya API charts'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-VFQNcaabsZY/Ti4nBEG0gvI/AAAAAAAAAjM/_bNSnJR_y44/s72-c/zu41.gif' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-4840125933505570676</id><published>2011-06-10T08:41:00.000-07:00</published><updated>2011-06-10T08:42:15.546-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CG'/><title type='text'>SPH second test</title><content type='html'>&lt;object height="390" width="640"&gt;&lt;param name="movie" value="http://www.youtube.com/v/H6_0g62pHZk&amp;amp;hl=en_US&amp;amp;feature=player_embedded&amp;amp;version=3"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowScriptAccess" value="always"&gt;&lt;embed src="http://www.youtube.com/v/H6_0g62pHZk&amp;amp;hl=en_US&amp;amp;feature=player_embedded&amp;amp;version=3" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" height="390" width="640"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;18000 particles.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-4840125933505570676?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/4840125933505570676/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=4840125933505570676' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/4840125933505570676'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/4840125933505570676'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2011/06/sph-second-test.html' title='SPH second test'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-4158182808220569152</id><published>2011-06-04T07:45:00.000-07:00</published><updated>2011-06-04T07:46:01.391-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CG'/><title type='text'>SPH</title><content type='html'>Test.&lt;br /&gt;&lt;object height="344" width="425"&gt;&lt;param name="movie" value="http://www.youtube.com/v/J85T0_UbgfQ?hl=en&amp;amp;fs=1"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;embed src="http://www.youtube.com/v/J85T0_UbgfQ?hl=en&amp;amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="344" width="425"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-4158182808220569152?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/4158182808220569152/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=4158182808220569152' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/4158182808220569152'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/4158182808220569152'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2011/06/sph.html' title='SPH'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-5087817400020611302</id><published>2011-03-31T03:47:00.000-07:00</published><updated>2011-03-31T03:50:40.345-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='other'/><title type='text'>Working Effectively with Legacy Code</title><content type='html'>I ordered &lt;a href="http://www.amazon.com/Working-Effectively-Legacy-Michael-Feathers/dp/0131177052"&gt;Working Effectively with Legacy Code&lt;/a&gt; on Amazon.&lt;br /&gt;According to the comments, it looks it's about how to tackle with real world problems.&lt;br /&gt;I'll write a review here when I get it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-5087817400020611302?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/5087817400020611302/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=5087817400020611302' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/5087817400020611302'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/5087817400020611302'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2011/03/working-effectively-with-legacy-code.html' title='Working Effectively with Legacy Code'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-3878375816820976366</id><published>2011-03-18T23:12:00.000-07:00</published><updated>2011-03-18T23:31:51.300-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='other'/><title type='text'>I'm still in Tokyo</title><content type='html'>There are still power cuts, not a lot of food, gasoline in stores due to seaport damage, prioritized allocation to afflicted areas, and nasty buyups. Lots of foreigners and a bit of Japanese around me left Tokyo  momentarily. Tokyo is slowly getting back to normal. The gym I use, which was closed after the earthquake reopened yesterday. There is still a serious concern in the plant. The result is likely to be clear during this three-day weekend. I'm watching the news closely.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-3878375816820976366?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/3878375816820976366/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=3878375816820976366' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/3878375816820976366'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/3878375816820976366'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2011/03/im-still-in-tokyo.html' title='I&apos;m still in Tokyo'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-2184512739441397239</id><published>2011-03-11T08:07:00.000-08:00</published><updated>2011-03-11T08:11:41.570-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='offtopic'/><title type='text'>Earthquake</title><content type='html'>There was a couple of huge earthquakes that I had never experienced. Every public transportation stopped and I had to walk home taking 6 hours. There are still afterquakes every 30 minutes.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-2184512739441397239?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/2184512739441397239/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=2184512739441397239' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/2184512739441397239'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/2184512739441397239'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2011/03/earthquake.html' title='Earthquake'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-6486699820713513100</id><published>2011-03-07T05:18:00.000-08:00</published><updated>2011-03-07T05:19:43.947-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='offtopic'/><title type='text'>PENGUIN BOMB</title><content type='html'>&lt;iframe title="YouTube video player" width="480" height="390" src="http://www.youtube.com/embed/6-t3cqLWoTg" frameborder="0"&gt;&lt;/iframe&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-6486699820713513100?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/6486699820713513100/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=6486699820713513100' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/6486699820713513100'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/6486699820713513100'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2011/03/penguin-bomb.html' title='PENGUIN BOMB'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://img.youtube.com/vi/6-t3cqLWoTg/default.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-686210545776232556</id><published>2011-02-06T11:27:00.000-08:00</published><updated>2011-02-06T11:32:07.541-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='other'/><title type='text'>“Less is More” is Bullshit</title><content type='html'>&lt;a href="http://37signals.com/svn/archives2/less_is_more_is_bullshit.php"&gt;“Less is More” is Bullshit&lt;/a&gt; by Ian Crawford&lt;br /&gt;&lt;span style="font-style: italic;"&gt;“Less is More” implies that more is better. It’s not. Less is less. Less  is just right. Less is better.&lt;/span&gt;&lt;br /&gt;from 37signals blog.&lt;br /&gt;&lt;br /&gt;That's very true.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-686210545776232556?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/686210545776232556/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=686210545776232556' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/686210545776232556'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/686210545776232556'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2011/02/less-is-more-is-bullshit-by-ian.html' title='“Less is More” is Bullshit'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-6507991312536611703</id><published>2011-01-31T06:37:00.000-08:00</published><updated>2011-01-31T06:43:41.199-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='other'/><title type='text'>LLVM</title><content type='html'>Since I went to a workshop held several weeks ago, I got interested in LLVM. LLVM stands for Low Level Virtual Machine which is a compiler infrastructure (a good tool to use when you write your compiler). There are lots of project going on using LLVM, unladen swallow is a famous one of them. Now I'm reading LLVM tutorial and I found it's not only good for understanding LLVM, but it's very helpful to understand compiler itself, i.e. lexer, parser, and code generation, with lots of practical tips. It's not difficult at all if you have a basic knowledge of C++.&lt;br /&gt;&lt;br /&gt;The following info are some tips to run the sample program (toy.cpp) on fedora.&lt;br /&gt;&lt;br /&gt;1) Installation&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;yum install llvm&lt;br /&gt;yum install clang&lt;br /&gt;yum install llvm-doc&lt;br /&gt;yum install clang-doc&lt;br /&gt;yum install llvm-devel&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;2) Add -rdynamic option when you compile chapter 5 example program.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt; g++ -g toy.cpp `llvm-config --cppflags --ldflags --libs core jit native` -O3 -o toy -rdynamic&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;   Accoding to the gcc man page,&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;           Pass the flag -export-dynamic to the ELF linker, on targets that&lt;br /&gt;           support it. This instructs the linker to add all symbols, not only&lt;br /&gt;           used ones, to the dynamic symbol table. This option is needed for&lt;br /&gt;           some uses of "dlopen" or to allow obtaining backtraces from within&lt;br /&gt;           a program.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Without this, you'll see an error message when you use "putchard"&lt;br /&gt;&lt;pre&gt;&lt;br /&gt; LLVM ERROR: Program used external function 'putchard' which could not be resolved!&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;3) To Make the chapter 5 example program work exactly like the document, comment out the following line.&lt;br /&gt;   Adding this will do some more optimization.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt; OurFPM.add(createCFGSimplificationPass());&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;4) If you are puzzled by the following part of chapter5's If/Then/Else section,&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;  // Codegen of 'Then' can change the current block, update ThenBB for the PHI.&lt;br /&gt;  ThenBB = Builder.GetInsertBlock();&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;try executing the following code and see what it generates.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt; extern foo();&lt;br /&gt; extern bar();&lt;br /&gt; extern kou();&lt;br /&gt; extern tam();&lt;br /&gt; def baz(x) if x then if foo() then kou() else tam() else bar();&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;and be aware that if/then/else/merge always ends its execution at merge(ifcont) block.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-6507991312536611703?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/6507991312536611703/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=6507991312536611703' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/6507991312536611703'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/6507991312536611703'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2011/01/since-i-went-to-held-several-weeks-ago.html' title='LLVM'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-736585308117045524</id><published>2011-01-30T09:50:00.000-08:00</published><updated>2011-01-30T10:07:52.214-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='other'/><title type='text'>PyCon mini JP</title><content type='html'>Yesterday we held PyCon mini JP.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_c-kJL128S60/TUWlReX6S7I/AAAAAAAAAi4/ZKCD299fzqY/s1600/IMG_20110129_173020.jpg"&gt;&lt;img style="float: left; margin: 0pt 10px 10px 0pt; cursor: pointer; width: 271px; height: 362px;" src="http://3.bp.blogspot.com/_c-kJL128S60/TUWlReX6S7I/AAAAAAAAAi4/ZKCD299fzqY/s400/IMG_20110129_173020.jpg" alt="" id="BLOGGER_PHOTO_ID_5568038233943198642" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ice break&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_c-kJL128S60/TUWlLpakVeI/AAAAAAAAAiw/qdrAblLOc1I/s1600/IMG_20110129_101141.jpg"&gt;&lt;img style="float: left; margin: 0pt 10px 10px 0pt; cursor: pointer; width: 388px; height: 291px;" src="http://2.bp.blogspot.com/_c-kJL128S60/TUWlLpakVeI/AAAAAAAAAiw/qdrAblLOc1I/s400/IMG_20110129_101141.jpg" alt="" id="BLOGGER_PHOTO_ID_5568038133827917282" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I think it was a big success. We had a wide variety of sessions and attendances seemed to enjoy them a lot. It was the first time for me to participate in holding a conference. I don't think I could work like others who regularly do it but I enjoyed it a lot and had a good experience. It was interesting that the way people who likes holding conferences think are quite different from other developers, they think about communities much more seriously for example.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-736585308117045524?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/736585308117045524/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=736585308117045524' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/736585308117045524'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/736585308117045524'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2011/01/pycon-mini-jp.html' title='PyCon mini JP'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_c-kJL128S60/TUWlReX6S7I/AAAAAAAAAi4/ZKCD299fzqY/s72-c/IMG_20110129_173020.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-8685098779243373912</id><published>2011-01-23T05:22:00.001-08:00</published><updated>2011-01-23T05:43:47.599-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='other'/><title type='text'>One more video</title><content type='html'>Find .mov and .ogv from a directory and its sub directories, convert them to .avi files and store them to another directory. 1080p available.&lt;br /&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/Nw_fguyJiLY?hl=en&amp;fs=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/Nw_fguyJiLY?hl=en&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-8685098779243373912?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/8685098779243373912/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=8685098779243373912' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/8685098779243373912'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/8685098779243373912'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2011/01/one-more-video.html' title='One more video'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-2434367152534112129</id><published>2011-01-13T07:36:00.000-08:00</published><updated>2011-01-14T17:54:47.347-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='other'/><title type='text'>Zamami pre-alpha</title><content type='html'>This is a software I've been making.&lt;br /&gt;It'll be better to watch them on full screen mode with 720p.&lt;br /&gt;&lt;br /&gt;Basic usage&lt;br /&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/5ytgJ-PVE3U?hl=en&amp;fs=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/5ytgJ-PVE3U?hl=en&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;Batch execute and debugger&lt;br /&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/Q_BEE9C_3as?hl=en&amp;fs=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/Q_BEE9C_3as?hl=en&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;sqlite&lt;br /&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/DwuQ3PtDtKQ?hl=en&amp;fs=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/DwuQ3PtDtKQ?hl=en&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;Detect missing files in an image sequence&lt;br /&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/YiB-UJSC_cs?hl=en&amp;fs=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/YiB-UJSC_cs?hl=en&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;job dispatch&lt;br /&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/i41PNT9-dyM?hl=en&amp;fs=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/i41PNT9-dyM?hl=en&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;fancy template&lt;br /&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/df9sMkrx14Q?hl=en&amp;fs=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/df9sMkrx14Q?hl=en&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;I made a twitter client on it for a complecated node-network example but twitter has turned off Basic auth last year and it doesn't work now. I'll upload it when I've made it working.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-2434367152534112129?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/2434367152534112129/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=2434367152534112129' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/2434367152534112129'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/2434367152534112129'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2011/01/zamami-pre-alpha.html' title='Zamami pre-alpha'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-4438044359011573800</id><published>2010-12-04T17:35:00.000-08:00</published><updated>2010-12-23T08:17:41.425-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>Tips to obfuscate your code.</title><content type='html'>I often realize people make their code hard to maintain. It's a very good idea to raise your value in the company since nobody else can maintain it. Let's learn from their code. Often you can even get more efficient code since you don't need to write extra lines to make your code nicer. It doesn't cover basic skills like using magic numbers, not making a method name readable, give an object more than one name, delete all comments, etc (Do all of them!). Ideas are listed in order of importance.&lt;br /&gt;&lt;br /&gt;(1) Store the same value in more than one places.&lt;br /&gt;&lt;br /&gt;If you store the same parameter in more than one places, you need to synchronize them. When a maintainer write a code that changes the value, he will have a change to miss the fact and change only one of them. Every code that uses the other variable which wasn't changed will behave mistakenly. Hopefully the program will be in an inconsistent state.&lt;br /&gt;&lt;br /&gt;(2) Store lots of data in an object and every method depends on them&lt;br /&gt;&lt;br /&gt;If lots of methods are dependent on the state of the object, the user of the class will need to set all of them properly before using the method and he will be confused. A nice side effect is that it makes the program hard to debug and test cause the behavior of a method can have lots of right and wrong cases. Try packing lots of unnecessary parameters, make the state of objects complicated, and make it hard to maintain.&lt;br /&gt;&lt;br /&gt;(3) Reference an object from lots of other objects.&lt;br /&gt;&lt;br /&gt;People who look at it will be puzzled, "Is the object I can get from A is the same as what I can get through B?". This strategy is good with (1) above. Unnecessary references are good!&lt;br /&gt;&lt;br /&gt;Dec. 24:&lt;br /&gt;Just tried to tell what will happen if you do them. Don't do them of course :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-4438044359011573800?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/4438044359011573800/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=4438044359011573800' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/4438044359011573800'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/4438044359011573800'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2010/12/tips-to-obfuscate-your-code.html' title='Tips to obfuscate your code.'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-3139376791612192074</id><published>2010-11-25T08:25:00.000-08:00</published><updated>2010-11-25T09:45:04.966-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>pycurry</title><content type='html'>A friend of mine wrote a very interesting function that makes arbitrary methods good for &lt;a href="http://en.wikipedia.org/wiki/Currying"&gt;currying&lt;/a&gt; when used as a decorator. This is an example he wrote,&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="python"&gt;&lt;br /&gt;import pycurry&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;@pycurry.curryfunc&lt;br /&gt;def test(aa, bb, cc):&lt;br /&gt;    print aa, bb, cc&lt;br /&gt;&lt;br /&gt;f = test(10) # =&gt; currying&lt;br /&gt;test(10, 20, 30) # =&gt; execute the func&lt;br /&gt;&lt;br /&gt;f(40, 50) # =&gt; execute the func since sufficient arguments are given&lt;br /&gt;f(200, cc=400) # =&gt; You can execute the func like this as well&lt;br /&gt;&lt;br /&gt;g = f('aaa') # =&gt; curring again&lt;br /&gt;g([10]) # =&gt; execute&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;One example use case is making similar functions that takes some of arguments in common, and some of arguments given previously, like&lt;br /&gt;&lt;pre name="code" class="python"&gt;&lt;br /&gt;import pycurry&lt;br /&gt;&lt;br /&gt;@pycurry.curryfunc&lt;br /&gt;def myShotMessageSlot(buttonName, toggled):&lt;br /&gt;    print 'Button ' + buttonName + "'s current state is " + str(toggled)&lt;br /&gt;&lt;br /&gt;qtToggleButtonAAA.someSignal.connect(myShotMessageSlot('AAA'))&lt;br /&gt;qtToggleButtonBBB.someSignal.connect(myShotMessageSlot('BBB'))&lt;br /&gt;qtToggleButtonCCC.someSignal.connect(myShotMessageSlot('CCC'))&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I usually do the same thing using a closure (you can also use partial),&lt;br /&gt;&lt;pre name="code" class="python"&gt;&lt;br /&gt;def slotFactory(buttonName):&lt;br /&gt;    def myShotMessageSlot(toggled):&lt;br /&gt;        print 'Button ' + buttonName + "'s current state is " + str(toggled)&lt;br /&gt;    return myShotMessageSlot&lt;br /&gt;qtToggleButtonAAA.someSignal.connect(slotFactory('AAA'))&lt;br /&gt;qtToggleButtonBBB.someSignal.connect(slotFactory('BBB'))&lt;br /&gt;qtToggleButtonCCC.someSignal.connect(slotFactory('CCC'))&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;but using his pycurry makes it nicer.&lt;br /&gt;&lt;br /&gt;&lt;a href="https://github.com/shomah4a/pycurry"&gt;https://github.com/shomah4a/pycurry&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;By the way I just noticed syntaxhighlighter doesn't work anymore. The JavaScript files were on a free hosting site that has ended its service, I need to put it somewhere else, ahhhh...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-3139376791612192074?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/3139376791612192074/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=3139376791612192074' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/3139376791612192074'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/3139376791612192074'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2010/11/pycurry.html' title='pycurry'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-1308290436751488497</id><published>2010-11-21T17:17:00.000-08:00</published><updated>2010-11-21T17:22:35.626-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CG'/><title type='text'>First result</title><content type='html'>First result of my Sunday programming.&lt;br /&gt;&lt;object height="385" width="640"&gt;&lt;param name="movie" value="http://www.youtube.com/v/MF2PN8sgrQs?fs=1&amp;amp;hl=en_US"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;embed src="http://www.youtube.com/v/MF2PN8sgrQs?fs=1&amp;amp;hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="385" width="640"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;Spheres in the grids are pressures (positive or negative), lines are velocities in the staggered grid.&lt;br /&gt;Took a bit of time to show Karman vortex.&lt;br /&gt;I will take several source codes before making it 3D.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-1308290436751488497?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/1308290436751488497/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=1308290436751488497' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/1308290436751488497'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/1308290436751488497'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2010/11/first-result.html' title='First result'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-3704877532398430652</id><published>2010-11-07T07:09:00.000-08:00</published><updated>2010-11-07T07:12:20.089-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='offtopic'/><title type='text'>40 days passed since I started weight control</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_c-kJL128S60/TNbBZEiBBsI/AAAAAAAAAig/KYUessKXd8E/s1600/%E5%90%8D%E7%A7%B0%E6%9C%AA%E8%A8%AD%E5%AE%9A.jpg"&gt;&lt;img style="float: left; margin: 0pt 10px 10px 0pt; cursor: pointer; width: 400px; height: 116px;" src="http://2.bp.blogspot.com/_c-kJL128S60/TNbBZEiBBsI/AAAAAAAAAig/KYUessKXd8E/s400/%E5%90%8D%E7%A7%B0%E6%9C%AA%E8%A8%AD%E5%AE%9A.jpg" alt="" id="BLOGGER_PHOTO_ID_5536825428355909314" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Yellow: body fat&lt;br /&gt;Green: lean body weight&lt;br /&gt;Blue spot: workout&lt;br /&gt;Red spot: went for a drink&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-3704877532398430652?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/3704877532398430652/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=3704877532398430652' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/3704877532398430652'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/3704877532398430652'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2010/11/40-days-passed-since-i-started-weight.html' title='40 days passed since I started weight control'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_c-kJL128S60/TNbBZEiBBsI/AAAAAAAAAig/KYUessKXd8E/s72-c/%E5%90%8D%E7%A7%B0%E6%9C%AA%E8%A8%AD%E5%AE%9A.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-8649439186227523545</id><published>2010-11-07T07:02:00.000-08:00</published><updated>2010-11-07T07:08:03.205-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tec'/><title type='text'>Coq Proof Assistant</title><content type='html'>From the &lt;a href="http://coq.inria.fr/"&gt;homepage&lt;/a&gt;.&lt;br /&gt;&lt;div style="font-weight: bold; font-style: italic;" class="frameworkcontent"&gt;   &lt;p&gt;Coq is a formal proof management system. It provides a formal  language to write mathematical definitions, executable algorithms and  theorems together with an environment for semi-interactive development  of machine-checked proofs.   &lt;/p&gt; &lt;/div&gt;   I studied basic symbolic logic to learn Coq, but its still very difficult. I still have no idea about correspondence between "A's type is B" and "A is a proof of B" (Curry–Howard  correspondence).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-8649439186227523545?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/8649439186227523545/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=8649439186227523545' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/8649439186227523545'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/8649439186227523545'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2010/11/coq-proof-assistant.html' title='Coq Proof Assistant'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-9205482440855737800</id><published>2010-11-07T06:47:00.000-08:00</published><updated>2010-11-07T07:01:46.703-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CG'/><title type='text'>From my note (Fluid)</title><content type='html'>Please let me know if something is wrong.&lt;br /&gt;&lt;br /&gt;* [001]Simulating Ocean Water&lt;br /&gt;         - Jerry Tessendorf&lt;br /&gt;   * [002]Deep-Water Animation and Rendering&lt;br /&gt;         - http://www.gamasutra.com/gdce/2001/jensen/jensen_01.htm&lt;br /&gt;         - Lasse Staff Jensen and Robert Golias&lt;br /&gt;   * [003]A Novel Algorithm for Incompressible Flow Using Only A Coarse Grid Projection&lt;br /&gt;         - physbam.stanford.edu/~eenglish/tmp/refinement.pdf&lt;br /&gt;         - Michael Lentine, Wen Zheng, Ronald Fedkiw&lt;br /&gt;         - Read.&lt;br /&gt;   * [004]Filament based smoke with vortex shedding and variational reconnection&lt;br /&gt;         - Steffen Weißmann and Ulrich Pinkall&lt;br /&gt;         - That filament based stuff.&lt;br /&gt;   * [005]Animating Sand as a Fluid&lt;br /&gt;         - Yongning Zhu and Robert Bridson&lt;br /&gt;         - Bridson's page http://www.cs.ubc.ca/~rbridson/&lt;br /&gt;         - First paper of Flip in CG.&lt;br /&gt;   * [006]Basic knowledge to learn weather dynamics(Japanese)&lt;br /&gt;         - for [005] (strain rate tensor, etc.)&lt;br /&gt;         - http://epa.scitec.kobe-u.ac.jp/~ykawai/project/meteo_basic/meteo_basic.html&lt;br /&gt;         - http://epa.scitec.kobe-u.ac.jp/~ykawai/project/meteo_basic/node15.html&lt;br /&gt;   * [007]A Controllable, Fast and Stable Basis for Vortex Based Smoke Simulation&lt;br /&gt;         - http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.101.6870&amp;amp;rep=rep1&amp;amp;type=pdf&lt;br /&gt;         - Alexis Angelidis, Fabrice Neyret, Karan Singh, Derek Nowrouzezahrai&lt;br /&gt;         - one of original paper of [004].&lt;br /&gt;   * [008]Computation of Vortex Ring Dynamics&lt;br /&gt;         - http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.101.6870&amp;amp;rep=rep1&amp;amp;type=pdf&lt;br /&gt;         - Robert KRASNY and Leon KAGANOVSKIY&lt;br /&gt;         - For [004] tutorial.&lt;br /&gt;&lt;br /&gt;   * Vorticity Structure and Evolution in a Transverse Jet with New Algorithms for Scalable Particle Simulation http://dspace.mit.edu/bitstream/handle/1721.1/27103/56835888.pdf?sequence=1&lt;br /&gt;         - Fro [004] Looks good explanation for rosenhead-moore.&lt;br /&gt;   * [009]FLIP: A LOW-DISSIPATION, PARTICLE-IN-CELL METhOD FOR FLUID FLOW&lt;br /&gt;         - J.U. BRACKBILL, D.B. KOTHE and H.M. RUPPEL&lt;br /&gt;         - Flip.&lt;br /&gt;   * [010]A new doubly discrete analogue of smoke ring flow and the real time simulation of fluid flow.&lt;br /&gt;         - Written by Pinkall, author of Philament based ...&lt;br /&gt;   * [011]Fluid Simulation For Computer Graphics: A Tutorial in Grid Based and Particle Based Methods&lt;br /&gt;         - http://www.colinbraley.com/Pubs/FluidSimColinBraley.pdf&lt;br /&gt;         - Found when googled "MAC grid" while reading Animating Sand as a Fluid&lt;br /&gt;   * [012]strain and rotation(Japanese)&lt;br /&gt;         - http://solid4.mech.okayama-u.ac.jp/ひずみと回転.pdf&lt;br /&gt;         - Written by a prof. of Okayama univ. For Animating Sand as a Fluid. Good.&lt;br /&gt;   * [013]Strain and stress&lt;br /&gt;         - http://www.mech.kyushu-u.ac.jp/lab/chi10/jp/chap3.pdf&lt;br /&gt;         - Written by a prof. of Kyusyu univ. For Animating Sand as a Fluid. Good.&lt;br /&gt;   * [014]FLUID SIMULATION SIGGRAPH 2007 Course Notes&lt;br /&gt;         - http://www.cs.ubc.ca/~rbridson/fluidsimulation/fluids_notes.pdf&lt;br /&gt;         - Famous one by Bridson, authoer of Animating Sand as a Fluid. SUPER GOOD.&lt;br /&gt;   * [015]A forward-trajectory global semi-Lagrangian transport scheme&lt;br /&gt;         - Detailed documents about semi-Lagrangian method.&lt;br /&gt;   * [016](Japanese)&lt;br /&gt;         - www.sr3.t.u-tokyo.ac.jp/~matsuo/lecture/09suchi/shiryo8.pdf&lt;br /&gt;   * [017]Wavelet Turbulence for Fluid Simulation&lt;br /&gt;         - That Wavelet Trubulence one.&lt;br /&gt;   * [018]Real-time Fluid Simulations with Wavelet Turbulence&lt;br /&gt;         - Student's paper. His professor is the author of Wavelet Trubulence.&lt;br /&gt;   * [019]Real-Time Simulation and Rendering of 3D Fluids&lt;br /&gt;         - GPU Gems 3 chapter30. Haven't read.&lt;br /&gt;         - http://geometry.caltech.edu/~keenan/pdf/rtsr3df.pdf&lt;br /&gt;   * [020]Animation and Rendering of Complex Water Surfaces&lt;br /&gt;         - Origin of particle level set. Haven't read.&lt;br /&gt;   * [021]A Hybrid Particle Level Set Method for Improved Interface Capturing&lt;br /&gt;         - Origin of Particle level set. Havne't read.&lt;br /&gt;   * [022]Meshless Approximation Methods and Applications in Physics Based Modeling and Animation Bart Adams, Martin Wicke Eurographics 2009 Tutorial（未）&lt;br /&gt;         - http://graphics.stanford.edu/~wicke/publications.html&lt;br /&gt;         - Like a course note about Meshles. Haven't read.&lt;br /&gt;   * [023]FlowFixer?: Using BFECC for Fluid Simulation&lt;br /&gt;         - http://www.gvu.gatech.edu/~jarek/papers/FlowFixer.pdf&lt;br /&gt;         - Haven't read.&lt;br /&gt;   * [024]Fluid Simulation for Computer Animation&lt;br /&gt;         - PPT slide when googled "Mark Carlson bfecc". Haven't read.&lt;br /&gt;         - www.cc.gatech.edu/~turk/powerpoint_presentations/fluids.ppt&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-9205482440855737800?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/9205482440855737800/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=9205482440855737800' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/9205482440855737800'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/9205482440855737800'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2010/11/from-my-note-fluid.html' title='From my note (Fluid)'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-1556476574008590356</id><published>2010-11-07T06:46:00.000-08:00</published><updated>2010-11-07T07:02:10.220-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CG'/><title type='text'>From my note (PRT)</title><content type='html'>Please let me know if something is wrong.&lt;br /&gt;&lt;br /&gt;PRT&lt;br /&gt;   * [001]PRT (Japanese)&lt;br /&gt;         - http://www.pyramid-inc.net/technical/index.php&lt;br /&gt;         - explanation of :http://journal.mycom.co.jp/articles/2006/09/23/cedec4/(Japanese)&lt;br /&gt;&lt;br /&gt;   * [002]Spherical Harmonic Lighting: The Gritty Details&lt;br /&gt;         http://www.research.scea.com/gdc2003/spherical-harmonic-lighting.html&lt;br /&gt;         - [001] says read this for docs about SH Rotation.&lt;br /&gt;&lt;br /&gt;   * [003]All-frequency precomputed radiance transfer using spherical radial basis functions and clustered tensor approximation&lt;br /&gt;         - http://www.cis.nctu.edu.tw/~gis91812/&lt;br /&gt;         - Tsai, Yu-Ting and Shih, Zen-Chung.&lt;br /&gt;         - Proceedings of ACM SIGGRAPH 2006, pp. 967-976, 2006.&lt;br /&gt;         - SRBF for PRT. Half read.&lt;br /&gt;&lt;br /&gt;   * [004]All-Frequency Precomputed Radiance Transfer for Glossy Objects&lt;br /&gt;         - Read for [003]. Uses PRT for glossy materials by high compression with a combination of wavelet, CPCA, BRDF factorization&lt;br /&gt;&lt;br /&gt;   * [005]All Frequency Shadows Using Non linear Wavelet Lighting Approximation&lt;br /&gt;         - Read for [003] [004]Uses wavelet for PRT.&lt;br /&gt;&lt;br /&gt;   * [006]Matrix Radiance Transfer&lt;br /&gt;         - Read for [003] [004]. Uses CPCA.&lt;br /&gt;&lt;br /&gt;   * [007]Interactive Rendering with Arbitrary BRDFs using Separable Approximations&lt;br /&gt;         - Read for [004]. BRDF factorization。&lt;br /&gt;&lt;br /&gt;   * [008]Nonstationary Wavelets on them-Sphere for Scattered Data&lt;br /&gt;         - [003] says detailed explanation for SRBF convolution, i.e. spherical sigular integral. Haven't read.&lt;br /&gt;&lt;br /&gt;   * [009]Triple Product Wavelet Integrals for. All-Frequency Relighting&lt;br /&gt;         - [003]Referenced. Came after[005]. Haven't read.&lt;br /&gt;&lt;br /&gt;   * [010]Is There Anything Comparable to Spherical Harmonics But Simpler?&lt;br /&gt;         - http://www.cse.cuhk.edu.hk/~ttwong/papers/srbf/srbf.html&lt;br /&gt;         - srbf.pps http://appsrv.cse.cuhk.edu.hk/~ttwong/cgi-bin/paper-download/download.cgi?path=srbf&amp;amp;dl=srbf.pps&lt;br /&gt;         - Good document of SRBF for PRT.&lt;br /&gt;         - Probabably the base of this is "An RBF-based Image Compression Method for Image-based Rendering" written by the same author. Couldn't find on the web.&lt;br /&gt;&lt;br /&gt;   * [011]&lt;br /&gt;         - Stupid Spherical Harmonics (SH) Tricks&lt;br /&gt;         - SH (and PRT?) document by Sloan. Notes on Zonal harmonics.&lt;br /&gt;         - Haven't read&lt;br /&gt;&lt;br /&gt;   * [012]&lt;br /&gt;         - Nonstationary Wavelets on the m-Sphere for Scattered Data&lt;br /&gt;         - Francis J. Narcowich, Joseph D.Ward&lt;br /&gt;         - [003] referenced for spherical functionのconvolution&lt;br /&gt;&lt;br /&gt;   * [013]&lt;br /&gt;         - An Efficient Representation for Irradiance Environment Maps&lt;br /&gt;         - For test implementation in Nuke&lt;br /&gt;&lt;br /&gt;   * [014]&lt;br /&gt;         - On the Relationship between Radiance and Irradiance: Determining the illumination from images of a convex Lambertian object&lt;br /&gt;         - [013] referenced.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;   * [100]Hierarchical RBF&lt;br /&gt;         - http://en.wikipedia.org/wiki/Hierarchical_RBF&lt;br /&gt;         - Looks model generation from a point cloud, haven't read.&lt;br /&gt;&lt;br /&gt;   * [101]Cinematic Wavelet Lighting&lt;br /&gt;         - www.pyramid-inc.net/technical/rd_file/wavelet_jp.pdf(Japanese)&lt;br /&gt;         - Pyramid published at CEDEC2004&lt;br /&gt;&lt;br /&gt;   * [102]Wavelet Lighting(Japanese)&lt;br /&gt;         - www.pyramid-inc.net/technical/rd_file/wavelet_jp.pdf&lt;br /&gt;         - Comes with [101]&lt;br /&gt;&lt;br /&gt;   * [200]&lt;br /&gt;         - All-Frequency Relighting of Non-Diffuse Objects&lt;br /&gt;         - Haven't red, looks famous.&lt;br /&gt;         - Simpler than [004], fast&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-1556476574008590356?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/1556476574008590356/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=1556476574008590356' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/1556476574008590356'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/1556476574008590356'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2010/11/from-my-note-prt.html' title='From my note (PRT)'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-2890756661786713299</id><published>2010-11-02T18:18:00.000-07:00</published><updated>2010-11-02T18:20:25.728-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Maya'/><title type='text'>Re-opened hohehohe2's OpenMaya tutorial</title><content type='html'>It's moved here!&lt;br /&gt;&lt;a href="http://www.daisukemaki.com/archive/koichi/0mokuji.html"&gt;http://www.daisukemaki.com/archive/koichi/0mokuji.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Thank you Maki for hosting it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-2890756661786713299?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/2890756661786713299/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=2890756661786713299' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/2890756661786713299'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/2890756661786713299'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2010/11/re-opened-hohehohe2s-openmaya-tutorial.html' title='Re-opened hohehohe2&apos;s OpenMaya tutorial'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-6952488885318605015</id><published>2010-09-25T23:31:00.001-07:00</published><updated>2010-09-25T23:41:44.853-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Maya'/><title type='text'>hohehohe2's OpenMaya tutorial is closing</title><content type='html'>&lt;a href="http://hohehohe2.hp.infoseek.co.jp/openMaya-eng/0mokuji.html"&gt;My OpenMaya(Maya API) tutorial site&lt;/a&gt; and &lt;a href="http://hohehohe2.hp.infoseek.co.jp/welcome/"&gt;its main page&lt;/a&gt; are closing due to the end of the free hosting service they are using.&lt;br /&gt;&lt;br /&gt;In the meantime I may reopen it somewhere else but at the moment there's no plan for it since the contents are getting old, I've moved my main blog here, and I have less interest in maintaining these kind of informations.&lt;br /&gt;&lt;br /&gt;It'll be closed at the end of October. I think the role of the site has finished but if you happen to need it and cannot read it anymore, please email me.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-6952488885318605015?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/6952488885318605015/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=6952488885318605015' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/6952488885318605015'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/6952488885318605015'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2010/09/hohehohe2s-openmaya-tutorial-is-closing.html' title='hohehohe2&apos;s OpenMaya tutorial is closing'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-190526670361420281</id><published>2010-09-24T07:55:00.000-07:00</published><updated>2010-09-24T08:12:02.884-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CG'/><title type='text'>Thoughts</title><content type='html'>I've seen quite a lot of programmers in the CG field and haven't seen one who can analyze the problem, divide the task, and put it in the schedule. Things are changing but everybody still seems to be in the 20th century. CG is quite different from other fields, more frequent feature requests and less time for them, but that doesn't mean we can make a program with no plan. I don't know if it is a tendency only in Japan but anyway, we should be ashamed of it!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-190526670361420281?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/190526670361420281/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=190526670361420281' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/190526670361420281'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/190526670361420281'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2010/09/thoughts.html' title='Thoughts'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-5678294238299572968</id><published>2010-09-24T07:11:00.000-07:00</published><updated>2010-09-24T07:52:07.874-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>Qt Designer bad knowhows (*)</title><content type='html'>"bad knowhow" is a Japangrish meaning it is something you have to use knowing it is not a nice way.&lt;br /&gt;&lt;br /&gt;Qt designer is a good tool but there are several things you need to know until you get familiar with it.&lt;br /&gt;&lt;br /&gt;1) Making widgets expand within a window&lt;br /&gt;It is the first thing most people takes a few hours googling to get the answer. The answer is tricky.&lt;br /&gt;&lt;br /&gt;- Drag and drop arbitrary widget (button or spacer is enough)&lt;br /&gt;- Right click the background of the window (not the widget you have dropped)&lt;br /&gt;- Select Layout - Layout Horizontally (or Layout Vertically) in the pop-up menu&lt;br /&gt;&lt;br /&gt;You cannot select Layout- Layout Horizontally (Vertically) until you create a widget on the window.&lt;br /&gt;&lt;br /&gt;2) Moving a layout from its parent to another.&lt;br /&gt;When the UI gets complicated, it is often difficult to move the right layout to the right place.&lt;br /&gt;&lt;br /&gt;To move the right layout:&lt;br /&gt;- Select the layout in the Object Inspector.&lt;br /&gt;- Click the layout&lt;br /&gt;Qt Designer will pick the selected layout.&lt;br /&gt;&lt;br /&gt;To the right place:&lt;br /&gt;- When clicking the layout, click near the top left corner of the layout&lt;br /&gt;- Drag and drop it to the new parent in the Object Inspector&lt;br /&gt;Unless you click new the top left corner, you'll be puzzled when dragging it to the Object Inspector&lt;br /&gt;&lt;br /&gt;3) Try to copy and paste a widget and get error "Cannot paste widgets. Designer could not find a container without a layout to paste into."&lt;br /&gt;&lt;br /&gt;My solution is to create a new dummy window (with ctrl-N) and copy&amp;paste to it. then drag and drop it to wherever you wish to. There may be other ways.&lt;br /&gt;&lt;br /&gt;I will add a screen shot on request.&lt;br /&gt;When using the qt-designer generated file (*.ui), never modify automatically generated file. For example, I use Python and I convert *.ui to *.py with pyuic4 tool. I never modify the .py file by hand, which would halve the qt designer's strength. You will quite often want to update the GUI design and once you have modified the generated file, your modification to the source code would be lost. Insted, use the file from another. Same applies to C++ users to.&lt;br /&gt;&lt;br /&gt;By the way qt designer is in qt-devel yum package (e.g. qt-devel-4.6.3-8.fc13.i686). It tool a while for me to find it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-5678294238299572968?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/5678294238299572968/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=5678294238299572968' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/5678294238299572968'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/5678294238299572968'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2010/09/qt-designer-bad-knowhow.html' title='Qt Designer bad knowhows (*)'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-3240726057932704067</id><published>2010-09-04T23:23:00.001-07:00</published><updated>2011-05-25T04:10:03.535-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><category scheme='http://www.blogger.com/atom/ns#' term='other'/><title type='text'>Scons</title><content type='html'>&lt;span style="font-style: italic;"&gt;This is my log of start using SCons, you don't need to read this if you are familiar with SCons already. Most of my knowledge comes from &lt;/span&gt;&lt;a style="font-style: italic;" href="http://www.scons.org/doc/production/HTML/scons-user/index.html"&gt;SCons User Guide&lt;/a&gt;&lt;span style="font-style: italic;"&gt;, and many of examples shown here were taken from the guide.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I looked for a build tool (like make) for my project. Like everybody else in the world, I'm sick of traditional make and needed a more elegant one.&lt;a href="http://omake.metaprl.org/index.html"&gt;OMake&lt;/a&gt;'s concurrent build (-P switch) attracted me a lot but it seemed to need some time to use Omake with emacs. Scons is a build tool (like make) fully utilizes Python, and there is no need to code in OCaml (omake) (*).&lt;br /&gt;&lt;br /&gt;Once you have installed scons (if you use macport to install, you also need py25-hashlib to be installed), the first step of using Scons is to write a SConstruct file (Makefile equivalent), which is actually a Python script (so you can write a Makefile equivalent in Python).&lt;br /&gt;If you just have two files hello.cpp which uses hello.h, a simple SConstruct file is&lt;br /&gt;&lt;pre name="code" class="python"&gt;Program('hello.cpp')&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;to build, you just type&lt;br /&gt;&lt;pre name="code" class="python"&gt;scons&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Scons automatically looks at the source code hello.cpp and it is dependent on hello.h, so whenever hello.h changes, scons knows it needs to rebuild hello.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; &lt;/span&gt;&lt;a style="font-style: italic;" href="http://www.scons.org/doc/production/HTML/scons-user/index.html"&gt;SCons  User Guide&lt;/a&gt; is very well written and easy to read document but it is targeted for non-Python programmers and a little bit verbose, so I'll just write down the most important parts (for me) of the guide here. It doesn't cover throughout hte guide, I only read the first several chapters, up to 7.2.1 and I felt I can already use Scons to some extent.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-Program(['foo.cpp', 'bar.cpp']) if there are two sources. Basically if you need to specify more than files (, or directories, or anything) you use Python list.&lt;br /&gt;&lt;br /&gt;-You can write Program('program', Glob('*.c')).&lt;br /&gt;&lt;br /&gt;-SharedLibrary('foo', ['f1.c', 'f2.c']) and StaticLibrary('foo', ['f1.c', 'f2.c']) for shared and static library.&lt;br /&gt;&lt;br /&gt;-Program('prog.c', LIBS=['foo', 'bar'], LIBPATH='.')&lt;br /&gt;&lt;br /&gt;-Program('hello.c', CPPPATH = ['include', '/home/project/inc']) for -Iinclude -I/home/project/inc&lt;br /&gt;&lt;br /&gt;-Program('prog.c', LIBS = 'm', LIBPATH = ['/usr/lib', '/usr/local/lib']) for -L/usr/lib -L/usr/local/lib -lm&lt;br /&gt;&lt;br /&gt;-You can write SConstruct script like,&lt;br /&gt;&lt;pre name="code" class="python"&gt;     hello_list = Object('hello.c', CCFLAGS='-DHELLO')&lt;br /&gt;     goodbye_list = Object('goodbye.c', CCFLAGS='-DGOODBYE')&lt;br /&gt;     Program(hello_list + goodbye_list)&lt;br /&gt;&lt;/pre&gt;Object means "Object file" (i.e. *.o file). Not Python object, nor any other object.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-Explict dependency.&lt;br /&gt;&lt;pre name="code" class="python"&gt;      hello = Program('hello.c')&lt;br /&gt;      Depends(hello, 'other_file')&lt;br /&gt;&lt;/pre&gt;The following scripts are also accepted.&lt;br /&gt;&lt;pre name="code" class="python"&gt;Program('hello.c')&lt;br /&gt;Depends('hello', 'ho.cpp')&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;-Construction Environment&lt;br /&gt;&lt;pre name="code" class="python"&gt;env = Environment(CC = 'gcc', CCFLAGS = '-O2')&lt;br /&gt;env.Program('foo.c')&lt;br /&gt;&lt;/pre&gt;To make it default settings (so that you can write Program('foo.c') instead of env.Program('foo.c')),&lt;br /&gt;&lt;pre name="code" class="python"&gt;DefaultEnvironment(CC = 'gcc')&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;- SConscript(['subdirectory/SConscript']) for hierarchical build,&lt;br /&gt;&lt;br /&gt;- Program(['foo.cpp', 'bar.cpp']) makes build target foo (looks scons gets the name from the first item in the list, not where the main function exists). Default(Program(['foo.cpp', 'bar.cpp'])) to set it as the default target.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;(*) OMake official site says "There is no need to code in Perl (cons), or         Python (scons)." ;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-3240726057932704067?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/3240726057932704067/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=3240726057932704067' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/3240726057932704067'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/3240726057932704067'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2010/09/scons.html' title='Scons'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-4796860974046762105</id><published>2010-09-02T09:18:00.000-07:00</published><updated>2010-09-02T09:35:41.022-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CG'/><title type='text'>So what am I doing now (again)</title><content type='html'>Now I work for &lt;a href="http://www.ppi.co.jp/"&gt;Polygon Pictures&lt;/a&gt; as a freelancer and working for some big project. It is O.K, I wish if my work could be a little bit more challenging since it's one of the easiest works I've ever done, but working with artists is always fun.&lt;br /&gt;&lt;br /&gt;Apart from my work, I'm trying to make something interesting (interesting for CG guys), but I'm not going to tell you what it is since &lt;span style="font-style: italic; font-weight: bold;"&gt;nothing is worth mentioning until you show an image&lt;/span&gt; is an unwritten rule all over the CG industry.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-4796860974046762105?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/4796860974046762105/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=4796860974046762105' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/4796860974046762105'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/4796860974046762105'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2010/09/so-what-am-i-doing-now-again.html' title='So what am I doing now (again)'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-30518217586565306</id><published>2010-08-11T04:16:00.000-07:00</published><updated>2010-08-11T04:17:20.676-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>Any good module for saving settings file?</title><content type='html'>I'm thinking about the file format for various settings.&lt;br /&gt;Using XML is like going to a super market by jet plane. YAML is good but not in the standard module.&lt;br /&gt;So far the best choice is using JSON but json module in the standard module is not suitable for my needs since it has no __getstate__/__setstate__ equivalent.&lt;br /&gt;&lt;br /&gt;I wonder if there's a nice module that has both pickle and json features. It would&lt;br /&gt;&lt;br /&gt;- be able to serialize arbitrary object&lt;br /&gt;- have __getstate__, __setstate__ equivalent&lt;br /&gt;- be able to convert to/from standard Python objects (NOT Tag/Node/Element object ! )&lt;br /&gt;- create json formatted file&lt;br /&gt;- preferably customize the behavior on error&lt;br /&gt;- be a light weight module (not dependent on thousands of other modules)&lt;br /&gt;&lt;br /&gt;There's no need to maintain object references, dump() can raise an exception just like json.&lt;br /&gt;I can make one by myself but I don't want to reinvent the wheel. Anybody knows if it exists already?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-30518217586565306?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/30518217586565306/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=30518217586565306' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/30518217586565306'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/30518217586565306'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2010/08/any-good-module-for-saving-settings.html' title='Any good module for saving settings file?'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-2409850312292856585</id><published>2010-07-17T09:35:00.000-07:00</published><updated>2010-07-17T09:50:46.921-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='other'/><title type='text'>Mighty Optical Illusions</title><content type='html'>If you haven't seen it, take a look at this site! &lt;a href="http://www.moillusions.com/"&gt;http://www.moillusions.com/&lt;/a&gt;.&lt;br /&gt;Some of them I'm fascinated.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.moillusions.com/2006/08/stereo-dino-optical-illusion.html"&gt;Stereo Dino Optical Illusion&lt;/a&gt; (must visit)&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.moillusions.com/2010/06/this-isnt-a-painting.html"&gt;This Isn't a Painting&lt;/a&gt;  (must visit)&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.moillusions.com/2010/06/shadow-and-reflection-sculptures.html"&gt;Shadow and Reflection Sculptures&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.moillusions.com/2010/06/illusion-billboards-again.html"&gt;Illusion Billboards Again&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-2409850312292856585?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/2409850312292856585/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=2409850312292856585' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/2409850312292856585'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/2409850312292856585'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2010/07/mighty-optical-illusions.html' title='Mighty Optical Illusions'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-9009738642549405989</id><published>2010-07-04T07:23:00.000-07:00</published><updated>2010-07-04T07:47:23.302-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>Makin your Python code fast</title><content type='html'>Check out a presentatiton by Andrew Bennetts at Pycon Australia 2010.&lt;br /&gt;&lt;a href="http://pyconau.blip.tv/"&gt;http://pyconau.blip.tv/&lt;/a&gt;&lt;br /&gt;He introduced various ways of Python code profiling.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://pyconau.blip.tv/"&gt;&lt;img style="float: left; margin: 0pt 10px 10px 0pt; cursor: pointer; width: 400px; height: 283px;" src="http://1.bp.blogspot.com/_c-kJL128S60/TDCcBbt9nGI/AAAAAAAAAiQ/_vI-Y79_w6E/s400/%E5%90%8D%E7%A7%B0%E6%9C%AA%E8%A8%AD%E5%AE%9A.png" alt="" id="BLOGGER_PHOTO_ID_5490059494198975586" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Material from PyCon AU are licensed under the Creative  Commons CC-BY-NC-SA license.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;And you may also be interested in "Python Goes to the Movies" by Mark J Streatfield at Dr. D Studios, which is kind of introductory stuffs though because the conference is for Python and not for vfx.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-9009738642549405989?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/9009738642549405989/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=9009738642549405989' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/9009738642549405989'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/9009738642549405989'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2010/07/makin-your-python-code-fast.html' title='Makin your Python code fast'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_c-kJL128S60/TDCcBbt9nGI/AAAAAAAAAiQ/_vI-Y79_w6E/s72-c/%E5%90%8D%E7%A7%B0%E6%9C%AA%E8%A8%AD%E5%AE%9A.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-8727798167753690124</id><published>2010-05-28T23:23:00.000-07:00</published><updated>2010-05-28T23:25:12.769-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='offtopic'/><title type='text'>Ohhh iPad !</title><content type='html'>I didn't know we can do such thinkgs with iPad!&lt;br /&gt;&lt;object width="480" height="385"&gt;&lt;param name="movie" value="http://www.youtube.com/v/cbI0r0CIT18&amp;hl=en_US&amp;fs=1&amp;"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/cbI0r0CIT18&amp;hl=en_US&amp;fs=1&amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-8727798167753690124?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/8727798167753690124/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=8727798167753690124' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/8727798167753690124'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/8727798167753690124'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2010/05/ohhh-ipad.html' title='Ohhh iPad !'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-9219488524344751965</id><published>2010-05-21T10:16:00.000-07:00</published><updated>2010-05-21T10:20:15.106-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>Recipe 577237: Prevent star imports (Python)</title><content type='html'>&lt;a href="http://code.activestate.com/recipes/577237-prevent-star-imports/"&gt;Recipe 577237&lt;/a&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Use this code in your module to prevent people using the "from foo import *" syntax with your module.&lt;/span&gt;&lt;br /&gt;&lt;pre name="code" class="python"&gt;&lt;br /&gt;@apply&lt;br /&gt;class __all__(object):&lt;br /&gt;    def __getitem__(self, _):&lt;br /&gt;        raise ImportError("Star imports not supported")&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-9219488524344751965?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/9219488524344751965/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=9219488524344751965' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/9219488524344751965'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/9219488524344751965'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2010/05/recipe-577237-prevent-star-imports.html' title='Recipe 577237: Prevent star imports (Python)'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-8376565870930059754</id><published>2010-04-24T00:39:00.000-07:00</published><updated>2010-04-24T01:12:02.696-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>Path class</title><content type='html'>I hope one of these stuffs is in the standard library.&lt;br /&gt;&lt;pre name="code" class="python"&gt;&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; p = Path('/path/to/some/text.txt')&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; p.parent()&lt;br /&gt;Path('/path/to/some')&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; p.parent().parent()&lt;br /&gt;Path('/path/to')&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; p.parent().parent().parent()&lt;br /&gt;Path('/path')&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; p.parent().parent().parent().parent()&lt;br /&gt;Path('/')&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; p.parent().parent().parent().parent().parent()&lt;br /&gt;Path('/')&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; p.parent().child('other').child('text.txt')&lt;br /&gt;Path('/path/to/some/other/text.txt')&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; p[:-1]&lt;br /&gt;Path('/path/to/some')&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; p[1:-1]&lt;br /&gt;Path('path/to/some')&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; p[2:-1]&lt;br /&gt;Path('to/some')&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;You cannot write e.g. p[2:3] = p('aaa') since conceptually the Path class is immutable.&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="python"&gt;&lt;br /&gt;import os&lt;br /&gt;&lt;br /&gt;class Path(object):&lt;br /&gt;    def __init__(self, path):&lt;br /&gt;        if isinstance(path, Path):&lt;br /&gt;            path = path.path&lt;br /&gt;        self.path = path&lt;br /&gt;&lt;br /&gt;    def parent(self):&lt;br /&gt;        return Path(os.path.dirname(self.path))&lt;br /&gt;&lt;br /&gt;    def child(self, name):&lt;br /&gt;        if isinstance(name, Path):&lt;br /&gt;            name = name.path&lt;br /&gt;        childPath = os.path.join(self.path, name)&lt;br /&gt;        return Path(childPath)&lt;br /&gt;&lt;br /&gt;    def base(self):&lt;br /&gt;        return Path(os.path.basename(self.path))&lt;br /&gt;&lt;br /&gt;    def abspath(self):&lt;br /&gt;        return Path(os.path.abspath(self.path))&lt;br /&gt;&lt;br /&gt;    def __str__(self):&lt;br /&gt;        return self.path&lt;br /&gt;&lt;br /&gt;    def __repr__(self):&lt;br /&gt;        return self.__class__.__name__ + '(' + repr(self.path) + ')'&lt;br /&gt;&lt;br /&gt;    def __add__(self, rhs):&lt;br /&gt;        if isinstance(rhs, Path):&lt;br /&gt;            return self.child(rhs.path)&lt;br /&gt;        else:&lt;br /&gt;            return Path(self.path + rhs)&lt;br /&gt;&lt;br /&gt;    def __eq__(self, rhs):&lt;br /&gt;        if isinstance(rhs, Path):&lt;br /&gt;            rpath = rhs.path&lt;br /&gt;        elif isinstance(rhs, unicode):&lt;br /&gt;            rpath = rhs&lt;br /&gt;        else:&lt;br /&gt;            return False&lt;br /&gt;        return os.path.abspath(self.path) == os.path.abspath(rpath)&lt;br /&gt;&lt;br /&gt;    def __ne__(self, rhs):&lt;br /&gt;        return not self.__eq__(rhs)&lt;br /&gt;&lt;br /&gt;    def __getitem__(self, key):&lt;br /&gt;        this, parent = self, self.parent()&lt;br /&gt;        bases = [this.base()]&lt;br /&gt;        while this != parent:&lt;br /&gt;            bases[:0] = [parent.base()]&lt;br /&gt;            this, parent = parent, parent.parent()&lt;br /&gt;        bases[0] = this&lt;br /&gt;        bases = bases[key]&lt;br /&gt;        retPath = bases[0]&lt;br /&gt;        for base in bases[1:]:&lt;br /&gt;            retPath = retPath.child(base)&lt;br /&gt;        return retPath&lt;br /&gt;&lt;br /&gt;    @staticmethod&lt;br /&gt;    def getCurrent():&lt;br /&gt;        return Path(os.getcwd())&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;To extract the Python string a Path object has, you can pass the object to str() or unicode(). A friend of mine gave me an idea to make the class to be a subclass of str/unicode so that a Path object can be used as a Python string. But the meaning of __eq__, __ne__, and __getitem__ is quite different between str/unicode and my class.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-8376565870930059754?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/8376565870930059754/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=8376565870930059754' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/8376565870930059754'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/8376565870930059754'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2010/04/path-class.html' title='Path class'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-5380176561854535471</id><published>2010-04-14T11:05:00.000-07:00</published><updated>2010-04-14T11:07:47.334-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Maya'/><title type='text'>MRV　multi-platform python development environment</title><content type='html'>&lt;a href="http://packages.python.org/MRV/index.html"&gt;MRV v1.0.0-preview  documentation&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Looks like a high abstract level Maya API Python wrapper (and more?). Anybody tested it?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-5380176561854535471?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/5380176561854535471/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=5380176561854535471' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/5380176561854535471'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/5380176561854535471'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2010/04/mrvmulti-platform-python-development.html' title='MRV　multi-platform python development environment'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-6172069881254717077</id><published>2010-04-04T08:05:00.000-07:00</published><updated>2010-04-04T08:17:30.390-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='other'/><title type='text'>Detexify2 - LaTeX symbol classifier</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://detexify.kirelabs.org/classify.html"&gt;&lt;img style="float: left; margin: 0pt 10px 10px 0pt; cursor: pointer; width: 400px; height: 360px;" src="http://2.bp.blogspot.com/_c-kJL128S60/S7ir89T07II/AAAAAAAAAgw/CPs5DzeB1aA/s400/%E5%90%8D%E7%A7%B0%E6%9C%AA%E8%A8%AD%E5%AE%9A.png" alt="" id="BLOGGER_PHOTO_ID_5456300012297579650" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;a href="http://detexify.kirelabs.org/classify.html"&gt;Detexify2 - LaTeX symbol classifier&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;What is this?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Anyone who works with LaTeX knows how time-consuming it can be to find a symbol in symbols-a4.&lt;/span&gt;&lt;span style="font-style: italic;"&gt;pdf that you just can't memorize. Detexify is an attempt to simplify this search.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;How does it work?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Just draw the symbol you are looking for into the square area above and look what happens! &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Wrong usage.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_c-kJL128S60/S7itS-fU7II/AAAAAAAAAg4/57Buw3DxvE0/s1600/%E5%90%8D%E7%A7%B0%E6%9C%AA%E8%A8%AD%E5%AE%9A.png"&gt;&lt;img style="float: left; margin: 0pt 10px 10px 0pt; cursor: pointer; width: 400px; height: 271px;" src="http://2.bp.blogspot.com/_c-kJL128S60/S7itS-fU7II/AAAAAAAAAg4/57Buw3DxvE0/s400/%E5%90%8D%E7%A7%B0%E6%9C%AA%E8%A8%AD%E5%AE%9A.png" alt="" id="BLOGGER_PHOTO_ID_5456301490082999426" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-6172069881254717077?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/6172069881254717077/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=6172069881254717077' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/6172069881254717077'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/6172069881254717077'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2010/04/detexify2-latex-symbol-classifier.html' title='Detexify2 - LaTeX symbol classifier'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_c-kJL128S60/S7ir89T07II/AAAAAAAAAgw/CPs5DzeB1aA/s72-c/%E5%90%8D%E7%A7%B0%E6%9C%AA%E8%A8%AD%E5%AE%9A.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-6502345814332133254</id><published>2010-03-27T03:05:00.000-07:00</published><updated>2010-04-04T06:16:38.847-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='offtopic'/><title type='text'>google translate</title><content type='html'>Japanese:*****&lt;br /&gt;google translate&lt;br /&gt;-&gt; English:I do not have to surgery. No way, thank you.&lt;br /&gt;-&gt; Japanese:*****&lt;br /&gt;-&gt; English:I do not need the surgery. So no thank you.&lt;br /&gt;-&gt; Japanese:*****&lt;br /&gt;-&gt; English:I do not need the surgery. Well, thank you.&lt;br /&gt;-&gt; Japanese:*****&lt;br /&gt;-&gt; English:I do not need the surgery. Well, thank you.&lt;br /&gt;&lt;br /&gt;It's interesting the final translation of the second sentence is closer to the right meaning, though the first translation is completely opposite. Google translate needs convergence ;)&lt;br /&gt;The meaning of the first sentence remained opposite. It means "You need to have an operation".&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-6502345814332133254?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/6502345814332133254/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=6502345814332133254' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/6502345814332133254'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/6502345814332133254'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2010/03/google-translate.html' title='google translate'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-9162327263933922163</id><published>2010-03-21T10:24:00.001-07:00</published><updated>2010-03-21T10:33:09.401-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CG'/><title type='text'>So what am I doing now?</title><content type='html'>I haven't updated "on topic" issues for quite a long time. Now I'm working as a freelancer at a company which is making a GI renderer and mainly working with 3ds Max (especially with material part of its SDK, that explains why I am NOT a big fan of Max). At home I'm reading siggraph papers, papers, papers. Siggraph papers are like treasure boxes but they are often hard to open, the key of a box is often inside another, and it needs yet another to open ...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-9162327263933922163?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/9162327263933922163/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=9162327263933922163' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/9162327263933922163'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/9162327263933922163'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2010/03/so-whatt-am-i-doing-now.html' title='So what am I doing now?'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-5432676592902830597</id><published>2010-03-20T11:11:00.000-07:00</published><updated>2010-04-22T16:01:16.334-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='offtopic'/><title type='text'>particle breakout</title><content type='html'>&lt;a href="http://wonderfl.net/code/d0dcc2f2d0f8012e42785ef71dab7da2abd5453d/fullscreen"&gt;Particle breakout&lt;/a&gt;&lt;br /&gt;Nice idea and beautiful.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://wonderfl.net/code/d0dcc2f2d0f8012e42785ef71dab7da2abd5453d/fullscreen"&gt;&lt;img style="float: left; margin: 0pt 10px 10px 0pt; cursor: pointer; width: 400px; height: 400px;" src="http://4.bp.blogspot.com/_c-kJL128S60/S6UQfogaAGI/AAAAAAAAAgc/Y89vfWM09Q8/s400/pk.png" alt="" id="BLOGGER_PHOTO_ID_5450781059637182562" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-5432676592902830597?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/5432676592902830597/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=5432676592902830597' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/5432676592902830597'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/5432676592902830597'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2010/03/particle-breakout.html' title='particle breakout'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_c-kJL128S60/S6UQfogaAGI/AAAAAAAAAgc/Y89vfWM09Q8/s72-c/pk.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-3473528629816814164</id><published>2010-02-14T00:28:00.000-08:00</published><updated>2010-02-14T07:59:02.753-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='other'/><title type='text'>Sikuli on my visual programming app</title><content type='html'>I made a Sikuli node on my application for a test of conbining two visual programming software. When the user starts his application by clicking the small red circle, the downstream Sikuli node(s) gets activated, it starts a Sikuli ide ("hello popup" and "open my blog") and another Sikuli command line application to control the Sikuli ide, press play button and terminate the Sikuli ide. Sikuli uses HTML so I could easily show a Sikuli script on my Sikuli node. When opening my blog, I ran it on debug mode. You'll see what node is currently evaluated.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;object height="344" width="425"&gt;&lt;param name="movie" value="http://www.youtube.com/v/gFEuQCQ92Ag&amp;amp;hl=en_US&amp;amp;fs=1&amp;amp;"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;embed src="http://www.youtube.com/v/gFEuQCQ92Ag&amp;amp;hl=en_US&amp;amp;fs=1&amp;amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="344" width="425"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Feb, 15 added:&lt;br /&gt;I just think it'll be conceptually fun if it could handle objects in a screen movie capture. The user plays the movie forward/backward and defines objects with a mouse, and the rest is the same as Sikuli. It'll be fun if it can generate a script from the movie capture automatically after the user defines objects in the movie.&lt;br /&gt;&lt;br /&gt;Practically Sikuli might need a robust way to identify objects in the screen. I wanted to do File - close but many applications has the same visual interface. Currently region and inside() can specify only screen coordinates but people will want to make his script work after a window has been moved (I think they may change the behavior to get the region(s) dinamically from the screen image). Other methods like similar(), near(), etc. could be a help, or it can have some method to restrict click() actions if the region belongs to some application. Since Sikuli can already start and end an application with its name it will probably be possible to implement it.&lt;br /&gt;&lt;br /&gt;And I think it'll be useful to be able to click a certain point in an image. It'll be good to click an "empty space" (think of clicking F4 cell in an excel sheet). And "do something until image appears" loop (think of dragging a scroll bar in a panel to show a scrolled out button).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-3473528629816814164?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/3473528629816814164/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=3473528629816814164' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/3473528629816814164'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/3473528629816814164'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2010/02/sikuli-on-my-visual-programming-app.html' title='Sikuli on my visual programming app'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-4436461004093317116</id><published>2010-02-13T03:48:00.000-08:00</published><updated>2010-02-14T00:42:23.985-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='other'/><title type='text'>SIKULI is fun.</title><content type='html'>This is my first &lt;a href="http://groups.csail.mit.edu/uid/sikuli/"&gt;SIKULI&lt;/a&gt; script which makes a sphere, duplicate it, and move it.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_c-kJL128S60/S3aR_y6VZ1I/AAAAAAAAAgU/x4IGxC8FjdI/s1600-h/Picture+3.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 263px; height: 163px;" src="http://1.bp.blogspot.com/_c-kJL128S60/S3aR_y6VZ1I/AAAAAAAAAgU/x4IGxC8FjdI/s400/Picture+3.png" alt="" id="BLOGGER_PHOTO_ID_5437694125280683858" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I like its "what you see is how it works" style scripting :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-4436461004093317116?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/4436461004093317116/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=4436461004093317116' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/4436461004093317116'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/4436461004093317116'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2010/02/sikuli.html' title='SIKULI is fun.'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_c-kJL128S60/S3aR_y6VZ1I/AAAAAAAAAgU/x4IGxC8FjdI/s72-c/Picture+3.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-6897237813981296050</id><published>2010-01-05T06:19:00.000-08:00</published><updated>2010-01-05T07:35:07.967-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CG'/><title type='text'>The Third &amp; The Seventh</title><content type='html'>Amazing!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;A FULL-CG animated piece that tries to illustrate architecture art across a photographic point of view where main subjects&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; are already-built spaces. Sometimes in an abstract way. Sometimes surreal.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;.Fullscreen it, please. (comment by the Author)&lt;br /&gt;&lt;object height="225" width="400"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=7809605&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&amp;amp;fullscreen=1"&gt;&lt;embed src="http://vimeo.com/moogaloop.swf?clip_id=7809605&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&amp;amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" height="225" width="400"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;p&gt;&lt;a href="http://vimeo.com/7809605"&gt;The Third &amp;amp; The Seventh&lt;/a&gt; from &lt;a href="http://vimeo.com/user1337612"&gt;Alex Roman&lt;/a&gt; on &lt;a href="http://vimeo.com/"&gt;Vimeo&lt;/a&gt;.&lt;/p&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-6897237813981296050?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/6897237813981296050/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=6897237813981296050' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/6897237813981296050'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/6897237813981296050'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2010/01/third-seventh.html' title='The Third &amp; The Seventh'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-6522367832151936148</id><published>2010-01-04T15:38:00.000-08:00</published><updated>2010-01-04T15:51:01.088-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tec'/><title type='text'>Early preview(2)</title><content type='html'>My new visual programming environment.&lt;br /&gt;&lt;br /&gt;- Macro (under developing)&lt;br /&gt;- Node definition in Python (callback based)&lt;br /&gt;- Code editor&lt;br /&gt;- Node template&lt;br /&gt;- Visual debugger (It's fun to see how node networks are working. I'll soon add a video on this entry)&lt;br /&gt;&lt;br /&gt;See some brief descriptions here about the demo.&lt;br /&gt;&lt;a href="http://koichitamura.blogspot.com/2009/12/early-preview.html"&gt;http://koichitamura.blogspot.com/2009/12/early-preview.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;(Please wait if an error occurs and couldn't see the movie until youtube finishes processing)&lt;br /&gt;&lt;object height="344" width="425"&gt;&lt;param name="movie" value="http://www.youtube.com/v/ljQPmjBgglw&amp;amp;hl=en&amp;amp;fs=1"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;embed src="http://www.youtube.com/v/ljQPmjBgglw&amp;amp;hl=en&amp;amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="344" width="425"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-6522367832151936148?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/6522367832151936148/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=6522367832151936148' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/6522367832151936148'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/6522367832151936148'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2010/01/early-preview2.html' title='Early preview(2)'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-3290026608184825203</id><published>2009-12-25T02:18:00.000-08:00</published><updated>2009-12-25T06:06:16.882-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='other'/><title type='text'>Merry christmas</title><content type='html'>In Japan a Christmas day is not a holiday but the New Year's day  takes the role, like people gathering at their grandma's house and having a big dinner. Today is my last working day this year. I'm going to go to my parents' house and get scratches on my wrists (*).&lt;br /&gt;&lt;br /&gt;I wish you a Merry Christmas.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;(*)This one scratches.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_c-kJL128S60/SzSUG3EpJtI/AAAAAAAAAgI/yG3im-8uKw4/s1600-h/1258078004_99.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 150px; height: 73px;" src="http://3.bp.blogspot.com/_c-kJL128S60/SzSUG3EpJtI/AAAAAAAAAgI/yG3im-8uKw4/s400/1258078004_99.jpg" alt="" id="BLOGGER_PHOTO_ID_5419119097217099474" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-3290026608184825203?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/3290026608184825203/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=3290026608184825203' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/3290026608184825203'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/3290026608184825203'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/12/merry-christmas.html' title='Merry christmas'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_c-kJL128S60/SzSUG3EpJtI/AAAAAAAAAgI/yG3im-8uKw4/s72-c/1258078004_99.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-776367732952182254</id><published>2009-12-15T21:08:00.000-08:00</published><updated>2009-12-15T21:33:09.325-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CG'/><category scheme='http://www.blogger.com/atom/ns#' term='other'/><title type='text'>SIGGRAPH ASIA</title><content type='html'>The company I'm working for as a freelance is going to exhibit their new GI &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;renderer&lt;/span&gt; (at &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;fixstars&lt;/span&gt;' booth, E22).&lt;br /&gt;&lt;br /&gt;&lt;span style="text-decoration: underline;"&gt;&lt;a href="http://lighttransport.com/"&gt;Company web site&lt;/a&gt;&lt;/span&gt; (Japanese)&lt;br /&gt;&lt;a href="http://lucille.atso-net.jp/blog/"&gt;CEO/&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;CRO&lt;/span&gt;(chief rendering officer) blog&lt;/a&gt; (partially English)&lt;br /&gt;&lt;a href="http://blog.s21g.com/genki"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;CTO&lt;/span&gt; blog&lt;/a&gt; (Japanese)&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.fixstars.com/en/index.html"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;fixstars&lt;/span&gt;&lt;/a&gt; is a company they are working with, &lt;a href="http://www.fixstars.com/en/company/press/20091216.html"&gt;which beta released their &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;OpenCL&lt;/span&gt; compiler today&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;And one of my ex-workmate is going to &lt;a href="http://www.siggraph.org/asia2009/for_attendees/courses_attendees/details/?type=course&amp;amp;id=6"&gt;make a presentation&lt;/a&gt; (hey &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;Mihai&lt;/span&gt;!) about the crowd simulator project we were working on.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-776367732952182254?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/776367732952182254/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=776367732952182254' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/776367732952182254'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/776367732952182254'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/12/siggraph-asia.html' title='SIGGRAPH ASIA'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-6993026411388129059</id><published>2009-12-04T04:52:00.000-08:00</published><updated>2009-12-04T06:01:16.878-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='other'/><title type='text'>Early Preview</title><content type='html'>What I've been making. Written in pure Python (and wx). Currently it's working only on Linux. I'm also making windows version but it's still quite buggy.&lt;br /&gt;&lt;br /&gt;Finding missing files in a sequence.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_c-kJL128S60/SxkHKq2IntI/AAAAAAAAAf4/wbmLvmHm9fI/s1600-h/Screenshot.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 201px;" src="http://2.bp.blogspot.com/_c-kJL128S60/SxkHKq2IntI/AAAAAAAAAf4/wbmLvmHm9fI/s400/Screenshot.png" alt="" id="BLOGGER_PHOTO_ID_5411364307143794386" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Fancy template&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_c-kJL128S60/SxkHBGaN0DI/AAAAAAAAAfg/rZ9hxAvFmPA/s1600-h/Screenshot-3.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 312px;" src="http://1.bp.blogspot.com/_c-kJL128S60/SxkHBGaN0DI/AAAAAAAAAfg/rZ9hxAvFmPA/s400/Screenshot-3.png" alt="" id="BLOGGER_PHOTO_ID_5411364142744195122" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Image node&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_c-kJL128S60/SxkG9DMpfGI/AAAAAAAAAfY/eutbn3KiYHk/s1600-h/Screenshot-4.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 128px;" src="http://1.bp.blogspot.com/_c-kJL128S60/SxkG9DMpfGI/AAAAAAAAAfY/eutbn3KiYHk/s400/Screenshot-4.png" alt="" id="BLOGGER_PHOTO_ID_5411364073162505314" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;List union/intersection node&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_c-kJL128S60/SxkG5sSU-RI/AAAAAAAAAfQ/3ykqhrVgwo4/s1600-h/Screenshot-5.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 127px;" src="http://2.bp.blogspot.com/_c-kJL128S60/SxkG5sSU-RI/AAAAAAAAAfQ/3ykqhrVgwo4/s400/Screenshot-5.png" alt="" id="BLOGGER_PHOTO_ID_5411364015472703762" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Macro example&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_c-kJL128S60/SxkIpflGAAI/AAAAAAAAAgA/ji-19P49W8I/s1600-h/Screenshot.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 316px;" src="http://3.bp.blogspot.com/_c-kJL128S60/SxkIpflGAAI/AAAAAAAAAgA/ji-19P49W8I/s400/Screenshot.png" alt="" id="BLOGGER_PHOTO_ID_5411365936207101954" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;union/intersection node code&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_c-kJL128S60/SxkG2FnHVwI/AAAAAAAAAfI/GOxVlYatrsA/s1600-h/Screenshot-6.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 312px;" src="http://3.bp.blogspot.com/_c-kJL128S60/SxkG2FnHVwI/AAAAAAAAAfI/GOxVlYatrsA/s400/Screenshot-6.png" alt="" id="BLOGGER_PHOTO_ID_5411363953551300354" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Opens every files in a directory, replaces every occurrence of string ".jpg" to ".png", save it to the same file.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_c-kJL128S60/SxkHEMRwuTI/AAAAAAAAAfo/MAeeVwHksDU/s1600-h/Screenshot-2.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 123px;" src="http://4.bp.blogspot.com/_c-kJL128S60/SxkHEMRwuTI/AAAAAAAAAfo/MAeeVwHksDU/s400/Screenshot-2.png" alt="" id="BLOGGER_PHOTO_ID_5411364195858954546" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;System command example.&lt;br /&gt;directory node outputs a list of containing files,&lt;br /&gt;getElement takes list and outputs the elements one by one,&lt;br /&gt;systemCommand executes it, outputs the result&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_c-kJL128S60/SxkHHjhXJQI/AAAAAAAAAfw/aG3p--HPO5Y/s1600-h/Screenshot-1.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 209px;" src="http://1.bp.blogspot.com/_c-kJL128S60/SxkHHjhXJQI/AAAAAAAAAfw/aG3p--HPO5Y/s400/Screenshot-1.png" alt="" id="BLOGGER_PHOTO_ID_5411364253638010114" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://hohehohe2.sakura.ne.jp/20091127H.mpg"&gt;http://hohehohe2.sakura.ne.jp/20091127H.mpg&lt;/a&gt;(high quality)&lt;br /&gt;&lt;a href="http://hohehohe2.sakura.ne.jp/20091127L.mpg"&gt;http://hohehohe2.sakura.ne.jp/20091127L.mpg&lt;/a&gt;(low quality)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-6993026411388129059?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/6993026411388129059/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=6993026411388129059' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/6993026411388129059'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/6993026411388129059'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/12/early-preview.html' title='Early Preview'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_c-kJL128S60/SxkHKq2IntI/AAAAAAAAAf4/wbmLvmHm9fI/s72-c/Screenshot.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-4262056722520121732</id><published>2009-11-28T09:05:00.000-08:00</published><updated>2009-11-28T09:10:07.670-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='other'/><title type='text'>Hey, I'm not dead</title><content type='html'>I'm a little bit busy these days and cannot update this blog.&lt;br /&gt;Currently I'm making something interesting, (not a CG stuff,&lt;br /&gt;but general thing).&lt;br /&gt;I'll show it here when time comes.&lt;a id="publishButton" class="cssButton" href="javascript:void(0)" target="" onclick="if (this.className.indexOf(&amp;quot;ubtn-disabled&amp;quot;) == -1) {var e = document['stuffform'].publish;(e.length) ? e[0].click() : e.click(); if (window.event) window.event.cancelBubble = true; return false;}"&gt;&lt;/a&gt;&lt;div class="cssButtonOuter"&gt;&lt;div class="cssButtonMiddle"&gt;&lt;div class="cssButtonInner"&gt;&lt;a href="file:///home/kotamura/index.html"&gt;&lt;br /&gt;&lt;/a&gt; &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-4262056722520121732?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/4262056722520121732/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=4262056722520121732' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/4262056722520121732'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/4262056722520121732'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/11/hey-im-not-dead.html' title='Hey, I&apos;m not dead'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-4491001480508297933</id><published>2009-11-02T15:45:00.000-08:00</published><updated>2009-11-02T15:54:32.470-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='offtopic'/><title type='text'>Pencil Carving</title><content type='html'>Wow.&lt;a href="http://www.infofreako.com/jad/enpitsu-e.html"&gt;&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.infofreako.com/jad/enpitsu-e.html"&gt;Pencil Carving&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;My favorite is&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.infofreako.com/jad/pencil/3nejire-e.html"&gt;Twisted chain&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.infofreako.com/jad/pencil/7nisou-e.html"&gt;Twin Double-spirals&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.infofreako.com/jad/pencil/8chained-e.html"&gt;Chained Pencil&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.infofreako.com/jad/pencil/13tripod-e.html"&gt;Tripod&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.infofreako.com/jad/pencil/15bjoint-e.html"&gt;Ball-joint&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.infofreako.com/jad/setsuei.html"&gt;Snow swimming by the same artist group, (ouch)&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Top page(Japanese)&lt;br /&gt;&lt;a href="http://www.infofreako.com/jad/index.html"&gt;http://www.infofreako.com/jad/index.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-4491001480508297933?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/4491001480508297933/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=4491001480508297933' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/4491001480508297933'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/4491001480508297933'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/11/pencil-carving.html' title='Pencil Carving'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-8597825307720463522</id><published>2009-11-01T01:38:00.000-07:00</published><updated>2009-11-01T05:11:13.636-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='other'/><title type='text'>Real World Haskell</title><content type='html'>Several month ago I wanted to learn a functional programming and chose Emacs Lisp as a language (see the results &lt;a href="http://koichitamura.blogspot.com/2009/06/pydoc-look-up-command-emacs.html"&gt;A&lt;/a&gt; and &lt;a href="http://koichitamura.blogspot.com/2009/06/emacs-to-maya-for-python-scripts.html"&gt;B&lt;/a&gt;), but ELisp was not a good language for me to learn it since I can write any script procedurally. When I said I like languages which are simple and elegant and easy to read,  a guy working with me recommended OCaml  but it's not good to learn a functional programming with a language that supports procedural way of programming for a lazy man like me. So I chose Haskell. It is used at my workplace so learning it is also practical. I looked at several haskell tuts on the web and found &lt;a href="http://book.realworldhaskell.org/read/"&gt;Real World Haskell&lt;/a&gt; to be the easiest to read. So far I'm enjoying it but I don't know if I can finish it since priority of learning a functional programming is still not high.&lt;br /&gt;Note: Real World Haskell seems to expect the readers should have a basic knoledge of Python and C.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://book.realworldhaskell.org/read/"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 300px;" src="http://3.bp.blogspot.com/_c-kJL128S60/Su1JD2VcpbI/AAAAAAAAAew/9SGYkzJPyKk/s400/6010547_200x300.jpg" alt="" id="BLOGGER_PHOTO_ID_5399051858761000370" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-8597825307720463522?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/8597825307720463522/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=8597825307720463522' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/8597825307720463522'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/8597825307720463522'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/11/real-world-haskell.html' title='Real World Haskell'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_c-kJL128S60/Su1JD2VcpbI/AAAAAAAAAew/9SGYkzJPyKk/s72-c/6010547_200x300.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-6774191116865753105</id><published>2009-10-29T14:29:00.000-07:00</published><updated>2009-10-29T14:51:23.833-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><category scheme='http://www.blogger.com/atom/ns#' term='other'/><title type='text'>Cross platform editor written in Python</title><content type='html'>&lt;a href="http://editra.org/"&gt;http://editra.org/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It's written in Python, It seems to have all the features of &lt;a href="http://www.yellowbrain.com/stc/index.html"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;wx&lt;/span&gt;.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;STC&lt;/span&gt;&lt;/a&gt;, multi-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;lingualized&lt;/span&gt;, it has launchers, and it comes with so many lexers 68k assembly, Apache &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;conf&lt;/span&gt;, Haskell, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;LaTex&lt;/span&gt;, Lisp, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;Lua&lt;/span&gt;, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;Matlab&lt;/span&gt;, R, Objective-C, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;VHDL&lt;/span&gt;, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;YAML&lt;/span&gt;, ... &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;ofcourse&lt;/span&gt; Python.&lt;br /&gt;&lt;br /&gt;It's still version 0.5 but looks promising.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_c-kJL128S60/SuoNRe0t8EI/AAAAAAAAAeQ/NpdMaK4_ReY/s1600-h/%E7%84%A1%E9%A1%8C2.JPG"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 355px;" src="http://3.bp.blogspot.com/_c-kJL128S60/SuoNRe0t8EI/AAAAAAAAAeQ/NpdMaK4_ReY/s400/%E7%84%A1%E9%A1%8C2.JPG" alt="" id="BLOGGER_PHOTO_ID_5398141697340076098" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_c-kJL128S60/SuoOA2oQgeI/AAAAAAAAAeo/Z7BN0G1YhQ0/s1600-h/%E7%84%A1%E9%A1%8C3.JPG"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 323px;" src="http://4.bp.blogspot.com/_c-kJL128S60/SuoOA2oQgeI/AAAAAAAAAeo/Z7BN0G1YhQ0/s400/%E7%84%A1%E9%A1%8C3.JPG" alt="" id="BLOGGER_PHOTO_ID_5398142511184118242" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_c-kJL128S60/SuoNUhzoZII/AAAAAAAAAeY/mpK1xTcu99s/s1600-h/%E7%84%A1%E9%A1%8C.JPG"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 63px; height: 400px;" src="http://3.bp.blogspot.com/_c-kJL128S60/SuoNUhzoZII/AAAAAAAAAeY/mpK1xTcu99s/s400/%E7%84%A1%E9%A1%8C.JPG" alt="" id="BLOGGER_PHOTO_ID_5398141749680432258" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-6774191116865753105?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/6774191116865753105/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=6774191116865753105' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/6774191116865753105'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/6774191116865753105'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/10/cross-platform-editor-written-in-python.html' title='Cross platform editor written in Python'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_c-kJL128S60/SuoNRe0t8EI/AAAAAAAAAeQ/NpdMaK4_ReY/s72-c/%E7%84%A1%E9%A1%8C2.JPG' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-561551203694530792</id><published>2009-10-23T17:32:00.000-07:00</published><updated>2009-10-23T17:51:30.505-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>PyQt is nice</title><content type='html'>I started using PyQt. It's so nice. Unlike Qt, you don't have to worry about Qt specific stuff, qmake, .pro, moc, etc. I started off by converting several examples that come with Qt. I realized I could convert a Qt code to a PyQt script half automatically. I've converted some of WebKit examples and there was almost no difficulty, though it took a little bit of time to be able to call a slot in PyQt script from JavaScript, until I read &lt;a href="http://www.developpez.net/forums/d779929/autres-langages/python-zope/gui/pyqt/comportement-bizarre-webkit/"&gt;this&lt;/a&gt; (french!) and found @QtCore.pyqtSlot works.&lt;br /&gt;&lt;br /&gt;Ah, and Qt Designer is very nice :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-561551203694530792?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/561551203694530792/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=561551203694530792' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/561551203694530792'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/561551203694530792'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/10/pyqt-is-nice.html' title='PyQt is nice'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-7845161095182326236</id><published>2009-10-19T20:54:00.000-07:00</published><updated>2009-10-19T20:57:49.578-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>Unladden Swallow</title><content type='html'>&lt;a href="http://code.google.com/p/unladen-swallow/wiki/ProjectPlan"&gt;http://code.google.com/p/unladen-swallow/wiki/ProjectPlan&lt;/a&gt;&lt;br /&gt;(&lt;a href="http://articles.shibu.jp/category/765998-1.html"&gt;Japanese translation here&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://llvm.org/devmtg/2009-10/Winter_UnladenSwallowLLVM-400kbps.mov"&gt;http://llvm.org/devmtg/2009-10/Winter_UnladenSwallowLLVM-400kbps.mov&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-7845161095182326236?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/7845161095182326236/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=7845161095182326236' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/7845161095182326236'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/7845161095182326236'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/10/unladden-swallow.html' title='Unladden Swallow'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-8957497606188185624</id><published>2009-10-15T06:51:00.000-07:00</published><updated>2009-10-15T06:54:38.762-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='offtopic'/><title type='text'>Water curtain</title><content type='html'>&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/0HeUixe_Lpg&amp;amp;hl=en&amp;amp;fs=1&amp;amp;"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/0HeUixe_Lpg&amp;amp;hl=en&amp;amp;fs=1&amp;amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;Qt Designer is so nice by the way.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-8957497606188185624?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/8957497606188185624/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=8957497606188185624' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/8957497606188185624'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/8957497606188185624'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/10/water-curtain.html' title='Water curtain'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-8675825669062260205</id><published>2009-10-07T07:19:00.000-07:00</published><updated>2009-10-07T07:35:50.700-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='offtopic'/><title type='text'>Big typhoon is coming</title><content type='html'>&lt;a href="http://weathernews.jp/radar/index.html"&gt;http://weathernews.jp/radar/index.html&lt;/a&gt; (Weather news)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-8675825669062260205?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/8675825669062260205/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=8675825669062260205' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/8675825669062260205'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/8675825669062260205'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/10/big-typhoon-is-coming.html' title='Big typhoon is coming'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-6314220239004621431</id><published>2009-09-24T07:53:00.000-07:00</published><updated>2009-09-24T07:59:46.015-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tec'/><title type='text'>What every programmer should know about memory</title><content type='html'>I started reading &lt;a href="http://lwn.net/Articles/250967/"&gt;What every programmer should know about memory&lt;/a&gt;.&lt;br /&gt;It's much more advanced than "L2 cache is 10 times faster than memory access" stuff.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-6314220239004621431?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/6314220239004621431/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=6314220239004621431' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/6314220239004621431'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/6314220239004621431'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/09/what-every-programmer-should-know-about.html' title='What every programmer should know about memory'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-1302572851951466630</id><published>2009-09-21T06:31:00.000-07:00</published><updated>2009-09-21T06:32:37.306-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='offtopic'/><title type='text'>Blackbud</title><content type='html'>It's surprising they are not yet famous in Japan. GOOD.&lt;br /&gt;&lt;a href="http://vids.myspace.com/index.cfm?fuseaction=vids.individual&amp;amp;videoid=56907752"&gt;Blackbud - You Can Run&lt;/a&gt;&lt;br/&gt;&lt;object width="425px" height="360px"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="wmode" value="transparent"&gt;&lt;param name="movie" value="http://mediaservices.myspace.com/services/media/embed.aspx/m=56907752,t=1,mt=video"&gt;&lt;embed src="http://mediaservices.myspace.com/services/media/embed.aspx/m=56907752,t=1,mt=video" width="425" height="360" allowfullscreen="true" type="application/x-shockwave-flash" wmode="transparent"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-1302572851951466630?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/1302572851951466630/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=1302572851951466630' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/1302572851951466630'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/1302572851951466630'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/09/blackbud.html' title='Blackbud'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-874521714265039427</id><published>2009-09-13T09:17:00.000-07:00</published><updated>2009-09-13T09:22:14.434-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='offtopic'/><title type='text'>Still alive</title><content type='html'>I'm still alive and this blog is still alive.&lt;br /&gt;Just have nothing to write for now.&lt;br /&gt;I'll find one soon. Meanwhile, have fun with &lt;a href="http://images.google.co.jp/images?hl=ja&amp;amp;lr=&amp;amp;safe=off&amp;amp;um=1&amp;amp;sa=1&amp;amp;q=%E3%81%8A%E5%8F%B0%E5%A0%B4+%E3%82%AC%E3%83%B3%E3%83%80%E3%83%A0"&gt;1:1 scale gundam&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-874521714265039427?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/874521714265039427/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=874521714265039427' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/874521714265039427'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/874521714265039427'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/09/still-alive.html' title='Still alive'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-1961319830823867830</id><published>2009-08-28T22:36:00.000-07:00</published><updated>2009-08-28T22:39:14.992-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tec'/><title type='text'>How many outputs in a node, one or more?</title><content type='html'>That matters.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-1961319830823867830?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/1961319830823867830/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=1961319830823867830' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/1961319830823867830'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/1961319830823867830'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/08/how-many-outputs-in-node.html' title='How many outputs in a node, one or more?'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-7761207705774598605</id><published>2009-08-18T23:59:00.000-07:00</published><updated>2009-08-19T00:01:34.548-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='offtopic'/><title type='text'>Living Root Bridges</title><content type='html'>&lt;a href="http://rootbridges.blogspot.com/"&gt;http://rootbridges.blogspot.com/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://rootbridges.blogspot.com/"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 640px; height: 403px;" src="http://3.bp.blogspot.com/_cdkEvfZCk3o/Sno700GTgbI/AAAAAAAAAEM/83cfXDH7Jsw/s640/1493245031_d922002d62_o.gif" alt="" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-7761207705774598605?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/7761207705774598605/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=7761207705774598605' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/7761207705774598605'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/7761207705774598605'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/08/living-root-bridges.html' title='Living Root Bridges'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_cdkEvfZCk3o/Sno700GTgbI/AAAAAAAAAEM/83cfXDH7Jsw/s72-c/1493245031_d922002d62_o.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-5281551562027757333</id><published>2009-08-18T10:31:00.000-07:00</published><updated>2009-08-18T11:32:35.446-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tec'/><title type='text'>Fascinated in Qt</title><content type='html'>I just read some about Qt and soon started fascinated in it. Since the main part of Qt is GUI framework the functionalities Qt offers are roughly the same as &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;wx&lt;/span&gt;, if there is on in &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;wx&lt;/span&gt;, there's an equivalent in qt (roughly, again). What I am interested is its direct use of C++ methods in a simple and flexible way. &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;wx&lt;/span&gt; has event objects, multiple 'bind' types and multiple macros to bind events to callbacks. Qt does it in only two macros, signal, slot, and one method &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;QObject&lt;/span&gt;::connect(). It is easy to connect a single event to multiple callbacks, multiple events to a single callback, the programmer doesn't have to be aware of thread, It's so flexible that it can be used in many ways. I looked at Qt &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;WebKit&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;API&lt;/span&gt; and found Qt has excellently integrated &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;WebKit&lt;/span&gt;, which would have been very difficult if there was no signal-slot mechanism flexibility. Since it doesn't restrict the number and types of arguments of the callbacks, it can be well used for callback type network programming.&lt;br /&gt;&lt;br /&gt;I think there's one minor drawback. In &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;wx&lt;/span&gt;, what and when &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;wx&lt;/span&gt; emits an event is usually explicit in the document. In Qt, the user can easily emits an event so it is not as easy as &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;wx&lt;/span&gt; (it's a trade-off). It is also explicit for the events Qt itself emits, but the information is scattered in the document. In &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;wx&lt;/span&gt; there's little chance to miss an event type and timing being emit once you get used to reading the document. (if not, read through &lt;a href="http://docs.wxwidgets.org/stable/wx_eventhandlingoverview.html#eventhandlingoverview"&gt;Event handling overview&lt;/a&gt; (Don't miss the difference of event propagation mechanism between command events and other) then 'Events' section of &lt;a href="http://docs.wxwidgets.org/stable/wx_classesbycat.html#classesbycat"&gt;Classes by category&lt;/a&gt;. See what kind of events there are in &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;wx&lt;/span&gt;, then read the 'Event handling' section of the document of specific window you use, such as &lt;a href="http://docs.wxwidgets.org/stable/wx_wxtextctrl.html#wxtextctrl"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;wxTextCtrl&lt;/span&gt;&lt;/a&gt;.)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-5281551562027757333?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/5281551562027757333/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=5281551562027757333' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/5281551562027757333'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/5281551562027757333'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/08/fascinated-in-qt.html' title='Fascinated in Qt'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-4054586664529400417</id><published>2009-08-01T00:03:00.000-07:00</published><updated>2009-08-01T00:24:29.115-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>Not a nice way to interrupt a sub thread</title><content type='html'>In my application, the main thread in in charge of UI drawing with wxPython and starting worker threads which runs user defined Python code. If a user defined Python code is buggy the application user needs to stop it. There's a way to &lt;a href="http://www.blogger.com/raise%20a%20KeyboardInterrupt%20exception%20in%20the%20main%20thread"&gt;raise a KeyboardInterrupt exception in the main thread&lt;/a&gt; but unfortunately not the opposite. What I needed to do is interrupting a sub thread from the main thread. I don't know why it doesn't exist. Probably it is a well considered decision but what I need is what Python misses. The API provides a function &lt;a href="http://docs.python.org/c-api/init.html?highlight=pythreadstate_setasyncexc#PyThreadState_SetAsyncExc"&gt;PyThreadState_SetAsyncExc()&lt;/a&gt; which takes a thread id and exception object and raises exception in the thread. So I had to make a wrapper extension.&lt;br /&gt;&lt;br /&gt;pySubthreadInterruptTest.c&lt;br /&gt;&lt;pre name="code" class="cpp"&gt;&lt;br /&gt;#include &amp;lt;Python.h&amp;gt;&lt;br /&gt;&lt;br /&gt;static PyObject* interrupt(PyObject* self, PyObject* args)&lt;br /&gt;{&lt;br /&gt;    long threadid;&lt;br /&gt;    PyObject* po_exception;&lt;br /&gt;    if(! PyArg_ParseTuple(args, "lO", &amp;threadid, &amp;po_exception))&lt;br /&gt;    {&lt;br /&gt;        return NULL;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    int result = PyThreadState_SetAsyncExc(threadid, po_exception);&lt;br /&gt;    return Py_BuildValue("l", result);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;static PyMethodDef MethodsDefs[] = {&lt;br /&gt;    {"interrupt", interrupt, METH_VARARGS},&lt;br /&gt;    {NULL, NULL, 0},&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;void initpystit(void){&lt;br /&gt;    (void) Py_InitModule("pystit", MethodsDefs);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;setup.py&lt;br /&gt;&lt;pre name="code" class="python"&gt;&lt;br /&gt;from distutils.core import setup, Extension&lt;br /&gt;&lt;br /&gt;module1 = Extension('pystit',&lt;br /&gt;                    sources = ['pySubthreadInterruptTest.c'])&lt;br /&gt;&lt;br /&gt;setup (name = 'PackageName',&lt;br /&gt;       version = '1.0',&lt;br /&gt;       description = 'This is a demo package',&lt;br /&gt;       ext_modules = [module1])&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;test.py&lt;br /&gt;&lt;pre name="code" class="python"&gt;&lt;br /&gt;import time, thread&lt;br /&gt;import pystit&lt;br /&gt;def f():&lt;br /&gt;    print 'thread start'&lt;br /&gt;    try:&lt;br /&gt;            for i in range(1000):&lt;br /&gt;                    print i&lt;br /&gt;                    time.sleep(0.001)&lt;br /&gt;    except:&lt;br /&gt;            print 'interrupted'&lt;br /&gt;            raise&lt;br /&gt;    print 'thread end'&lt;br /&gt;tid = thread.start_new_thread(f, ())&lt;br /&gt;time.sleep(0.001)&lt;br /&gt;pystit.interrupt(tid, ValueError)&lt;br /&gt;time.sleep(1)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$ python setup.py build&lt;br /&gt;running build&lt;br /&gt;running build_ext&lt;br /&gt;building 'pystit' extension&lt;br /&gt;gcc -pthread -shared build/temp.linux-i686-2.6/pySubthreadInterruptTest.o -L/usr/lib -lpython2.6 -o build/lib.linux-i686-2.6/pystit.so&lt;br /&gt;$ cd build/lib.linux-i686-2.6/&lt;br /&gt;$ ls&lt;br /&gt;pystit.so  test.py&lt;br /&gt;$ python test.py&lt;br /&gt;thread start&lt;br /&gt;0&lt;br /&gt;1&lt;br /&gt;2&lt;br /&gt;3&lt;br /&gt;interrupted&lt;br /&gt;Unhandled exception in thread started by &amp;lt;function f at 0xb8043e64&amp;gt;&lt;br /&gt;Traceback (most recent call last):&lt;br /&gt;  File "test.py", line 8, in f&lt;br /&gt;    time.sleep(0.001)&lt;br /&gt;ValueError&lt;br /&gt;$ &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;It works but I can't say I'm quite satisfied with the solution.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-4054586664529400417?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/4054586664529400417/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=4054586664529400417' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/4054586664529400417'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/4054586664529400417'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/08/not-nice-way-to-interrupt-sub-thread.html' title='Not a nice way to interrupt a sub thread'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-2819283670622347150</id><published>2009-07-28T05:59:00.000-07:00</published><updated>2009-08-08T06:05:27.170-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>Highlevel Mouse Event Converter (wxPython)</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_c-kJL128S60/Sm78gTYn6hI/AAAAAAAAAeA/p15zqCdzu14/s1600-h/mouseState.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 268px;" src="http://1.bp.blogspot.com/_c-kJL128S60/Sm78gTYn6hI/AAAAAAAAAeA/p15zqCdzu14/s400/mouseState.png" alt="" id="BLOGGER_PHOTO_ID_5363501838134405650" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I really needed to make a good one (not a school assignment :) that convers lowlevel mouse events to highlevel ones. When the user left double clicks on a window, the window gets leftdown, leftup, leftdoubleclick, leftup events in this order. It is too low level. In this case all we want is a single double click event.&lt;br /&gt;&lt;br /&gt;- A double click event doesn't come with friends.&lt;br /&gt;- Whenever a mouse down event comes, the application can except a following mouse up event (it may be after dragging event stuff or enter/leave window event).&lt;br /&gt;- A series of dragging events are always wrapped by a startdragging and an enddragging event.&lt;br /&gt;- Capture mouse automatically. (See the comment in onButtonDown() method)&lt;br /&gt;- Can set threshold in pixels so that anybody can double click with his trembling hand (e.g. my dad's)&lt;br /&gt;&lt;br /&gt;BUG&lt;br /&gt;While dragging, EnterWindow/LeaveWindow occurs when the mouse enter/leaves the parent window on GTK+.&lt;br /&gt;&lt;br /&gt;UPDATES&lt;br /&gt;Jul 29: Passing proper event object to mouse down/up handlers.&lt;br /&gt;Jul 31: Get the right mouse position while mouse captured.&lt;br /&gt;Aug 5 : Fixed missing double click detection failure.&lt;br /&gt;Aug 8 : Modified to Register popup menu functions.&lt;br /&gt;&lt;pre name="code" class="python"&gt;&lt;br /&gt;"""Low level -&gt; high level mouse event converter."""&lt;br /&gt;import wx&lt;br /&gt;&lt;br /&gt;NORMAL = 0&lt;br /&gt;FIRSTWAIT = 1&lt;br /&gt;SECONDWAIT = 2&lt;br /&gt;AFTERDCLICK = 3&lt;br /&gt;MOUSEDOWN = 4&lt;br /&gt;DRAGGING = 5&lt;br /&gt;&lt;br /&gt;ID_FIRSTTIMER = wx.NewId()&lt;br /&gt;ID_SECONDTIMER = wx.NewId()&lt;br /&gt;&lt;br /&gt;class HighLevMouseEventConv(object):&lt;br /&gt;    def __init__(self, eventWindow, t1 = 200, t2 = 100, dragThreshPixel = 3):&lt;br /&gt;        """HighLevelEvent(eventWindow, t1 = 200, t2 = 100, dragThreshPixel = 3)&lt;br /&gt;&lt;br /&gt;        eventWindow: The window that receives mouse events.&lt;br /&gt;        t1, t2: How long it waits to detect is a mouse down is a double click in mili seconds.&lt;br /&gt;        dragThreshPixel: Drag moves within this thresh do not produce drag related events.&lt;br /&gt;&lt;br /&gt;        When you want a popup menu associated with the window create a func to show the menu, register&lt;br /&gt;        it using set(Left, Middle, Right)PopupMenuFunc(). These functions should never return value.&lt;br /&gt;        """&lt;br /&gt;        self.t1 = t1&lt;br /&gt;        self.t2 = t2&lt;br /&gt;        self.dragThreshPixel = dragThreshPixel&lt;br /&gt;        self.state = NORMAL&lt;br /&gt;        self.evwin = eventWindow&lt;br /&gt;&lt;br /&gt;        self.firstTimer = wx.Timer(eventWindow, ID_FIRSTTIMER)&lt;br /&gt;        self.secondTimer = wx.Timer(eventWindow, ID_SECONDTIMER)&lt;br /&gt;&lt;br /&gt;        dh = self.defaultHandler&lt;br /&gt;        l, r, m = wx.MOUSE_BTN_LEFT, wx.MOUSE_BTN_RIGHT, wx.MOUSE_BTN_MIDDLE&lt;br /&gt;&lt;br /&gt;        self.onHLVMouseDown          = {l:dh, r:dh, m:dh}&lt;br /&gt;        self.onHLVMouseUp            = {l:dh, r:dh, m:dh}&lt;br /&gt;        self.onHLVMouseDClick        = {l:dh, r:dh, m:dh}&lt;br /&gt;        self.onHLVMouseStartDragging = {l:dh, r:dh, m:dh}&lt;br /&gt;        self.onHLVMouseDragging      = {l:dh, r:dh, m:dh}&lt;br /&gt;        self.onHLVMouseEndDragging   = {l:dh, r:dh, m:dh}&lt;br /&gt;        self.popupMenuFunc           = {l:dh, r:dh, m:dh}&lt;br /&gt;&lt;br /&gt;        self.onHLVMotion      = dh&lt;br /&gt;        self.onHLVEnterWindow = dh&lt;br /&gt;        self.onHLVLeaveWindow = dh&lt;br /&gt;&lt;br /&gt;        eventWindow.Bind(wx.EVT_MOUSE_EVENTS, self.onMouseEvents)&lt;br /&gt;        eventWindow.Bind(wx.EVT_MOUSE_CAPTURE_LOST, self.onMouseCaptureLost)&lt;br /&gt;        eventWindow.Bind(wx.EVT_TIMER, self.onFirstTimer, id = ID_FIRSTTIMER)&lt;br /&gt;        eventWindow.Bind(wx.EVT_TIMER, self.onSecondTimer, id = ID_SECONDTIMER)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    def setOnHLVLeftDown(self, handler):&lt;br /&gt;        self.onHLVMouseDown[wx.MOUSE_BTN_LEFT] = handler&lt;br /&gt;&lt;br /&gt;    def setOnHLVLeftUp(self, handler):&lt;br /&gt;        self.onHLVMouseUp[wx.MOUSE_BTN_LEFT] = handler&lt;br /&gt;&lt;br /&gt;    def setOnHLVLeftDClick(self, handler):&lt;br /&gt;        self.onHLVMouseDClick[wx.MOUSE_BTN_LEFT] = handler&lt;br /&gt;&lt;br /&gt;    def setOnHLVLeftStartDragging(self, handler):&lt;br /&gt;        self.onHLVMouseStartDragging[wx.MOUSE_BTN_LEFT] = handler&lt;br /&gt;&lt;br /&gt;    def setOnHLVLeftDragging(self, handler):&lt;br /&gt;        self.onHLVMouseDragging[wx.MOUSE_BTN_LEFT] = handler&lt;br /&gt;&lt;br /&gt;    def setOnHLVLeftEndDragging(self, handler):&lt;br /&gt;        self.onHLVMouseEndDragging[wx.MOUSE_BTN_LEFT] = handler&lt;br /&gt;&lt;br /&gt;    def setOnHLVMiddleDown(self, handler):&lt;br /&gt;        self.onHLVMouseDown[wx.MOUSE_BTN_MIDDLE] = handler&lt;br /&gt;&lt;br /&gt;    def setOnHLVMiddleUp(self, handler):&lt;br /&gt;        self.onHLVMouseUp[wx.MOUSE_BTN_MIDDLE] = handler&lt;br /&gt;&lt;br /&gt;    def setOnHLVMiddleDClick(self, handler):&lt;br /&gt;        self.onHLVMouseDClick[wx.MOUSE_BTN_MIDDLE] = handler&lt;br /&gt;&lt;br /&gt;    def setOnHLVMiddleStartDragging(self, handler):&lt;br /&gt;        self.onHLVMouseStartDragging[wx.MOUSE_BTN_MIDDLE] = handler&lt;br /&gt;&lt;br /&gt;    def setOnHLVMiddleDragging(self, handler):&lt;br /&gt;        self.onHLVMouseDragging[wx.MOUSE_BTN_MIDDLE] = handler&lt;br /&gt;&lt;br /&gt;    def setOnHLVMiddleEndDragging(self, handler):&lt;br /&gt;        self.onHLVMouseEndDragging[wx.MOUSE_BTN_MIDDLE] = handler&lt;br /&gt;&lt;br /&gt;    def setOnHLVRightDown(self, handler):&lt;br /&gt;        self.onHLVMouseDown[wx.MOUSE_BTN_RIGHT] = handler&lt;br /&gt;&lt;br /&gt;    def setOnHLVRightUp(self, handler):&lt;br /&gt;        self.onHLVMouseUp[wx.MOUSE_BTN_RIGHT] = handler&lt;br /&gt;&lt;br /&gt;    def setOnHLVRightDClick(self, handler):&lt;br /&gt;        self.onHLVMouseDClick[wx.MOUSE_BTN_RIGHT] = handler&lt;br /&gt;&lt;br /&gt;    def setOnHLVRightStartDragging(self, handler):&lt;br /&gt;        self.onHLVMouseStartDragging[wx.MOUSE_BTN_RIGHT] = handler&lt;br /&gt;&lt;br /&gt;    def setOnHLVRightDragging(self, handler):&lt;br /&gt;        self.onHLVMouseDragging[wx.MOUSE_BTN_RIGHT] = handler&lt;br /&gt;&lt;br /&gt;    def setOnHLVRightEndDragging(self, handler):&lt;br /&gt;        self.onHLVMouseEndDragging[wx.MOUSE_BTN_RIGHT] = handler&lt;br /&gt;&lt;br /&gt;    def setOnHLVMotion(self, handler):&lt;br /&gt;        self.onHLVMotion = handler&lt;br /&gt;&lt;br /&gt;    def setOnHLVEnterWindow(self, handler):&lt;br /&gt;        """It can detect the mouse enter/leaves from, to the parent window when the mouse is dragging.&lt;br /&gt;        There's no clear way but detecting mouse motion event to enter/leave the window itself&lt;br /&gt;        while the mouse is captured to the parent"""&lt;br /&gt;        self.onHLVEnterWindow = handler&lt;br /&gt;&lt;br /&gt;    def setOnHLVLeaveWindow(self, handler):&lt;br /&gt;        """See setOnHLVLeaveWindow doc."""&lt;br /&gt;        self.onHLVLeaveWindow = handler&lt;br /&gt;&lt;br /&gt;    #popupMenu&lt;br /&gt;    def setLeftPopupMenuFunc(self, func):&lt;br /&gt;        self.popupMenuFunc[wx.MOUSE_BTN_LEFT] = func&lt;br /&gt;&lt;br /&gt;    def setMiddlePopupMenuFunc(self, func):&lt;br /&gt;        self.popupMenuFunc[wx.MOUSE_BTN_MIDDLE] = func&lt;br /&gt;&lt;br /&gt;    def setRightPopupMenuFunc(self, func):&lt;br /&gt;        self.popupMenuFunc[wx.MOUSE_BTN_RIGHT] = func&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    def defaultHandler(self, ev):&lt;br /&gt;        return True&lt;br /&gt;&lt;br /&gt;    def onButtonDown(self, ev):&lt;br /&gt;        if not self.popupMenuFunc[ev.GetButton()](ev):&lt;br /&gt;            return&lt;br /&gt;&lt;br /&gt;        if self.state == AFTERDCLICK:&lt;br /&gt;            self.state = NORMAL&lt;br /&gt;        self.evwin.CaptureMouse()&lt;br /&gt;&lt;br /&gt;        #On GTK, I knoticed if the window is a control, its parent gets mouse events when the window&lt;br /&gt;        #captures mouse events with CaptureMouse(). To call ReleaseMouse() properly this object receives&lt;br /&gt;        #the mouse leftup events sent to the parent window temporarily.&lt;br /&gt;        parent = self.evwin.GetParent()&lt;br /&gt;        if parent:&lt;br /&gt;            parent.Bind(wx.EVT_LEFT_UP, self.onParentButtonUp)&lt;br /&gt;            parent.Bind(wx.EVT_MIDDLE_UP, self.onParentButtonUp)&lt;br /&gt;            parent.Bind(wx.EVT_RIGHT_UP, self.onParentButtonUp)&lt;br /&gt;            parent.Bind(wx.EVT_MOUSE_CAPTURE_LOST, self.onMouseCaptureLost)&lt;br /&gt;            parent.Bind(wx.EVT_MOTION, self.onParentMouseEvents)&lt;br /&gt;            parent.Bind(wx.EVT_ENTER_WINDOW, self.onParentEntering)&lt;br /&gt;            parent.Bind(wx.EVT_LEAVE_WINDOW, self.onParentLeaving)&lt;br /&gt;&lt;br /&gt;        self.secondTimer.Stop()&lt;br /&gt;        state = self.state&lt;br /&gt;        if state == NORMAL:&lt;br /&gt;            self.button = ev.GetButton()&lt;br /&gt;            self.state = FIRSTWAIT&lt;br /&gt;            self.posx, self.posy = ev.GetPosition()&lt;br /&gt;            self.downevattrs = self._getEventAttrs(ev)&lt;br /&gt;            self.firstTimer.Start(self.t1, True)&lt;br /&gt;        elif state == SECONDWAIT:&lt;br /&gt;            self.state = AFTERDCLICK&lt;br /&gt;            self.onHLVMouseDClick[self.button](ev)&lt;br /&gt;&lt;br /&gt;    def onButtonUp(self, ev):&lt;br /&gt;        evwin = self.evwin&lt;br /&gt;        if evwin.HasCapture():&lt;br /&gt;             evwin.ReleaseMouse()&lt;br /&gt;        parent = evwin.GetParent()&lt;br /&gt;        if parent:&lt;br /&gt;            parent.Unbind(wx.EVT_LEFT_UP)&lt;br /&gt;            parent.Unbind(wx.EVT_MIDDLE_UP)&lt;br /&gt;            parent.Unbind(wx.EVT_RIGHT_UP)&lt;br /&gt;            parent.Unbind(wx.EVT_MOUSE_CAPTURE_LOST)&lt;br /&gt;            parent.Unbind(wx.EVT_MOTION)&lt;br /&gt;            parent.Unbind(wx.EVT_ENTER_WINDOW)&lt;br /&gt;            parent.Unbind(wx.EVT_LEAVE_WINDOW)&lt;br /&gt;&lt;br /&gt;        self.firstTimer.Stop()&lt;br /&gt;        state = self.state&lt;br /&gt;        if state == FIRSTWAIT:&lt;br /&gt;            self.state = SECONDWAIT&lt;br /&gt;            self.upevattrs = self._getEventAttrs(ev)&lt;br /&gt;            self.secondTimer.Start(self.t2, True)&lt;br /&gt;        elif state == AFTERDCLICK:&lt;br /&gt;            self.state = NORMAL&lt;br /&gt;        elif state == MOUSEDOWN:&lt;br /&gt;            self.state = NORMAL&lt;br /&gt;            self.onHLVMouseUp[self.button](ev)&lt;br /&gt;        elif state == DRAGGING:&lt;br /&gt;            self.state = NORMAL&lt;br /&gt;            self.onHLVMouseEndDragging[self.button](ev)&lt;br /&gt;            self.onHLVMouseUp[self.button](ev)&lt;br /&gt;&lt;br /&gt;    def onButtonDClick(self, ev):&lt;br /&gt;        self.secondTimer.Stop()&lt;br /&gt;        state = self.state&lt;br /&gt;        if state == NORMAL:&lt;br /&gt;            self.onButtonDown(ev)&lt;br /&gt;        elif state == SECONDWAIT:&lt;br /&gt;            self.state = AFTERDCLICK&lt;br /&gt;            self.onHLVMouseDClick[self.button](ev)&lt;br /&gt;&lt;br /&gt;    def onMoving(self, ev):&lt;br /&gt;        if self.state == NORMAL:&lt;br /&gt;            self.onHLVMotion(ev)&lt;br /&gt;&lt;br /&gt;    def onDragging(self, ev):&lt;br /&gt;        x, y = ev.GetPosition()&lt;br /&gt;        t = self.dragThreshPixel&lt;br /&gt;        state = self.state&lt;br /&gt;        if state == FIRSTWAIT:&lt;br /&gt;            if -t &lt; x - self.posx &lt; t and -t &lt; y - self.posy &lt; t:&lt;br /&gt;                return&lt;br /&gt;            else:&lt;br /&gt;                self.state = DRAGGING&lt;br /&gt;                self.firstTimer.Stop()&lt;br /&gt;                self.onHLVMouseDown[self.button](ev)&lt;br /&gt;                self.onHLVMouseStartDragging[self.button](ev)&lt;br /&gt;        elif state == MOUSEDOWN:&lt;br /&gt;            if -t &lt; x - self.posx &lt; t and -t &lt; y - self.posy &lt; t:&lt;br /&gt;                return&lt;br /&gt;            else:&lt;br /&gt;                self.state = DRAGGING&lt;br /&gt;                self.onHLVMouseStartDragging[self.button](ev)&lt;br /&gt;        elif state == DRAGGING:&lt;br /&gt;            self.onHLVMouseDragging[self.button](ev)&lt;br /&gt;&lt;br /&gt;    def onEntering(self, ev):&lt;br /&gt;        self.onHLVEnterWindow(ev)&lt;br /&gt;&lt;br /&gt;    def onLeaving(self, ev):&lt;br /&gt;        self.onHLVLeaveWindow(ev)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    def onMouseEvents(self, ev):&lt;br /&gt;        ev.Skip()&lt;br /&gt;        if ev.Moving():&lt;br /&gt;            return self.onMoving(ev)&lt;br /&gt;        elif ev.Dragging():&lt;br /&gt;            return self.onDragging(ev)&lt;br /&gt;        elif ev.ButtonDown():&lt;br /&gt;            return self.onButtonDown(ev)&lt;br /&gt;        elif ev.ButtonUp():&lt;br /&gt;            return self.onButtonUp(ev)&lt;br /&gt;        elif ev.ButtonDClick():&lt;br /&gt;            return self.onButtonDClick(ev)&lt;br /&gt;        elif ev.Entering():&lt;br /&gt;            return self.onEntering(ev)&lt;br /&gt;        elif ev.Leaving():&lt;br /&gt;            return self.onLeaving(ev)&lt;br /&gt;&lt;br /&gt;    def onMouseCaptureLost(self, ev):&lt;br /&gt;        self.evwin.ReleaseMouse()&lt;br /&gt;        ev.Skip()&lt;br /&gt;&lt;br /&gt;    def onFirstTimer(self, ev):&lt;br /&gt;        self.state = MOUSEDOWN&lt;br /&gt;        downev = self._createMouseEvent(self.downevattrs)&lt;br /&gt;        self.onHLVMouseDown[self.button](downev)&lt;br /&gt;&lt;br /&gt;    def onSecondTimer(self, ev):&lt;br /&gt;        self.state = NORMAL&lt;br /&gt;        downev = self._createMouseEvent(self.downevattrs)&lt;br /&gt;        upev = self._createMouseEvent(self.upevattrs)&lt;br /&gt;        self.onHLVMouseDown[self.button](downev)&lt;br /&gt;        self.onHLVMouseUp[self.button](upev)&lt;br /&gt;&lt;br /&gt;    def onParentButtonUp(self, ev):&lt;br /&gt;        self._convetMouseEvent(ev)&lt;br /&gt;        self.onButtonUp(ev)&lt;br /&gt;    def onParentMouseEvents(self, ev):&lt;br /&gt;        self._convetMouseEvent(ev)&lt;br /&gt;        self.onMouseEvents(ev)&lt;br /&gt;    def onParentEntering(self, ev):&lt;br /&gt;        self._convetMouseEvent(ev)&lt;br /&gt;        self.onEntering(ev)&lt;br /&gt;    def onParentLeaving(self, ev):&lt;br /&gt;        self._convetMouseEvent(ev)&lt;br /&gt;        self.onLeaving(ev)&lt;br /&gt;&lt;br /&gt;    def _convetMouseEvent(self, ev):&lt;br /&gt;        evwin = self.evwin&lt;br /&gt;        parent = evwin.GetParent()&lt;br /&gt;        x, y = ev.GetPosition()&lt;br /&gt;        offsetx, offsety = evwin.GetPosition()&lt;br /&gt;        ev.m_x = x - offsetx&lt;br /&gt;        ev.m_y = y - offsety&lt;br /&gt;        ev.SetEventObject(evwin)&lt;br /&gt;&lt;br /&gt;    def _getEventAttrs(self, ev):&lt;br /&gt;        return [&lt;br /&gt;            ev.GetEventObject(),&lt;br /&gt;            ev.GetEventType(),&lt;br /&gt;            ev.GetId(),&lt;br /&gt;            ev.GetTimestamp(),&lt;br /&gt;            ev.m_altDown,&lt;br /&gt;            ev.m_controlDown,&lt;br /&gt;            ev.m_leftDown,&lt;br /&gt;            ev.m_middleDown,&lt;br /&gt;            ev.m_rightDown,&lt;br /&gt;            ev.m_metaDown,&lt;br /&gt;            ev.m_shiftDown,&lt;br /&gt;            ev.m_x,&lt;br /&gt;            ev.m_y,&lt;br /&gt;            ev.m_wheelRotation,&lt;br /&gt;            ev.m_wheelDelta,&lt;br /&gt;            ev.m_linesPerAction]&lt;br /&gt;&lt;br /&gt;    def _createMouseEvent(self, eventAttrs):&lt;br /&gt;        obj, typ, id, time, alt, ctrl, l, m, r, meta, shift, x, y, wr, wd, lpa = eventAttrs&lt;br /&gt;        ev = wx.MouseEvent(typ)&lt;br /&gt;        ev.SetEventObject(obj)&lt;br /&gt;        ev.GetEventObject()&lt;br /&gt;        ev.SetEventType(typ)&lt;br /&gt;        ev.SetId(id)&lt;br /&gt;        ev.SetTimestamp(time)&lt;br /&gt;        ev.m_altDown = alt&lt;br /&gt;        ev.m_controlDown = ctrl&lt;br /&gt;        ev.m_leftDown = l&lt;br /&gt;        ev.m_middleDown = m&lt;br /&gt;        ev.m_rightDown = r&lt;br /&gt;        ev.m_metaDown = meta&lt;br /&gt;        ev.m_shiftDown = shift&lt;br /&gt;        ev.m_x = x&lt;br /&gt;        ev.m_y = y&lt;br /&gt;        ev.m_wheelRotation = wr&lt;br /&gt;        ev.m_wheelDelta = wd&lt;br /&gt;        ev.m_linesPerAction = lpa&lt;br /&gt;        return ev&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;if __name__ == '__main__':&lt;br /&gt;    class TestWindow(wx.Button):&lt;br /&gt;        def __init__(self, parent):&lt;br /&gt;            super(TestWindow, self).__init__(parent, -1, pos = (50, 50), size = (150, 150))&lt;br /&gt;&lt;br /&gt;            hlev = HighLevMouseEventConv(self, dragThreshPixel = 15)&lt;br /&gt;&lt;br /&gt;            hlev.setOnHLVLeftDown(self.onHLVLeftDown)&lt;br /&gt;            hlev.setOnHLVLeftUp(self.onHLVLeftUp)&lt;br /&gt;            hlev.setOnHLVLeftDClick(self.onHLVLeftDClick)&lt;br /&gt;            hlev.setOnHLVLeftStartDragging(self.onHLVLeftStartDragging)&lt;br /&gt;            hlev.setOnHLVLeftDragging(self.onHLVLeftDragging)&lt;br /&gt;            hlev.setOnHLVLeftEndDragging(self.onHLVLeftEndDragging)&lt;br /&gt;            hlev.setOnHLVMiddleDown(self.onHLVMiddleDown)&lt;br /&gt;            hlev.setOnHLVMiddleUp(self.onHLVMiddleUp)&lt;br /&gt;            hlev.setOnHLVMiddleDClick(self.onHLVMiddleDClick)&lt;br /&gt;            hlev.setOnHLVMiddleStartDragging(self.onHLVMiddleStartDragging)&lt;br /&gt;            hlev.setOnHLVMiddleDragging(self.onHLVMiddleDragging)&lt;br /&gt;            hlev.setOnHLVMiddleEndDragging(self.onHLVMiddleEndDragging)&lt;br /&gt;            hlev.setOnHLVRightDown(self.onHLVRightDown)&lt;br /&gt;            hlev.setOnHLVRightUp(self.onHLVRightUp)&lt;br /&gt;            hlev.setOnHLVRightDClick(self.onHLVRightDClick)&lt;br /&gt;            hlev.setOnHLVRightStartDragging(self.onHLVRightStartDragging)&lt;br /&gt;            hlev.setOnHLVRightDragging(self.onHLVRightDragging)&lt;br /&gt;            hlev.setOnHLVRightEndDragging(self.onHLVRightEndDragging)&lt;br /&gt;            hlev.setOnHLVMotion(self.onHLVMotion)&lt;br /&gt;            hlev.setOnHLVEnterWindow(self.onHLVEnterWindow)&lt;br /&gt;            hlev.setOnHLVLeaveWindow(self.onHLVLeaveWindow)&lt;br /&gt;&lt;br /&gt;            self.lup = True&lt;br /&gt;            self.dragstate = 'normal'&lt;br /&gt;&lt;br /&gt;        def onHLVLeftDown(self, ev):&lt;br /&gt;            print 'onHLVLeftDown', ev.GetPosition(), type(ev.GetEventObject()).__name__&lt;br /&gt;            if not self.lup: print 'ERROR ' * 5&lt;br /&gt;            self.lup = False&lt;br /&gt;        def onHLVLeftUp(self, ev):&lt;br /&gt;            print 'onHLVLeftUp', ev.GetPosition(), type(ev.GetEventObject()).__name__&lt;br /&gt;            self.lup = True&lt;br /&gt;        def onHLVLeftDClick(self, ev):&lt;br /&gt;            print 'onHLVLeftDClick', ev.GetPosition(), type(ev.GetEventObject()).__name__&lt;br /&gt;        def onHLVLeftStartDragging(self, ev):&lt;br /&gt;            print 'onHLVLeftStartDragging', ev.GetPosition(), type(ev.GetEventObject()).__name__&lt;br /&gt;            if self.dragstate != 'normal': print 'ERROR ' * 5&lt;br /&gt;            self.dragstate = 'started'&lt;br /&gt;        def onHLVLeftDragging(self, ev):&lt;br /&gt;            print 'onHLVLeftDragging', ev.GetPosition(), type(ev.GetEventObject()).__name__&lt;br /&gt;            if not self.dragstate in ('started', 'dragging'): print 'ERROR ' * 5&lt;br /&gt;            self.dragstate = 'dragging'&lt;br /&gt;        def onHLVLeftEndDragging(self, ev):&lt;br /&gt;            print 'onHLVLeftEndDragging', ev.GetPosition(), type(ev.GetEventObject()).__name__&lt;br /&gt;            if not self.dragstate in ('started', 'dragging'): print 'ERROR ' * 5&lt;br /&gt;            self.dragstate = 'normal'&lt;br /&gt;        def onHLVMiddleDown(self, ev):&lt;br /&gt;            print 'onHLVMiddleDown', ev.GetPosition(), type(ev.GetEventObject()).__name__&lt;br /&gt;        def onHLVMiddleUp(self, ev):&lt;br /&gt;            print 'onHLVMiddleUp', ev.GetPosition(), type(ev.GetEventObject()).__name__&lt;br /&gt;        def onHLVMiddleDClick(self, ev):&lt;br /&gt;            print 'onHLVMiddleDClick', ev.GetPosition(), type(ev.GetEventObject()).__name__&lt;br /&gt;        def onHLVMiddleStartDragging(self, ev):&lt;br /&gt;            print 'onHLVMiddleStartDragging', ev.GetPosition(), type(ev.GetEventObject()).__name__&lt;br /&gt;        def onHLVMiddleDragging(self, ev):&lt;br /&gt;            print 'onHLVMiddleDragging', ev.GetPosition(), type(ev.GetEventObject()).__name__&lt;br /&gt;        def onHLVMiddleEndDragging(self, ev):&lt;br /&gt;            print 'onHLVMiddleEndDragging', ev.GetPosition(), type(ev.GetEventObject()).__name__&lt;br /&gt;        def onHLVRightDown(self, ev):&lt;br /&gt;            print 'onHLVRightDown', ev.GetPosition(), type(ev.GetEventObject()).__name__&lt;br /&gt;        def onHLVRightUp(self, ev):&lt;br /&gt;            print 'onHLVRightUp', ev.GetPosition(), type(ev.GetEventObject()).__name__&lt;br /&gt;        def onHLVRightDClick(self, ev):&lt;br /&gt;            print 'onHLVRightDClick', ev.GetPosition(), type(ev.GetEventObject()).__name__&lt;br /&gt;        def onHLVRightStartDragging(self, ev):&lt;br /&gt;            print 'onHLVRightStartDragging', ev.GetPosition(), type(ev.GetEventObject()).__name__&lt;br /&gt;        def onHLVRightDragging(self, ev):&lt;br /&gt;            print 'onHLVRightDragging', ev.GetPosition(), type(ev.GetEventObject()).__name__&lt;br /&gt;        def onHLVRightEndDragging(self, ev):&lt;br /&gt;            print 'onHLVRightEndDragging', ev.GetPosition(), type(ev.GetEventObject()).__name__&lt;br /&gt;        def onHLVMotion(self, ev):&lt;br /&gt;            print 'onHLVMotion', ev.GetPosition(), type(ev.GetEventObject()).__name__&lt;br /&gt;        def onHLVEnterWindow(self, ev):&lt;br /&gt;            print 'onHLVEnterWindow', ev.GetPosition(), type(ev.GetEventObject()).__name__&lt;br /&gt;        def onHLVLeaveWindow(self, ev):&lt;br /&gt;            print 'onHLVLeaveWindow', ev.GetPosition(), type(ev.GetEventObject()).__name__&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    app = wx.App()&lt;br /&gt;    frame = wx.Frame(None, -1, "Title", size = (300, 400))&lt;br /&gt;    panel = wx.Panel(frame, -1)&lt;br /&gt;    testwin = TestWindow(panel)&lt;br /&gt;    frame.Show()&lt;br /&gt;    app.MainLoop()&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-2819283670622347150?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/2819283670622347150/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=2819283670622347150' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/2819283670622347150'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/2819283670622347150'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/07/highlevel-mouse-event-handler-wxpython.html' title='Highlevel Mouse Event Converter (wxPython)'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_c-kJL128S60/Sm78gTYn6hI/AAAAAAAAAeA/p15zqCdzu14/s72-c/mouseState.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-4432790759712753275</id><published>2009-07-25T05:05:00.000-07:00</published><updated>2009-07-25T05:50:37.321-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>Click selecting a curve</title><content type='html'>I wanted a nice connection arrow for my app, not just a concatenation of lines like&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_c-kJL128S60/Smr1uKShQOI/AAAAAAAAAdY/95X9cJNPAUk/s1600-h/Screenshot-4.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 243px; height: 198px;" src="http://2.bp.blogspot.com/_c-kJL128S60/Smr1uKShQOI/AAAAAAAAAdY/95X9cJNPAUk/s400/Screenshot-4.png" alt="" id="BLOGGER_PHOTO_ID_5362368479722815714" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Recently &lt;a href="http://www.wxwidgets.org/"&gt;wxWidgets&lt;/a&gt; got &lt;a href="http://cairographics.org/"&gt;cairo&lt;/a&gt; and &lt;a href="http://www.wxpython.org/"&gt;wxPython&lt;/a&gt; got it accordingly. Using wxcairo (wx.lib.wxcairo) I could draw a nice line of connection like this.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_c-kJL128S60/Smr1qhq-YjI/AAAAAAAAAdQ/TNMr5SPSdAA/s1600-h/Screenshot-5.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 264px; height: 195px;" src="http://1.bp.blogspot.com/_c-kJL128S60/Smr1qhq-YjI/AAAAAAAAAdQ/TNMr5SPSdAA/s400/Screenshot-5.png" alt="" id="BLOGGER_PHOTO_ID_5362368417279926834" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;But there was one problem, in my app, the user needs to be able to select the connection by clicking it. How can I detect if the mouse point is on a connection? I need to calculate the length between the line and the point. cairo uses 3rd order &lt;a href="http://en.wikipedia.org/wiki/B%C3%A9zier_curve"&gt;bezier curve&lt;/a&gt;. To get the parameter t of the bezier curve that gives the closest point on the curve to the mouse point, I need to differentiate the distance and solve the equation of t (or I can get the condition that on the closest point the tangent vector and the vector towards the mouse point makes the right angle. It should produce the same result). The problem is, the equation is 5th order and I cannot solve it. I thought if I should use numerical calculation but still the calculation cost is too expensive. So I decided to use linear interpolation. It's good as long as the user doesn't recognize the error. I can use bounding box and it won't be time consuming. Finally I decided to divide the curve where t = 0, 0.05, 0.1, 0.15, 0.3, 0.5, 0.7, 0.85, 0.9, 0.95, 1. It should be enough just for a GUI program.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;These are several tests.&lt;br /&gt;&lt;br /&gt;Divide the curve in 3, 5, 8, and 10&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_c-kJL128S60/Smr1y0u3PZI/AAAAAAAAAdg/u8y0r4LbFLE/s1600-h/Screenshot.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 228px;" src="http://3.bp.blogspot.com/_c-kJL128S60/Smr1y0u3PZI/AAAAAAAAAdg/u8y0r4LbFLE/s400/Screenshot.png" alt="" id="BLOGGER_PHOTO_ID_5362368559835463058" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Close up&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_c-kJL128S60/Smr2F0cdViI/AAAAAAAAAdw/meCeUDtdaak/s1600-h/Screenshot-2.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 385px; height: 247px;" src="http://1.bp.blogspot.com/_c-kJL128S60/Smr2F0cdViI/AAAAAAAAAdw/meCeUDtdaak/s400/Screenshot-2.png" alt="" id="BLOGGER_PHOTO_ID_5362368886175782434" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Final result&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_c-kJL128S60/Smr1_cddjdI/AAAAAAAAAdo/fPNY2iD8yrs/s1600-h/Screenshot-3.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 133px; height: 231px;" src="http://3.bp.blogspot.com/_c-kJL128S60/Smr1_cddjdI/AAAAAAAAAdo/fPNY2iD8yrs/s400/Screenshot-3.png" alt="" id="BLOGGER_PHOTO_ID_5362368776658324946" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-4432790759712753275?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/4432790759712753275/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=4432790759712753275' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/4432790759712753275'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/4432790759712753275'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/07/i-wanted-nice-connection-arrow-for-my.html' title='Click selecting a curve'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_c-kJL128S60/Smr1uKShQOI/AAAAAAAAAdY/95X9cJNPAUk/s72-c/Screenshot-4.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-7921050606238455446</id><published>2009-07-22T16:25:00.000-07:00</published><updated>2009-07-28T07:26:37.392-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CG'/><title type='text'>Evolution Reel</title><content type='html'>&lt;a href="http://www.jaganimations.com/jaganimationscom.html"&gt;Evolution Reel&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;From the site:&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;Most people want to see how a professional animator struggles... well here's the reel for you. A playblast of my progress on a shot at the end of each production day.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;From the video:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;ICE AGE DAWN OF THE DINOSAURS is property of Fox and Blue Sky Studios&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;The following is for educational purposes only. The reel demonstrates the entire process of completing a production shot from the rough poses to blocking, splining, and polish. The shot was created working 7 days a week during "crunch." Some days represent 16 hour workdays while others are only 3 hours on a Sunday.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-7921050606238455446?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/7921050606238455446/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=7921050606238455446' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/7921050606238455446'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/7921050606238455446'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/07/evelution-reel.html' title='Evolution Reel'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-4496005663544784371</id><published>2009-07-21T17:35:00.000-07:00</published><updated>2009-07-22T16:34:38.981-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='offtopic'/><title type='text'>Eclipse</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://en.wikipedia.org/wiki/Teru_teru_bozu"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 240px; height: 320px;" src="http://1.bp.blogspot.com/_c-kJL128S60/SmZlUlj2kfI/AAAAAAAAAbg/QLX0PPpB-wo/s400/090722_1001%7E01.JPG" alt="" id="BLOGGER_PHOTO_ID_5361083810785432050" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Wishing for a clear sky.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://en.wikipedia.org/wiki/Teru_teru_bozu"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 76px; height: 89px;" src="http://4.bp.blogspot.com/_c-kJL128S60/SmZfIv6V3QI/AAAAAAAAAbY/IiOJ1tDF_ok/s400/Diagram1.png" alt="" id="BLOGGER_PHOTO_ID_5361077010335915266" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-4496005663544784371?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/4496005663544784371/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=4496005663544784371' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/4496005663544784371'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/4496005663544784371'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/07/eclipse.html' title='Eclipse'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_c-kJL128S60/SmZlUlj2kfI/AAAAAAAAAbg/QLX0PPpB-wo/s72-c/090722_1001%7E01.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-4213801693216544152</id><published>2009-07-21T05:22:00.000-07:00</published><updated>2009-07-21T05:59:08.156-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='other'/><title type='text'>Task Dependency Diagram</title><content type='html'>When I make a relatively large scale system (here relatively large means something that takes more than one month to develop), I make a task dependency diagram like this.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_c-kJL128S60/SmWzOqOBDXI/AAAAAAAAAbI/APh60Da9go0/s1600-h/20090721105049.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 300px; height: 213px;" src="http://3.bp.blogspot.com/_c-kJL128S60/SmWzOqOBDXI/AAAAAAAAAbI/APh60Da9go0/s400/20090721105049.jpg" alt="" id="BLOGGER_PHOTO_ID_5360887995887062386" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Blue ones are tasks that has been done, whites are not, greens are milestones, usually tests. And I put a small icon that indicates what task I'm currently doing.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_c-kJL128S60/SmWzTcuJfFI/AAAAAAAAAbQ/7YrvoFO0eT4/s1600-h/20090721211931.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 182px;" src="http://2.bp.blogspot.com/_c-kJL128S60/SmWzTcuJfFI/AAAAAAAAAbQ/7YrvoFO0eT4/s400/20090721211931.jpg" alt="" id="BLOGGER_PHOTO_ID_5360888078163082322" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;During the last project I drew it on an A3 paper and put it on the wall so that everybody could see what he was doing in the overall project picture and how one's work was related to others (each had an animal shaped magnet, I was monky ;). I did it so that nobody would feel as if he was a cog by showing the goal and having people recognize it was a team work but it was also good for a communication tool.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;This task &lt;/span&gt;&lt;span style="font-style: italic;"&gt;(pointing at a task) &lt;/span&gt;&lt;span style="font-style: italic;"&gt;needs some try and error and he may need more time than expected, so after you have done your current work you jump here &lt;/span&gt;&lt;span style="font-style: italic;"&gt;(pointing at a task) &lt;/span&gt;&lt;span style="font-style: italic;"&gt;to prepare for it before he finishes this one &lt;/span&gt;&lt;span style="font-style: italic;"&gt;(pointing at a task) &lt;/span&gt;&lt;span style="font-style: italic;"&gt;and comes here&lt;/span&gt;&lt;span style="font-style: italic;"&gt; (pointing at a task)&lt;/span&gt;&lt;span style="font-style: italic;"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It really works.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-4213801693216544152?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/4213801693216544152/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=4213801693216544152' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/4213801693216544152'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/4213801693216544152'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/07/task-diagram.html' title='Task Dependency Diagram'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_c-kJL128S60/SmWzOqOBDXI/AAAAAAAAAbI/APh60Da9go0/s72-c/20090721105049.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-176825285267103645</id><published>2009-07-17T10:54:00.000-07:00</published><updated>2009-07-17T16:59:21.368-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>A module file can be loaded twice as two different modules (in Python 2.x)</title><content type='html'>I'll show you a case where one file (&lt;span style="font-style: italic;"&gt;mymodule.py&lt;/span&gt;) gets loaded twice as two different modules. I'm sure this is trivial to some people, if you know how to do this, you don't have to read the rest of this entry. I will write it anyway hoping it will help somebody since it could bring a huge confusion if he doesn't know why it happens (huge confusion, according to my experience).&lt;br /&gt;&lt;br /&gt;Modules and packages in directories found in &lt;span style="font-style: italic;"&gt;sys.path&lt;/span&gt; are called &lt;span style="font-style: italic;"&gt;toplevel&lt;/span&gt;. Those which are not in the directories found in &lt;span style="font-style: italic;"&gt;sys.path&lt;/span&gt; but in  a package are still accessible but not &lt;span style="font-style: italic;"&gt;toplevel&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Say you have a package named &lt;span style="font-style: italic;"&gt;mypackage&lt;/span&gt; in a directory you can find in the PYTHONPATH, and it has a module &lt;span style="font-style: italic;"&gt;mymodule&lt;/span&gt;. My &lt;span style="font-style: italic;"&gt;package&lt;/span&gt; is a &lt;span style="font-style: italic;"&gt;toplevel&lt;/span&gt; and &lt;span style="font-style: italic;"&gt;mymodule&lt;/span&gt; is not.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$ pwd&lt;br /&gt;/home/kotamura/mytest&lt;br /&gt;$ echo $PYTHONPATH&lt;br /&gt;/home/kotamura/mytest/mytoplevel&lt;br /&gt;$ tree mytoplevel/&lt;br /&gt;mytoplevel/&lt;br /&gt;`-- mypackage&lt;br /&gt;|-- __init__.py&lt;br /&gt;`-- mymodule.py&lt;br /&gt;&lt;/pre&gt;Let's run Python interactively.&lt;br /&gt;&lt;pre&gt;$ python&lt;br /&gt;Python 2.6 (r26:66714, Jun  8 2009, 16:07:26)&lt;br /&gt;[GCC 4.4.0 20090506 (Red Hat 4.4.0-4)] on linux2&lt;br /&gt;Type "help", "copyright", "credits" or "license" for more information.&lt;br /&gt;&gt;&gt;&gt; import mypackage.mymodule as mm&lt;br /&gt;&gt;&gt;&gt; mm.__name__&lt;br /&gt;'mypackage.mymodule'&lt;br /&gt;&lt;/pre&gt;You can see the module is not a &lt;span style="font-style: italic;"&gt;toplevel&lt;/span&gt; from its name (it's under &lt;span style="font-style: italic;"&gt;mypackage&lt;/span&gt;.)&lt;br /&gt;Go down the directories and do it again.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$ python&lt;br /&gt;Python 2.6 (r26:66714, Jun  8 2009, 16:07:26)&lt;br /&gt;[GCC 4.4.0 20090506 (Red Hat 4.4.0-4)] on linux2&lt;br /&gt;Type "help", "copyright", "credits" or "license" for more information.&lt;br /&gt;&gt;&gt;&gt; import mypackage.mymodule as mm&lt;br /&gt;&gt;&gt;&gt; mm.__name__&lt;br /&gt;'mypackage.mymodule'&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;It's not surprising at all. But you can also import &lt;span style="font-style: italic;"&gt;mymodule&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&gt;&gt;&gt; import mymodule as m&lt;br /&gt;&gt;&gt;&gt; m.__name__&lt;br /&gt;'mymodule'&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now &lt;span style="font-style: italic;"&gt;mymodule&lt;/span&gt; is &lt;span style="font-style: italic;"&gt;toplevel&lt;/span&gt;!, This is because if you run Python interactively Python adds the current directory to &lt;span style="font-style: italic;"&gt;sys.path&lt;/span&gt;. What is important is that &lt;span style="font-style: italic;"&gt;mm&lt;/span&gt; and &lt;span style="font-style: italic;"&gt;m&lt;/span&gt; are different objects even if it is created from the same file &lt;span style="font-style: italic;"&gt;mymodule.py&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&gt;&gt;&gt; mm.a = 1&lt;br /&gt;&gt;&gt;&gt; m.a = 2&lt;br /&gt;&gt;&gt;&gt; mm.a&lt;br /&gt;1&lt;br /&gt;&gt;&gt;&gt; mm is m&lt;br /&gt;False&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;It's not the case you will see only when you use interactive console. The same thing happens when you import a module from another module without specifying it from the &lt;span style="font-style: italic;"&gt;toplevel&lt;/span&gt;.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$ cat weirdImporter.py&lt;br /&gt;import mypackage.mymodule as mm&lt;br /&gt;import mymodule as m&lt;br /&gt;print mm.__name__&lt;br /&gt;print m.__name__&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;You don't have to be in the directory to run &lt;span style="font-style: italic;"&gt;weirdImporter.py&lt;/span&gt;. You can run it from anywhere&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$ python /home/kotamura/mytest/mytoplevel/mypackage/weirdImporter.py&lt;br /&gt;mypackage.mymodule&lt;br /&gt;mymodule&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Again &lt;span style="font-style: italic;"&gt;mymodule.py&lt;/span&gt;got imported twice.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;import mymodule as m&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Python lets &lt;span style="font-style: italic;"&gt;weirdImporter&lt;/span&gt; import &lt;span style="font-style: italic;"&gt;mymodule&lt;/span&gt; because it is in the same directory, and since &lt;span style="font-style: italic;"&gt;weirdImporter&lt;/span&gt; runs in the &lt;span style="font-style: italic;"&gt;__main__&lt;/span&gt; module (not &lt;span style="font-style: italic;"&gt;mypackage.weirdImporter&lt;/span&gt; I mean), it imports &lt;span style="font-style: italic;"&gt;mymodule&lt;/span&gt; as a &lt;span style="font-style: italic;"&gt;toplevel&lt;/span&gt;. While&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;import mypackage.mymodule as mm&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;imports the &lt;span style="font-style: italic;"&gt;mymoduel.py&lt;/span&gt; as &lt;span style="font-style: italic;"&gt;mypackage.mymodule&lt;/span&gt;. So they are different.&lt;br /&gt;&lt;br /&gt;A solution many people recommend is that you always import a package/module specicfying the path from the toplevel. It will solve every problem. You can also use &lt;span style="font-style: italic;"&gt;"relative import"&lt;/span&gt; first introduced in Python2.5 but it brings another confusion until you get used to it.&lt;br /&gt;&lt;br /&gt;Finally, Python3.x doesn't let &lt;span style="font-style: italic;"&gt;weirdImporter&lt;/span&gt; import &lt;span style="font-style:italic;"&gt;mymoduel.py&lt;/span&gt; only because it's in the same directory. But you still need to be careful not to have the same file be imported more than once from multiple toplevels. Don't forget executing 'python /path/to/foo.py' adds /path/to directory to &lt;span style="font-style:italic;"&gt;sys.path&lt;/span&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-176825285267103645?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/176825285267103645/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=176825285267103645' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/176825285267103645'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/176825285267103645'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/07/ill-show-you-case-where-one-file.html' title='A module file can be loaded twice as two different modules (in Python 2.x)'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-8782866164106995077</id><published>2009-07-14T04:18:00.000-07:00</published><updated>2009-07-14T18:20:09.045-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>wx.MiniPanel</title><content type='html'>While I was browsing wxPython demo, I found a really nifty window called wx.MiniFrame.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_c-kJL128S60/Slxp3PmQ0YI/AAAAAAAAAao/T3Yt53mShBI/s1600-h/Screenshot-2.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 235px; height: 343px;" src="http://3.bp.blogspot.com/_c-kJL128S60/Slxp3PmQ0YI/AAAAAAAAAao/T3Yt53mShBI/s400/Screenshot-2.png" alt="" id="BLOGGER_PHOTO_ID_5358274054464786818" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I thought it was nice for my app but soon realized it's wx.Frame. I wanted it inside my application to draw a graph. I didn't want one of my nodes to travel outside my application window and join Firefox, so I decided to make a similar one as a panel.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_c-kJL128S60/SlxyNOMa2CI/AAAAAAAAAbA/h_hAZ77nrsE/s1600-h/Screenshot-1.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 272px; height: 340px;" src="http://1.bp.blogspot.com/_c-kJL128S60/SlxyNOMa2CI/AAAAAAAAAbA/h_hAZ77nrsE/s400/Screenshot-1.png" alt="" id="BLOGGER_PHOTO_ID_5358283228138100770" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Can you see which one is MiniFrame and which is MiniPanel?&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_c-kJL128S60/SlxqkcCldkI/AAAAAAAAAaw/BAj86u8MhTY/s1600-h/Screenshot.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 389px; height: 199px;" src="http://1.bp.blogspot.com/_c-kJL128S60/SlxqkcCldkI/AAAAAAAAAaw/BAj86u8MhTY/s400/Screenshot.png" alt="" id="BLOGGER_PHOTO_ID_5358274830898918978" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;One that cannot' be outside the application window is MiniPanel!&lt;br /&gt;(well, anybody talked about close but something? I don't know... (works on Windows))&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_c-kJL128S60/SlxsHgU9hiI/AAAAAAAAAa4/W60yN6_DoUE/s1600-h/Screenshot-1.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 330px; height: 280px;" src="http://2.bp.blogspot.com/_c-kJL128S60/SlxsHgU9hiI/AAAAAAAAAa4/W60yN6_DoUE/s400/Screenshot-1.png" alt="" id="BLOGGER_PHOTO_ID_5358276532856784418" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I haven't finished minor tunings, e.g. the title is embedded in the code, but it's already resizable.&lt;br /&gt;&lt;br /&gt;Jul. 15 added:&lt;br /&gt;I tested on (Python2.6, wxPython-2.8.10.1, Fedora11) and (Python 2.6.2, wxPython 2.8.10.1, WindowsXP). Not tested on Mac.&lt;br /&gt;&lt;pre name="code" class="python"&gt;&lt;br /&gt;import wx&lt;br /&gt;import wx.lib.resizewidget as resizewidget&lt;br /&gt;import cStringIO as StringIO&lt;br /&gt;&lt;br /&gt;batten = '\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x11\x00\x00\x00\x10\x08\x02\x00\x00\x00\x7fS\x03\x08\x00\x00\x00\x01sRGB\x00\xae\xce\x1c\xe9\x00\x00\x00\x04gAMA\x00\x00\xb1\x8f\x0b\xfca\x05\x00\x00\x00 cHRM\x00\x00z&amp;\x00\x00\x80\x84\x00\x00\xfa\x00\x00\x00\x80\xe8\x00\x00u0\x00\x00\xea`\x00\x00:\x98\x00\x00\x17p\x9c\xbaQ&lt;\x00\x00\x00`IDAT8OcdX\xf9\x9f\x81d\x00\xd4C*B\xd6\xf0\x1f7@1\x17\xce\x01\xaa\xc7c!\x8a,\xa6\x1edi8\x1b\x9f\x1e\xb8\xeb\x80f\xa1\xb1\x11\xae\xc0j\x0f\xb2\xbf \n\x08\xb8\r\xcd\x06\xa2\xf4\xa0\x05\x1ea=\xe4\xfb\x07\x7f`2P\x14?\xc8^\xc7L\x0f\xd8\xd3\x01\t\xa9\x8e\x04\xa5\xf0\xa4L\x86\x1e\x00\xbc\xf4\xfe\xa6\xcaO\x9a\x16\x00\x00\x00\x00IEND\xaeB`\x82'&lt;br /&gt;&lt;br /&gt;bmpstream = StringIO.StringIO(batten)&lt;br /&gt;try:&lt;br /&gt;    image = wx.ImageFromStream(bmpstream)&lt;br /&gt;finally:&lt;br /&gt;    bmpstream.close()&lt;br /&gt;&lt;br /&gt;class _TitleBarPanel(wx.Panel):&lt;br /&gt;    def __init__(self, parent, titleFGColour, titleBGColour, barWidth, fontSize, title):&lt;br /&gt;        wx.Panel.__init__(self, parent, pos = (0, 0), size = (0, barWidth))&lt;br /&gt;        self.SetBackgroundColour(titleBGColour)&lt;br /&gt;        self.SetMaxSize((100000, barWidth))&lt;br /&gt;        self.parent = parent&lt;br /&gt;        self.gparent = parent.GetParent()&lt;br /&gt;        self.restwin = None&lt;br /&gt;&lt;br /&gt;        #Title static text.&lt;br /&gt;        self.titlest = titlest = wx.StaticText(self, -1, title, size = (100000, barWidth))&lt;br /&gt;        titlest.SetForegroundColour(titleFGColour)&lt;br /&gt;        font = titlest.GetFont()&lt;br /&gt;        font.SetPointSize(fontSize)&lt;br /&gt;        titlest.SetFont(font)&lt;br /&gt;&lt;br /&gt;        #Close bitmap button.&lt;br /&gt;        bfi = wx.BitmapFromImage(image)&lt;br /&gt;        self.closeb = b = wx.BitmapButton(self, -1, bfi, (0, 0), (barWidth, barWidth), style = wx.BU_EXACTFIT)&lt;br /&gt;        b.SetToolTipString("Delete this node.")&lt;br /&gt;&lt;br /&gt;        hsizer = wx.BoxSizer(wx.HORIZONTAL)&lt;br /&gt;        hsizer.Add(titlest, 1, wx.EXPAND | wx.CENTER)&lt;br /&gt;        hsizer.Add(b, 0, wx.RIGHT)&lt;br /&gt;        self.SetSizer(hsizer)&lt;br /&gt;&lt;br /&gt;        self.titlest.Bind(wx.EVT_BUTTON, self.onClose, b)&lt;br /&gt;        self.Bind(wx.EVT_BUTTON, self.onClose, b)&lt;br /&gt;        self.titlest.Bind(wx.EVT_LEFT_DOWN, self.onTitleMouseLeftDown)&lt;br /&gt;        self.titlest.Bind(wx.EVT_LEFT_UP, self.onTitleMouseLeftUp)&lt;br /&gt;        self.Bind(wx.EVT_LEFT_UP, self.onTitleMouseLeftUp)&lt;br /&gt;        self.titlest.Bind(wx.EVT_MOTION, self.onTitleMouseMotion)&lt;br /&gt;        self.Bind(wx.EVT_MOTION, self.onTitleMouseMotion)&lt;br /&gt;        self.titlest.Bind(wx.EVT_MOUSE_CAPTURE_LOST, self.onTitleMouseCaptureLost)&lt;br /&gt;        self.Bind(wx.EVT_MOUSE_CAPTURE_LOST, self.onTitleMouseCaptureLost)&lt;br /&gt;&lt;br /&gt;    def onClose(self, ev):&lt;br /&gt;        self.parent.Close()&lt;br /&gt;&lt;br /&gt;    def onTitleMouseLeftDown(self, ev):&lt;br /&gt;        self.titlest.CaptureMouse()&lt;br /&gt;        x, y = ev.GetPosition()&lt;br /&gt;        sx, sy = self.titlest.GetScreenPosition()&lt;br /&gt;        gx, gy = self.gparent.GetPosition()&lt;br /&gt;        self.px, self.py = sx + x, sy + y&lt;br /&gt;        self.gx, self.gy = gx, gy&lt;br /&gt;&lt;br /&gt;    def onTitleMouseLeftUp(self, ev):&lt;br /&gt;        if self.titlest.HasCapture():&lt;br /&gt;            self.titlest.ReleaseMouse()&lt;br /&gt;&lt;br /&gt;    def onTitleMouseMotion(self, ev):&lt;br /&gt;        if ev.Dragging():&lt;br /&gt;            x, y = ev.GetPosition()&lt;br /&gt;            sx, sy = self.titlest.GetScreenPosition()&lt;br /&gt;            px, py = sx + x, sy + y&lt;br /&gt;            if self.restwin:&lt;br /&gt;                fsx, fsy = self.restwin.GetScreenPosition()&lt;br /&gt;                fw, fh = self.restwin.GetSize()&lt;br /&gt;                margin = self.margin&lt;br /&gt;                if px &lt; fsx + margin or py &lt; fsy + margin or px &gt; fsx + fw - margin or py &gt; fsy + fh - margin:&lt;br /&gt;                    return&lt;br /&gt;            self.gparent.SetPosition((self.gx + px - self.px, self.gy + py - self.py))&lt;br /&gt;&lt;br /&gt;    def onTitleMouseCaptureLost(self, ev):&lt;br /&gt;        self.titlest.ReleaseMouse()&lt;br /&gt;&lt;br /&gt;    def setDragRestrictWindow(self, window, margin):&lt;br /&gt;        self.restwin = window&lt;br /&gt;        self.margin = margin&lt;br /&gt;&lt;br /&gt;class NodePanel(wx.Panel):&lt;br /&gt;    def __init__(self, parent, id = wx.ID_ANY, pos=wx.DefaultPosition, size = wx.DefaultSize,&lt;br /&gt;                 style = wx.TAB_TRAVERSAL|wx.NO_BORDER, name=wx.PanelNameStr,&lt;br /&gt;                 borderColour = wx.BLACK, minSize = (0, 0), maxSize = (-1, -1),&lt;br /&gt;                 bgColour = wx.NullColour, titleFGColour = wx.WHITE, titleBGColour = wx.Colour(80, 167, 255),&lt;br /&gt;                 barWidth = 13, fontSize = 8, title = 'MiniPanel'):&lt;br /&gt;        wx.Panel.__init__(self, parent, id, pos, size, style | wx.FULL_REPAINT_ON_RESIZE, name)&lt;br /&gt;        self.borderColour = borderColour&lt;br /&gt;&lt;br /&gt;        rw = resizewidget.ResizeWidget(parent, pos = pos, style = wx.FULL_REPAINT_ON_RESIZE)&lt;br /&gt;        self.SetMinSize(minSize)&lt;br /&gt;        self.SetMaxSize(maxSize)&lt;br /&gt;        rw.SetManagedChild(self)&lt;br /&gt;&lt;br /&gt;        self.tb = tb = _TitleBarPanel(self, titleFGColour, titleBGColour, barWidth, fontSize, title)&lt;br /&gt;        self.clientPanel = clientPanel = wx.Panel(self)&lt;br /&gt;        sizer = wx.BoxSizer(wx.VERTICAL)&lt;br /&gt;        sizer.Add(tb, 0, wx.EXPAND | wx.TOP | wx.LEFT | wx.RIGHT, border = 3)&lt;br /&gt;        sizer.Add(clientPanel, 1,  wx.EXPAND | wx.BOTTOM | wx.LEFT | wx.RIGHT, border = 3)&lt;br /&gt;&lt;br /&gt;        self.SetSizer(sizer)&lt;br /&gt;        self.SetBackgroundColour(bgColour)&lt;br /&gt;        clientPanel.SetBackgroundColour(bgColour)&lt;br /&gt;&lt;br /&gt;        rw.SetSize(size)&lt;br /&gt;&lt;br /&gt;        self.Bind(wx.EVT_PAINT,self.OnPaint)&lt;br /&gt;        self.Bind(wx.EVT_IDLE,self.OnPaintOnIdle)&lt;br /&gt;&lt;br /&gt;    def OnPaintOnIdle(self, ev):&lt;br /&gt;        #self._onPaint(wx.ClientDC(self))&lt;br /&gt;        pass&lt;br /&gt;&lt;br /&gt;    def OnPaint(self, ev):&lt;br /&gt;        self._onPaint(wx.PaintDC(self))&lt;br /&gt;&lt;br /&gt;    def _onPaint(self, dc):&lt;br /&gt;        #Use double buffering as you like.&lt;br /&gt;        #(wxPython-demo dir)/samples/pySketch/pySketch.py has a good example of it.&lt;br /&gt;        dc.SetPen(wx.Pen(self.borderColour))&lt;br /&gt;        x, y = self.GetSize()&lt;br /&gt;        dc.DrawLine(0,   0,   x-1, 0)&lt;br /&gt;        dc.DrawLine(0,   0,   0,   y-1)&lt;br /&gt;        dc.DrawLine(x-1, 0,   x-1, y-1)&lt;br /&gt;        dc.DrawLine(0,   y-1, x-1, y-1)&lt;br /&gt;&lt;br /&gt;    def setDragRestrictWindow(self, window, margin = 0):&lt;br /&gt;        #If you don't set this, the Panel will go outside the window. Is there a nice way? :(&lt;br /&gt;        self.tb.setDragRestrictWindow(window, margin)&lt;br /&gt;&lt;br /&gt;    def getClientPanel(self):&lt;br /&gt;        return self.clientPanel&lt;br /&gt;&lt;br /&gt;    def getTitleStaticText(self):&lt;br /&gt;        return self.tb.titlest&lt;br /&gt;&lt;br /&gt;    def Destroy(self):&lt;br /&gt;        #The resize handle is the parent of the Panel(reparented). We want to destroy&lt;br /&gt;        #the handle too. We'll override Destroy() to make sure it is destroyed.&lt;br /&gt;        self.GetParent().Destroy()&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;if __name__ == '__main__':&lt;br /&gt;    myapp=wx.PySimpleApp()&lt;br /&gt;    frame = wx.Frame(None, -1, "Title", size = wx.Size(300, 400))&lt;br /&gt;    scroll = wx.ScrolledWindow(frame, -1)&lt;br /&gt;    scroll.SetScrollbars(50,50,10,10)&lt;br /&gt;    np = NodePanel(scroll, pos = (30, 30), size = (200, 200), borderColour = (128, 128, 128))&lt;br /&gt;&lt;br /&gt;    np.setDragRestrictWindow(scroll, 15)&lt;br /&gt;&lt;br /&gt;    print np.getTitleStaticText().GetLabel()&lt;br /&gt;&lt;br /&gt;    def OnClose(ev):&lt;br /&gt;        if ev.CanVeto():&lt;br /&gt;            dlg = wx.MessageDialog(None, 'Are you sure?', 'msgb', wx.YES_NO)&lt;br /&gt;            if dlg.ShowModal() == wx.ID_YES:&lt;br /&gt;                np.GetParent().Destroy()&lt;br /&gt;            dlg.Destroy()&lt;br /&gt;&lt;br /&gt;        else:&lt;br /&gt;            np.Destroy()&lt;br /&gt;&lt;br /&gt;        &lt;br /&gt;    np.Bind(wx.EVT_CLOSE, OnClose, np)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    def CloseIt(ev):&lt;br /&gt;        np.Close()&lt;br /&gt;    clientAreaCloseButton = wx.Button(np.getClientPanel(), -1, "Close Me", pos = (20, 20))&lt;br /&gt;    np.Bind(wx.EVT_BUTTON, CloseIt, clientAreaCloseButton)&lt;br /&gt;&lt;br /&gt;    frame.Show()&lt;br /&gt;    myapp.MainLoop()&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-8782866164106995077?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/8782866164106995077/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=8782866164106995077' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/8782866164106995077'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/8782866164106995077'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/07/wxminipanel.html' title='wx.MiniPanel'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_c-kJL128S60/Slxp3PmQ0YI/AAAAAAAAAao/T3Yt53mShBI/s72-c/Screenshot-2.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-4428161624985408483</id><published>2009-07-09T14:38:00.000-07:00</published><updated>2009-07-09T14:45:03.374-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='other'/><title type='text'>Philippe Ramette: Rational exploration of the undersea</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.xippas.com/en/artist/philippe_ramette/works"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 147px; height: 184px;" src="http://www.xippas.com/i/artistes/gallery/philippe_ramette/pra06_12b.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.xippas.com/en/artist/philippe_ramette/works"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 147px; height: 184px;" src="http://www.xippas.com/i/artistes/gallery/philippe_ramette/pra06_15b.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.xippas.com/en/artist/philippe_ramette/works"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 147px; height: 184px;" src="http://www.xippas.com/i/artistes/gallery/philippe_ramette/pra06_11b.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.xippas.com/en/artist/philippe_ramette/works"&gt;&lt;br /&gt;galerie xippas 07_2009&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-4428161624985408483?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/4428161624985408483/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=4428161624985408483' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/4428161624985408483'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/4428161624985408483'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/07/philippe-ramette-rational-exploration.html' title='Philippe Ramette: Rational exploration of the undersea'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-788739002437273984</id><published>2009-07-08T22:28:00.000-07:00</published><updated>2009-07-10T06:18:34.202-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>Thread Manager</title><content type='html'>Last update Jun 10&lt;br /&gt;&lt;pre name="code" class="python"&gt;&lt;br /&gt;import thread, threading&lt;br /&gt;&lt;br /&gt;class _WorkerThread(threading.Thread):&lt;br /&gt;    def __init__(self, sem, job, *args, **kargs):&lt;br /&gt;        self._workSem = sem&lt;br /&gt;        super(_WorkerThread, self).__init__()&lt;br /&gt;        self.job = job&lt;br /&gt;        self.args = args&lt;br /&gt;        self.kargs = kargs&lt;br /&gt;        self.isCanceled = False&lt;br /&gt;        self.hasStarted = False&lt;br /&gt;        self._cancelLock = threading.Lock()&lt;br /&gt;&lt;br /&gt;    def run(self):&lt;br /&gt;        if self._workSem:&lt;br /&gt;            with self._workSem:&lt;br /&gt;                with self._cancelLock:&lt;br /&gt;                    if self.isCanceled:&lt;br /&gt;                        return&lt;br /&gt;                    self.hasStarted = True&lt;br /&gt;                self.job(*self.args, **self.kargs)&lt;br /&gt;        else:&lt;br /&gt;            self.job(*self.args, **self.kargs)&lt;br /&gt;&lt;br /&gt;class JobManager(object):&lt;br /&gt;    def __init__(self, maxnumthreads = 1):&lt;br /&gt;        """Set maxnumthreads to specify the max number of threads which runs concurrently."""&lt;br /&gt;        self._workers = {}&lt;br /&gt;        self._unmanagedWorkers = []&lt;br /&gt;        self._workSem = threading.Semaphore(maxnumthreads)&lt;br /&gt;        self.maxnumthreads = maxnumthreads&lt;br /&gt;        self._lock = threading.RLock()&lt;br /&gt;        self._nextJobIdCounter = 1&lt;br /&gt;&lt;br /&gt;    def postJob(self, job, *args, **kargs):&lt;br /&gt;        """job must be a callable, args and kargs are arguments passed to it."""&lt;br /&gt;        self._gc()&lt;br /&gt;        wt = _WorkerThread(self._workSem, job, *args, **kargs)&lt;br /&gt;        wt.start()&lt;br /&gt;        id = self._nextJobIdCounter&lt;br /&gt;        self._workers[id] = wt&lt;br /&gt;        self._nextJobIdCounter += 1&lt;br /&gt;        return id&lt;br /&gt;&lt;br /&gt;    def cancelJob(self, jobid):&lt;br /&gt;        """Cancel a posted job. jobid must be an object returned by postJob().&lt;br /&gt;        It returns True if the job gets canceled, False it it has started."""&lt;br /&gt;        self._gc()&lt;br /&gt;        worker = self._workers.get(jobid, None)&lt;br /&gt;        if not worker: #It doesn't exist because it finished execution and removed from the _workers&lt;br /&gt;            return False&lt;br /&gt;        with worker._cancelLock:&lt;br /&gt;            worker.isCanceled = True&lt;br /&gt;            return not worker.hasStarted&lt;br /&gt;&lt;br /&gt;    def waitOnIdle(self):&lt;br /&gt;        """Blocks until the every worker thread terminates."""&lt;br /&gt;        self._gc()&lt;br /&gt;        while self._workers or self._unmanagedWorkers:&lt;br /&gt;            wt = (self._workers.values() + self._unmanagedWorkers).pop()&lt;br /&gt;            wt.join()&lt;br /&gt;            self._gc()&lt;br /&gt;&lt;br /&gt;    def getNumWaitingJobs(self):&lt;br /&gt;        """Returns the number of jobs waiting. It includes threads currently running."""&lt;br /&gt;        self._gc()&lt;br /&gt;        return len(self._workers)&lt;br /&gt;&lt;br /&gt;    def forceExecuteOnWorkerThread(self, job, *args, **kargs):&lt;br /&gt;        """Execute the job immediately on a thread. It is not queued."""&lt;br /&gt;        wt = _WorkerThread(None, job, *args, **kargs)&lt;br /&gt;        wt.start()&lt;br /&gt;        self._unmanagedWorkers.append(wt)&lt;br /&gt;&lt;br /&gt;    def executeWhenNoWorkerThreadsRunning(self, job, *args, **kargs):&lt;br /&gt;        """The calling thread execute the job (callable), ensuring no worker threads running.&lt;br /&gt;        It blocks when a thread is running.It DOESN'T mean job is executed after the every&lt;br /&gt;        worker threads has been terminated.&lt;br /&gt;        (Though it looks the current Python implementation awakens a thread which called acquire()&lt;br /&gt;        earlier.)&lt;br /&gt;        It doesn't take jobs launched by forceExecuteOnWorkerThread() into account."""&lt;br /&gt;        for i in range(self.maxnumthreads):&lt;br /&gt;            self._workSem.acquire()&lt;br /&gt;        try:&lt;br /&gt;            job(*args, **kargs)&lt;br /&gt;        finally:&lt;br /&gt;            for i in range(self.maxnumthreads):&lt;br /&gt;                self._workSem.release()&lt;br /&gt;&lt;br /&gt;    def _gc(self):&lt;br /&gt;        with self._lock:&lt;br /&gt;            self._workers = dict([w for w in self._workers.items() if w[1].isAlive()])&lt;br /&gt;            self._unmanagedWorkers = [wt for wt in self._unmanagedWorkers if wt.isAlive()]&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;if __name__ == '__main__':&lt;br /&gt;    import time&lt;br /&gt;    def somejob(i, wait = 0.1):&lt;br /&gt;        time.sleep(wait)&lt;br /&gt;        print 'somejob', i&lt;br /&gt;        time.sleep(1)&lt;br /&gt;    def endMessage(msg):&lt;br /&gt;        print msg&lt;br /&gt;&lt;br /&gt;    jm = JobManager()&lt;br /&gt;    jobIds = []&lt;br /&gt;    for i in range(5):&lt;br /&gt;        id = jm.postJob(somejob, i + 1)&lt;br /&gt;        jobIds.append(id)&lt;br /&gt;        print 'posted', id&lt;br /&gt;    time.sleep(2)&lt;br /&gt;    print "cancel", jobIds[0], jm.cancelJob(jobIds[0])&lt;br /&gt;    print "cancel", jobIds[-1], jm.cancelJob(jobIds[-1])&lt;br /&gt;    #print jm.getNumWaitingJobs()&lt;br /&gt;    jm.forceExecuteOnWorkerThread(somejob, 'unmanaged1', 4)&lt;br /&gt;    jm.waitOnIdle() #It waits for unmanaged1 termination&lt;br /&gt;    jm.forceExecuteOnWorkerThread(somejob, 'unmanaged2')&lt;br /&gt;    jm.executeWhenNoWorkerThreadsRunning(endMessage, 'done') #It doesn't wait for unmanaged2&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-788739002437273984?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/788739002437273984/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=788739002437273984' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/788739002437273984'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/788739002437273984'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/07/thread-manager.html' title='Thread Manager'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-4930284950511767515</id><published>2009-07-02T01:55:00.000-07:00</published><updated>2009-07-02T02:29:14.573-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tec'/><title type='text'>Writing a technical document</title><content type='html'>When I write a technical document, I try to be careful to keep three things.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1) Do not use the term that hasn't been explained in the earlier pages.&lt;br /&gt;&lt;/span&gt;I think this is a basic rule that every document must keep, but lots of them break it. I once read a document about a Python framework which uses a term "jelly" (is that case, it used the term in method names) with no explanation beforehand. It took me a long time until I know its meaning. I hoped if the writer had added just one line saying "jelly means serialize".   (although the framework itself is very useful. Lots of its terms are named after a sandwich. You guess what it &lt;a href="http://twistedmatrix.com/projects/core/documentation/howto/pb-intro.html"&gt;is&lt;/a&gt;? ;).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;2) Do not try to explain two things at a time.&lt;br /&gt;&lt;/span&gt;Human brains are not designed to think about two things at a time. When you explain recursive function call, don't take mandelbrot as an example. Think about an average reader and take an example that most reader is supposed to know.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;3) "Make a list of stuffs to write, think about the explanation flow of the document".&lt;br /&gt;&lt;/span&gt;I usually make a graph for 1) and 3), which has a set of circles, each circle contains one element of the list , and dependencies as arrows between the circles.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-4930284950511767515?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/4930284950511767515/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=4930284950511767515' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/4930284950511767515'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/4930284950511767515'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/07/writing-technical-document.html' title='Writing a technical document'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-6823454136007360255</id><published>2009-06-30T08:27:00.000-07:00</published><updated>2009-06-30T08:37:02.761-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tec'/><title type='text'>Playing .wav files on Windows, Mac, Linux</title><content type='html'>Playing .wav files in the current directory.&lt;br /&gt;&lt;br /&gt;Windows&lt;br /&gt;&lt;pre name="code" class="python"&gt;&lt;br /&gt;import glob, winsound, random&lt;br /&gt;wavfiles = glob.glob("*.wav")&lt;br /&gt;wavfile = random.choice(wavfiles)&lt;br /&gt;while(True):&lt;br /&gt;   raw_input()&lt;br /&gt;   wavfile = random.choice(wavfiles)&lt;br /&gt;   winsound.PlaySound(wavfile, winsound.SND_FILENAME)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Mac (got the idea &lt;a href="http://yamashita.dyndns.org/blog/play-sounds-with-python-on-mac/"&gt;here&lt;/a&gt;)&lt;br /&gt;&lt;pre name="code" class="python"&gt;&lt;br /&gt;from AppKit import NSSound&lt;br /&gt;from time import sleep&lt;br /&gt;import glob, random&lt;br /&gt;wavfiles = glob.glob("*.wav")&lt;br /&gt;while(True):&lt;br /&gt;   raw_input()&lt;br /&gt;   wavfile = random.choice(wavfiles)&lt;br /&gt;   s = NSSound.alloc()&lt;br /&gt;   s.initWithContentsOfFile_byReference_(wavfile, True)&lt;br /&gt;   s.play()&lt;br /&gt;   while s.isPlaying():&lt;br /&gt;       sleep(0.1)&lt;br /&gt;   s.stop()&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Linux (needs play command)&lt;br /&gt;&lt;pre name="code" class="python"&gt;&lt;br /&gt;import os, glob, random&lt;br /&gt;wavfiles = glob.glob("*.wav")&lt;br /&gt;wavfile = random.choice(wavfiles)&lt;br /&gt;while(True):&lt;br /&gt;   raw_input()&lt;br /&gt;   wavfile = random.choice(wavfiles)&lt;br /&gt;   os.system("play -q " + wavfile)&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-6823454136007360255?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/6823454136007360255/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=6823454136007360255' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/6823454136007360255'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/6823454136007360255'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/06/playing-wav-files-in-various-os.html' title='Playing .wav files on Windows, Mac, Linux'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-3023582581512268079</id><published>2009-06-29T03:00:00.001-07:00</published><updated>2009-06-29T03:01:03.514-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='offtopic'/><title type='text'>Damien Walters Showreel 2009</title><content type='html'>Hey look at this!&lt;br /&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/5MeiwLLZjDo&amp;hl=en&amp;fs=1&amp;"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/5MeiwLLZjDo&amp;hl=en&amp;fs=1&amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-3023582581512268079?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/3023582581512268079/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=3023582581512268079' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/3023582581512268079'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/3023582581512268079'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/06/walters-showreel-2009.html' title='Damien Walters Showreel 2009'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-6617127302996809882</id><published>2009-06-29T01:24:00.001-07:00</published><updated>2009-06-30T10:10:15.032-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tec'/><title type='text'>pydoc look up command (Emacs)</title><content type='html'>Just add the following stuff in your .emacs.&lt;br /&gt;and type Ctrl-h f at point where you want to look up pydoc.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_c-kJL128S60/SkiI2noz0mI/AAAAAAAAAag/dQ2OWb9KSLk/s1600-h/Screenshot.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 392px; height: 285px;" src="http://4.bp.blogspot.com/_c-kJL128S60/SkiI2noz0mI/AAAAAAAAAag/dQ2OWb9KSLk/s400/Screenshot.png" alt="" id="BLOGGER_PHOTO_ID_5352678629064299106" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="python"&gt;&lt;br /&gt;;;----pydoc lookup----&lt;br /&gt;(defun hohe2-lookup-pydoc ()&lt;br /&gt;  (interactive)&lt;br /&gt;  (let ((curpoint (point)) (prepoint) (postpoint) (cmd))&lt;br /&gt;    (save-excursion&lt;br /&gt;      (beginning-of-line)&lt;br /&gt;      (setq prepoint (buffer-substring (point) curpoint)))&lt;br /&gt;    (save-excursion&lt;br /&gt;      (end-of-line)&lt;br /&gt;      (setq postpoint (buffer-substring (point) curpoint)))&lt;br /&gt;    (if (string-match "[_a-z][_\\.0-9a-z]*$" prepoint)&lt;br /&gt;        (setq cmd (substring prepoint (match-beginning 0) (match-end 0))))&lt;br /&gt;    (if (string-match "^[_0-9a-z]*" postpoint)&lt;br /&gt;        (setq cmd (concat cmd (substring postpoint (match-beginning 0) (match-end 0)))))&lt;br /&gt;    (if (string= cmd "") nil&lt;br /&gt;      (let ((max-mini-window-height 0))&lt;br /&gt;        (shell-command (concat "pydoc " cmd))))))&lt;br /&gt;&lt;br /&gt;(add-hook 'python-mode-hook&lt;br /&gt;          (lambda ()&lt;br /&gt;            (local-set-key (kbd "C-h f") 'hohe2-lookup-pydoc)))&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I had been thinking that Python is a toy and the rest of the programming languages are all tools, but I realized Emacs Lisp is a toy too. I'm sure I'm reinventing a wheel. Don't worry!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-6617127302996809882?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/6617127302996809882/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=6617127302996809882' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/6617127302996809882'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/6617127302996809882'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/06/pydoc-look-up-command-emacs.html' title='pydoc look up command (Emacs)'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_c-kJL128S60/SkiI2noz0mI/AAAAAAAAAag/dQ2OWb9KSLk/s72-c/Screenshot.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-7327954205101909783</id><published>2009-06-27T09:51:00.000-07:00</published><updated>2011-02-12T20:33:11.712-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Maya'/><title type='text'>Emacs To Maya for Python Scripts</title><content type='html'>I modified the original &lt;a href="http://www.highend3d.com/maya/downloads/tools/syntax_scripting/Emacs-To-Maya-4794.html"&gt;Emacs To Maya&lt;/a&gt; by slavomir.kaslev.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_c-kJL128S60/SkZVSB9PIqI/AAAAAAAAAaY/OuuXPcTKsOY/s1600-h/Screenshot.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 197px;" src="http://4.bp.blogspot.com/_c-kJL128S60/SkZVSB9PIqI/AAAAAAAAAaY/OuuXPcTKsOY/s400/Screenshot.png" alt="" id="BLOGGER_PHOTO_ID_5352058975427699362" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Feb. 13, 2011.&lt;br /&gt;Sending a command through file is a spec, not cutting corners. Due to Maya command port limitation we need to make a command small enough to have it within one packet (I don't know if the limitation still exisits in Maya 2011, anyone knows it?).&lt;br /&gt;&lt;br /&gt;Feb. 6, 2011.&lt;br /&gt;When I posted this entry two years ago, I emailed Slavomir and he replied&lt;span style="font-style: italic;"&gt;&lt;br /&gt;I am very happy that you find etom.el usefull. Etom.el is free&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; software, so you can do whatever you want with it to suit your needs.&lt;/span&gt;&lt;br /&gt;so you can feel free to use this patch. Still please keep in mind that this is GPL licenced.&lt;br /&gt;&lt;br /&gt;Jan. 23, 2011.&lt;br /&gt;If you get error regarding replace-in-string, it's probably due to missing function on your emacs. you can find a replace-in-string implementation in &lt;a href="http://www.robf.de/Hacking/elisp/find-files.el"&gt;find-files.el&lt;/a&gt; module, made by &lt;a href="http://www.robf.de/"&gt;Robert Fenk&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;And on Windows Vista,&lt;br /&gt;commandPort -eo -n ":2222";&lt;br /&gt;doesn't work. Execute&lt;br /&gt;commandPort -eo -n "127.0.0.1:2222";&lt;br /&gt;&lt;br /&gt;Tnanks Hajime!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This is not an authorized version by the original author/maintainer, and I only tested on Linux (Fedora 11, Maya 8.5, GNU Emacs 22.3.1)&lt;br /&gt;last modified: Jan. 23, 2011&lt;br /&gt;&lt;pre name="code" class="python"&gt;&lt;br /&gt;;;; etom.el --- Emacs to Maya communication&lt;br /&gt;&lt;br /&gt;;; Copyright (C) 2007 Slavomir Kaslev&lt;br /&gt;&lt;br /&gt;;; Author: Slavomir Kaslev &amp;lt;slavomir.kaslev@gmail.com&amp;gt;&lt;br /&gt;;; Maintainer: Slavomir Kaslev &amp;lt;slavomir.kaslev@gmail.com&amp;gt;&lt;br /&gt;;; Created: 17 Jun 2007&lt;br /&gt;;; Version: etom.el 0.02 dated 07/07/03 at 16:45:51&lt;br /&gt;;; Keywords: emacs, maya, mel&lt;br /&gt;&lt;br /&gt;;; Modified the original script by Slavomir Kaslev to send Python scripts&lt;br /&gt;;; Modified By: Koichi Tamura &amp;lt;hohehohe2@gmail.com&amp;gt;&lt;br /&gt;;; Date: 28 Jun 2009&lt;br /&gt;&lt;br /&gt;;; This file is NOT part of Emacs.&lt;br /&gt;;;&lt;br /&gt;;; This program is free software; you can redistribute it and/or&lt;br /&gt;;; modify it under the terms of the GNU General Public License&lt;br /&gt;;; as published by the Free Software Foundation; either version 2&lt;br /&gt;;; of the License, or (at your option) any later version.&lt;br /&gt;;;&lt;br /&gt;;; This program is distributed in the hope that it will be useful,&lt;br /&gt;;; but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt;;; GNU General Public License for more details.&lt;br /&gt;;;&lt;br /&gt;;; You should have received a copy of the GNU General Public License&lt;br /&gt;;; along with this program; if not, write to the Free Software&lt;br /&gt;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,&lt;br /&gt;;; MA 02110-1301, USA.&lt;br /&gt;&lt;br /&gt;;; Commentary:&lt;br /&gt;&lt;br /&gt;;; This package is used for communication between emacs and Maya. For&lt;br /&gt;;; example you can use it together with Shuji Narazaki's mel-mode to&lt;br /&gt;;; send pieces of mel code to Maya and get the results back in emacs.&lt;br /&gt;&lt;br /&gt;;; To use this, insert in your ~/.emacs file:&lt;br /&gt;;; (add-hook&lt;br /&gt;;;  'mel-mode-hook&lt;br /&gt;;;  (lambda ()&lt;br /&gt;;;    (require 'etom)&lt;br /&gt;;;    (setq etom-default-host "localhost")&lt;br /&gt;;;    (setq etom-default-port 2222)&lt;br /&gt;;;    (local-set-key (kbd "C-c C-r") 'etom-send-region)&lt;br /&gt;;;    (local-set-key (kbd "C-c C-c") 'etom-send-buffer)&lt;br /&gt;;;    (local-set-key (kbd "C-c C-l") 'etom-send-buffer)&lt;br /&gt;;;    (local-set-key (kbd "C-c C-z") 'etom-show-buffer)))&lt;br /&gt;;;&lt;br /&gt;;; For Python&lt;br /&gt;;;&lt;br /&gt;;; Add the following script after the above one.&lt;br /&gt;;; (add-hook&lt;br /&gt;;;  'python-mode-hook&lt;br /&gt;;;  (lambda ()&lt;br /&gt;;;    (require 'etom)&lt;br /&gt;;;    (setq etom-default-host "localhost")&lt;br /&gt;;;    (setq etom-default-port 2222)&lt;br /&gt;;;    (local-set-key (kbd "C-c C-r") 'etom-send-region-py)&lt;br /&gt;;;    (local-set-key (kbd "C-c C-c") 'etom-send-buffer-py)&lt;br /&gt;;;    (local-set-key (kbd "C-c C-l") 'etom-send-buffer-py)&lt;br /&gt;;;    (local-set-key (kbd "C-c C-z") 'etom-show-buffer)))&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;;;; Code:&lt;br /&gt;&lt;br /&gt;(require 'comint)&lt;br /&gt;&lt;br /&gt;(defcustom etom-default-host "localhost"&lt;br /&gt;"Default name of the host on which Maya is running."&lt;br /&gt;:type 'string&lt;br /&gt;:group 'etom)&lt;br /&gt;&lt;br /&gt;(defcustom etom-default-port 2222&lt;br /&gt;"Default port number to connect to Maya."&lt;br /&gt;:type 'integer&lt;br /&gt;:group 'etom)&lt;br /&gt;&lt;br /&gt;(defcustom etom-always-show t&lt;br /&gt;"Non-nil means display etom-buffer after sending a command."&lt;br /&gt;:type 'boolean&lt;br /&gt;:group 'etom)&lt;br /&gt;&lt;br /&gt;(defcustom etom-prompt-regexp "^\0$"&lt;br /&gt;"Regexp which matches the Maya's prompt."&lt;br /&gt;:type 'regexp&lt;br /&gt;:group 'etom)&lt;br /&gt;&lt;br /&gt;(defvar etom-buffer nil&lt;br /&gt;"Buffer used for communication with Maya.")&lt;br /&gt;&lt;br /&gt;(defun etom-show-buffer ()&lt;br /&gt;"Make sure `etom-buffer' is being displayed."&lt;br /&gt;(interactive)&lt;br /&gt;(if (not (etom-connected))&lt;br /&gt;(etom-connect))&lt;br /&gt;(display-buffer etom-buffer))&lt;br /&gt;&lt;br /&gt;(defun etom-hide-buffer ()&lt;br /&gt;"Delete all windows that display `etom-buffer'."&lt;br /&gt;(interactive)&lt;br /&gt;(delete-windows-on etom-buffer))&lt;br /&gt;&lt;br /&gt;(defun etom-connect ()&lt;br /&gt;"Connect to Maya."&lt;br /&gt;(interactive)&lt;br /&gt;(setq comint-prompt-regexp etom-prompt-regexp)&lt;br /&gt;(setq etom-buffer (make-comint "Maya" (cons etom-default-host etom-default-port)))&lt;br /&gt;(set-process-query-on-exit-flag (get-buffer-process etom-buffer) nil)&lt;br /&gt;(if etom-always-show&lt;br /&gt;(etom-show-buffer))&lt;br /&gt;(comint-simple-send (get-buffer-process etom-buffer)&lt;br /&gt;                (concat&lt;br /&gt;                 "python(\""&lt;br /&gt;                 "def etom_pyexec(fname):\\n"&lt;br /&gt;                 "  f = open(fname)\\n"&lt;br /&gt;                 "  try:\\n"&lt;br /&gt;                 "    c = f.read()\\n"&lt;br /&gt;                 "    try:\\n"&lt;br /&gt;                 "      return str(eval(c))\\n"&lt;br /&gt;                 "    except:\\n"&lt;br /&gt;                 "      exec c in globals(), globals()\\n"&lt;br /&gt;                 "  finally:\\n"&lt;br /&gt;                 "    f.close()"&lt;br /&gt;                 "\")")))&lt;br /&gt;&lt;br /&gt;(defun etom-disconnect ()&lt;br /&gt;"Disconnect from Maya and kill etom-buffer."&lt;br /&gt;(interactive)&lt;br /&gt;(if etom-buffer&lt;br /&gt;(kill-buffer etom-buffer)))&lt;br /&gt;&lt;br /&gt;(defun etom-connected ()&lt;br /&gt;"Return non-nil if there is connection to Maya."&lt;br /&gt;(interactive)&lt;br /&gt;(comint-check-proc etom-buffer))&lt;br /&gt;&lt;br /&gt;(defun etom-prompt-line ()&lt;br /&gt;(save-excursion&lt;br /&gt;(forward-line 0)&lt;br /&gt;(looking-at comint-prompt-regexp)))&lt;br /&gt;&lt;br /&gt;(defun etom-wait-for-prompt (last-prompt)&lt;br /&gt;(let ((prompt-found nil))&lt;br /&gt;(while (not prompt-found)&lt;br /&gt;(accept-process-output (get-buffer-process (current-buffer)))&lt;br /&gt;(goto-char (point-max))&lt;br /&gt;(setq prompt-found (and (etom-prompt-line) (not (= (count-lines (point-min) (point-max)) last-prompt)))))))&lt;br /&gt;&lt;br /&gt;(defun etom-send-current-line ()&lt;br /&gt;"Send current line to Maya."&lt;br /&gt;(interactive)&lt;br /&gt;(let ((start (save-excursion (beginning-of-line) (point)))&lt;br /&gt;(end (save-excursion (end-of-line) (point))))&lt;br /&gt;(etom-send-region start end)))&lt;br /&gt;&lt;br /&gt;(defun etom-send-current-line-py ()&lt;br /&gt;"Send current line to Maya as Python."&lt;br /&gt;(interactive)&lt;br /&gt;(let ((start (save-excursion (beginning-of-line) (point)))&lt;br /&gt;(end (save-excursion (end-of-line) (point))))&lt;br /&gt;(etom-send-region-py start end)))&lt;br /&gt;&lt;br /&gt;(defun etom-send-region (start end &amp;amp;optional aspython)&lt;br /&gt;"Send region to Maya."&lt;br /&gt;(interactive "r")&lt;br /&gt;(if (not (etom-connected))&lt;br /&gt;(etom-connect))&lt;br /&gt;(if etom-always-show&lt;br /&gt;(etom-show-buffer))&lt;br /&gt;(let (&lt;br /&gt;(tempfile (make-temp-file "etom-"))&lt;br /&gt;(formatstr (if aspython "python(\"etom_pyexec('%s')\")" "source \"%s\";")))&lt;br /&gt;(write-region start end tempfile)&lt;br /&gt;;; send source(tempfile)&lt;br /&gt;(with-current-buffer etom-buffer&lt;br /&gt;(let ((last-prompt (count-lines (point-min) (point-max))))&lt;br /&gt;(goto-char (point-max))&lt;br /&gt;(comint-simple-send (get-buffer-process (current-buffer))&lt;br /&gt;                   (format formatstr&lt;br /&gt;                           (replace-in-string tempfile "\\\\" "\\\\\\\\" )))&lt;br /&gt;(etom-wait-for-prompt last-prompt)&lt;br /&gt;(delete-file tempfile)))))&lt;br /&gt;&lt;br /&gt;(defun etom-send-region-py (start end)&lt;br /&gt;"Send region to Maya as Python."&lt;br /&gt;(interactive "r")&lt;br /&gt;(etom-send-region start end t))&lt;br /&gt;&lt;br /&gt;(defun etom-send-region-2 (start end)&lt;br /&gt;"Send region to Maya."&lt;br /&gt;(interactive "r")&lt;br /&gt;(if (not (etom-connected))&lt;br /&gt;(etom-connect))&lt;br /&gt;(if etom-always-show&lt;br /&gt;(etom-show-buffer))&lt;br /&gt;(comint-simple-send (get-buffer-process etom-buffer)&lt;br /&gt;             (buffer-substring start end)))&lt;br /&gt;&lt;br /&gt;(defun etom-send-buffer ()&lt;br /&gt;"Send whole buffer to Maya."&lt;br /&gt;(interactive)&lt;br /&gt;(etom-send-region (point-min) (point-max)))&lt;br /&gt;&lt;br /&gt;(defun etom-send-buffer-py ()&lt;br /&gt;"Send whole buffer to Maya as Python."&lt;br /&gt;(interactive)&lt;br /&gt;(etom-send-region-py (point-min) (point-max)))&lt;br /&gt;&lt;br /&gt;(provide 'etom)&lt;br /&gt;&lt;br /&gt;;;; etom.el ends here&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-7327954205101909783?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/7327954205101909783/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=7327954205101909783' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/7327954205101909783'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/7327954205101909783'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/06/emacs-to-maya-for-python-scripts.html' title='Emacs To Maya for Python Scripts'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_c-kJL128S60/SkZVSB9PIqI/AAAAAAAAAaY/OuuXPcTKsOY/s72-c/Screenshot.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-6367211340486531323</id><published>2009-06-26T21:16:00.000-07:00</published><updated>2009-06-26T21:24:16.502-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Maya'/><title type='text'>Emacs To Maya</title><content type='html'>I started using &lt;a href="http://www.highend3d.com/maya/downloads/tools/syntax_scripting/4794.html"&gt;Emacs To Maya&lt;/a&gt;.&lt;br /&gt;Now modifying it to send Python scripts (Half done, thinking about how to get the value printed in the command history).&lt;br /&gt;&lt;br /&gt;Ah, I added the following script to .emacs before&lt;br /&gt;&lt;pre name="code" class="python"&gt;&lt;br /&gt;(add-hook&lt;br /&gt;  'mel-mode-hook ...&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;to avoid&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Symbol's function definition is void: replace-in-string&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;error.&lt;br /&gt;&lt;pre name="code" class="python"&gt;&lt;br /&gt;(if (not (fboundp 'replace-in-string))&lt;br /&gt;    (defun replace-in-string (string regexp replacement &amp;optional literal)&lt;br /&gt;      "Replace regex in string with replacement"&lt;br /&gt;      (replace-regexp-in-string regexp replacement string t literal)))&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;(got it &lt;a href="http://sugarshark.com/elisp/init/lisp.el.html"&gt;here&lt;/a&gt;)&lt;br /&gt;For those who has seen the same error.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-6367211340486531323?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/6367211340486531323/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=6367211340486531323' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/6367211340486531323'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/6367211340486531323'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/06/emacs-to-maya.html' title='Emacs To Maya'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-5076625779487938561</id><published>2009-06-26T10:01:00.001-07:00</published><updated>2009-06-26T10:14:58.808-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tec'/><title type='text'>Recursive directory search configuration for anything.el</title><content type='html'>Continued from the previous entry.&lt;br /&gt;If the selected document is html (".html" or ".htm" case insensitive) it opens the document with w3m in a new frame, otherwise it just opens it normally as a text file in the current frame.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;hohe2-anything-find.el&lt;br /&gt;&lt;pre name="code" class="python"&gt;&lt;br /&gt;(require 'w3m)&lt;br /&gt;(require 'anything-config)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;;;;; Find&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;(defun hohe2-register-c-source-find (config-symbol title-name find-dir min-required-chars)&lt;br /&gt;  "Register a new find configuration"&lt;br /&gt;  (set config-symbol&lt;br /&gt;       (list&lt;br /&gt;        `(name . ,title-name)&lt;br /&gt;        `(candidates . (lambda ()&lt;br /&gt;                         (apply 'start-process "find-process" nil&lt;br /&gt;                                (list&lt;br /&gt;                                 "find"&lt;br /&gt;                                 ,find-dir&lt;br /&gt;                                 "-iname"&lt;br /&gt;                                 (concat "*" anything-pattern "*"))&lt;br /&gt;                                )))&lt;br /&gt;        '(type . findfile)&lt;br /&gt;        `(requires-pattern . ,min-required-chars)&lt;br /&gt;        '(delayed))&lt;br /&gt;       )&lt;br /&gt;  )&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;(defun hohe2-anything-html-open-method (c)&lt;br /&gt;  (select-window (frame-selected-window (make-frame)))&lt;br /&gt;  (w3m-browse-url (concat "file://" c)))&lt;br /&gt;&lt;br /&gt;(defun hohe2-anything-default-open-method (c)&lt;br /&gt;  (let ((ext (file-name-extension c)))&lt;br /&gt;    (if ext&lt;br /&gt;        (if (member (downcase ext) '("html" "htm"))&lt;br /&gt;            (hohe2-anything-html-open-method c)&lt;br /&gt;          (find-file c)))))&lt;br /&gt;&lt;br /&gt;(add-to-list 'anything-type-attributes&lt;br /&gt;             '(findfile (action&lt;br /&gt;                         ("Default" . hohe2-anything-default-open-method)&lt;br /&gt;                         ("Browse other window" . (lambda (c)&lt;br /&gt;                                                    (hohe2-anything-html-open-method c)))&lt;br /&gt;                         ("Browse" . (lambda (c) (w3m-browse-url (concat "file://" c))))&lt;br /&gt;                         ("Browse with Firefox" . (lambda (c) (shell-command (concat "firefox file://" c))))&lt;br /&gt;                         ("Open as text" . find-file)&lt;br /&gt;                         )))&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;(provide 'hohe2-anything-find)&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-5076625779487938561?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/5076625779487938561/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=5076625779487938561' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/5076625779487938561'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/5076625779487938561'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/06/recursive-directory-search.html' title='Recursive directory search configuration for anything.el'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-560708574832503439</id><published>2009-06-26T03:20:00.000-07:00</published><updated>2009-06-26T10:17:32.743-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tec'/><title type='text'>anything.el for Maya document (continued)</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_c-kJL128S60/SkSxHKeAY4I/AAAAAAAAAaQ/FrPH5Sk13Wo/s1600-h/Screenshot.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: right; cursor: pointer; width: 400px; height: 364px;" src="http://3.bp.blogspot.com/_c-kJL128S60/SkSxHKeAY4I/AAAAAAAAAaQ/FrPH5Sk13Wo/s400/Screenshot.png" alt="" id="BLOGGER_PHOTO_ID_5351596993850401666" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;For those who uses emacs for Maya programming :)&lt;br /&gt;&lt;br /&gt;Internally it uses "find". It is not limited to Maya documents. you can search for documents in any directory (and its sub directories recursively).&lt;br /&gt;&lt;br /&gt;Usage:&lt;br /&gt;Type META-; (I made a shortcut that searches only Maya API documents)&lt;br /&gt;&lt;a href="http://koichitamura.blogspot.com/2009/06/anythingel-for-maya-document-under.html"&gt;See the movie in another blog entry.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Installation:&lt;br /&gt;1) If you haven't installed anything.el install it.&lt;br /&gt;&lt;br /&gt;2) Install w3m web browser for Emacs. I just executed&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;sudo yum install w3m-el&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;3) Add hohe2-anything-find.el in any directory.&lt;br /&gt;&lt;br /&gt;4) Add this line to .emacs, (unless the directory path has been added already)&lt;br /&gt;&lt;pre name="code" class="python"&gt;&lt;br /&gt;(add-to-list 'load-path "path/to/directory")&lt;br /&gt;&lt;/pre&gt;5) Add the following script to your .emacs file. (Change the paths to the document directories).&lt;br /&gt;&lt;pre name="code" class="python"&gt;&lt;br /&gt;;;Additional anything config for Maya.&lt;br /&gt;(hohe2-register-c-source-find&lt;br /&gt;'hohe2-anything-c-source-find-mayaapi "Maya API"  "/usr/autodesk/maya/docs/Maya8.5/en_US/API" 2)&lt;br /&gt;&lt;br /&gt;(hohe2-register-c-source-find&lt;br /&gt;'hohe2-anything-c-source-find-mayamel "Maya MEL" "/usr/autodesk/maya/docs/Maya8.5/en_US/Commands" 2)&lt;br /&gt;&lt;br /&gt;(hohe2-register-c-source-find&lt;br /&gt;'hohe2-anything-c-source-find-mayapython "Maya Python" "/usr/autodesk/maya/docs/Maya8.5/en_US/CommandsPython" 2)&lt;br /&gt;&lt;br /&gt;(hohe2-register-c-source-find&lt;br /&gt;'hohe2-anything-c-source-find-mayanode "Maya Node" "/usr/autodesk/maya/docs/Maya8.5/en_US/Nodes" 2)&lt;br /&gt;&lt;br /&gt;(setq hohe2-anything-alternative-sources (list hohe2-anything-c-source-find-mayaapi&lt;br /&gt;                                    hohe2-anything-c-source-find-mayamel&lt;br /&gt;                                    hohe2-anything-c-source-find-mayapython&lt;br /&gt;                                    hohe2-anything-c-source-find-mayanode&lt;br /&gt;                                    ))&lt;br /&gt;&lt;br /&gt;(defun hohe2-anything-alternative ()&lt;br /&gt;(interactive)&lt;br /&gt;(anything hohe2-anything-alternative-sources);;)&lt;br /&gt;)&lt;br /&gt;(global-set-key (kbd "M-;") 'hohe2-anything-alternative)&lt;br /&gt;&lt;/pre&gt;6) Restart Emacs.&lt;br /&gt;&lt;br /&gt;7) Enjoy programming if it works.&lt;br /&gt;&lt;br /&gt;This is my development environment&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;2.6.29.4-167.fc11.i686.PAE #1 SMP Wed May 27 17:28:22 EDT 2009 i686 i686 i386 GNU/Linux&lt;br /&gt;Gnome 2.26.2&lt;br /&gt;GNU Emacs 22.3.1&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;No guarantee. Use it at your own risk.&lt;br /&gt;&lt;br /&gt;hohe2-anything-find.el&lt;br /&gt;&lt;pre name="code" class="python"&gt;&lt;br /&gt;(require 'w3m)&lt;br /&gt;(require 'anything-config)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;;;;; Find&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;(defun hohe2-register-c-source-find (config-symbol title-name find-dir min-required-chars)&lt;br /&gt;"Register a new find configuration"&lt;br /&gt;(set config-symbol&lt;br /&gt;(list&lt;br /&gt;`(name . ,title-name)&lt;br /&gt;`(candidates . (lambda ()&lt;br /&gt;              (apply 'start-process "find-process" nil&lt;br /&gt;                     (list&lt;br /&gt;                      "find"&lt;br /&gt;                      ,find-dir&lt;br /&gt;                      "-iname"&lt;br /&gt;                      (concat "*" anything-pattern "*"))&lt;br /&gt;                     )))&lt;br /&gt;'(type . findfile)&lt;br /&gt;`(requires-pattern . ,min-required-chars)&lt;br /&gt;'(delayed))&lt;br /&gt;)&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;(add-to-list 'anything-type-attributes&lt;br /&gt;  '(findfile (action&lt;br /&gt;              ("Browse other window" . (lambda (c)&lt;br /&gt;                                         (select-window (frame-selected-window (make-frame)))&lt;br /&gt;                                         (w3m-browse-url (concat "file://" c))))&lt;br /&gt;              ("Browse" . (lambda (c) (w3m-browse-url (concat "file://" c))))&lt;br /&gt;              ("Browse with Firefox" . (lambda (c) (shell-command (concat "firefox file://" c))))&lt;br /&gt;              ("Open as text" . find-file)&lt;br /&gt;              )))&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;(provide 'hohe2-anything-find)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Currently it assumes every document is HTML. I will modify the script so that it looks at the file extension to know how to open the file soon(er or later). If you modify part of the above code like this it opens the file as a text by default.&lt;br /&gt;June 28 added. &lt;a href="http://koichitamura.blogspot.com/2009/06/recursive-directory-search.html"&gt;Done&lt;/a&gt;.&lt;br /&gt;&lt;pre name="code" class="python"&gt;&lt;br /&gt;(add-to-list 'anything-type-attributes&lt;br /&gt;  '(findfile (action&lt;br /&gt;              ("Open as text" . find-file)&lt;br /&gt;              ("Browse other window" . (lambda (c)&lt;br /&gt;                                         (select-window (frame-selected-window (make-frame)))&lt;br /&gt;                                         (w3m-browse-url (concat "file://" c))))&lt;br /&gt;              ("Browse" . (lambda (c) (w3m-browse-url (concat "file://" c))))&lt;br /&gt;              ("Browse with Firefox" . (lambda (c) (shell-command (concat "firefox file://" c))))&lt;br /&gt;              )))&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-560708574832503439?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/560708574832503439/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=560708574832503439' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/560708574832503439'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/560708574832503439'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/06/anythingel-for-maya-document-continued.html' title='anything.el for Maya document (continued)'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_c-kJL128S60/SkSxHKeAY4I/AAAAAAAAAaQ/FrPH5Sk13Wo/s72-c/Screenshot.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-8463107156664789484</id><published>2009-06-25T12:55:00.000-07:00</published><updated>2009-06-25T14:00:18.281-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tec'/><title type='text'>anything.el for Maya document (under construction)</title><content type='html'>Currently making an &lt;a href="http://www.emacswiki.org/emacs/Anything"&gt;anything.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;el&lt;/span&gt;&lt;/span&gt;&lt;/a&gt; configuration for Maya document.&lt;br /&gt;&lt;br /&gt;&lt;object height="344" width="425"&gt;&lt;param name="movie" value="http://www.youtube.com/v/D9o1bw2BNDs&amp;amp;hl=en&amp;amp;fs=1"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;embed src="http://www.youtube.com/v/D9o1bw2BNDs&amp;amp;hl=en&amp;amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="344" width="425"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-8463107156664789484?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/8463107156664789484/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=8463107156664789484' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/8463107156664789484'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/8463107156664789484'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/06/anythingel-for-maya-document-under.html' title='anything.el for Maya document (under construction)'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-5076716341149288803</id><published>2009-06-24T06:14:00.000-07:00</published><updated>2009-06-24T08:53:30.849-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CG'/><title type='text'>Complementary Afterimage</title><content type='html'>You can see an example of complementary afterimage &lt;span style="font-size:100%;"&gt;&lt;a style="font-weight: bold;" href="http://www.olympus.co.jp/jp/event/wakuwaku/lesson/sample01.cfm"&gt;here&lt;/a&gt;&lt;/span&gt; (Stare at the black dot in the center of the image for 10 sec and move the mouse pointer over the image). This is a very good one.&lt;br /&gt;&lt;br /&gt;You can also find a lot of examples on youtube like this (keep looking at the center of the image)&lt;br /&gt;&lt;object height="344" width="425"&gt;&lt;param name="movie" value="http://www.youtube.com/v/KnPIH1bkqkM&amp;amp;hl=en&amp;amp;fs=1&amp;amp;"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;embed src="http://www.youtube.com/v/KnPIH1bkqkM&amp;amp;hl=en&amp;amp;fs=1&amp;amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="344" width="425"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;I was curious if I can "add" those fake colors just like others (e.g. red and green makes yellow).&lt;br /&gt;I made a simple test. I looked at cyan with my left eye and and magenta with my right for 10 seconds. Interestingly enough, I could see a yellow band in between two colors (red and green) when I looked at gray with my both eyes. Now I'm trying to make another test that makes clearer result which proves it, since the band was not easy to see and my preconception may have had it visible (and using left eye and right eye separately is not good for this test).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-5076716341149288803?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/5076716341149288803/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=5076716341149288803' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/5076716341149288803'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/5076716341149288803'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/06/complementary-afterimage.html' title='Complementary Afterimage'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-5853690386640078639</id><published>2009-06-22T04:09:00.000-07:00</published><updated>2009-06-22T04:29:00.694-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='offtopic'/><title type='text'>Sketch Furniture</title><content type='html'>Drawing a furniture in the air with a mocap marker attached finger and send the data to a 3d forming machine. Awesome!&lt;br /&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/WDn6dJvHkZ4&amp;hl=en&amp;fs=1&amp;"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/WDn6dJvHkZ4&amp;hl=en&amp;fs=1&amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-5853690386640078639?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/5853690386640078639/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=5853690386640078639' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/5853690386640078639'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/5853690386640078639'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/06/sketch-furniture.html' title='Sketch Furniture'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-5599751076598904757</id><published>2009-06-18T12:47:00.000-07:00</published><updated>2009-06-18T13:44:59.135-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CG'/><title type='text'>One way to control shader parameters</title><content type='html'>The basic idea is making a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;shader&lt;/span&gt; with which you can control the surface's reflection characteristics by editing its &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;BRDF&lt;/span&gt; in the GUI. Simple &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;BRDF&lt;/span&gt; has two parameters. By mapping the two parameters to the angle components &lt;span style="font-weight: bold;"&gt;theta&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;phi&lt;/span&gt; of a polar coordinate, and mapping the reflectance ratio (so not &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;BRDF&lt;/span&gt;, strictly speaking. I just used the term BRDF for explanation) to the &lt;span style="font-weight: bold;"&gt;r&lt;/span&gt; components of the polar coordinate, you can make a 3D shape that represents a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;BRDF&lt;/span&gt; (not &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;BRDF&lt;/span&gt; strictly ...)&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_c-kJL128S60/SjqZ9od0D3I/AAAAAAAAAZ4/GCEmEdd6zh8/s1600-h/expl.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 218px;" src="http://3.bp.blogspot.com/_c-kJL128S60/SjqZ9od0D3I/AAAAAAAAAZ4/GCEmEdd6zh8/s400/expl.jpg" alt="" id="BLOGGER_PHOTO_ID_5348756791569420146" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I made a test &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;shader&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;looooong&lt;/span&gt; time ago. The &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;shader&lt;/span&gt; is assigned to the sphere. By changing the shape of the cobra like surface you can you can control the reflection characteristics of the test &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;shader&lt;/span&gt;. It's a just a test so I shot rays from the origin to get &lt;span style="font-weight: bold;"&gt;r &lt;/span&gt;(length from the origin to the hit point) in side the surface &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;shader&lt;/span&gt;, still you can edit the reflection characteristics interactively and animate them if you like. The test shader uses surface color too. It'll be better to be able to store the shape data to the file so that we can separate reflection editing and using it.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_c-kJL128S60/SjqaD2IBmGI/AAAAAAAAAaI/142jVcki-cw/s1600-h/genShader2.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 193px;" src="http://1.bp.blogspot.com/_c-kJL128S60/SjqaD2IBmGI/AAAAAAAAAaI/142jVcki-cw/s400/genShader2.jpg" alt="" id="BLOGGER_PHOTO_ID_5348756898315343970" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_c-kJL128S60/SjqaA_kyCaI/AAAAAAAAAaA/j6wQ6m8lWb0/s1600-h/genShader.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 192px;" src="http://2.bp.blogspot.com/_c-kJL128S60/SjqaA_kyCaI/AAAAAAAAAaA/j6wQ6m8lWb0/s400/genShader.jpg" alt="" id="BLOGGER_PHOTO_ID_5348756849312270754" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The usage is limited of course. It is rather a simple reflection, it can control only parameters which are mapped to the surface but it's more intuitive, the user doesn't need to write a code.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-5599751076598904757?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/5599751076598904757/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=5599751076598904757' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/5599751076598904757'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/5599751076598904757'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/06/shader-that-represents-arbitrary-brdf.html' title='One way to control shader parameters'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_c-kJL128S60/SjqZ9od0D3I/AAAAAAAAAZ4/GCEmEdd6zh8/s72-c/expl.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-2294956038344350783</id><published>2009-06-15T23:29:00.001-07:00</published><updated>2009-06-15T23:36:53.213-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='other'/><title type='text'>My software development profile</title><content type='html'>Professional experience&lt;br /&gt;- Group based crowd simulator development.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- From concept design making to artist support&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- system API design/implementation&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Maya nodes for crowd control (mocap placement, Python expression node for crowd control etc.)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Maya hardware for preview&lt;br /&gt;- 3D reconstruction from images (interactive still image interpolation)&lt;br /&gt;- Procedural animation software&lt;br /&gt;- Tool development for artists&lt;br /&gt;&lt;br /&gt;And these are my private works (links to the blog entries)&lt;br /&gt;- &lt;a href="http://koichitamura.blogspot.com/2008/05/texppattrmapper.html"&gt;Maya node to map texture color/normal to arbitrary per particle attribute&lt;/a&gt;&lt;br /&gt;- &lt;a href="http://koichitamura.blogspot.com/2008/11/hair-plug-in.html"&gt;Maya command to generate and control curves&lt;/a&gt;&lt;br /&gt;- &lt;a href="http://koichitamura.blogspot.com/2008/06/shake-command-window-doc.html"&gt;Shake Command Window&lt;/a&gt;&lt;br /&gt;- &lt;a href="http://koichitamura.blogspot.com/2008/05/making-patch-for-boostpython-accepted.html"&gt;boost.python patch&lt;/a&gt;&lt;br /&gt;- &lt;a href="http://koichitamura.blogspot.com/2008/09/visual-programming.html"&gt;Visual programming framework (prototype)&lt;/a&gt;&lt;br /&gt;- &lt;a href="http://koichitamura.blogspot.com/2008/07/integrating-maya-and-shake-using-python.html"&gt;Shake and Maya functional integration&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-2294956038344350783?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/2294956038344350783/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=2294956038344350783' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/2294956038344350783'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/2294956038344350783'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/06/summary-of-koichi-tamura.html' title='My software development profile'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-7334075432812298826</id><published>2009-06-14T07:41:00.000-07:00</published><updated>2009-06-14T08:59:08.968-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CG'/><title type='text'>How Will Balloons Look That Lift Your House Up?</title><content type='html'>There's an interesting article about &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;Disney-Pixar's&lt;/span&gt; new movie &lt;a href="http://www.pixar.com/featurefilms/up/"&gt;Up&lt;/a&gt;.&lt;br /&gt;&lt;a href="http://www.ksbw.com/entertainment/19690582/detail.html"&gt;How Many Balloons Will Lift Your House Up?&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It says,&lt;br /&gt;&lt;span style="font-style: italic;"&gt;According to &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;Pixar&lt;/span&gt;, Carl's house in the film attains liftoff with about 20,000 balloons. But for the sake of realism, director Pete &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;Docter&lt;/span&gt; and his crew wanted to know how many balloons it would take in &lt;/span&gt;&lt;i style="font-style: italic;"&gt;real life&lt;/i&gt;&lt;span style="font-style: italic;"&gt; to make the scenario plausible, which came in at 20 million to 30 million.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I just wondered "what if there are 20 million balloons?", and tested it.&lt;br /&gt;Each balloon is r=10cm sphere and the house is 15m x 7.5m x 7.5m.&lt;br /&gt;(Click for bigger image)&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_c-kJL128S60/SjUMRTsDgPI/AAAAAAAAAZw/uGkFvCMuQDA/s1600-h/up.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 221px;" src="http://4.bp.blogspot.com/_c-kJL128S60/SjUMRTsDgPI/AAAAAAAAAZw/uGkFvCMuQDA/s400/up.jpg" alt="" id="BLOGGER_PHOTO_ID_5347193624054694130" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;Hmmm&lt;/span&gt;, I guess just 20000 balloons might possibly look better...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-7334075432812298826?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/7334075432812298826/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=7334075432812298826' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/7334075432812298826'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/7334075432812298826'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/06/up.html' title='How Will Balloons Look That Lift Your House Up?'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_c-kJL128S60/SjUMRTsDgPI/AAAAAAAAAZw/uGkFvCMuQDA/s72-c/up.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-5563916754600807709</id><published>2009-05-31T02:50:00.000-07:00</published><updated>2009-06-01T15:50:50.097-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>Python type createion</title><content type='html'>Now I'm looking at Python3.0 source code.&lt;br /&gt;&lt;pre name="code" class="python"&gt;&lt;br /&gt;PyTypeObject PyUnicode_Type = {&lt;br /&gt; PyVarObject_HEAD_INIT(&amp;amp;PyType_Type, 0)&lt;br /&gt; "str",              /* tp_name */&lt;br /&gt; sizeof(PyUnicodeObject),        /* tp_size */&lt;br /&gt; ...(snip)...&lt;br /&gt; &amp;amp;unicode_as_number,         /* tp_as_number */&lt;br /&gt; &amp;amp;unicode_as_sequence,       /* tp_as_sequence */&lt;br /&gt; &amp;amp;unicode_as_mapping,        /* tp_as_mapping */&lt;br /&gt; (hashfunc) unicode_hash,        /* tp_hash*/&lt;br /&gt; 0,                  /* tp_call*/&lt;br /&gt; (reprfunc) unicode_str,     /* tp_str */&lt;br /&gt; ...(snip)...&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This is a code snippet from Python3.01 unicode object implementation. tp_as_sequence is a behavior definition when the object is used as a sequence, tp_as_mapping is a behavior when used as a mapping object. unicode_as_sequence is defined like this.&lt;br /&gt;&lt;pre name="code" class="python"&gt;&lt;br /&gt;static PySequenceMethods unicode_as_sequence = {&lt;br /&gt; (lenfunc) unicode_length,       /* sq_length */&lt;br /&gt; PyUnicode_Concat,           /* sq_concat */&lt;br /&gt; (ssizeargfunc) unicode_repeat,  /* sq_repeat */&lt;br /&gt; (ssizeargfunc) unicode_getitem,     /* sq_item */&lt;br /&gt; 0,                  /* sq_slice */&lt;br /&gt; 0,                  /* sq_ass_item */&lt;br /&gt; 0,                  /* sq_ass_slice */&lt;br /&gt; PyUnicode_Contains,         /* sq_contains */&lt;br /&gt;};&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;unicode_repeat etc. are just a simple C function.&lt;br /&gt;&lt;br /&gt;Another code snippet taken from bool object implementation. bool is a subtype of int. It is specified by setting PyLong_Type(i.e. int) to tp_base entry.&lt;br /&gt;&lt;pre name="code" class="python"&gt;&lt;br /&gt;PyTypeObject PyBool_Type = {&lt;br /&gt;PyVarObject_HEAD_INIT(&amp;amp;PyType_Type, 0)&lt;br /&gt;"bool",&lt;br /&gt;     ...(snip)...&lt;br /&gt;&amp;amp;PyLong_Type,    /* tp_base */&lt;br /&gt;     ...(snip)...&lt;br /&gt;};&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Simple enough.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;(&lt;/span&gt;&lt;span style="font-size:78%;"&gt;Above code snippets are &lt;/span&gt;&lt;span style="font-size:78%;"&gt;&lt;a href="http://www.python.org/download/releases/3.0.1/license/"&gt;Python licensed&lt;/a&gt;)&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-5563916754600807709?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/5563916754600807709/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=5563916754600807709' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/5563916754600807709'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/5563916754600807709'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/05/python-type-createion.html' title='Python type createion'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-817345001252098145</id><published>2009-05-27T02:05:00.000-07:00</published><updated>2009-05-27T02:14:14.259-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='offtopic'/><title type='text'>robthebloke.org has died :(</title><content type='html'>&lt;a href="http://www.robthebloke.org/"&gt;Hey, what happened to him???!!!&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_c-kJL128S60/Sh0Dc0k_WbI/AAAAAAAAAZo/v__zL3GlhXw/s1600-h/Screenshot-2.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 256px;" src="http://2.bp.blogspot.com/_c-kJL128S60/Sh0Dc0k_WbI/AAAAAAAAAZo/v__zL3GlhXw/s400/Screenshot-2.png" alt="" id="BLOGGER_PHOTO_ID_5340428526816287154" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-817345001252098145?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/817345001252098145/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=817345001252098145' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/817345001252098145'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/817345001252098145'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/05/robtheblokeorg-has-died.html' title='robthebloke.org has died :('/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_c-kJL128S60/Sh0Dc0k_WbI/AAAAAAAAAZo/v__zL3GlhXw/s72-c/Screenshot-2.png' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-910751167779754125</id><published>2009-05-24T11:48:00.000-07:00</published><updated>2009-05-26T22:41:17.114-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Shake'/><title type='text'>NRiHook</title><content type='html'>I haven't added an entry for a while so this is just a copy&amp;paste from my hidden blog which tells you how to use Shake's NRiHook. This entry is just for telling you that I'm not dead ;)&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="python"&gt;&lt;br /&gt;class TamHook : public NRiHook&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;TamHook(NRiNode *hNode, const NRiName &amp;hName):NRiHook(hNode, hName){}&lt;br /&gt;virtual void notify (Event e, void *n);&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;void TamHook::notify(Event e, void *n)&lt;br /&gt;{&lt;br /&gt;NRiSys::error("TamHook::notify called.\n");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;TamHook* t;&lt;br /&gt;NRiNode* node = NRiNode::findNode("NRiScript1.foo");&lt;br /&gt;t = new TamHook(node, "tamtam");&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;You can see what has happened to "foo" by looking at the 'Event' object passed as an argument. Take care of memory management (Make sure you delete a hook which is not used any more) when you use it.&lt;br /&gt;&lt;br /&gt;I tried to show an working example from one of my plugins but it was way way too complicated to copy it here. Please let me know if you happen to be interested.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-910751167779754125?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/910751167779754125/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=910751167779754125' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/910751167779754125'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/910751167779754125'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/05/nrihook.html' title='NRiHook'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-6952726733108956859</id><published>2009-05-16T12:24:00.000-07:00</published><updated>2009-05-16T13:42:05.278-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tec'/><title type='text'>Emacs Lisp newbie</title><content type='html'>I studied (Emacs) Lisp a little bit and I got some concept of it.  'symbol' is one of them that fascinated me. It's like a Python variable, you can get its value by evaluating it, but it can also be stored in another symbol as a value. Interesting, isn't it?&lt;br /&gt;&lt;br /&gt;While studying Lisp, I found there were some which didn't sound natural to me. 1) Dynamic scope is confusing. 2) I don't like macro. Though I understand the necessity of it, it can let you write a counter intuitive code too easily just like C. 3) And there are too many special forms, which doesn't look elegant. Do we really need setq? Maybe Having set is enough, isn't it?. Lisp is so different between variants (*) so I don't know if they are specific to Emacs lisp or common to all lisps.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;(*)&lt;br /&gt;They are so different that some variants have lazy evaluation and others don't!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I don't like a symbol having two values, function and value. A function is not just a value in Emacs Lisp and Common Lisp. Language designers are quite careful so there must be a reason but I don't know why they have made such a decision. In Scheme a function is just a value, which is not at all different from other values such as integer or string. If this type of simplicity is what Scheme attaches importance to, I prefer Scheme to Emacs Lisp. Simplicity rocks!&lt;br /&gt;&lt;br /&gt;Now I can read the source code of basic Emacs major modes. But I'm still not good at writing a code yet (Is there a function in ELisp which is equivalent to range() in Python? I still don't know) I remember those days when I was a Python newbie.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);"&gt;If you are a Lisp master and notice I wrote something wrong please leave a comment.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-6952726733108956859?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/6952726733108956859/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=6952726733108956859' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/6952726733108956859'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/6952726733108956859'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/05/emacs-lisp-apprentice.html' title='Emacs Lisp newbie'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-5892362952863708120</id><published>2009-05-08T16:12:00.000-07:00</published><updated>2009-05-20T18:27:48.339-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>Python FizzBuzz oneliner</title><content type='html'>From a comment on &lt;a href="http://imranontech.com/2007/01/24/using-fizzbuzz-to-find-developers-who-grok-coding/"&gt;this blog&lt;/a&gt; via &lt;a href="http://d.hatena.ne.jp/gunyara-python/20070509"&gt;this blog&lt;/a&gt;&lt;br /&gt;&lt;pre name="code" class="python"&gt;&lt;br /&gt;for i in range(1,101):print"FizzBuzz"[i*i%3*4:8--i**4%5]or i&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This is mine (May, 17, 18 modified)&lt;br /&gt;&lt;pre name="code" class="python"&gt;&lt;br /&gt;print '\n'.join(['Fizz'*(not i%3) + 'Buzz'*(not i%5) or str(i) for i in range(1, 101)])&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I post this topic on a Python forum and a guy posted this, nice.&lt;br /&gt;&lt;pre name="code" class="python"&gt;&lt;br /&gt;for x in range(100): print x%3/2*'Fizz'+x%5/4*'Buzz' or x+1&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-5892362952863708120?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/5892362952863708120/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=5892362952863708120' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/5892362952863708120'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/5892362952863708120'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/05/python-fizzbuzz.html' title='Python FizzBuzz oneliner'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-1189120806992124319</id><published>2009-05-08T14:15:00.001-07:00</published><updated>2009-05-10T20:14:21.434-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>Passing more than 65536 arguments to a function</title><content type='html'>Creating a simple function with 4 arguments and it works.&lt;br /&gt;&lt;pre name="code" class="python"&gt;&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; cmd1 = 'def f('&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; cmd2 = cmd2[:-3]&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; cmd2 = 'print '&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; for i in range(0, 4):&lt;br /&gt;...     cmd1 += 'p' + str(i) + ', '&lt;br /&gt;...     cmd2 += 'p' + str(i) + ' + '&lt;br /&gt;...&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; cmd = cmd1[:-2] + "):" + cmd2[:-3]&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; cmd&lt;br /&gt;'def f(p0, p1, p2, p3):print p0 + p1 + p2 + p3'&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; exec cmd&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; f(1,1,1,1)&lt;br /&gt;4&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Let's discompile it.&lt;br /&gt;&lt;pre name="code" class="python"&gt;&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; dis.dis(f)&lt;br /&gt; 1           0 LOAD_FAST                0 (p0)&lt;br /&gt;             3 LOAD_FAST                1 (p1)&lt;br /&gt;             6 BINARY_ADD         &lt;br /&gt;             7 LOAD_FAST                2 (p2)&lt;br /&gt;            10 BINARY_ADD         &lt;br /&gt;            11 LOAD_FAST                3 (p3)&lt;br /&gt;            14 BINARY_ADD         &lt;br /&gt;            15 PRINT_ITEM         &lt;br /&gt;            16 PRINT_NEWLINE      &lt;br /&gt;            17 LOAD_CONST               0 (None)&lt;br /&gt;            20 RETURN_VALUE       &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The first number of each line is the address of the instruction(&lt;a href="http://docs.python.org/library/dis.html#module-dis"&gt;see this&lt;/a&gt;). You'll see LOAD_FAST takes three bytes, which means an argument is indexed in two bytes (LOAD_FAST instruction itself is one byte). So Python should be confused if we pass more than 65536 arguments. Let's create 100000 arguments and confuse it :p&lt;br /&gt;&lt;pre name="code" class="python"&gt;&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; cmd1 = 'def f('&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; cmd2 = 'print '&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; for i in range(0, 100000):&lt;br /&gt;...     cmd1 += 'p' + str(i) + ', '&lt;br /&gt;...     cmd2 += 'p' + str(i) + ' + '&lt;br /&gt;...&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; cmd = cmd1[:-2] + "):" + cmd2[:-3]&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; exec cmd&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; f(*(1,)*100000)&lt;br /&gt;100000&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Why did it work? It's me who is confused...&lt;br /&gt;&lt;pre name="code" class="python"&gt;&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; dis.dis(f)&lt;br /&gt; 1           0 LOAD_FAST                0 (p0)&lt;br /&gt;             3 LOAD_FAST                1 (p1)&lt;br /&gt;             6 BINARY_ADD         &lt;br /&gt;             7 LOAD_FAST                2 (p2)&lt;br /&gt;            10 BINARY_ADD         &lt;br /&gt;            11 LOAD_FAST                3 (p3)&lt;br /&gt;          ...&lt;br /&gt;          262135 LOAD_FAST            65534 (p65534)&lt;br /&gt;          262138 BINARY_ADD         &lt;br /&gt;          262139 LOAD_FAST            65535 (p65535)&lt;br /&gt;          262142 BINARY_ADD         &lt;br /&gt;          262143 EXTENDED_ARG             1&lt;br /&gt;          262146 LOAD_FAST            65536L (p65536)&lt;br /&gt;          262149 BINARY_ADD         &lt;br /&gt;          262150 EXTENDED_ARG             1&lt;br /&gt;          262153 LOAD_FAST            65537L (p65537)&lt;br /&gt;          262156 BINARY_ADD         &lt;br /&gt;          262157 EXTENDED_ARG             1&lt;br /&gt;          ...&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Whoa! Python is prepared for the mean test. So clever!&lt;br /&gt;&lt;br /&gt;May 11 added:&lt;br /&gt;EXTENDED_ARG n is an instruction to tell the interpreter that it should add n*65536 to the next LOAD_FAST argument.&lt;br /&gt;Related code snippet from &lt;a href="http://svn.python.org/view/python/tags/r26/Python/ceval.c?revision=66716&amp;view=markup"&gt;ceval.c&lt;/a&gt;&lt;br /&gt;&lt;pre name="code" class="cpp"&gt;&lt;br /&gt;  case EXTENDED_ARG:&lt;br /&gt;   opcode = NEXTOP();&lt;br /&gt;   oparg = oparg&lt;&lt;16 | NEXTARG();&lt;br /&gt;   goto dispatch_opcode;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-1189120806992124319?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/1189120806992124319/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=1189120806992124319' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/1189120806992124319'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/1189120806992124319'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/05/cmd1-def-f-cmd2-cmd2-3-cmd2-print-for-i.html' title='Passing more than 65536 arguments to a function'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-3890655540040058976</id><published>2009-05-05T19:01:00.001-07:00</published><updated>2009-05-05T19:07:27.635-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='offtopic'/><title type='text'>A wolf loves pork</title><content type='html'>Nice idea!&lt;br /&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/rmkLlVzUBn4&amp;hl=ja&amp;fs=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/rmkLlVzUBn4&amp;hl=ja&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-3890655540040058976?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/3890655540040058976/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=3890655540040058976' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/3890655540040058976'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/3890655540040058976'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/05/wolf-loves-pork.html' title='A wolf loves pork'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-1217719884268952308</id><published>2009-04-11T21:33:00.000-07:00</published><updated>2009-04-26T01:33:26.008-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>Virtualenv</title><content type='html'>If you cannot be the root, or system wide Python installation have a package which version is incompatible with the one you need, you can use &lt;a href="http://pypi.python.org/pypi/virtualenv"&gt;Virtualenv&lt;/a&gt;.&lt;br /&gt;By executing virtualenv.py with an arbitrary directory name, you can make a local Python environment, in which there is its own python executable and easy_install in the bin directory. When you install a package with the easy_install, it installs it to the lib/python2.5/site-packages. Of course you can still use the default python installation without being affected by whatever you have installed in your local virtual python.&lt;br /&gt;&lt;pre name="code" class="python"&gt;&lt;br /&gt;$ python virtualenv.py vpsandbox&lt;br /&gt;$ cd vpsandbox/&lt;br /&gt;$ bin/easy_install pylons&lt;br /&gt;$ bin/easy_install QuickWiki==0.1.6&lt;br /&gt;$ bin/paster make-config QuickWiki test.ini&lt;br /&gt;$ bin/paster setup-app test.ini&lt;br /&gt;$ bin/paster serve test.ini&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I haven't tried but I found distutils.cfg in lib/python2.5/distutils, it should be possible to make easy_install use any package repository as well as &lt;a href="http://pypi.python.org/pypi"&gt;PYPI&lt;/a&gt;(Python Package Index aka cheeseshop) by adding its URL in the file.&lt;br /&gt;&lt;pre name="code" class="python"&gt;&lt;br /&gt;$ cat ./lib/python2.5/distutils/distutils.cfg&lt;br /&gt;# This is a config file local to this virtualenv installation&lt;br /&gt;# You may include options that will be used by all distutils commands,&lt;br /&gt;# and by easy_install.  For instance:&lt;br /&gt;#&lt;br /&gt;#   [easy_install]&lt;br /&gt;#   find_links = http://mylocalsite&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;More on&lt;br /&gt;&lt;a href="http://wiki.pylonshq.com/display/pylonscookbook/Using+a+Virtualenv+Sandbox"&gt;http://wiki.pylonshq.com/display/pylonscookbook/Using+a+Virtualenv+Sandbox&lt;/a&gt;&lt;br /&gt;&lt;a href="http://pypi.python.org/pypi/virtualenv"&gt;http://pypi.python.org/pypi/virtualenv&lt;/a&gt;&lt;br /&gt;&lt;a href="http://blog.ianbicking.org/2007/10/10/workingenv-is-dead-long-live-virtualenv/"&gt;http://blog.ianbicking.org/2007/10/10/workingenv-is-dead-long-live-virtualenv/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Here is the sys.path in my virtualenv Python. I've installed pylons here so it's not a brand new virtual Python environment.&lt;br /&gt;&lt;pre name="code" class="python"&gt;&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; for p in sys.path:&lt;br /&gt;...     print p&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;/home/kotamura/vpsandbox/lib/python2.5/site-packages/setuptools-0.6c9-py2.5.egg&lt;br /&gt;/home/kotamura/vpsandbox/lib/python2.5/site-packages/Pylons-0.9.7-py2.5.egg&lt;br /&gt;/home/kotamura/vpsandbox/lib/python2.5/site-packages/Tempita-0.2-py2.5.egg&lt;br /&gt;/home/kotamura/vpsandbox/lib/python2.5/site-packages/WebTest-1.1-py2.5.egg&lt;br /&gt;/home/kotamura/vpsandbox/lib/python2.5/site-packages/WebError-0.10.1-py2.5.egg&lt;br /&gt;/home/kotamura/vpsandbox/lib/python2.5/site-packages/WebOb-0.9.6.1-py2.5.egg&lt;br /&gt;/home/kotamura/vpsandbox/lib/python2.5/site-packages/Mako-0.2.4-py2.5.egg&lt;br /&gt;/home/kotamura/vpsandbox/lib/python2.5/site-packages/nose-0.10.4-py2.5.egg&lt;br /&gt;/home/kotamura/vpsandbox/lib/python2.5/site-packages/decorator-3.0.0-py2.5.egg&lt;br /&gt;/home/kotamura/vpsandbox/lib/python2.5/site-packages/simplejson-2.0.8-py2.5-linux-x86_64.egg&lt;br /&gt;/home/kotamura/vpsandbox/lib/python2.5/site-packages/FormEncode-1.2.1-py2.5.egg&lt;br /&gt;/home/kotamura/vpsandbox/lib/python2.5/site-packages/PasteScript-1.7.3-py2.5.egg&lt;br /&gt;/home/kotamura/vpsandbox/lib/python2.5/site-packages/PasteDeploy-1.3.3-py2.5.egg&lt;br /&gt;/home/kotamura/vpsandbox/lib/python2.5/site-packages/Paste-1.7.2-py2.5.egg&lt;br /&gt;/home/kotamura/vpsandbox/lib/python2.5/site-packages/Beaker-1.3-py2.5.egg&lt;br /&gt;/home/kotamura/vpsandbox/lib/python2.5/site-packages/WebHelpers-0.6.4-py2.5.egg&lt;br /&gt;/home/kotamura/vpsandbox/lib/python2.5/site-packages/Routes-1.10.3-py2.5.egg&lt;br /&gt;/home/kotamura/vpsandbox/lib/python2.5/site-packages/Pygments-1.0-py2.5.egg&lt;br /&gt;/home/kotamura/vpsandbox/lib/python2.5/site-packages/QuickWiki-0.1.6-py2.5.egg&lt;br /&gt;/home/kotamura/vpsandbox/lib/python2.5/site-packages/docutils-0.4-py2.5.egg&lt;br /&gt;/home/kotamura/vpsandbox/lib/python2.5/site-packages/SQLAlchemy-0.5.3-py2.5.egg&lt;br /&gt;/home/kotamura/vpsandbox/lib64/python25.zip&lt;br /&gt;/home/kotamura/vpsandbox/lib64/python2.5&lt;br /&gt;/home/kotamura/vpsandbox/lib64/python2.5/plat-linux2&lt;br /&gt;/home/kotamura/vpsandbox/lib64/python2.5/lib-tk&lt;br /&gt;/home/kotamura/vpsandbox/lib64/python2.5/lib-dynload&lt;br /&gt;/usr/lib/python2.5&lt;br /&gt;/usr/lib64/python2.5&lt;br /&gt;/home/kotamura/vpsandbox/lib/python2.5/site-packages&lt;br /&gt;/usr/lib/python2.5/site-packages&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Info from an anonymous:&lt;br /&gt;You can run "source bin/activate" to change PATH env. etc.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-1217719884268952308?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/1217719884268952308/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=1217719884268952308' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/1217719884268952308'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/1217719884268952308'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/04/virtualenv.html' title='Virtualenv'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-3778233474967506851</id><published>2009-03-29T05:19:00.000-07:00</published><updated>2009-03-29T05:45:03.180-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='offtopic'/><title type='text'>Reading an article from bottom to top</title><content type='html'>This is what I often do to make my brain and imagination free from the idea of the article that the author tells as a *fact*.&lt;span class="wordlink"&gt; Since each article has its idea (otherwise it's a garbage), and in most cases it is written at the end, I can easily find the idea by just looking at the final part of the article and read the rest of the document thinking in what way &lt;/span&gt;&lt;span class="wordlink"&gt;the author is trying to convince the reader, not &lt;/span&gt;&lt;span class="wordlink"&gt;unquestioningly believing it&lt;/span&gt;&lt;span class="wordlink"&gt;. &lt;/span&gt; I do it not only when I see &lt;span class="wordlink"&gt;editorials, &lt;/span&gt;&lt;span class="wordlink"&gt;I do it whenever I feel "looks good but something is weird", or there are too many &lt;/span&gt;&lt;span class="wordlink"&gt;&lt;/span&gt;&lt;span class="wordlink"&gt;methods and everything looks fine by itself. &lt;/span&gt;&lt;span class="wordlink"&gt;&lt;/span&gt;&lt;span class="wordlink"&gt;&lt;/span&gt;&lt;span class="wordlink"&gt;&lt;/span&gt;&lt;span class="wordlink"&gt;I can take the idea, or ignore it, or modify it, or whatever.&lt;/span&gt;&lt;span class="wordlink"&gt;&lt;/span&gt;&lt;span class="wordlink"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-3778233474967506851?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/3778233474967506851/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=3778233474967506851' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/3778233474967506851'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/3778233474967506851'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/03/reading-article-from-bottom-to-top.html' title='Reading an article from bottom to top'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-1669202533826789821</id><published>2009-03-28T22:04:00.000-07:00</published><updated>2009-03-29T06:09:44.352-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='offtopic'/><title type='text'>Beests came to Japan</title><content type='html'>Theo Jansen's &lt;a href="http://www.google.com/search?q=strandbeest"&gt;strandbeests&lt;/a&gt; came to Japan!&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_c-kJL128S60/Sc8D5hIW8iI/AAAAAAAAAZI/amO2rC32MTM/s1600-h/090328_1604%7E01.JPG"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 320px; height: 240px;" src="http://2.bp.blogspot.com/_c-kJL128S60/Sc8D5hIW8iI/AAAAAAAAAZI/amO2rC32MTM/s400/090328_1604%7E01.JPG" alt="" id="BLOGGER_PHOTO_ID_5318473971628700194" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_c-kJL128S60/Sc8DzGycfxI/AAAAAAAAAZA/vsH3WdExa_I/s1600-h/090328_1549%7E01.JPG"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 240px; height: 320px;" src="http://2.bp.blogspot.com/_c-kJL128S60/Sc8DzGycfxI/AAAAAAAAAZA/vsH3WdExa_I/s400/090328_1549%7E01.JPG" alt="" id="BLOGGER_PHOTO_ID_5318473861478252306" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So beautiful.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_c-kJL128S60/Sc9woC4MkUI/AAAAAAAAAZY/yN9XMA3B84k/s1600-h/Screenshot-3.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 297px; height: 283px;" src="http://2.bp.blogspot.com/_c-kJL128S60/Sc9woC4MkUI/AAAAAAAAAZY/yN9XMA3B84k/s400/Screenshot-3.png" alt="" id="BLOGGER_PHOTO_ID_5318593518217498946" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Basic idea (proportions are not correct).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-1669202533826789821?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/1669202533826789821/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=1669202533826789821' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/1669202533826789821'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/1669202533826789821'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/03/beests-came-to-japan.html' title='Beests came to Japan'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_c-kJL128S60/Sc8D5hIW8iI/AAAAAAAAAZI/amO2rC32MTM/s72-c/090328_1604%7E01.JPG' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-9000320889642785814</id><published>2009-03-14T06:23:00.000-07:00</published><updated>2009-03-14T06:36:30.262-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Maya'/><title type='text'>Simulating Maya Animation Curve calculation in C</title><content type='html'>It's a super old program I made for one of my friend.&lt;br /&gt;&lt;pre name="code" class="cpp"&gt;&lt;br /&gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;&lt;br /&gt;int main(){&lt;br /&gt;&lt;br /&gt; double x1, x2, x3, x4;&lt;br /&gt; double y1, y2, y3, y4;&lt;br /&gt; double t1x, t1y, t2x, t2y;&lt;br /&gt; double scale;&lt;br /&gt; double t, x, y;&lt;br /&gt; double ax, bx, cx, dx;&lt;br /&gt; double ay, by, cy, dy;&lt;br /&gt;&lt;br /&gt; printf("Input start point and end point(P1, P4)\n");&lt;br /&gt; scanf("%lf %lf %lf %lf", &amp;amp;x1, &amp;amp;y1, &amp;amp;x4, &amp;amp;y4);&lt;br /&gt; printf("P1 = (%lf, %lf), P4 = (%lf, %lf)\n",&lt;br /&gt;   x1, y1, x4, y4);&lt;br /&gt;&lt;br /&gt; //Input P1's keyTangent -q -ox, keyTangent -q -oy and&lt;br /&gt; //P4's keyTangent -q -ix, keyTangent -q -iy values.&lt;br /&gt; printf("Input outTangent of P1 and inTangent of P4\n");&lt;br /&gt; scanf("%lf %lf %lf %lf", &amp;amp;t1x, &amp;amp;t1y, &amp;amp;t2x, &amp;amp;t2y);&lt;br /&gt; printf("P1outTan = (%lf, %lf), P4inTan = (%lf, %lf)\n",&lt;br /&gt;   t1x, t1y, t2x, t2y);&lt;br /&gt;&lt;br /&gt; //move x2 to the deviding point 1:3 between the start and end.&lt;br /&gt; x2 = x1 + (x4 - x1) / 3;&lt;br /&gt; &lt;br /&gt; //Change y2 to adjust the tangent.&lt;br /&gt; scale = (x2 - x1) / t1x;&lt;br /&gt; y2 = y1 + t1y * scale;&lt;br /&gt;&lt;br /&gt; //move x3 to the deviding point 2:3 between the start and end.&lt;br /&gt; x3 = x4 - (x4 - x1) / 3;&lt;br /&gt; //Change y3 to adjust the tangent.&lt;br /&gt; scale = (x4 - x3) / t2x;&lt;br /&gt; y3 = y4 - t2y * scale;&lt;br /&gt;&lt;br /&gt; while(1){&lt;br /&gt;  printf("Input curve parameter: ");&lt;br /&gt;  scanf("%lf", &amp;amp;t);&lt;br /&gt;&lt;br /&gt;  ax = - 1 * x1 + 3 * x2 - 3 * x3 + 1 * x4;&lt;br /&gt;  bx =   3 * x1 - 6 * x2 + 3 * x3 + 0 * x4;&lt;br /&gt;  cx = - 3 * x1 + 3 * x2 + 0 * x3 + 0 * x4;&lt;br /&gt;  dx =   1 * x1 + 0 * x2 - 0 * x3 + 0 * x4;&lt;br /&gt;&lt;br /&gt;  ay = - 1 * y1 + 3 * y2 - 3 * y3 + 1 * y4;&lt;br /&gt;  by =   3 * y1 - 6 * y2 + 3 * y3 + 0 * y4;&lt;br /&gt;  cy = - 3 * y1 + 3 * y2 + 0 * y3 + 0 * y4;&lt;br /&gt;  dy =   1 * y1 + 0 * y2 - 0 * y3 + 0 * y4;&lt;br /&gt;  &lt;br /&gt;  x = ax * t*t*t + bx * t*t + cx * t + dx;&lt;br /&gt;  y = ay * t*t*t + by * t*t + cy * t + dy;&lt;br /&gt;&lt;br /&gt;  printf("x = %lf, y = %lf\n", x, y);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; return 0;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;----------------Test MEL Script----------------&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="cpp"&gt;&lt;br /&gt;//Set the unit to cm and second in Window-&gt;Settings/Preferences-&gt;Preferences&lt;br /&gt;//before runnning the MEL script.&lt;br /&gt;&lt;br /&gt;sphere;&lt;br /&gt;currentTime 0;&lt;br /&gt;setAttr "nurbsSphere1.tx" 0;&lt;br /&gt;setKeyframe "nurbsSphere1.tx";&lt;br /&gt;currentTime 1;&lt;br /&gt;setKeyframe "nurbsSphere1.tx";&lt;br /&gt;keyTangent -e -a -t 0 -outAngle 89.035812 -outWeight 1 nurbsSphere1_translateX ;&lt;br /&gt;keyTangent -e -a -t 1 -inAngle 85.969596 -inWeight 1 nurbsSphere1_translateX ;&lt;br /&gt;&lt;br /&gt;print "---tangents---\n";&lt;br /&gt;selectKey -r -k -t 0 nurbsSphere1_translateX ;&lt;br /&gt;print `keyTangent -q -ox`;&lt;br /&gt;print `keyTangent -q -oy`;&lt;br /&gt;selectKey -r -k -t 1 nurbsSphere1_translateX ;&lt;br /&gt;print `keyTangent -q -ox`;&lt;br /&gt;print `keyTangent -q -oy`;&lt;br /&gt;print "---data---\n";&lt;br /&gt;float $i;&lt;br /&gt;for ($i = 0; $i &amp;lt;1.01; $i += 0.2){&lt;br /&gt;   currentTime $i;&lt;br /&gt;   print ( `currentTime -q`+ ": " + `getAttr "nurbsSphere1.tx"` + "\n");&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;----------------Result----------------&lt;br /&gt;[Maya]&lt;br /&gt;&lt;br /&gt;---tangents---&lt;br /&gt;0.016827&lt;br /&gt;0.999858&lt;br /&gt;0.070286&lt;br /&gt;0.997527&lt;br /&gt;---data---&lt;br /&gt;0: 0&lt;br /&gt;0.2: 7.151379024&lt;br /&gt;0.4: 7.193755345&lt;br /&gt;0.6: 3.660442155&lt;br /&gt;0.8: 0.08475264279&lt;br /&gt;1: 0&lt;br /&gt;&lt;br /&gt;[program]&lt;br /&gt;&lt;br /&gt;Input start point and end point(P1, P4)&lt;br /&gt;0 0 1 0&lt;br /&gt;P1 = (0.000000, 0.000000), P4 = (1.000000, 0.000000)&lt;br /&gt;Input outTangent of P1 and inTangent of P4&lt;br /&gt;0.016827 0.999858 0.070286 0.997527&lt;br /&gt;P1outTan = (0.016827, 0.999858), P4inTan = (0.070286, 0.997527)&lt;br /&gt;Input curve parameter: 0.0&lt;br /&gt;x = 0.000000, y = 0.000000&lt;br /&gt;Input curve parameter: 0.2&lt;br /&gt;x = 0.200000, y = 7.151585&lt;br /&gt;Input curve parameter: 0.4&lt;br /&gt;x = 0.400000, y = 7.193990&lt;br /&gt;Input curve parameter: 0.6&lt;br /&gt;x = 0.600000, y = 3.660601&lt;br /&gt;Input curve parameter: 0.8&lt;br /&gt;x = 0.800000, y = 0.084808&lt;br /&gt;Input curve parameter: 1.0&lt;br /&gt;x = 1.000000, y = -0.000000&lt;br /&gt;Input curve parameter:&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-9000320889642785814?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/9000320889642785814/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=9000320889642785814' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/9000320889642785814'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/9000320889642785814'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/03/reconstructing-maya-animation-curve.html' title='Simulating Maya Animation Curve calculation in C'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823133891942040386.post-6303671263256505527</id><published>2009-03-11T16:41:00.000-07:00</published><updated>2009-03-11T17:04:41.907-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>Slice object and Ellipsis</title><content type='html'>&lt;pre name="code" class="python"&gt;&lt;br /&gt;&gt;&gt;&gt; class Array(list):&lt;br /&gt;...     def __getitem__(self, key):&lt;br /&gt;...             print "key:", key, type(key)&lt;br /&gt;...     def __getslice__(self, i, j):&lt;br /&gt;...             print "ij", i, j&lt;br /&gt;...&lt;br /&gt;&gt;&gt;&gt; a = Array(range(10))&lt;br /&gt;&gt;&gt;&gt; a[0]&lt;br /&gt;key: 0 &amp;lt;type int=""&amp;gt;&lt;br /&gt;&gt;&gt;&gt; a[0:5]&lt;br /&gt;ij 0 5&lt;br /&gt;&gt;&gt;&gt; a[0, 1, 2]&lt;br /&gt;key: (0, 1, 2) &amp;lt;type tuple=""&amp;gt;&lt;br /&gt;&gt;&gt;&gt; a[0:6:2]&lt;br /&gt;key: slice(0, 6, 2) &amp;lt;type 'slice'&amp;gt;&lt;br /&gt;&gt;&gt;&gt; a[0:1, 3:4]&lt;br /&gt;key: (slice(0, 1, None), slice(3, 4, None)) &amp;lt;type 'tuple'&amp;gt;&lt;br /&gt;&gt;&gt;&gt; slice(1,3), type(slice(1,3))&lt;br /&gt;(slice(1, 3, None), &amp;lt;type 'slice'&amp;gt;)&lt;br /&gt;&gt;&gt;&gt; a[0, ..., 5]&lt;br /&gt;key: (0, Ellipsis, 5) &amp;lt;type tuple=""&amp;gt;&lt;br /&gt;&gt;&gt;&gt; Ellipsis, type(Ellipsis)&lt;br /&gt;(Ellipsis, &amp;lt;type 'ellipsis'&amp;gt;)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;hmmm...&lt;br /&gt;(to be updated)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823133891942040386-6303671263256505527?l=koichitamura.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://koichitamura.blogspot.com/feeds/6303671263256505527/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823133891942040386&amp;postID=6303671263256505527' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/6303671263256505527'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823133891942040386/posts/default/6303671263256505527'/><link rel='alternate' type='text/html' href='http://koichitamura.blogspot.com/2009/03/ellipsis.html' title='Slice object and Ellipsis'/><author><name>hohehohe2 [at] gmail.com</name><uri>http://www.blogger.com/profile/03759348601978839903</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
