<?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-8272723058145483540</id><updated>2011-11-28T02:34:35.926-08:00</updated><category term='linux'/><category term='DRAC'/><category term='install'/><category term='Python'/><category term='Cython'/><category term='console'/><category term='ffi'/><category term='SWIG'/><category term='ctypes'/><category term='numpy'/><category term='init'/><category term='python extension'/><category term='parallel port'/><category term='gentoo'/><category term='jenkins'/><category term='optimization'/><category term='Dell'/><category term='python module'/><category term='performance'/><title type='text'>Pythonic Wisdom</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://pythonic-wisdom.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8272723058145483540/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://pythonic-wisdom.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Dima Tisnek</name><uri>http://www.blogger.com/profile/02596502493502644800</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_rAnU7ajL6X0/TAX_YkAKXwI/AAAAAAAAAAM/AwVQyLy70qU/S220/cat.jpeg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>18</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8272723058145483540.post-5640491431166551287</id><published>2011-11-28T00:49:00.000-08:00</published><updated>2011-11-28T02:34:26.802-08:00</updated><title type='text'>Best flash file system</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;A while ago I wanted to get most theoretical flash lifespan out of the following stack&lt;br /&gt;&lt;br /&gt;app / sqlite / file system / linux / consumer flash&lt;br /&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Flash_memory#Block_erasure"&gt;Background&lt;/a&gt; here, to summarize, writes smaller than erase page size put just as much strain on the flash as exactly one erase page. Typical erase page size for 1GB~4GB consumer flash is 64KB or 128KB.&lt;br /&gt;&lt;br /&gt;Modern flashes implement some form of wear leveling, yet no consumer flash manufacturer specifies what algorithm they use or whether it works over entire flash or several logical blocks of flash. Some specs are available for industrial flashes, but those are pricey and, it seems, fall behind times, that is consumer flash cards are built on newer tech and ought to yield better results. &lt;br /&gt;&lt;br /&gt;The app was modified to (read -- compare -- write if needed) in transaction, and to request possible changes in batches, thus removing unnecessary writes and combining multiple small changes into fewer larger writes.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://sqlite.org/"&gt;SQLite&lt;/a&gt; is&amp;nbsp; a practical necessity, I want transaction safety as a guarantee of logical data consistency. SQLite has options though, these were tested. A 100 byte row takes 1KB in the database, the difference is comprised of indices, data structures and metadata.&lt;br /&gt;&lt;br /&gt;Linux offers many file systems, some more developed than others, yet most were made for hard disk storage. As my type of flash is seen as a block block device to the system, I cannot use dedicated flash file systems anyway.&lt;br /&gt;&lt;br /&gt;Result key:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;test1: update 1000 records 100 at a time&lt;/li&gt;&lt;li&gt;test2: save 1000 records 1 at a time, delete 1000 records 1 at a time&lt;/li&gt;&lt;li&gt;--&lt;/li&gt;&lt;li&gt;total: total KB written&lt;/li&gt;&lt;li&gt;bins: 128KB-size erase blocks touched&lt;/li&gt;&lt;li&gt;worst: number of time most used erase sector overwritten&lt;/li&gt;&lt;li&gt;bins &amp;gt;90% worst: number of erase blocks overwritten &amp;gt;90% of worst&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;Raw results:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;sqlite std options&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; against ext3 std options&lt;/b&gt;&lt;br /&gt;total&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1288K, bins&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 15, worst&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11, bins &amp;gt;90% worst 3 # whitelist&lt;br /&gt;total&amp;nbsp; 106836K, bins&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 266, worst&amp;nbsp;&amp;nbsp; 2001, bins &amp;gt;90% worst 2 # offline&lt;/li&gt;&lt;li&gt;&lt;b&gt;sqlite page size 64K&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; against ext3 std options&lt;/b&gt;&lt;br /&gt;total&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7740K, bins&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 26, worst&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 14, bins &amp;gt;90% worst 2&lt;br /&gt;total 616132K, bins&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 267, worst&amp;nbsp;&amp;nbsp; 2046, bins &amp;gt;90% worst 4&lt;/li&gt;&lt;li&gt;&lt;b&gt;sqlite journal_mode persist&amp;nbsp; against ext3 std options&lt;/b&gt;&lt;br /&gt;total&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 992K, bins&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11, worst&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 21, bins &amp;gt;90% worst 1&lt;br /&gt;total&amp;nbsp; 48016K, bins&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 118, worst&amp;nbsp;&amp;nbsp; 4004, bins &amp;gt;90% worst 1&lt;/li&gt;&lt;li&gt;&lt;b&gt;sqlite synchronous off&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; against ext3 std options&amp;nbsp;&amp;nbsp;&amp;nbsp; (unsafe)&lt;/b&gt;&lt;br /&gt;total&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 292K, bins&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12, worst&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7, bins &amp;gt;90% worst 1&lt;br /&gt;total&amp;nbsp;&amp;nbsp;&amp;nbsp; 3748K, bins&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 25, worst&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 88, bins &amp;gt;90% worst 1&lt;/li&gt;&lt;li&gt;&lt;b&gt;sqlite write ahead logging&amp;nbsp;&amp;nbsp;&amp;nbsp; against ext3 std options&lt;/b&gt;&lt;br /&gt;total&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7740K, bins&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 26, worst&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11, bins &amp;gt;90% worst 4&lt;br /&gt;total 616100K, bins&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 267, worst&amp;nbsp;&amp;nbsp; 2046, bins &amp;gt;90% worst 4&lt;/li&gt;&lt;li&gt;--&lt;/li&gt;&lt;li&gt;&lt;b&gt;sqlite std ext3 std&lt;/b&gt; (repeated for comparison)&lt;br /&gt;total&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1288K, bins&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 15, worst&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11, bins &amp;gt;90% worst 3 # whitelist&lt;br /&gt;total&amp;nbsp; 106836K, bins&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 266, worst&amp;nbsp;&amp;nbsp; 2001, bins &amp;gt;90% worst 2 # offline&lt;/li&gt;&lt;li&gt;&lt;b&gt;sqlite std ext3 std noatime&lt;/b&gt;&lt;br /&gt;total&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1312K, bins&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 16, worst&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11, bins &amp;gt;90% worst 4&lt;br /&gt;total 106616K, bins&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 266, worst&amp;nbsp;&amp;nbsp; 2002, bins &amp;gt;90% worst 2&lt;/li&gt;&lt;li&gt;--&lt;/li&gt;&lt;li&gt;--&lt;/li&gt;&lt;li&gt;&lt;b&gt;sqlite best (std; persist)&lt;/b&gt;&lt;br /&gt;total&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1288K, bins&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 15, worst&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11, bins &amp;gt;90% worst 3 # std&lt;br /&gt;total&amp;nbsp; 106836K, bins&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 266, worst&amp;nbsp;&amp;nbsp; 2001, bins &amp;gt;90% worst 2&lt;br /&gt;total&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 992K, bins&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11, worst&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 21, bins &amp;gt;90% worst 1 # persist&lt;br /&gt;total&amp;nbsp; 48016K, bins&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 118, worst&amp;nbsp;&amp;nbsp; 4004, bins &amp;gt;90% worst 1&lt;/li&gt;&lt;li&gt;--&lt;/li&gt;&lt;li&gt;&lt;b&gt;sqlite std &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; against ext4 std options&lt;/b&gt;&lt;br /&gt;total&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1280K, bins&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 18, worst&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10, bins &amp;gt;90% worst 2&lt;br /&gt;total 106768K, bins&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 296, worst&amp;nbsp;&amp;nbsp; 2000, bins &amp;gt;90% worst 1&lt;/li&gt;&lt;li&gt;&lt;b&gt;sqlite std,pers &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; against ext4 ^journal&lt;/b&gt;&lt;br /&gt;total&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 904K, bins&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 14, worst&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 13, bins &amp;gt;90% worst 1 # std&lt;br /&gt;total&amp;nbsp;&amp;nbsp; 42996K, bins&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 23, worst&amp;nbsp;&amp;nbsp;&amp;nbsp; 2015, bins &amp;gt;90% worst 4&lt;br /&gt;total&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 820K, bins&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11, worst&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 20, bins &amp;gt;90% worst 1 # persist&lt;br /&gt;total &amp;nbsp; 34508K, bins&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7, worst&amp;nbsp;&amp;nbsp;&amp;nbsp; 4000, bins &amp;gt;90% worst 1&lt;/li&gt;&lt;li&gt;&lt;b&gt;sqlite std,pers,page&amp;nbsp;&amp;nbsp;&amp;nbsp; against ext4 stride 128K&lt;/b&gt;&lt;br /&gt;total&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1284K, bins&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 19, worst&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10, bins &amp;gt;90% worst 3 # std&lt;br /&gt;total 106852K, bins&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 266, worst&amp;nbsp;&amp;nbsp; 2000, bins &amp;gt;90% worst 1&lt;br /&gt;total&amp;nbsp;&amp;nbsp;&amp;nbsp; 1012K, bins&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12, worst&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 20, bins &amp;gt;90% worst 1 # persist&lt;br /&gt;total&amp;nbsp;&amp;nbsp; 58296K, bins&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 197, worst&amp;nbsp;&amp;nbsp; 4000, bins &amp;gt;90% worst 1&lt;br /&gt;total&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7648K, bins&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 29, worst&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11, bins &amp;gt;90% worst 2 # page size 64K&lt;br /&gt;total 600220K, bins&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 267, worst&amp;nbsp;&amp;nbsp; 2022, bins &amp;gt;90% worst 3&lt;/li&gt;&lt;li&gt;--&lt;/li&gt;&lt;li&gt;&lt;b&gt;sqlite std&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; against nilfs2&lt;/b&gt;&lt;br /&gt;total 319800K, bins&amp;nbsp;&amp;nbsp;&amp;nbsp; 2500, worst&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 20, bins &amp;gt;90% worst 1&lt;br /&gt;total 255528K, bins&amp;nbsp;&amp;nbsp;&amp;nbsp; 1998, worst&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 18, bins &amp;gt;90% worst 1 # nilfs2 ran out of disk space - it's gc bugs&lt;/li&gt;&lt;li&gt;&lt;b&gt;sqlite std, persist &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; against nilfs2 protection period 1 second, other tweaks&lt;/b&gt;&lt;br /&gt;total&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2308K, bins&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 21, worst&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3, bins &amp;gt;90% worst 1 #std&lt;br /&gt;total 319580K, bins&amp;nbsp;&amp;nbsp;&amp;nbsp; 2498, worst&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 20, bins &amp;gt;90% worst 1&lt;br /&gt;total&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2804K, bins&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 24, worst&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3, bins &amp;gt;90% worst 1&lt;br /&gt;total 166032K, bins&amp;nbsp;&amp;nbsp;&amp;nbsp; 1300, worst&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10, bins &amp;gt;90% worst 1 # incomplete nilfs2 crashed&lt;br /&gt;total&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2592K, bins&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 23, worst&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3, bins &amp;gt;90% worst 9&lt;br /&gt;total 707968K, bins&amp;nbsp;&amp;nbsp;&amp;nbsp; 5532, worst&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 27, bins &amp;gt;90% worst 1&lt;/li&gt;&lt;li&gt;&lt;b&gt;sqlite std&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; against btrfs std&lt;/b&gt;&lt;br /&gt;# too raw - ran out of space copying in static image and code&lt;/li&gt;&lt;li&gt;&lt;b&gt;sqlite std&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; against fuse-exfat&lt;/b&gt;&lt;br /&gt;total&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 116K, bins&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9, worst&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1, bins &amp;gt;90% worst 9&lt;br /&gt;# fuse evidently doesn't sync&lt;br /&gt;total&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 48K, bins&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5, worst&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1, bins &amp;gt;90% worst 5&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8272723058145483540-5640491431166551287?l=pythonic-wisdom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pythonic-wisdom.blogspot.com/feeds/5640491431166551287/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8272723058145483540&amp;postID=5640491431166551287' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8272723058145483540/posts/default/5640491431166551287'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8272723058145483540/posts/default/5640491431166551287'/><link rel='alternate' type='text/html' href='http://pythonic-wisdom.blogspot.com/2011/11/best-flash-file-system.html' title='Best flash file system'/><author><name>Dima Tisnek</name><uri>http://www.blogger.com/profile/02596502493502644800</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_rAnU7ajL6X0/TAX_YkAKXwI/AAAAAAAAAAM/AwVQyLy70qU/S220/cat.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8272723058145483540.post-2651868920923197119</id><published>2011-09-07T04:15:00.000-07:00</published><updated>2011-09-07T04:17:33.603-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jenkins'/><category scheme='http://www.blogger.com/atom/ns#' term='init'/><title type='text'>/etc/init.d/jenkins</title><content type='html'>&lt;pre&gt;&lt;br /&gt;#!/sbin/runscript&lt;br /&gt;&lt;br /&gt;depend() {&lt;br /&gt;        use net dns logger&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;checkconfig() {&lt;br /&gt;        return 0&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;start() {&lt;br /&gt;        checkconfig || return $?&lt;br /&gt;        ebegin "Starting jenkins"&lt;br /&gt;        start-stop-daemon --start --background --user dev --env JENKINS_HOME=/var/lib/jenkins \&lt;br /&gt;                --make-pidfile --pidfile /var/run/jenkins.pid \&lt;br /&gt;                --startas /usr/bin/java -- -jar /usr/share/jenkins.war --httpPort=8014 --prefix=/jenkins&lt;br /&gt;        eend $? "Failed to start jenkins"&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;stop() {&lt;br /&gt;        ebegin "Stopping jenkins"&lt;br /&gt;        start-stop-daemon --stop --background --user dev --env JENKINS_HOME=/var/lib/jenkins \&lt;br /&gt;                --make-pidfile --pidfile /var/run/jenkins.pid \&lt;br /&gt;                --startas /usr/bin/java -- -jar /usr/share/jenkins.war --httpPort=8014 --prefix=/jenkins&lt;br /&gt;        eend $? "Failed to stop jenkins"&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/8272723058145483540-2651868920923197119?l=pythonic-wisdom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pythonic-wisdom.blogspot.com/feeds/2651868920923197119/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8272723058145483540&amp;postID=2651868920923197119' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8272723058145483540/posts/default/2651868920923197119'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8272723058145483540/posts/default/2651868920923197119'/><link rel='alternate' type='text/html' href='http://pythonic-wisdom.blogspot.com/2011/09/etcinitdjenkins.html' title='/etc/init.d/jenkins'/><author><name>Dima Tisnek</name><uri>http://www.blogger.com/profile/02596502493502644800</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_rAnU7ajL6X0/TAX_YkAKXwI/AAAAAAAAAAM/AwVQyLy70qU/S220/cat.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8272723058145483540.post-2556749989250277760</id><published>2011-06-28T17:14:00.000-07:00</published><updated>2011-06-28T17:47:38.197-07:00</updated><title type='text'>What is Google SRE, a.k.a. google.com engineer?</title><content type='html'>&lt;p&gt;A few months ago I went to PyCon, Google had a booth and a riddle there. I was sort of looking at Google as a potential employer in Europe for a while prior to that, so I had a chat with two Google recruiters. Unfortunately neither of them could tell me much about their European offices, nevertheless it took off from there.&lt;/p&gt;&lt;p&gt;Unfortunately the more proactive recruiter was after new meat for SRE, he emailed:&lt;/p&gt;&lt;p&gt;"My name is &lt;span class="il"&gt;Xxx&lt;/span&gt; and I'm a recruiter at Google.  I support the Google.com Engineering Team."&lt;/p&gt;&lt;p&gt;I wondered what different positions at Google were for a while, so I already knew that "google.com engineer" equals "SRE" equals "site reliability engineer" equals lots of hacking and very little engineering. I have read about &lt;a href="http://research.google.com/pubs/archive/32583.pdf"&gt;reliability at google&lt;/a&gt; before, including a very insightful report on &lt;a href="http://labs.google.com/papers/disk_failures.pdf"&gt;hard drive reliability&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;From then on I had a few phone contacts, handed off to European recruiter, 3 phone interviews, and eventually an invitation for an on-site interview day at &lt;a href="http://en.wikipedia.org/wiki/Googleplex"&gt;GooglePlex&lt;/a&gt; in silicon valley. That was exciting!&lt;/p&gt;&lt;p&gt;Unfortunately the SRE tag stuck with me from the start and I was unable to shake it off. Everyone who interviewed me on the phone was an SRE, everyone who interviewed me on sitewas an SRE or former SRE. &lt;/p&gt;&lt;p&gt;Out of on-site interviews 1 was magnificent and all others sucked.&lt;/p&gt;&lt;p&gt;The great interview was conducted by a slightly older googler who had great command of algorithms and asked me a question that somehow my university never did. O(n) solution to a given problem was already discovered in the 70s, but somehow it was not in my curriculum even though many other similar problems were. Needless to say it was challenging. Also I think I didn't do so great, although I doubt I did awfully badly either.&lt;/p&gt;&lt;p&gt;The other interviewers were around my age and asked lame and redundant questions like "what's in an inode?" Lame because it's mostly trivia, redundant because I was asked that on the phone before. One SRE interviewer (on the phone), when asked to describe what working SRE was like, eventually gave up and told me "it's a job." I mean, really, if you are considering work for Google almighty, would ever take an offer of "a job?"&lt;/p&gt;&lt;p&gt;Coming back to the subject of this post, what is SRE position and what do SREs do? Basically SREs have to keep the crap that real engineers wrote running. They don't really code, they don't really do much engineering. Yet, they are more than server-rebooting-monkeys. And of course they have to make the tools to make their job easier. Plus they are sometimes on call, and if something breaks they have to repair it pretty fast. Yes they have to be on top of things, yes they have to be hackers at heart, and yes the job could be interesting.&lt;/p&gt;&lt;p&gt;Still I couldn't help but wonder -- do I want to create or merely help run other people's stuff?&lt;/p&gt;&lt;p&gt;Moreover I couldn't shake off the feeling that recruiters tried to suck me into the quagmire of SRE regardless of my real skills.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;So here comes advise:&lt;/p&gt;&lt;p&gt;If you are applying for Google and hear SRE, run.&lt;/p&gt;&lt;p&gt;Redo your resume and remove any references to hardware or server maintenance, that's a red flag that puts you in SRE category immediately.&lt;/p&gt;&lt;p&gt;Most importantly, think hard what you want to do.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Coming up, Brazil-esque vision of real google engineers and other things that sucked.&lt;/p&gt;&lt;p&gt;I would like to finish off on a positive note, I really really liked the full-height "barn" automatic bike doors buildings in Google campus are equipped with. It just warmed my heart to see that someone thought of that!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8272723058145483540-2556749989250277760?l=pythonic-wisdom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pythonic-wisdom.blogspot.com/feeds/2556749989250277760/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8272723058145483540&amp;postID=2556749989250277760' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8272723058145483540/posts/default/2556749989250277760'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8272723058145483540/posts/default/2556749989250277760'/><link rel='alternate' type='text/html' href='http://pythonic-wisdom.blogspot.com/2011/06/what-is-google-sre-aka-googlecom.html' title='What is Google SRE, a.k.a. google.com engineer?'/><author><name>Dima Tisnek</name><uri>http://www.blogger.com/profile/02596502493502644800</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_rAnU7ajL6X0/TAX_YkAKXwI/AAAAAAAAAAM/AwVQyLy70qU/S220/cat.jpeg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8272723058145483540.post-3249794500909491057</id><published>2011-03-19T19:07:00.000-07:00</published><updated>2011-03-19T20:32:46.196-07:00</updated><title type='text'>PyCon US 2011 review</title><content type='html'>&lt;span class="Apple-style-span"  style="font-size:large;"&gt;Overall&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:large;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:large;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;To be honest, I still have not made up my mind about the conference. There was a lot, some was great, some was not. And I drove to and from, 4 days each way, which was an experience on its own.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:large;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:large;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Atlanta turned out, quite unexpectedly, a very nice city, remarkably different from the rest of US of A, for one the streets are not laid out in a grid (although of course there are some) and with the help of my couch surfing host, we went to some really nice, authentic and interesting places to eat. Most important to note, a &lt;a href="http://www.hankooktaqueria.com/"&gt;Korean-flavoured taco place&lt;/a&gt;, the runner up is an &lt;a href="http://www.papisgrill.com/"&gt;authentic Cuban joint&lt;/a&gt;, that serves sandwiches, burgers and most importantly sucos, kind of like smoothies. Had I stayed in the hotel, as the conference recommended, I would have missed so much! Kudos to William of couch surfing in Atlanta!&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:large;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:large;"&gt;Tutorials&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;I picked only one tutorial, as I wanted to find out if tutorials were worth it. As such I picked the most appealing to me, on machine learning. First half was really good, perhaps just a tad too slow for me, as it allowed to go and refresh my classification concepts on Wikipedia, but when I tuned back in, I have already missed a little bit of the talk. Second half was a bit confused. The code examples didn't seem to complete in reasonable amount of time and it seems almost none tried to run them, talk was more on how it's done with this particular library and less on why it's done or why Python is involved at all. These were nice 3 hours, although to think that I shelled out 100 bucks for the tutorial, I expected more.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:large;"&gt;Keynotes&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;I missed the PSF chairman address, but was on time to see the 1st keynote, delivered by Hilary Mason. That was a downer. Sure, there was a kitten and a dubious, but fun, statistics on pycon web site. But there was no content, absolutely zip! It is as if the speaker was instructed to dumb down the address so that a complete stranger who walked in to the wrong hall would understand. After all she's not a bad speaker. And to think that I could have had breakfast instead!&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;"Chat with Guido" was more interesting. I wouldn't say it was super, as apparently Guido is not as concise in his speech as in his programs, but it was interesting nevertheless.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Sunday didn't seem to feature a speech deserving to be called Keynote. Threadless was interesting to listen to, the rest was entirely forgettable.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:large;"&gt;Talks&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Now that all is attended and done, very few talks come to mind. In all honesty, very few were memorable enough.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Friday started with a rather interesting and forcefully delivered talk "Getting the job," that focused on non-technical aspects of getting hired, in particular to a company that uses Python, loves open source and hiring is done by a regular manager. It emphasized social skills and left me with impression that a lot needs to improve in software companies.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;The other interesting talk was, remarkably "Javascript for Pythonistas." That should say something about a Python conference if one the more interesting talks focuses on a "competitor" language.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;I must have missed a couple of talks, as I went to talk to all the interesting companies at the startup row.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;I was really looking forward to Zed Shaw's talk on ZeroMQ on Saturday, based on his spectacular, stunning talk "&lt;a href="http://vimeo.com/2723800"&gt;ACL is dead&lt;/a&gt;", that includes part on "how to keep your soul" (in the industry). This time it was not as great, perhaps because the allotted time was significantly shorter.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Unfortunately I missed Augie Fackler's talk on choice of http libraries in Python. I have seen him prepare earlier and must have been a great talk, but I figured I'd check other talks first, becuase surely the beginning of his talk would be too basic. Well by the time I got there, all I heard was "that was it, do you have any questions?" He only used half his slot, and there were no questions. Or none that I remember. I can't wait for all the videos to appear online so that I can check it out.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Sunday was a total bummer. There were lightning talks in the morning, at least one of which was good, obligatory business-like talks and 3 time slots for normal tracked talks. First of these features a rather non-issue talk masterfully delivered by Raymond Hettinger, and the next 2 slots there was obsolutely nothing worth staying at the conference for. The half-day was concluded with more lightning talks, at least 2 of which stood out, I'll post links when videos show up, and introduction to sprints that was downer too. I should have realized this in advance and gone to see the city.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;And the ones that I mentioned were the good talks. More than once did I find myself bouncing between one room and next and back, just because there was nothing worth listening to!&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:large;"&gt;Goodies&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;PyCon featured a swag shop, ran by &lt;a href="http://www.companycasuals.com/elegantstitchesconway"&gt;Elegant Stitches&lt;/a&gt;, there were a couple of cool t-shirts, "flash wound" with a keyboard jammed in a broken monitor and a neat Python with an apple tee, perhaps referring to the tree of knowledge. Some swag was good, none was great. As with much tech swag, there was conspicuous lack of colours, women's cuts or even some sizes.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;There was also a book store, with hoards of books on Python and related subjects, what surprised me the most was that all books except for one (and I checked) had code examples in serif font, most as far as I remember didn't even bother to highlight the keywords. Some went as backwards as include screenshots of IDE. I could perhaps accept that in an old Fortran book published in the age of punch cards, but nowadays surely programming is done on a display with syntax highlighting and therefore programmer is accustomed to seeing her code in good sans-serif font, in colour, keywords in bold and perhaps comments marked in some way (though I'm strictly against italics and underlined text). Surely then modern programming books must adopt same convention! If printing in black and white saves money, sure, but the rest?&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:large;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:large;"&gt;In Conclusion&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Will I go again? Only if someone pays me to.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Should you go? Well that depends:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span"  style=" ;font-size:medium;"&gt;If you practiced Python for years, don't go, you won't learn anything.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span"  style=" ;font-size:medium;"&gt;If you are a student, it's too expensive, though if you get funding, go for it.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span"  style=" ;font-size:medium;"&gt;If you have many friends to meet at the conference, sure, go ahead.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8272723058145483540-3249794500909491057?l=pythonic-wisdom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pythonic-wisdom.blogspot.com/feeds/3249794500909491057/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8272723058145483540&amp;postID=3249794500909491057' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8272723058145483540/posts/default/3249794500909491057'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8272723058145483540/posts/default/3249794500909491057'/><link rel='alternate' type='text/html' href='http://pythonic-wisdom.blogspot.com/2011/03/pycon-us-2011-review.html' title='PyCon US 2011 review'/><author><name>Dima Tisnek</name><uri>http://www.blogger.com/profile/02596502493502644800</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_rAnU7ajL6X0/TAX_YkAKXwI/AAAAAAAAAAM/AwVQyLy70qU/S220/cat.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8272723058145483540.post-4044836752955684461</id><published>2011-02-02T15:21:00.000-08:00</published><updated>2011-02-02T15:31:03.435-08:00</updated><title type='text'>Going to PyCon</title><content type='html'>&lt;p&gt;PyCon 2011 will be held in Atlanta, GA, USA during March 9th~17th.&lt;/p&gt;&lt;p&gt;It's quite pricey though, at least if you pay yourself. Conference is 300 for early brids and tutorials are 100 each for same. Moreover the special hotel rate is 160 a night, what a ripoff!&lt;/p&gt;&lt;p&gt;It's probably a nice hotel and all, but if you read &lt;a href="http://www.tripadvisor.com/"&gt;Trip Advisor&lt;/a&gt;, some manage to stay in same hotel for 53 plus tax a night! I didn't book a hotel yet, but there's a bunch of cheaper options in the vicinity.&lt;/p&gt;&lt;p&gt;PyCon expects over a thousand attendees, so perhaps it is worthwhile to compare to &lt;a href="http://www.darrenbarefoot.com/archives/2009/03/how-much-does-running-a-big-tech-conference-cost.html"&gt;DrupalCon costs&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Anyhow, I'm going to make a Google calendar for the event because the PyCon's website leaves far to be desired, and I will surely post my impressions and more when I'm there!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8272723058145483540-4044836752955684461?l=pythonic-wisdom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pythonic-wisdom.blogspot.com/feeds/4044836752955684461/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8272723058145483540&amp;postID=4044836752955684461' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8272723058145483540/posts/default/4044836752955684461'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8272723058145483540/posts/default/4044836752955684461'/><link rel='alternate' type='text/html' href='http://pythonic-wisdom.blogspot.com/2011/02/going-to-pycon.html' title='Going to PyCon'/><author><name>Dima Tisnek</name><uri>http://www.blogger.com/profile/02596502493502644800</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_rAnU7ajL6X0/TAX_YkAKXwI/AAAAAAAAAAM/AwVQyLy70qU/S220/cat.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8272723058145483540.post-4480685807760370753</id><published>2010-12-20T15:29:00.000-08:00</published><updated>2010-12-20T15:39:45.543-08:00</updated><title type='text'>Google, cough up!</title><content type='html'>&lt;p&gt;Google spends several b on data centers every year (short scale), it neither reports how much exactly nor on what, nor what share of the cpu load is eaten by Python programs, yet we know big G definitely loves and uses Python.&lt;/p&gt;&lt;p&gt;If Python cpu consumption totaled a meager 10% of total, and some project improved Python's performance by a meager 1%, that alone would save Google several m a year.&lt;/p&gt;&lt;p&gt;Meanwhile PyPy, by far the most fertile modern python performance project, received eurostars grant E! 4791  "PyJIT" worth half an m that is supposed to last several years. ( http://www.eurostars-eureka.eu/search.do ) &lt;/p&gt;&lt;p&gt;Thus, Google, cough up!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8272723058145483540-4480685807760370753?l=pythonic-wisdom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pythonic-wisdom.blogspot.com/feeds/4480685807760370753/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8272723058145483540&amp;postID=4480685807760370753' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8272723058145483540/posts/default/4480685807760370753'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8272723058145483540/posts/default/4480685807760370753'/><link rel='alternate' type='text/html' href='http://pythonic-wisdom.blogspot.com/2010/12/google-cough-up.html' title='Google, cough up!'/><author><name>Dima Tisnek</name><uri>http://www.blogger.com/profile/02596502493502644800</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_rAnU7ajL6X0/TAX_YkAKXwI/AAAAAAAAAAM/AwVQyLy70qU/S220/cat.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8272723058145483540.post-2826347921906463771</id><published>2010-11-30T09:00:00.000-08:00</published><updated>2010-11-30T09:45:09.594-08:00</updated><title type='text'>Truly international Python</title><content type='html'>&lt;p&gt;Let's recall Guido's old Computer Programming for Everybody (CP4E) proposal.&lt;/p&gt;&lt;p&gt;Nowadays that Python is established, it's high time to push Python into education, especially first programming language education. I think, in the modern world it means pre-school.&lt;/p&gt;&lt;p&gt;Now the larger part of the world's children doesn't learn English before school, therefore we need to have truly localized Python.&lt;/p&gt;&lt;p&gt;Some might recall a Python derivative demo with unicode variable names (link anyone?).&lt;/p&gt;&lt;p&gt;I think we ought to go further. For example, consider imaginary language pig latin:&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;"""This does that"""  --&gt; """Thiso acto thato"""   # docstrings&lt;br /&gt;__version__ = (1,2,3) --&gt; __versio__ = (1,2,3)     # variable names&lt;br /&gt;import time           --&gt; importo chrono           # standard module names&lt;br /&gt;def foo(): pass       --&gt; defo foo(): passo        # Python keywords&lt;br /&gt;"foo".upper()         --&gt; "foo".uppero()           # standard library&lt;br /&gt;raise Xx("undefined") --&gt; raisio Xx("indifinito")  # errors&lt;br /&gt;#!/usr/bin/python     --&gt; #!/usr/bin/pythono       # executable name&lt;br /&gt;#!/usr/bin/python     --&gt; #!/usero/binaro/pythono  # name and path&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;Of course there are concerns for many languages:&lt;br /&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Each language needs to establish stable translations for keywords, basic types, standard modules, methods in standard modules, etc.&lt;/li&gt;&lt;li&gt;Some languages don't support word spaces natively&lt;/li&gt;&lt;li&gt;Some languages have different punctuation rules, e.g. comma for decimal point&lt;/li&gt;&lt;li&gt;Some languages use different quotes&lt;/li&gt;&lt;li&gt;RTL languages spell words RTL yet (some/all?) spell numbers LTR&lt;/li&gt;&lt;li&gt;Hopefully none has to recreate 10,000-separator system ;-)&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Anyhow, it's not the issue of core Python to support particular languages, what is needed is:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;the concept that this is needed, and&lt;/li&gt;&lt;li&gt;the base where from a particular localization can evolve from&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Here, a fun example, how Python might look like in google-translate-simplified-chinese. Blame google, not me as I know very little about this language.&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;"""This does that"""  --&gt; """这是"""           # docstrings&lt;br /&gt;__version__ = (1,2,3) --&gt; __版本__ = (1,2,3)   # variable names&lt;br /&gt;import time           --&gt; 进口 时间             # standard module names&lt;br /&gt;def foo(): pass       --&gt; 业 美孚（）： 通过     # Python keywords&lt;br /&gt;"foo".upper()         --&gt; “富” 上层（）         # standard library&lt;br /&gt;raise Xx("undefined") --&gt; 提高。二十（“未定义”） # errors&lt;br /&gt;#!/usr/bin/python     --&gt; #!/usr/bin/蛇        # executable name&lt;br /&gt;#!/usr/bin/python     --&gt; #!/用户/二进制/蛇      # name and path&lt;/pre&gt;&lt;p&gt;I track this here and will update with the received feedback:&lt;/p&gt;&lt;p&gt;http://pythonic-wisdom.blogspot.com/2010/11/truly-international-python.html&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8272723058145483540-2826347921906463771?l=pythonic-wisdom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pythonic-wisdom.blogspot.com/feeds/2826347921906463771/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8272723058145483540&amp;postID=2826347921906463771' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8272723058145483540/posts/default/2826347921906463771'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8272723058145483540/posts/default/2826347921906463771'/><link rel='alternate' type='text/html' href='http://pythonic-wisdom.blogspot.com/2010/11/truly-international-python.html' title='Truly international Python'/><author><name>Dima Tisnek</name><uri>http://www.blogger.com/profile/02596502493502644800</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_rAnU7ajL6X0/TAX_YkAKXwI/AAAAAAAAAAM/AwVQyLy70qU/S220/cat.jpeg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8272723058145483540.post-6032280343003971149</id><published>2010-11-29T18:09:00.000-08:00</published><updated>2011-02-02T15:20:25.315-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='performance'/><category scheme='http://www.blogger.com/atom/ns#' term='optimization'/><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>Literal name lookups</title><content type='html'>Todo and caveats&lt;br /&gt;&lt;p&gt;dictnotes.txt talks about sparse dictionaries for a different reason, check if spareseness is in fact implemented in the newest code.&lt;/p&gt;&lt;p&gt;tradeoff between memory (sparse dicts) and time (dense dicts) is not always obvious. perhaps some dicts could be targeted for extra sparseness live?&lt;br /&gt;&lt;/p&gt;&lt;p&gt;locals() is not really a dict since python 1.something.&lt;/p&gt;&lt;p&gt;python string object caches own hash value already, this could be improved though, rarely executed code could recompute hashes faster than it takes to load extra 4 or 8 bytes from memory and reduce cache pressure, there's probably little reason to store precomputed hash in pyc though.&lt;/p&gt;&lt;br /&gt;This post will track the status of my attempts to understand and hopefully optimize name lookups in python.&lt;br /&gt;&lt;br /&gt;Consider the following contrived example&lt;br /&gt;&lt;pre class="brush:python;"&gt;&lt;br /&gt;aglobal = ""&lt;br /&gt;&lt;br /&gt;def outer():&lt;br /&gt;def inner():&lt;br /&gt;alocal = 3&lt;br /&gt;li = [str(acomprehension) for acomprehension in range(aclosure+alocal)]&lt;br /&gt;return aglobal.join(li)&lt;br /&gt;aclosure = 5&lt;br /&gt;return inner()&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now, consider what name lookup happens inside invocation of inner():&lt;br /&gt;&lt;ul&gt;&lt;li&gt;alocal and acomprehension: locals() -&gt; hit&lt;br /&gt;&lt;/li&gt;&lt;li&gt;aclosure: locals() -&gt; miss, closure -&gt; hit&lt;/li&gt;&lt;li&gt;aglobal: locals()-&gt; miss, closure -&gt; miss, globals() -&gt; hit&lt;br /&gt;&lt;/li&gt;&lt;li&gt;str: locals() -&gt; miss, closure -&gt; miss, globals() -&gt; miss, builtins -&gt; hit&lt;/li&gt;&lt;/ul&gt;Now these namespaces are implemented internally as hashmaps, that might look like this:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:python;"&gt;&lt;br /&gt;# builtins hash table (using python syntax rather than C)&lt;br /&gt;idx = hash(name) % len(hashtable)&lt;br /&gt;hashtable = [&lt;br /&gt;[("int", {pointer to int})],              #&lt;br /&gt;[],                                       # some entries will be empty&lt;br /&gt;[("float", {pointer to float})],          #&lt;br /&gt;[("str", {pointer to str})],              # what we are looking for&lt;br /&gt;[("unicode", {ptr}), ("True", {ptr})]     # example collision&lt;br /&gt;]&lt;br /&gt;items = hashtable(idx)&lt;br /&gt;for item in items:&lt;br /&gt;if item[0] == name: return item[1]        # actual string comparison&lt;br /&gt;&lt;br /&gt;raise NameError("name '%s' is not defined" % name)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The larger the nesting (locals, number of closures, globals, builtins), the more important it become not to find a name in a hashtable, but to decide quickly that the name is not in the table.&lt;br /&gt;&lt;br /&gt;Therefore the intermediatory talbes be sparse like this:&lt;br /&gt;&lt;pre class="brush:python;"&gt;&lt;br /&gt;hashtable = [&lt;br /&gt;[("int", {pointer to int})],              #&lt;br /&gt;[],                                       # many entries will be empty&lt;br /&gt;[],                                       #&lt;br /&gt;[],                                       #&lt;br /&gt;[],                                       #&lt;br /&gt;[("float", {pointer to float})],          #&lt;br /&gt;[],                                       #&lt;br /&gt;[("str", {pointer to str})],              # what we are looking for&lt;br /&gt;[],                                       #&lt;br /&gt;[("unicode", {ptr})],                     #&lt;br /&gt;[],                                       #&lt;br /&gt;[],                                       #&lt;br /&gt;[("True", {ptr})]                         # no or few collision&lt;br /&gt;]&lt;/pre&gt;&lt;p&gt;Moreover hot hashtables (those that are looked up in frequently) should be instrumented with counters for hits, early misses, and late misses (requiring full string comparison).&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8272723058145483540-6032280343003971149?l=pythonic-wisdom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pythonic-wisdom.blogspot.com/feeds/6032280343003971149/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8272723058145483540&amp;postID=6032280343003971149' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8272723058145483540/posts/default/6032280343003971149'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8272723058145483540/posts/default/6032280343003971149'/><link rel='alternate' type='text/html' href='http://pythonic-wisdom.blogspot.com/2010/11/literal-name-lookups.html' title='Literal name lookups'/><author><name>Dima Tisnek</name><uri>http://www.blogger.com/profile/02596502493502644800</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_rAnU7ajL6X0/TAX_YkAKXwI/AAAAAAAAAAM/AwVQyLy70qU/S220/cat.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8272723058145483540.post-4409938389972485217</id><published>2010-06-07T03:46:00.000-07:00</published><updated>2010-06-07T03:55:46.700-07:00</updated><title type='text'>Wicked graphics!</title><content type='html'>&lt;ol&gt;&lt;li&gt;Circle inner radius 50, outer radius 51&lt;/li&gt;&lt;li&gt;Circle inner radius 50, outer radius 51.5&lt;/li&gt;&lt;/ol&gt;&lt;span onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_rAnU7ajL6X0/TAzOmIo3dxI/AAAAAAAAAAw/MWdHTv3m4qM/s1600/gfx-nobug-1.png"&gt;&lt;img style="cursor: pointer; width: 320px; height: 240px;" src="http://2.bp.blogspot.com/_rAnU7ajL6X0/TAzOmIo3dxI/AAAAAAAAAAw/MWdHTv3m4qM/s400/gfx-nobug-1.png" alt="" id="BLOGGER_PHOTO_ID_5479982001152292626" border="0" /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_rAnU7ajL6X0/TAzOwlO3o7I/AAAAAAAAAA4/_eXWpbuzC9Q/s1600/gfx-bug-1.png"&gt;&lt;img style="cursor: pointer; width: 320px; height: 240px;" src="http://4.bp.blogspot.com/_rAnU7ajL6X0/TAzOwlO3o7I/AAAAAAAAAA4/_eXWpbuzC9Q/s320/gfx-bug-1.png" alt="" id="BLOGGER_PHOTO_ID_5479982180626572210" border="0" /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;span onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_rAnU7ajL6X0/TAzOwlO3o7I/AAAAAAAAAA4/_eXWpbuzC9Q/s1600/gfx-bug-1.png"&gt;Wicked!&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8272723058145483540-4409938389972485217?l=pythonic-wisdom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pythonic-wisdom.blogspot.com/feeds/4409938389972485217/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8272723058145483540&amp;postID=4409938389972485217' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8272723058145483540/posts/default/4409938389972485217'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8272723058145483540/posts/default/4409938389972485217'/><link rel='alternate' type='text/html' href='http://pythonic-wisdom.blogspot.com/2010/06/wicked-graphics.html' title='Wicked graphics!'/><author><name>Dima Tisnek</name><uri>http://www.blogger.com/profile/02596502493502644800</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_rAnU7ajL6X0/TAX_YkAKXwI/AAAAAAAAAAM/AwVQyLy70qU/S220/cat.jpeg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_rAnU7ajL6X0/TAzOmIo3dxI/AAAAAAAAAAw/MWdHTv3m4qM/s72-c/gfx-nobug-1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8272723058145483540.post-3946878097195211481</id><published>2010-06-02T01:05:00.000-07:00</published><updated>2010-06-03T00:55:05.318-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SWIG'/><category scheme='http://www.blogger.com/atom/ns#' term='python module'/><category scheme='http://www.blogger.com/atom/ns#' term='Cython'/><category scheme='http://www.blogger.com/atom/ns#' term='ctypes'/><category scheme='http://www.blogger.com/atom/ns#' term='ffi'/><category scheme='http://www.blogger.com/atom/ns#' term='python extension'/><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><category scheme='http://www.blogger.com/atom/ns#' term='numpy'/><title type='text'>Cython, the new frontier</title><content type='html'>Learning to write in &lt;a href="http://cython.org/"&gt;Cython&lt;/a&gt;, a novel alternative to writing native python extensions in raw C.&lt;br /&gt;&lt;br /&gt;Stand by for updates...&lt;br /&gt;&lt;br /&gt;Meanwhile an overvire of the many ways to interface python with native programs and libraries:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;integrate through files, sockets, pipes or even mmap and shm&lt;/li&gt;&lt;li&gt;write &lt;a href="http://www.blogger.com/www.python.org/doc/ext/intro.html"&gt;extension in C&lt;/a&gt;&lt;/li&gt;&lt;li&gt;write extension in C and wrap it in Python module&lt;/li&gt;&lt;li&gt;write module in mix of C and Python and translate with Cython&lt;/li&gt;&lt;li&gt;use native library via &lt;a href="http://wiki.python.org/moin/ctypes"&gt;ctypes&lt;/a&gt;&lt;/li&gt;&lt;li&gt;use native library via ctypes and wrap in a Python module&lt;/li&gt;&lt;li&gt;generate wrappers with SWIG&lt;/li&gt;&lt;li&gt;write all in Python, numpy for performance&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;1&lt;sup&gt;st&lt;/sup&gt; is the easiest to start with, but doesn't offer tight control over native program's execution, such as timing, errors, feedback.&lt;br /&gt;&lt;br /&gt;2&lt;sup&gt;nd&lt;/sup&gt; and 3&lt;sup&gt;rd&lt;/sup&gt; are quite sane, and after a bit of learning even quite easy to debug. The advantage of a Python wrapper is to split the 2 parts of integration, the C and Python so that programming is the easiest.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8272723058145483540-3946878097195211481?l=pythonic-wisdom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pythonic-wisdom.blogspot.com/feeds/3946878097195211481/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8272723058145483540&amp;postID=3946878097195211481' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8272723058145483540/posts/default/3946878097195211481'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8272723058145483540/posts/default/3946878097195211481'/><link rel='alternate' type='text/html' href='http://pythonic-wisdom.blogspot.com/2010/06/cython-new-frontier.html' title='Cython, the new frontier'/><author><name>Dima Tisnek</name><uri>http://www.blogger.com/profile/02596502493502644800</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_rAnU7ajL6X0/TAX_YkAKXwI/AAAAAAAAAAM/AwVQyLy70qU/S220/cat.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8272723058145483540.post-6874780299668416401</id><published>2010-01-28T13:50:00.000-08:00</published><updated>2010-01-28T14:18:49.250-08:00</updated><title type='text'>PICs suck</title><content type='html'>I've been battling a little PIC for a couple weeks in my spare time...&lt;br /&gt;&lt;br /&gt;Why did I chose PIC over AVR? Now the question buffles me again. Truth be told, AVRs don't seem to frequent multiple serial ports on a small chip. The price of simplest PIC with 2 UARTS was twice less that of simplest AVR with 2 UARTS. That was basically why.&lt;br /&gt;&lt;br /&gt;However for the 2 USD I won having made the choice I seem to have to pay back in spades.&lt;br /&gt;&lt;br /&gt;Why could I think of AVR? The most important is the compiler. If the wise GNU people already spent almost 23 years writing it, why not use it? Indeed AVR is the right way. I thought a proper recommended compiler for PICs, the C18 could not be so bad. Not so.&lt;br /&gt;&lt;br /&gt;A quick example. I want to play with 2 serial ports, in C18 I have to use separate functions DataRdy1USART and DataRdy2USART to see if I'm getting something on the serial lines. Worse then, if I only had 1 serial port on a pic I'd have to use a third function, DataRdyUSART. Let alone the slightly abbreviated, two-thirds-camel-case-one-third-all-caps names, if I were to check the error state, I have to read from the uart, and then the crown jewel -- say I wanted to output a string of text, C18 library provides a function for that -- puts1USART (notice yet another capitalization scheme), which outputs a null-terminated string... including the null character!&lt;br /&gt;&lt;br /&gt;Then let's consider a function DisablePullups. A programmer would think a bit and start digging what its arguments might mean - which port? what pins? Alas! it only works on PORTB and on all pins at once.&lt;br /&gt;&lt;br /&gt;Someone said PICs have best documentation. Not quite so. I've encountered several mistakes and in the first PIC datasheet I ever worked with and it seems that trying to contact the documentation team is not as easy as it was made out to be. Through the powers of google, find in files, find in pdf, google again and the hordes of others who have trod this path before me I was able to resolve all the issues I had so far, but it took much precious time.&lt;br /&gt;&lt;br /&gt;I'm afraid these gotchas that got me are just the beginning, meanwhile the battle rages on...&lt;br /&gt;&lt;br /&gt;Next time I start with AVR and see where that leads me!&lt;br /&gt;&lt;br /&gt;P.S. PICs have many advatanges, easier access to multiple serial ports is just one of these. If you wanted CAN or Ethernet on cheap, AVR got just 1 practical model, PIC got many, and I bet these are just the beginning too.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8272723058145483540-6874780299668416401?l=pythonic-wisdom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pythonic-wisdom.blogspot.com/feeds/6874780299668416401/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8272723058145483540&amp;postID=6874780299668416401' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8272723058145483540/posts/default/6874780299668416401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8272723058145483540/posts/default/6874780299668416401'/><link rel='alternate' type='text/html' href='http://pythonic-wisdom.blogspot.com/2010/01/pics-suck.html' title='PICs suck'/><author><name>Dima Tisnek</name><uri>http://www.blogger.com/profile/02596502493502644800</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_rAnU7ajL6X0/TAX_YkAKXwI/AAAAAAAAAAM/AwVQyLy70qU/S220/cat.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8272723058145483540.post-7310398086401934316</id><published>2009-07-07T01:33:00.000-07:00</published><updated>2009-07-07T01:47:21.456-07:00</updated><title type='text'>USB HID with Linux and Python</title><content type='html'>I posted some working python code in python recipes section on activestate, here's link:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://code.activestate.com/recipes/576834/"&gt;http://code.activestate.com/recipes/576834/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I figured i post it now, because I haven't done any device-specific changes yet, and I'm about to.&lt;br /&gt;&lt;br /&gt;There is an enormous void of hiddev programming information out there... "in hiddev space none can hear you scream" kind of thing. There's some for usb hid event devices,  but none for hiddevN devices.&lt;br /&gt;&lt;br /&gt;If anyone wonders, the usb hid device I'm working on is made and sold by &lt;a href="http://delcomproducts.com/"&gt;Delcom Products&lt;/a&gt; (I have a strange feeling it used to be Delcome Engineering before). It looks like a good device, and when I get to the bottom of it I'll post more.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8272723058145483540-7310398086401934316?l=pythonic-wisdom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pythonic-wisdom.blogspot.com/feeds/7310398086401934316/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8272723058145483540&amp;postID=7310398086401934316' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8272723058145483540/posts/default/7310398086401934316'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8272723058145483540/posts/default/7310398086401934316'/><link rel='alternate' type='text/html' href='http://pythonic-wisdom.blogspot.com/2009/07/usb-hid-with-linux-and-python.html' title='USB HID with Linux and Python'/><author><name>Dima Tisnek</name><uri>http://www.blogger.com/profile/02596502493502644800</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_rAnU7ajL6X0/TAX_YkAKXwI/AAAAAAAAAAM/AwVQyLy70qU/S220/cat.jpeg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8272723058145483540.post-2904412203104528564</id><published>2009-05-26T01:40:00.000-07:00</published><updated>2009-05-26T02:08:57.954-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='install'/><category scheme='http://www.blogger.com/atom/ns#' term='gentoo'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Dell'/><category scheme='http://www.blogger.com/atom/ns#' term='DRAC'/><category scheme='http://www.blogger.com/atom/ns#' term='console'/><title type='text'>Battle of Mind with Dell DRAC</title><content type='html'>Dell's DRAC allows you to control your server through an ssh console or a web browser.&lt;br /&gt;&lt;br /&gt;At least in practice.&lt;br /&gt;&lt;br /&gt;In reality it goes more like this:&lt;br /&gt;1. Start with ssh, log in, look how cool it is, get confused...&lt;br /&gt;2. Try to find something on the internet...&lt;br /&gt;3. It's not quite there, but try again, go to step 2.&lt;br /&gt;4. Figure what the hell, it can't be so hard, but alas! you session timed out, to log in go to step 1.&lt;br /&gt;5. Consider thy art a hacker this lowly dell must kneel before thee, but alas! session timed out again, process to step 1.&lt;br /&gt;6. After a night's rest you find a few PDF's on Dell site (by great wizardry of Google, of course), and decide to check the browser access instead.&lt;br /&gt;7. Log in.&lt;br /&gt;8. Navigate to Media section and get thoroughly confused unable to make a distinction between Virtual Media and Virtual Flash. Besides it keeps bugging you to install something.&lt;br /&gt;9. Find another PDF on Dell's site (-"-) and get a clue: it's almost like vmware, except the server is real. somewhere in the dungeon of ISP.&lt;br /&gt;10. Install the extension for Virtual Media and alas! Firefox needs a restart.&lt;br /&gt;11. Restart and find out that your session is dead - go to step 7.&lt;br /&gt;12. Select your ISO image, and wait... what's wrong with that button, why is it still disabled?&lt;br /&gt;13. Use your grand hacker mad skillz and figure out that clicking around randomly might help.&lt;br /&gt;14. Try 13 again.&lt;br /&gt;15. And again.&lt;br /&gt;16. And again.&lt;br /&gt;17. Find out that the whole Virtual Media blob is disabled in Configuration.&lt;br /&gt;18. Re-enable, re-select file, a nice pop-up tells you now to tweak javasctipt (?) settings, nice! But what now?&lt;br /&gt;19. Proceed to Console, it wants you to install another extension...&lt;br /&gt;20. Install extension.&lt;br /&gt;21. Restart Firefox.&lt;br /&gt;22. Session is dead, go back to 7 again.&lt;br /&gt;23. Go to Console, all looks good, but where is the console?&lt;br /&gt;24. Click around randomly.&lt;br /&gt;25. Bah! Firefox died (2nd time already actually, but no matter)&lt;br /&gt;26. Start Firefox again, session is dead, back to step 7.&lt;br /&gt;27. Then by the virtue of true madness you see (if you are lucky that is) in the console that started Firefox errors like "blahblahblah not found"&lt;br /&gt;28. Run some find .mozilla -name blah, and discover that....&lt;br /&gt;29. The script that starts a standalone viewer program assumes that your profile is called "default."&lt;br /&gt;30. Restart Firefox in default profile, session dead, go to step 7.&lt;br /&gt;31. Install extension in default profile, restart Firefox, session dead go to step 7.&lt;br /&gt;32. A nice popup tells you how to tweak here-be-dragons settings in Firefox, nice!&lt;br /&gt;33. A console viewer shows up, telling you that operating system is not installed.&lt;br /&gt;34. Go to power, reset, really sure to reset, apply...&lt;br /&gt;35. Watch the console screen blink green for a while... and a while longer... and still a while... and whoa BIOS boots!&lt;br /&gt;36. See press F2 for BIOS config, nice screen, perhaps go to boot options?&lt;br /&gt;37. Oh horror! Arrow keys don't work!&lt;br /&gt;38. Muck around long.&lt;br /&gt;39. Google around even longer.&lt;br /&gt;40. No luck, try keypad arrow keys - salvation!&lt;br /&gt;41. Meanwhile browser session timed out, but now there's an overlay screen prompting you for a password, nice!&lt;br /&gt;42. Decide to check your RAID settings, arrow keys don't work and here, they don't support keyboard arrow keys anyway!&lt;br /&gt;43. Think&lt;br /&gt;44. Consider perhaps RAID settings are fine anyway...&lt;br /&gt;45. Press Escape to quit, get a pop-up [ok] [cancel] with cancel selected. To move to [ok] you need arrow keys...&lt;br /&gt;&lt;br /&gt;To Be Continued...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8272723058145483540-2904412203104528564?l=pythonic-wisdom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pythonic-wisdom.blogspot.com/feeds/2904412203104528564/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8272723058145483540&amp;postID=2904412203104528564' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8272723058145483540/posts/default/2904412203104528564'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8272723058145483540/posts/default/2904412203104528564'/><link rel='alternate' type='text/html' href='http://pythonic-wisdom.blogspot.com/2009/05/battle-of-mind-with-dell-drac.html' title='Battle of Mind with Dell DRAC'/><author><name>Dima Tisnek</name><uri>http://www.blogger.com/profile/02596502493502644800</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_rAnU7ajL6X0/TAX_YkAKXwI/AAAAAAAAAAM/AwVQyLy70qU/S220/cat.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8272723058145483540.post-2410714514513859703</id><published>2009-01-30T07:26:00.000-08:00</published><updated>2010-06-13T04:12:58.955-07:00</updated><title type='text'>Booting linux on eBox-3300 a.k.a. vortex86dx</title><content type='html'>Say you wanted to migrate from vortex86sx to vortex86dx. And there's a good reason to do so, you get floating point coprocessor and triple your cpu frequency. So you get yourself an eBox-3300 to replace your old eBox-2300SX. However it was not as easy as that.&lt;br /&gt;&lt;br /&gt;First, compactflash is now secondary ide controller, thus /dev/hdc1 instead of /dev/hda1. Furthermore even through the peripherals appear exactly the same, you suddenly get DMA timeouts. Apparently it812x driver for the embedded IT8212 controller is rather buggy and wants to select some DMA mode even if BIOS recommends PIO and even with the kernel patch from DM&amp;amp;P that worked just fine on vortex86sx.&lt;br /&gt;&lt;br /&gt;Thus here's a solution for all the hungry embedded linuxers out there.&lt;br /&gt;&lt;br /&gt;Go to BIOS, find IDE settings and set DMA to lowest (and slowest) possible value. It sounds like enabling DMA when you mean to disable it, however linux is smarter than you are and it will figure out that lowest level of DMA is worse than auto (and thus highest) level of PIO and happily choose PIO for you.&lt;br /&gt;&lt;br /&gt;That's all!&lt;br /&gt;&lt;br /&gt;Links:&lt;br /&gt;Vortex86SX and vortex86dx can be found here: &lt;a href="http://www.dmp.com.tw/"&gt;DM&amp;amp;P (Taiwan)&lt;/a&gt;&lt;br /&gt;EBox-3300 and eBox-2300SX can be found here: &lt;a href="http://www.compactpc.com.tw/ebox-3300.htm"&gt;CompactPC (related to DM&amp;amp;P)&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8272723058145483540-2410714514513859703?l=pythonic-wisdom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pythonic-wisdom.blogspot.com/feeds/2410714514513859703/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8272723058145483540&amp;postID=2410714514513859703' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8272723058145483540/posts/default/2410714514513859703'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8272723058145483540/posts/default/2410714514513859703'/><link rel='alternate' type='text/html' href='http://pythonic-wisdom.blogspot.com/2009/01/booting-linux-on-ebox-3300-aka.html' title='Booting linux on eBox-3300 a.k.a. vortex86dx'/><author><name>Dima Tisnek</name><uri>http://www.blogger.com/profile/02596502493502644800</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_rAnU7ajL6X0/TAX_YkAKXwI/AAAAAAAAAAM/AwVQyLy70qU/S220/cat.jpeg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8272723058145483540.post-3507411226457256437</id><published>2009-01-08T06:53:00.000-08:00</published><updated>2009-01-08T07:03:05.250-08:00</updated><title type='text'>Love Grease Mokey, Adopt a Fire Bug ;-)</title><content type='html'>Just now it took me about a minute to fix an annoying bit on RS Electronics website, namely the "family" selection box. Someone at RS had a great idea to limit the height of this box, which worked nicely as long as you are browsing a small product line, but when you get to the holy grail of component selection, connectors, you are presented with a list of 43 options, of which only the top two lines fit in the box height, thus you gotta scroll, and scroll a lot, because the these options are not grouped by pitch, so same pitch connectors happily live in several lines of the list, thus if you wanted to see all the options for 5.0 and 5.08 mm pitch you'd have to scroll up and down and up and down to get 3 lines of options through 2 lines of screen.&lt;br /&gt;&lt;br /&gt;Firebug: F12 to turn on, right click in the box to inspect element, check CSS of element and its parents for abnormal height restrictions.&lt;br /&gt;Google: greasemonkey add css, copy.&lt;br /&gt;Greasemonkey: add new script, asterixize the url, paste, enter class and property name, inherit.&lt;br /&gt;Reload.&lt;br /&gt;Done.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8272723058145483540-3507411226457256437?l=pythonic-wisdom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pythonic-wisdom.blogspot.com/feeds/3507411226457256437/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8272723058145483540&amp;postID=3507411226457256437' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8272723058145483540/posts/default/3507411226457256437'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8272723058145483540/posts/default/3507411226457256437'/><link rel='alternate' type='text/html' href='http://pythonic-wisdom.blogspot.com/2009/01/love-grease-mokey-adopt-fire-bug.html' title='Love Grease Mokey, Adopt a Fire Bug ;-)'/><author><name>Dima Tisnek</name><uri>http://www.blogger.com/profile/02596502493502644800</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_rAnU7ajL6X0/TAX_YkAKXwI/AAAAAAAAAAM/AwVQyLy70qU/S220/cat.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8272723058145483540.post-51778084910547347</id><published>2008-11-07T08:05:00.001-08:00</published><updated>2008-11-07T08:07:38.896-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='parallel port'/><title type='text'>Accessing Parallel Port on Linux from User Mode (2002)</title><content type='html'>&lt;pre&gt;there are two things you can do from userland -&lt;br /&gt;&lt;br /&gt;* access pc-style parallel port directly through inb/outb&lt;br /&gt;. works only on standard pc parallel port&lt;br /&gt;. most efficient (see below)&lt;br /&gt;. can only be done by root&lt;br /&gt;&lt;br /&gt;* access raw parallel port through ppdev (CONFIG_PPDEV)&lt;br /&gt;. needs ppdev in kernel&lt;br /&gt;. access control by normal file permissions (default root only)&lt;br /&gt;. can be somewhat slower&lt;br /&gt;&lt;br /&gt;* write a discipline driver, like lp&lt;br /&gt;. needs kernel module or patch&lt;br /&gt;. no real advantages over usermode&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;issues - speed:&lt;br /&gt;&lt;br /&gt;the standard x86 parallel port hardware is still used through inb/outb,&lt;br /&gt;whether you access it with inb/outb from usermode or you let kernel do it&lt;br /&gt;for you (through ppdev or parallel port discipline).&lt;br /&gt;&lt;br /&gt;inb and outb go though isa memory cycle (or are thes programmable&lt;br /&gt;instructions?), I don't understand this fully, anyway, the fact is that no&lt;br /&gt;matter how fast your cpu is, the time it takes to execute an inb or outb&lt;br /&gt;is the same. Basically you, are limited to 300,000 outb's a second (not&lt;br /&gt;sure about the exact number). No matter if it's 2.4 GHz P-4 or 100 MHz 486&lt;br /&gt;&lt;br /&gt;ppdev special:&lt;br /&gt;when you use ppdev you have to use two separate ioctl's - one to change&lt;br /&gt;data direction (in case of bidirectional port) and all other control&lt;br /&gt;lines/flags/etc, so if you need to change direction of data lines often,&lt;br /&gt;this might mean your bandwidth is cut in half :(&lt;br /&gt;&lt;br /&gt;irq special:&lt;br /&gt;there's a provision for the parallel port hardware to send an irq when&lt;br /&gt;status lines change (or some such), however you need to supply a module&lt;br /&gt;parameter or kernel argument to enable this (on legacy x86 port at least),&lt;br /&gt;because the logic that figures out the ioport apparantely doesn't dare to&lt;br /&gt;enable the interrupt&lt;br /&gt;&lt;br /&gt;thus if you want an interrupt it's same level of intrusiveness as&lt;br /&gt;requiring a kernel module. yuck.&lt;br /&gt;&lt;br /&gt;and without the interrupt you are destined to poll the parallel port&lt;br /&gt;status. polling is a problem in it's own, because most kernel mechanisms&lt;br /&gt;go through schedule, thus allowing only HZ precision (read 100 times a&lt;br /&gt;second on standard x86).  If you want more frequent polls without&lt;br /&gt;busywait, there's some info on the net about it.&lt;br /&gt;&lt;br /&gt;issues - access:&lt;br /&gt;inb/outb are only available to root, you could make a setuid program that&lt;br /&gt;does ioperm() and then goes back to unpriviledged mode of course&lt;br /&gt;&lt;br /&gt;ppdev is controlled by normal user/group and permission on&lt;br /&gt;/dev/parports/0, etc, so it's quite usable&lt;br /&gt;&lt;br /&gt;with your own parallel port discipline you can do anything you like&lt;br /&gt;&lt;br /&gt;issue - portability:&lt;br /&gt;inb/outb works only for x86 legacy hardware&lt;br /&gt;ppdev and your a new parallel discipline should work on any paralle port&lt;br /&gt;hardware.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Examples:&lt;br /&gt;&lt;br /&gt;inb/outb - from whoever I\m replying to:&lt;br /&gt;&gt; #include &lt;stdio.h&gt;&lt;br /&gt;&gt; #include &lt;sys h=""&gt;&lt;br /&gt;&gt;&lt;br /&gt;&gt; int main(int argc, char **argv)&lt;br /&gt;&gt; {&lt;br /&gt;&gt;  int addr = 0x378;&lt;br /&gt;&gt;&lt;br /&gt;&gt;  if(ioperm(addr, 3, 1) == -1) {&lt;br /&gt;&gt;   perror("ioperm");&lt;br /&gt;&gt;   exit(1);&lt;br /&gt;&gt;  }&lt;br /&gt;&gt;  printf("0x%02x\n", inb(addr + 1));&lt;br /&gt;&gt; }&lt;br /&gt;&gt;&lt;br /&gt;&gt; The ioperm() only works if you're root.&lt;br /&gt;2nd argument is 3 because there are 3 registers in standard parallel port,&lt;br /&gt;namely data, control and status (don't remember in which order). If you&lt;br /&gt;wanna use something more advanced, like ECP or EPP, you'll have more&lt;br /&gt;registers.&lt;br /&gt;&lt;br /&gt;ppdev:&lt;br /&gt;#include &lt;sys h=""&gt;&lt;br /&gt;#include &lt;sys h=""&gt;&lt;br /&gt;void blah()&lt;br /&gt;{&lt;br /&gt;fd = open("/dev/parports/0", O_RDWR);&lt;br /&gt;ioctl(fd, PPCLAIM, NULL);&lt;br /&gt;arg = IEEE1284_MODE_BYTE;&lt;br /&gt;ioctl(fd, PPSETMODE, &amp;amp;arg);&lt;br /&gt;&lt;br /&gt;unsigned char c = 13;&lt;br /&gt;int dir = 0;&lt;br /&gt;ioctl(fd, PPDATADIR, &amp;amp;dir);&lt;br /&gt;ioctl(fd, PPWDATA, &amp;amp;c);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;you\ll have to read ppdev.c in the kernel sources to figure out the&lt;br /&gt;ioctl's but it's not that bad :)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;hope this helps,&lt;br /&gt;dima&lt;br /&gt;&lt;/sys&gt;&lt;/sys&gt;&lt;/sys&gt;&lt;/stdio.h&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8272723058145483540-51778084910547347?l=pythonic-wisdom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pythonic-wisdom.blogspot.com/feeds/51778084910547347/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8272723058145483540&amp;postID=51778084910547347' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8272723058145483540/posts/default/51778084910547347'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8272723058145483540/posts/default/51778084910547347'/><link rel='alternate' type='text/html' href='http://pythonic-wisdom.blogspot.com/2008/11/accessing-parallel-port-on-linux-from.html' title='Accessing Parallel Port on Linux from User Mode (2002)'/><author><name>Dima Tisnek</name><uri>http://www.blogger.com/profile/02596502493502644800</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_rAnU7ajL6X0/TAX_YkAKXwI/AAAAAAAAAAM/AwVQyLy70qU/S220/cat.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8272723058145483540.post-7225869670410408081</id><published>2008-06-06T01:24:00.000-07:00</published><updated>2008-06-06T01:38:59.726-07:00</updated><title type='text'>Korean Goodies</title><content type='html'>&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Drama series&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;Korean drama series I liked enough to back up. One day I should write something about each.&lt;br /&gt;&lt;a href="http://wiki.d-addicts.com/Bodyguard"&gt;bodigadeu&lt;/a&gt;&lt;br /&gt;&lt;a href="http://wiki.d-addicts.com/Sorry_I_Love_You"&gt;MISA&lt;/a&gt;&lt;br /&gt;&lt;a href="http://wiki.d-addicts.com/Damo"&gt;damo&lt;/a&gt;&lt;br /&gt;&lt;a href="http://wiki.d-addicts.com/All_In"&gt;all in&lt;/a&gt;&lt;br /&gt;&lt;a href="http://wiki.d-addicts.com/Breathless"&gt;breathless&lt;/a&gt;&lt;br /&gt;&lt;a href="http://wiki.d-addicts.com/Invincible_Parachute_Agent"&gt;KSA&lt;/a&gt;&lt;br /&gt;&lt;a href="http://wiki.d-addicts.com/Delightful_Girl_Choon_Hyang"&gt;choonhyang&lt;/a&gt; + ost&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-size:130%;" &gt;Goodies Online&lt;/span&gt;&lt;br /&gt;&lt;a href="http://dic.impact.pe.kr/"&gt;http://dic.impact.pe.kr/&lt;/a&gt; A very good dictionary that users can contribute to. Used to be #1 or at least on the first page in google search for Korean-English dictionary. Not anymore. I can only wonder why -- granted commercial dictionaries became better, but still relegating this to the second page of search results is a crime! So here is my bit to keep it alive ;-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8272723058145483540-7225869670410408081?l=pythonic-wisdom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pythonic-wisdom.blogspot.com/feeds/7225869670410408081/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8272723058145483540&amp;postID=7225869670410408081' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8272723058145483540/posts/default/7225869670410408081'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8272723058145483540/posts/default/7225869670410408081'/><link rel='alternate' type='text/html' href='http://pythonic-wisdom.blogspot.com/2008/06/korean-goodies.html' title='Korean Goodies'/><author><name>Dima Tisnek</name><uri>http://www.blogger.com/profile/02596502493502644800</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_rAnU7ajL6X0/TAX_YkAKXwI/AAAAAAAAAAM/AwVQyLy70qU/S220/cat.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8272723058145483540.post-703940464930075358</id><published>2008-03-12T00:40:00.000-07:00</published><updated>2008-03-12T00:47:31.511-07:00</updated><title type='text'>Pythonic Wisdom Notebook</title><content type='html'>Hérinne Thy ambihtere shalt keepe their Google notes. &lt;a href="http://google.com/notebook/public/03099596564458296565/BDQGMIgoQgvGSusAi"&gt;[link]&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8272723058145483540-703940464930075358?l=pythonic-wisdom.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pythonic-wisdom.blogspot.com/feeds/703940464930075358/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8272723058145483540&amp;postID=703940464930075358' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8272723058145483540/posts/default/703940464930075358'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8272723058145483540/posts/default/703940464930075358'/><link rel='alternate' type='text/html' href='http://pythonic-wisdom.blogspot.com/2008/03/pythonic-wisdom-notebook.html' title='Pythonic Wisdom Notebook'/><author><name>Dima Tisnek</name><uri>http://www.blogger.com/profile/02596502493502644800</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_rAnU7ajL6X0/TAX_YkAKXwI/AAAAAAAAAAM/AwVQyLy70qU/S220/cat.jpeg'/></author><thr:total>0</thr:total></entry></feed>
