<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Programmer's Log</title>
	
	<link>http://blog.programmerslog.com</link>
	<description>Programmers Writing Stuff - Garry Bodsworth</description>
	<lastBuildDate>Thu, 12 Aug 2010 20:59:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/ProgrammersLog" /><feedburner:info uri="programmerslog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Python is beautifully over-engineered</title>
		<link>http://feedproxy.google.com/~r/ProgrammersLog/~3/b49SScgPWAA/</link>
		<comments>http://blog.programmerslog.com/?p=459#comments</comments>
		<pubDate>Thu, 12 Aug 2010 20:59:38 +0000</pubDate>
		<dc:creator>Garry Bodsworth</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[coda_network]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.programmerslog.com/?p=459</guid>
		<description><![CDATA[I could have called this "Don't re-invent the wheel". Sometimes the Python standard library really surprises me because some bits are very over-engineered, but in a really good way. First time I realised this was when I was working on what became coda_network as most people solving the proxy problem and other downloading issues just [...]]]></description>
			<content:encoded><![CDATA[<p>I could have called this "Don't re-invent the wheel".  Sometimes the Python standard library really surprises me because some bits are very over-engineered, but in a really good way.  First time I realised this was when I was working on what became <a href="http://github.com/garrybodsworth/coda_network">coda_network</a> as most people solving the proxy problem and other downloading issues just write a new network library, but there are some really handy base classes to derive from to solve it.  Admittedly it did require some bug fixing along the way, but it was kind of worthwhile.</p>
<p>In coda_network I've got a mini proxy using ForkingMixin to do a process per download bypassing a lot of GIL based multithreading pain.  I needed some more multi processing support for some shared state and possibly locking.  So I started trying to do a MultiprocessingMixIn for the SocketServer/TCPServer/BaseHTTPServer.  I thought "this is easy just rip off the threading one since they share the same interface".  That worked really well for general use but when I started putting the system under severe load the process cleanup started going wonky.</p>
<p>Eventually I think I got it working using this code:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://blog.programmerslog.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=459&amp;download=MultiProcessingMixin.py">MultiProcessingMixin.py</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p4593"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
</pre></td><td class="code" id="p459code3"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">class</span> MultiprocessingMixIn:
    <span style="color: #483d8b;">&quot;&quot;&quot;Mix-in class to handle each request in a new process.&quot;&quot;&quot;</span>
&nbsp;
    <span style="color: #808080; font-style: italic;"># Decides how process will act upon termination of the</span>
    <span style="color: #808080; font-style: italic;"># main process</span>
    daemon_processes = <span style="color: #008000;">False</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> process_request_process<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, request, client_address<span style="color: black;">&#41;</span>:
        <span style="color: #483d8b;">&quot;&quot;&quot;
        Same as in BaseServer but as a thread.
        In addition, exception handling is done here.
        &quot;&quot;&quot;</span>
        <span style="color: #ff7700;font-weight:bold;">try</span>:
            <span style="color: #808080; font-style: italic;"># Actually do the request</span>
            <span style="color: #008000;">self</span>.<span style="color: black;">finish_request</span><span style="color: black;">&#40;</span>request, client_address<span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">except</span>:
            <span style="color: #808080; font-style: italic;"># XXX: will this work with multiprocessing correctly?</span>
            <span style="color: #008000;">self</span>.<span style="color: black;">handle_error</span><span style="color: black;">&#40;</span>request, client_address<span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">finally</span>:
            <span style="color: #808080; font-style: italic;"># Close the socket request</span>
            <span style="color: #008000;">self</span>.<span style="color: black;">close_request</span><span style="color: black;">&#40;</span>request<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> process_request<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, request, client_address<span style="color: black;">&#41;</span>:
        <span style="color: #483d8b;">&quot;&quot;&quot;Start a new thread to process the request.&quot;&quot;&quot;</span>
        t = multiprocessing.<span style="color: black;">Process</span><span style="color: black;">&#40;</span>target = <span style="color: #008000;">self</span>.<span style="color: black;">process_request_process</span>,
                             args=<span style="color: black;">&#40;</span>request, client_address<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">self</span>.<span style="color: black;">daemon_processes</span>:
            t.<span style="color: black;">daemon</span> = <span style="color: #008000;">True</span>
        t.<span style="color: black;">start</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        <span style="color: #808080; font-style: italic;"># Now we close the parent request socket because the child process</span>
        <span style="color: #808080; font-style: italic;"># is now responsible for it</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">close_request</span><span style="color: black;">&#40;</span>request<span style="color: black;">&#41;</span></pre></td></tr></table></div>

<p>The important bit is closing the request in the parent after the child process has started since it takes responsibility for it then.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p459code4'); return false;">View Code</a> PYTHON</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p4594"><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code" id="p459code4"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">class</span> ProxyServer<span style="color: black;">&#40;</span>MultiprocessingMixIn, <span style="color: #dc143c;">BaseHTTPServer</span>.<span style="color: black;">HTTPServer</span><span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">pass</span>
&nbsp;
proxy = ProxyServer<span style="color: black;">&#40;</span>address, HttpResponder<span style="color: black;">&#41;</span>
proxy.<span style="color: black;">serve_forever</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<p>I've probably missed a couple of bits (like making sure the handle_error does what is expected) but this is at least a good starting point....</p>
<img src="http://feeds.feedburner.com/~r/ProgrammersLog/~4/b49SScgPWAA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.programmerslog.com/?feed=rss2&amp;p=459</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.programmerslog.com/?p=459</feedburner:origLink></item>
		<item>
		<title>A coda_network update</title>
		<link>http://feedproxy.google.com/~r/ProgrammersLog/~3/84NVb5JxEfM/</link>
		<comments>http://blog.programmerslog.com/?p=456#comments</comments>
		<pubDate>Tue, 03 Aug 2010 20:13:38 +0000</pubDate>
		<dc:creator>Garry Bodsworth</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[coda_network]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.programmerslog.com/?p=456</guid>
		<description><![CDATA[I have been making a slow trickle of commits to coda_network as I need various features. The httplib.py and urllib2.py have been used in the field for a while in a variety of networks and I am pleased with how it has gone (now that means I need to get these changes upstream when I [...]]]></description>
			<content:encoded><![CDATA[<p>I have been making a slow trickle of commits to <a href="http://github.com/garrybodsworth/coda_network">coda_network</a> as I need various features.  The httplib.py and urllib2.py have been used in the field for a while in a variety of networks and I am pleased with how it has gone (now that means I need to get these changes upstream when I have a chance).</p>
<p>So what changes have gone in?<br />
* A skeletal mock proxy server that can fake HTTP and HTTPS requests.  This will perform the basis of unit testing.<br />
* Fix a bit where TCP keepalive failed to happen over HTTPS.<br />
* Implemented MD5-sess digest authentication which seems to be what IIS Windows servers use.<br />
* Added an authentication handler for OAuth.</p>
<p>The authentication handler for OAuth was the most work.  Essentially I had to extract the OAuth logic from <a href="http://github.com/simplegeo/python-oauth2">oauth2</a> and remove all the close coupling with httplib.  This then means you can have an OAuth handler in the urllib2 world of Python and do it through proxies and the suchlike.  Your server does need to return a 401 rather than the ones I have seen that get a 500 internal server error when the request is made without authorisation.</p>
<p>To get it working I cheated and reused username and password because they have little meaning in the OAuth world.  So you end up with something like this (you can skip the token part if you don't have it yet):<br />
<code><br />
    password_mgr = urllib2.HTTPPasswordMgrWithDefaultRealm()<br />
    password_mgr.add_password(None,<br />
                              'http://oauthprotected.com',<br />
                              KeySecret('consumer_key', 'consumer_secret'),<br />
                              KeySecret('token', 'token_secret'),<br />
                              )<br />
    auth_handler = oauth_auth.HTTPOauthAuthHandler(password_mgr)<br />
</code></p>
<p>It is all done entirely in HTTP headers and there is no option for GET or POST parameters.</p>
<img src="http://feeds.feedburner.com/~r/ProgrammersLog/~4/84NVb5JxEfM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.programmerslog.com/?feed=rss2&amp;p=456</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.programmerslog.com/?p=456</feedburner:origLink></item>
		<item>
		<title>How (not to) write notes at Europython 2010</title>
		<link>http://feedproxy.google.com/~r/ProgrammersLog/~3/8BubZjUjFOU/</link>
		<comments>http://blog.programmerslog.com/?p=451#comments</comments>
		<pubDate>Mon, 02 Aug 2010 20:25:20 +0000</pubDate>
		<dc:creator>Garry Bodsworth</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[europython]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.programmerslog.com/?p=451</guid>
		<description><![CDATA[I was told my write-up of Europython was useless without seeing the actual pictures I was drawing when I should have been writing more notes.... I wasn't necessarily bored, just bitten by the drawing bug once again. First up I started with a simple Optimus Prime to pass the time. Then Optimus Prime needed someone [...]]]></description>
			<content:encoded><![CDATA[<p>I was told my write-up of Europython was useless without seeing the actual pictures I was drawing when I should have been writing more notes....  I wasn't necessarily bored, just bitten by the drawing bug once again.</p>
<p>First up I started with a simple Optimus Prime to pass the time.<br />
<a href="http://www.flickr.com/photos/garrybodsworth/4854492950/" title="Europython notes page 1 by Garry Bodsworth, on Flickr"><img src="http://farm5.static.flickr.com/4116/4854492950_8742ed17cc.jpg" width="500" height="374" alt="Europython notes page 1" /></a></p>
<p>Then Optimus Prime needed someone to fight, so Megatron popped in.<br />
<a href="http://www.flickr.com/photos/garrybodsworth/4854526694/" title="Europython notes page 2 by Garry Bodsworth, on Flickr"><img src="http://farm5.static.flickr.com/4118/4854526694_3eb8316d50.jpg" width="500" height="374" alt="Europython notes page 2" /></a></p>
<p>But Megatron was upgraded into the insane killing machine of Galvatron.<br />
<a href="http://www.flickr.com/photos/garrybodsworth/4853912621/" title="Europython notes page 3 by Garry Bodsworth, on Flickr"><img src="http://farm5.static.flickr.com/4075/4853912621_87b798271d.jpg" width="500" height="374" alt="Europython notes page 3" /></a></p>
<p>Hot Rod (for some reason channelling David Bowie) is needed to keep Galvatron in check.<br />
<a href="http://www.flickr.com/photos/garrybodsworth/4853917113/" title="Europython notes page 4 by Garry Bodsworth, on Flickr"><img src="http://farm5.static.flickr.com/4102/4853917113_983454eb10.jpg" width="500" height="374" alt="Europython notes page 4" /></a></p>
<p>The chaos bringer Unicron keeps a close eye on testing in planet form.<br />
<a href="http://www.flickr.com/photos/garrybodsworth/4854541782/" title="Europython notes page 5 by Garry Bodsworth, on Flickr"><img src="http://farm5.static.flickr.com/4101/4854541782_669a1cd004.jpg" width="500" height="374" alt="Europython notes page 5" /></a></p>
<p>A tough looking Iron Man decided to get in on the act.<br />
<a href="http://www.flickr.com/photos/garrybodsworth/4854547700/" title="Europython notes page 6 by Garry Bodsworth, on Flickr"><img src="http://farm5.static.flickr.com/4137/4854547700_93a280ab95.jpg" width="500" height="374" alt="Europython notes page 6" /></a></p>
<p>Then we go back to a slightly better rendered Optimus Prime.<br />
<a href="http://www.flickr.com/photos/garrybodsworth/4854554072/" title="Europython notes page 7 by Garry Bodsworth, on Flickr"><img src="http://farm5.static.flickr.com/4136/4854554072_afeee41d80.jpg" width="500" height="374" alt="Europython notes page 7" /></a></p>
<p>A childhood creation of an old friend is Thunder Supreme - the city robot.<br />
<a href="http://www.flickr.com/photos/garrybodsworth/4854560034/" title="Europython notes page 8 by Garry Bodsworth, on Flickr"><img src="http://farm5.static.flickr.com/4076/4854560034_df16aaa00f.jpg" width="500" height="374" alt="Europython notes page 8" /></a></p>
<p>Robocop helps organise a Python Code Dojo.<br />
<a href="http://www.flickr.com/photos/garrybodsworth/4853952247/" title="Europython notes page 10 by Garry Bodsworth, on Flickr"><img src="http://farm5.static.flickr.com/4093/4853952247_4b48eeb888.jpg" width="500" height="374" alt="Europython notes page 10" /></a></p>
<p>Judge Dredd pronounces sentence on Twisted.<br />
<a href="http://www.flickr.com/photos/garrybodsworth/4853957873/" title="Europython notes page 11 by Garry Bodsworth, on Flickr"><img src="http://farm5.static.flickr.com/4137/4853957873_2606e15a56.jpg" width="500" height="374" alt="Europython notes page 11" /></a></p>
<p>Death's Head slightly sketchy, yes?<br />
<a href="http://www.flickr.com/photos/garrybodsworth/4854581470/" title="Europython notes page 12 by Garry Bodsworth, on Flickr"><img src="http://farm5.static.flickr.com/4095/4854581470_b9d49739fe.jpg" width="500" height="374" alt="Europython notes page 12" /></a></p>
<p>Death's Head II was fighting at keeping Windows at bay.  But I fear he may not be powerful enough.<br />
<a href="http://www.flickr.com/photos/garrybodsworth/4853968351/" title="Europython notes page 13 by Garry Bodsworth, on Flickr"><img src="http://farm5.static.flickr.com/4076/4853968351_89285358dd.jpg" width="500" height="374" alt="Europython notes page 13" /></a></p>
<img src="http://feeds.feedburner.com/~r/ProgrammersLog/~4/8BubZjUjFOU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.programmerslog.com/?feed=rss2&amp;p=451</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.programmerslog.com/?p=451</feedburner:origLink></item>
		<item>
		<title>EuroPython 2010</title>
		<link>http://feedproxy.google.com/~r/ProgrammersLog/~3/yAlhytefW_c/</link>
		<comments>http://blog.programmerslog.com/?p=443#comments</comments>
		<pubDate>Sun, 01 Aug 2010 20:35:52 +0000</pubDate>
		<dc:creator>Garry Bodsworth</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.programmerslog.com/?p=443</guid>
		<description><![CDATA[Last week I attended EuroPython 2010 without contracting food poisoning like last year. It was four days of talks, food and beer. Before I completely forget everything I thought I'd write up my experience. This is the last year in Birmingham and next year it heads to Florence but PyCon UK will carrying on. I [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I attended EuroPython 2010 without contracting food poisoning like last year.  It was four days of talks, food and beer.  Before I completely forget everything I thought I'd write up my experience.  This is the last year in Birmingham and next year it heads to Florence but PyCon UK will carrying on.</p>
<p>I also did not only end up sketching such luminaries as Optimus Prime, Megatron, Robocop, Death's Head (1 and 2), and Judge Dredd, I actually took some notes as well(!)</p>
<p>This write up has taken me a few weeks since my iPhone4 died completely then my Macbook Pro decided to contract the nvidia graphics chip of death.</p>
<p><strong>Russel Winder - The Multicore Revolution</strong><br />
The everything you've held true all this time is going to change speech.  Russel was thoroughly entertaining as usual especially with the sidetrack into physics.  He stepped in at the last minute for someone dropping out going to OSCON or something, but if they hadn't said noone would have known or complained.</p>
<p><a href="http://wiki.europython.eu/Talks/Idiomatic%20Python">Idiomatic Python/Python Tips and Tricks</a><br />
This was the talk of the conference (there was a second part later I unfortunately missed because it overran).  Basically everyone in the audience no matter how expert they were in Python will have learnt something.  It rattled through at great pace.  Stuff I learnt included:<br />
Copying a sequence c = s[:]<br />
Delete a sequence s[:] = [] or del s[:]<br />
Iterating an array using enumerate() means you get a pair of index, value<br />
Iterating multiple sequences with zip() means you keep the arrays in lockstep<br />
You can do a for -> else</p>
<p><a href="http://wiki.europython.eu/Talks/The%20Development%20Process%20Of%20Python">Python Development Process</a><br />
I simply had to go to this because now I am thinking about the process to merge my changes I have made in <a href="http://github.com/garrybodsworth/coda_network">coda_network</a> back upstream since they seem to be working quite nicely now.</p>
<p>The branches are:<br />
3.2 - branches/py3k<br />
3.1 - release31-maint<br />
2.7 - release27-maint<br />
2.6 - release26-maint</p>
<p>To do an update and compile of the source do ./configure &#038;& make<br />
Or you can do a debug version by ./configure --with-pydebug &#038;& make<br />
And you only need make if the C files have changed.</p>
<p>Writing tests is extremely important, so write them check they fail, fix the problem and re-run the tests to make them work!  You should run your tests with Lib/Test/regrtest.py</p>
<p>To run all tests do ./python -m test.regrtest -uall and to do a specific test replace uall with the test name.</p>
<p>Apparently there is a maintainers file under Misc/maintainers.rst which should be very useful.</p>
<p><a href="http://wiki.europython.eu/Talks/How%20Import%20Works">How Import Works</a><br />
I went to this because it can never hurt to know what is going on int he background.  It covered some of the new functionality including relative imports which you can get at on older versions by doing "from __future__ import absolute_import" then you can do funky stuff like "from ..spam import flying_circus".</p>
<p>So the process of doing import:</p>
<ul>
<li>Resolve the name.</li>
<li>Find the module, it is possible to create custom finders that can drag your package from anywhere like the internet.</li>
<li>Then do a loader.load_module(fullname) and you've got it.</li>
</ul>
<p>They are putting in a __pycache__ where all the .pyc files go so you can use multiple interpreters without conflicting .pyc files and also they don't get left around on your hard drive because they are all in one place.  It helps prevent having stale .pyc files that can be accidentally imported.</p>
<p><strong>Cross Platform SIG</strong><br />
This was an impromptu talk because there were quite a few drop-outs for talks.  I decided to go because I feel Windows stalking me at every turn and I can only run away for so long.</p>
<p>The most interesting part was reimplementing UNIX commands in Python for some self contained non-administrator helpful commands.</p>
<p>Also mentioned was <a href="http://sphinx.pocoo.org/">Sphinx</a> for generated Python documentation and <a href="http://github.com/mxcl/homebrew">Homebrew</a> for Mac OSX to get a slightly better dev environment.</p>
<p><a href="http://wiki.europython.eu/Talks/Testing%20Http%20Apps%20With%20Python3">Monstrum - Python HTTP testing in Python 3</a><br />
Seems to be testing by using HTTP headers.</p>
<p><a href="http://wiki.europython.eu/Talks/Porting%20To%20Python%203">Porting Python 2 to 3</a><br />
One thing I wrote on my notepad was "Hiding to nothing".  I seem to remember thinking it requires a lot of effort and the ideal solution could conceivably be the most work which is a codebase that works in 2 and 3.</p>
<p><a href="http://wiki.europython.eu/Talks/Muddle%20Inventing%20A%20Build%20System">MUDDLE - A Build System</a><br />
Muddle is a build system for building embedded systems written in Python.  Considering my day job I could not miss out on this one since it is very relevant.  It supports lots of VCS, and build systems (make, linux kernel, apt-get, initscript, version files, debian files).  Basically, I need to find the time to really experiment with this and attempt to build a system.</p>
<p><a href="http://wiki.europython.eu/Talks/Kbus%20A%20Simple%20Messaging%20System">KBUS - A simple messaging system</a><br />
This is a messaging system using a Linux kernel module.  It is modelled on a socket model which is really easy to wrap your head around.  The testing is all done in Python which makes it really powerful to use.  It is definitely worth considering over dbus as that is really incredibly painful.  I know some uses for this already myself after the pain of dbus and dbus-python.</p>
<p><strong>Open Standards - Democratising The Web</strong><br />
Bruce Lawson from Opera had the keynote about open standards on the web.  He gave this <a href="http://www.brucelawson.co.uk/2006/pas-78-guide-to-good-practice-in-commissioning-accessible-websites/">interesting link</a> about accessibility.  He also mentioned the media queries for CSS to layout your content from different resolution screens and physically shaped devices.  Also he mentioned <a href="http://www.html5patch.org/">html5patch</a> for cross browser html5.</p>
<p><a href="http://wiki.europython.eu/Talks/A%20Case%20For%20Accessibility">A Case For Accessibility</a><br />
This is a subject close to my heart so there was no way I was going to miss this.  They designed <a href="http://getmediacore.com/">Mediacore</a> with accessibility in mind.</p>
<p>The W3C says 10% population in most countries has a disability and the average age of the population is increasing such that the rate will get higher.  They found actually seeing people with disabilities attempting to use the web through screenreaders and the suchlike made them see how hostile the web is (I am looking at you Tescos after your redesign, but that is a whole other article).</p>
<p>Things you should be thinking about are:<br />
Order of menu items and in fact number of menu items.<br />
Alt text for images - people still don't do this!<br />
Form labels<br />
Tab order<br />
Headlines and paragraphs are semantic and help<br />
Hiding things right.  display:none does not necessarily work with screen readers.</p>
<p>Some accessibility guidelines are available <a href="http://northtemple.com/1608">here</a>.</p>
<p>And something even closer to my heart, reduce or eliminate Adobe Flash completely.</p>
<p>It is also easy to partner with a visual disability centre, like for instance the RNIB or Sense.  There is also some Non Visual Accessibility web certification.</p>
<p><a href="http://wiki.europython.eu/Talks/Html5%20The%20Good%20The%20Bad%20And%20The%20Quite%20Interesting">HTML5: the good, the bad and the quite interesting</a><br />
And this talk was really quite interesting.  Just talking about the new things that are getting added to the HTML standard (the title is really honestly for marketing).</p>
<p>You've got new things like a header element that can go anywhere, and a nav element to contain say a group of links.  You can tag something article which is a discrete piece of content.  There is now a time element to unambiguously mark something as a time and date.</p>
<p>Interestingly (although Opera is the only browser implementing it right now) is form validation so you can have HTML smart forms which flag up to the user when something needs attention.</p>
<p><strong>First Round Of Lightning Talks</strong><br />
There was the face tracking robot called Hedroid that delighted the audience.  We had a talk about how the mobile interface for the schedule was knocked up in a pub and deployed in about an hour.  There was the pyweek game development challenge.  The online pygame book.  And a few more.</p>
<p><a href="http://wiki.europython.eu/Talks/Python%20And%20Windows%20Equality">Python On Windows</a><br />
Just to see how Python is getting on in the world of Windows and what real world stuff people are doing with it.  CPython from the standard installer seems to work well for most people and there are a few useful packages like active_directory, wmi, and pywin32.</p>
<p><a href="http://wiki.europython.eu/Talks/Python%20In%20The%20Browser">Python In The Browser</a><br />
This is web programming using Silverlight + ironPython.  It's an interesting thing to see and looks like it could make Windows development more palatable.  There is a really good demo <a href="http://www.trypython.org/">here</a> for the Python tutorial code executed in the browser.  The useful addresses are gestalt.ironpython.net/dlr_runtime.js to get python in the browser using Gestalt and silverlight.codeplex.com for the Silverlight Toolkit.</p>
<p>Like I say I see Windows stalking me in dark alleys....</p>
<p>The State Of Python<br />
Another day, another keynote.  Interesting bits from the talk included <a href="http://badassjs.com/post/745778955/skulpt-python-implementation-in-javascript">Skulpt</a> which is an implementation of Python in Javascript.  Also there was <a href="http://hackage.haskell.org/package/berp-0.0.1">Berp</a> which is Python 3 in Haskell that compiles down to Haskell.  Also a mention was made of <a href="http://pypi.python.org/pypi/distribute">distribute and pip</a> which should help with the minefield of deployment.</p>
<p><a href="http://wiki.europython.eu/Talks/Organise%20A%20Python%20Code%20Dojo">Organise a Python Dojo</a><br />
An entertaining talk about how the London Coding Dojos started with a strict <a href="http://codingdojo.org/">adherence to the rules</a> and how they evolved into what they are now.  They have things like multi-week projects divided into small units (like a text adventure game).  I think what I really took away is start with the default arrangement then find what works with the type of people.</p>
<p><a href="http://wiki.europython.eu/Talks/Adapting%20Libraries%20To%20Twisted">Twistify Your Library</a><br />
And<br />
<a href="http://wiki.europython.eu/Talks/Deferred%20Gratification">Deferred Gratification</a><br />
I think I sat in these because I lacked the ability to stand up and it was nice and air conditioned.  What I really learnt is Twisted deserves its name and it is implemented in completely the wrong language.  My sketch involved Judge Dredd declaring "Guilty! The sentence is death!"</p>
<p><a href="http://wiki.europython.eu/Talks/The%20Guardian%20Api%201%20Year%20On">The Guardian API One Year On</a><br />
This was about the kind of things the Guardian API is now capable of and how it is the antithesis of the newly implemented Murdoch Paywall.  The first example was an online version of the paper which can be viewed <a href="http://guardian.gyford.com/">here</a> and there was the <a href="http://www.guardian.co.uk/zeitgeist">zeitgeist example</a>.  Basically there are <a href="http://guardian.mashery.com/">three levels</a>, keyless for simple access, approved to get at the actual data, and bespoke for full access with no ads.  They have also opened up a large variety of data in the <a href="http://www.guardian.co.uk/news/datablog">Guardian Datablog</a>.</p>
<p><a href="http://wiki.europython.eu/Talks/Gevent%20Network%20Library">gevent library</a><br />
This is a library for large multithreaded programs.  It is a lot more sensible than Twisted and fits into the Python semantics a lot better.  It still needs a lot of work for various other python features like subprocesses.</p>
<p><strong>More Lightning Talks</strong><br />
I did a talk about <a href="http://github.com/garrybodsworth/coda_network">coda_network</a> and fixing up httplib and urllib2.</p>
<p>There was a quick one about <a href="http://bit.ly/__main__">__main__.py</a> which was really interesting because you can do all kinds of packaging like adding all the files to a ZIP and making it work.  Creating a __main__.py means you can execute a Python library which is really cool.</p>
<p>There was a talk that mentioned all kinds of hackery you can do with the with statement.  One library is <a href="http://pypi.python.org/pypi/withhacks">withhacks</a>.</p>
<p>There was a really cool demo of pdb++ a new funky python debugger.  I think the repository is <a href="http://github.com/antocuni/pdbpp">here</a>.</p>
<p>I've skipped some bits of Europython because I simply had Python overload and I am sure important stuff got pushed out of my brain.</p>
<img src="http://feeds.feedburner.com/~r/ProgrammersLog/~4/yAlhytefW_c" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.programmerslog.com/?feed=rss2&amp;p=443</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.programmerslog.com/?p=443</feedburner:origLink></item>
		<item>
		<title>Virtual On-Screen Keyboards On Linux</title>
		<link>http://feedproxy.google.com/~r/ProgrammersLog/~3/oLV9ZOL-q2k/</link>
		<comments>http://blog.programmerslog.com/?p=440#comments</comments>
		<pubDate>Sun, 11 Jul 2010 21:09:20 +0000</pubDate>
		<dc:creator>Garry Bodsworth</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[touch]]></category>

		<guid isPermaLink="false">http://blog.programmerslog.com/?p=440</guid>
		<description><![CDATA[With a tablet awaiting a better operating system I decided I had to evaluate the landscape on on-screen virtual keyboards on Linux. Obviously the ideal would be iPad/iPhone-esque, but that would be really frighteningly good, I had much lower expectations. I was not sure if the tech was there to even show the keyboards automatically [...]]]></description>
			<content:encoded><![CDATA[<p>With a <a href="http://thejoojoo.com">tablet</a> awaiting a better operating system I decided I had to evaluate the landscape on on-screen virtual keyboards on Linux.  Obviously the ideal would be iPad/iPhone-esque, but that would be really frighteningly good, I had much lower expectations.</p>
<p>I was not sure if the tech was there to even show the keyboards automatically when an input field was selected.  GTK are well ahead of the game on this with their IMContext base class to encapsulate input mainly for complex languages or disability accessibility, but a good side-effect is the ability to hook in an on-screen keyboard when a text input is focused.  In that case the on-screen keyboard needs to know about GTK in order to know when to show.</p>
<p>I tested all these on a VM that has now run out of hard disk space thanks to having to compile lots of stuff.  Most of the keyboards I completely failed to make automatically appear on the screen when a text input was selected, it was either me or them....</p>
<p>So in no particular order....</p>
<p><a href="http://matchbox-project.org/?p=1">Matchbox Keyboard</a><br />
Some people are using this actively.  It requires hacking to be able to toggle the display of it which makes it pretty much a no-go as it would always be on top of the screen.  The GUI looks all right though.  Some good info <a href="http://japiblog.dddgames.com/?p=15">here</a>.</p>
<p><a href="http://homepage3.nifty.com/tsato/xvkbd/">xvkbd</a><br />
The venerable old man of the line up.  It's been around the block and does exactly what it says on the tin.  It has lots of good features and hacks (like making it appear for login windows).  As far as I could see I couldn't hook it up to the IMContext but I could be missing something.</p>
<p><a href="http://www.gok.ca/">Gnome On-Screen Keyboard</a><br />
The oldest GTK based one and seems to be showing its age thanks to the UI.</p>
<p><a href="https://wiki.ubuntu.com/Accessibility/Projects/onBoard">onboard</a><br />
This is the Ubuntu one.  I couldn't get it to automatically appear on focus.  It looks OK, but seems to be lacking some features.  At least it is easily hackable in Python.  Some more interesting information <a href="http://www.combibo.net/articles/using_an_onscreen_keyboard_in_ubuntu/">is here</a>.</p>
<p><a href="http://florence.sourceforge.net/english.html">Florence</a><br />
This is the most recommended one and it is pretty good.  The main pain was I had to compile it as their were no packages for it.</p>
<p><a href="http://gitorious.org/fvkbd">fvkbd</a><br />
This looks fairly promising as it is very skinnable on configurable.  Unfortunately I could not work out how to hide or autohide the keyboard.  Also this had no packages and requires compiling.  This provides the basis for the OLPC virtual keyboard test and also the Meego/Maemo virtual keyboard.</p>
<p><a href="http://live.gnome.org/Caribou">Caribou</a><br />
This is the virtual keyboard testbed for Gnome 3.0.  It is written in Python and needs packaging so I had to compile it.  This was the one that got closest to what I want because it worked.  It shows a small keyboard by the input with current focus.  In my VM I had to disable the Clutter code for whizzy animations before getting it to work.</p>
<p>I've probably missed some but there are only so many not quite ready applications you can test before going completely and utterly bonkers.</p>
<p>Another thing I discovered was Google Chromium's addressbar is accessibility implemented, but none of the content in webpages is.  Firefox on the other hand and anything WebkitGTK based (like Epiphany) all work properly with their accessibility.  Part of the Chrome problem is the multiprocess rendering and that they have not prioritised accessibility according the bug reports I have read.</p>
<img src="http://feeds.feedburner.com/~r/ProgrammersLog/~4/oLV9ZOL-q2k" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.programmerslog.com/?feed=rss2&amp;p=440</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.programmerslog.com/?p=440</feedburner:origLink></item>
		<item>
		<title>JooJoo Technical Details</title>
		<link>http://feedproxy.google.com/~r/ProgrammersLog/~3/P2M3_uHPoYA/</link>
		<comments>http://blog.programmerslog.com/?p=435#comments</comments>
		<pubDate>Sat, 10 Jul 2010 20:45:54 +0000</pubDate>
		<dc:creator>Garry Bodsworth</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[joojoo]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.programmerslog.com/?p=435</guid>
		<description><![CDATA[For those of you as nerdy as me I thought I would try a virtual teardown of the JooJoo to gather information on its internals. First up the nvidia ION platform it is using is the MCP79 (revision b1). They are all much the same when it comes to ION motherboards with the revisions. lspci [...]]]></description>
			<content:encoded><![CDATA[<p>For those of you as nerdy as me I thought I would try a virtual teardown of the JooJoo to gather information on its internals.</p>
<p>First up the nvidia ION platform it is using is the MCP79 (revision b1).  They are all much the same when it comes to ION motherboards with the revisions.</p>
<p>lspci output:<br />
<code><br />
00:00.0 Host bridge: nVidia Corporation MCP79 Host Bridge (rev b1)<br />
00:00.1 RAM memory: nVidia Corporation MCP79 Memory Controller (rev b1)<br />
00:03.0 ISA bridge: nVidia Corporation MCP79 LPC Bridge (rev b3)<br />
00:03.1 RAM memory: nVidia Corporation MCP79 Memory Controller (rev b1)<br />
00:03.2 SMBus: nVidia Corporation MCP79 SMBus (rev b1)<br />
00:03.3 RAM memory: nVidia Corporation MCP79 Memory Controller (rev b1)<br />
00:03.5 Co-processor: nVidia Corporation MCP79 Co-processor (rev b1)<br />
00:04.0 USB Controller: nVidia Corporation MCP79 OHCI USB 1.1 Controller (rev b1)<br />
00:04.1 USB Controller: nVidia Corporation MCP79 EHCI USB 2.0 Controller (rev b1)<br />
00:06.0 USB Controller: nVidia Corporation MCP79 OHCI USB 1.1 Controller (rev b1)<br />
00:06.1 USB Controller: nVidia Corporation MCP79 EHCI USB 2.0 Controller (rev b1)<br />
00:08.0 Audio device: nVidia Corporation MCP79 High Definition Audio (rev b1)<br />
00:09.0 PCI bridge: nVidia Corporation MCP79 PCI Bridge (rev b1)<br />
00:0b.0 IDE interface: nVidia Corporation MCP79 SATA Controller (rev b1)<br />
00:10.0 PCI bridge: nVidia Corporation MCP79 PCI Express Bridge (rev b1)<br />
00:15.0 PCI bridge: nVidia Corporation MCP79 PCI Express Bridge (rev b1)<br />
00:16.0 PCI bridge: nVidia Corporation MCP79 PCI Express Bridge (rev b1)<br />
02:00.0 VGA compatible controller: nVidia Corporation Device 0876 (rev b1)<br />
03:00.0 Network controller: Realtek Semiconductor Co., Ltd. Device 8172 (rev 10)<br />
</code></p>
<p>The mini PCIe networking card is a Realtek 8172.  Ubuntu details are <a href="https://help.ubuntu.com/community/WifiDocs/Device/Realtek%208172">here</a> and driver install instructions are <a href="http://www.linwik.com/wiki/using+the+realtek+8172+and+8192se+wireless+controller+with+ubuntu+9.10">here</a> for older kernels.  I found the drivers very problematic, and according to the discussions out there on the Internet many other people struggle to get it working well on Linux.</p>
<p>You'll also notice there are no ethernet controllers listed.</p>
<p>And now stuff from dmesg....</p>
<p>A normal looking Atom chip.<br />
<code><br />
CPU0: Intel(R) Atom(TM) CPU N270   @ 1.60GHz stepping 02<br />
</code><br />
And I assume hyperthreading is enabled:<br />
<code><br />
CPU1: Intel(R) Atom(TM) CPU N270   @ 1.60GHz stepping 02<br />
</code><br />
Bluetooth is pretty standard:<br />
<code><br />
Bluetooth: Generic Bluetooth USB driver ver 0.5<br />
</code><br />
About 128Mb is allocated for graphics from the 1Gb total:<br />
<code><br />
Memory: 888772k<br />
</code><br />
There is a USB hub with 6 ports somewhere:<br />
<code><br />
hub 4-0:1.0: 6 ports detected<br />
</code><br />
The touch controller:<br />
<code><br />
input: eGalax Inc. USB TouchController as /devices/pci0000:00/0000:00:06.0/usb4/4-1/4-1:1.0/input/input3<br />
</code><br />
The driver for the touchscreen is <a href="http://home.eeti.com.tw/web20/eGalaxTouchDriver/linuxDriver.htm">here</a>.</p>
<p>There is a keyboard somewhere maybe it is used for something internally:<br />
<code><br />
input: Chicony USB Keyboard as /devices/pci0000:00/0000:00:04.1/usb1/1-1/1-1.2/1-1.2:1.0/input/input4<br />
</code></p>
<p>I'm still trying to work out the ambient light sensor and rotation sensor (which allegedly us ACPI through a hacked kernel that has not been GPL released yet).</p>
<img src="http://feeds.feedburner.com/~r/ProgrammersLog/~4/P2M3_uHPoYA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.programmerslog.com/?feed=rss2&amp;p=435</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.programmerslog.com/?p=435</feedburner:origLink></item>
		<item>
		<title>JooJoo or is that iooioo? A Review</title>
		<link>http://feedproxy.google.com/~r/ProgrammersLog/~3/sYdi3SvMN9c/</link>
		<comments>http://blog.programmerslog.com/?p=431#comments</comments>
		<pubDate>Fri, 09 Jul 2010 20:35:56 +0000</pubDate>
		<dc:creator>Garry Bodsworth</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ion]]></category>
		<category><![CDATA[joojoo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[nvidia]]></category>

		<guid isPermaLink="false">http://blog.programmerslog.com/?p=431</guid>
		<description><![CDATA[So I finally managed to get myself a Fusion Garage JooJoo from eBay for a reasonable price. I had previously tried to order through their online shop with multiple failures, basically their payment system does not work (I tried with three different cards). This was not a great start to my experience, so I sat [...]]]></description>
			<content:encoded><![CDATA[<p>So I finally managed to get myself a <a href="http://thejoojoo.com/">Fusion Garage JooJoo</a> from eBay for a reasonable price.  I had previously tried to order through their online shop with multiple failures, basically their payment system does not work (I tried with three different cards).  This was not a great start to my experience, so I sat it out and waited for one of them to appear on eBay.</p>
<p>Why was I so keen to get hold of one?  It is essentially an nVidia ION in a tablet.  At <a href="http://www.camvine.com">Camvine</a> the main hardware is based on this platform, so I thought it would be a great toy to play with and get our software working on it.  I can say my gut feeling was right and I had it going quickly.</p>
<p>No pictures for this one as they are all over the Internet.  But check out great internal photos <a href="http://thejoojooforum.com/viewtopic.php?f=4&#038;t=316">here</a>.</p>
<p>And on to the review....</p>
<p><strong>HARDWARE</strong><br />
I'll start with the hardware.  It's not badly done, with a nice sturdy engineered body.  The quality of finish does surpass what I thought it might be.  What we have is nVidia ION netbook internals crammed into a slim tablet chassis.</p>
<p><strong>The Display</strong><br />
The screen size is just wrong, I know why they went for 16:9 (with a very respectable 1360x768 720p resolution) but it just doesn't work.  When you are in portrait the top of the screen is way too far away from you.  The screen is really configured for movies rather than web browsing with that shape and resolution.  Ideally for a tablet you do want something closer to 4:3 and each edge being a minimum 1024 (I'll come onto why in the software section).  The viewing angle on the screen is good in one direction but then the other it is literally useless and you end up tilting it to see the content.</p>
<p><strong>Heat</strong><br />
The tablet does get very hot.  It has a fan internally which you can hear quite clearly when you hold it up to your ear.  That is good, but the thing that gets really hot on the ION is the video chipset (I've seen it going at 70ºC).  The heat seems to be at its greatest somewhere around the battery pack area which is odd since it is the other side to the processor.</p>
<p><strong>Power Button</strong><br />
Either my fingers are too big or the power button is just not very good.  It is quite good as it is orange when charging and white light when on, but it is recessed too far and seems terribly unresponsive.</p>
<p><strong>Ambient light sensor</strong><br />
Great to have one, but unfortunately it is positioned more or less where you place your left hand when you are operating in landscape.</p>
<p><strong>Weight</strong><br />
It is a bit more weighty than it needs to be but I put that down to the screen size.  With a smaller, better screen it would have been much more of an impulse device to use.</p>
<p><strong>Logo</strong><br />
The logo on the case appears when the JooJoo is switched on which is a real nice touch.  Also it illuminates the right one depending on the orientation you are currently in.</p>
<p><strong>Webcam</strong><br />
It has a webcam but I have not seen that it works - maybe it is for future software releases.</p>
<p><strong>Overall</strong><br />
I simultaneously dislike and like the hardware (from an external point of view).  For the internals <a href="http://mjg59.livejournal.com/124426.html">some corners have been cut</a>.  The niggles take away from the final finish, so with things like ambient sensor positioning, power button, and screen physical dimensions fixed it would be a lot better.</p>
<p><strong>SOFTWARE</strong><br />
For all of the hardware it is the software that will make or break the platform.  The software is basically a web browser with a web based start page showing bookmarks, with compiz to switch between windows.</p>
<p><strong>Boot Time</strong><br />
It is fairly quick to boot, but now lots of things boot quickly.  It mainly suspends when you "power off" and then restart.  This is great for speed but unfortunately the software can get upset so you need to reset hard in order to get a working system.</p>
<p><strong>Main Menu</strong><br />
The main menu at the top I still haven't quite worked out how you are supposed to bring it up.  Sometimes it is a tap at the top and sometimes a one finger swipe near the top.  Sometimes it is the top left only as well.</p>
<p><strong>Wifi</strong><br />
It seems it can only remember the last wifi network you were connected to so you have to type in the password again and again when you change locations.  For a portable internet connected device that is pretty poor.</p>
<p><strong>Scrolling</strong><br />
The JooJoo is "multitouch" for differing values of multitouch.  Essentially the only thing I have found multitouch is that webpages scroll by using two fingers (like the Apple touchpad).  There is no other functionality I have found like rotate or pinch n zoom.  The really annoying thing is that the main webpage that you start from uses one finger to scroll (due to the HTML implementation I am guessing) so once you are used to two-finger scrolling going back to the main page is really painful.</p>
<p><strong>Web Browser</strong><br />
According to some <a href="http://thejoojooforum.com/viewtopic.php?f=2&#038;t=217">hackery on the JooJoo forum</a> the browser is actually Google Chrome.  It is surprising it has some performance deficiencies in scrolling and browsing.  The browser supports Flash as well which may please some people (my intense aversion to it does not endear me to it).</p>
<p><strong>Multitasking</strong><br />
Because all webpages you have open are essentially live, you can end up with a Flash video playing int he background sapping CPU without even realising because it does not suspend the background processes.</p>
<p><strong>Compiz</strong><br />
You can switch the active web browser window using a compiz based switcher.  It hasn't been nicely user tested as you can end up scrolling off the left or right and struggling to get an active window.  To throw away a page simply chuck it off the top which is a nice gesture.</p>
<p><strong>Rotation and Orientation</strong><br />
Rotation is obviously done using xrandr.  This means no nice animation when changing orientation and you get the horrible destruction/creation of the framebuffer.  Also the orientation seems to only have only two active edges because otherwise the illuminated logos would be upside down.  This makes it inconvenient.</p>
<p><strong>GTK</strong><br />
It obviously has some GTK in the background (for Chrome), but I have seen  GTK error dialog pop up momentarily whilst whizzing around the compiz 3D bit.  It looked very odd.  Also in the Chrome browser it is obvious there is no GTK theme because you have the default (and off-putting) grey standard widgets for combos and the suchlike.</p>
<p><strong>Webpages and Scaling and Zooming</strong><br />
As I mentioned earlier there is no pinch and zoom and no way to scale webpages.  This is really important because of the resolution of the device.  One direction it is 768 pixels, so most webpages are designed with a minimum 1024 width and this means that you have to scroll horizontally to see a whole webpage.  There are two solutions - either scale a webpage (which is really easy in WebKit - even I have managed it for <a href="http://camvine.com/products/coda">CODA</a>), or supply a screen with a minimum 1024 in both directions (1280x1024 is still a great resolution).</p>
<p><strong>Security</strong><br />
Okay, I log into all of these webpages and then switch off the device.  Someone else switches it on and they can just go straight into those webpages because it simply remembers the credentials.  This is a wide gaping security hole and brings me onto the next thing.</p>
<p><strong>Users</strong><br />
It is a single user device.  I am pretty sure there is no particular "user" on this linux system, this means it is right pain for more than one person to check their gmail on this device.</p>
<p><strong>Overall</strong><br />
The software is OK for a toy, but not to be used beyond an internal engineering practice.  I was pretty annoyed by it after five minutes, so it is time to nuke it.</p>
<p><strong>HACKY HACKETY HACK HACK</strong><br />
So the real reason I got it was to hack my own OS onto it and to play around writing apps for it.</p>
<p>For a stand I decided to order a plate display stand which should work a treat and you can get two for a fiver(!)  Also I have ordered a 2Gb PC3-8500 204 pin DIMM for £25 to up the memory.  This should make it even nicer to hack on.</p>
<p>The SSD storage is the biggest debacle though, it is a mini-PCIe mSATA with some flipped pins which makes it impossible to find a replacement.  People have been trying for while now.  However, what I have ordered is a SD card to mini-PCIe adapter so I should be able to shoe-horn in some storage.</p>
<p>The wifi is also horrific, it is a Realtek card and as anyone who has tried to get these working on Linux solidly can attest they are cheap and nasty.  I can't get it to work even when compiling the module under a 2.6.31 kernel.  I might find another half height mini-PCIe wireless card to replace it with, Atheros has been quite good (and maybe find a wireless N).</p>
<p>The best bit is the screen and touchscreen is mounted upside down so all firmware images and media are stored upside down.  Pointless attempt to avert hacking....</p>
<p><strong>IS IT THE END YET?</strong><br />
So the JooJoo is good and bad, I couldn't recommend it to "normal" users, but it is a real interesting hacking platform.  If some of the tablet OSes come out this year they could give it a whole new lease of life.  Hardware wise it is nearly there, but needs more work (and battery life).  The software is a long way from being first useful, and then good which is unfortunate.</p>
<img src="http://feeds.feedburner.com/~r/ProgrammersLog/~4/sYdi3SvMN9c" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.programmerslog.com/?feed=rss2&amp;p=431</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.programmerslog.com/?p=431</feedburner:origLink></item>
		<item>
		<title>coda_network – and update already(!)</title>
		<link>http://feedproxy.google.com/~r/ProgrammersLog/~3/FJQw3jnIXJY/</link>
		<comments>http://blog.programmerslog.com/?p=429#comments</comments>
		<pubDate>Mon, 21 Jun 2010 19:41:24 +0000</pubDate>
		<dc:creator>Garry Bodsworth</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[coda_network]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.programmerslog.com/?p=429</guid>
		<description><![CDATA[After releasing the first version of coda_network over the weekend I have found a few bugfixes (corner cases). Mainly these involved using an NTLM proxy and attempting to tunnel a socket through it. This makes sense of the proxy case where you are trying to daisy-chain sockets together. This was really an issue with keep-alive [...]]]></description>
			<content:encoded><![CDATA[<p>After releasing the first version of <a href="http://github.com/garrybodsworth/coda_network">coda_network</a> over the weekend I have found a few bugfixes (corner cases).</p>
<p>Mainly these involved using an NTLM proxy and attempting to tunnel a socket through it.  This makes sense of the proxy case where you are trying to daisy-chain sockets together.  This was really an issue with keep-alive proxies where the Request object was not resetting some cached state that would only ever work once.</p>
<p>The main feature now though is I have added mini_proxy.py.  A multiprocess proxy server using all my code changes.  Only GET, POST and CONNECT are implemented, but that should be sufficient for most tests.  This mini proxy can then speak to upstream proxies of no authentication types, as well as basic. digest, and NTLM.</p>
<p>The readme on the <a href="http://github.com/garrybodsworth/coda_network">github page</a> has been updated with example commandlines for the proxy and I have tested it against all kinds of proxies.  Because of all the other work put into httplib and urllib2 the proxy itself is actually only 200 lines.  I've got no idea how efficient it is, but it should work fine.</p>
<img src="http://feeds.feedburner.com/~r/ProgrammersLog/~4/FJQw3jnIXJY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.programmerslog.com/?feed=rss2&amp;p=429</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.programmerslog.com/?p=429</feedburner:origLink></item>
		<item>
		<title>What next for coda_network</title>
		<link>http://feedproxy.google.com/~r/ProgrammersLog/~3/-attdQj53BQ/</link>
		<comments>http://blog.programmerslog.com/?p=425#comments</comments>
		<pubDate>Sat, 19 Jun 2010 14:40:44 +0000</pubDate>
		<dc:creator>Garry Bodsworth</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.programmerslog.com/?p=425</guid>
		<description><![CDATA[You can get coda_network here and read about it in my previous post. So what am I planning to do next for coda_network? To be honest it is functionally complete from my requirements but there are some less glamorous things that need doing. Finish writing up the unit test suite for proxies, downloads and requests. [...]]]></description>
			<content:encoded><![CDATA[<p>You can get <a href="http://github.com/garrybodsworth/coda_network">coda_network here</a> and read about it in my previous post.</p>
<p>So what am I planning to do next for coda_network?  To be honest it is functionally complete from my requirements but there are some less glamorous things that need doing.</p>
<ul>
<li>Finish writing up the unit test suite for proxies, downloads and requests.</li>
<li>Add some more example scripts for downloading and the suchlike.</li>
<li>Add an example mini_proxy that is half written right now that provides a Python based local proxy that can connect to any of the supported parent proxies.</li>
<li>Fix any bugs I find and from any feedback.</li>
<li>Try to egage the Python community to get these fixes or something similar pushed upstream.</li>
<li>And when I feel really brave - go have a look at Python 3.</li>
</ul>
<img src="http://feeds.feedburner.com/~r/ProgrammersLog/~4/-attdQj53BQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.programmerslog.com/?feed=rss2&amp;p=425</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.programmerslog.com/?p=425</feedburner:origLink></item>
		<item>
		<title>Fixing urllib2 and httplib Python networking – coda_network</title>
		<link>http://feedproxy.google.com/~r/ProgrammersLog/~3/7LbtkRUSDic/</link>
		<comments>http://blog.programmerslog.com/?p=423#comments</comments>
		<pubDate>Sat, 19 Jun 2010 14:33:56 +0000</pubDate>
		<dc:creator>Garry Bodsworth</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.programmerslog.com/?p=423</guid>
		<description><![CDATA[You can get coda_network from GitHub here. Originally the networking code at Camvine was based on httplib a very long time ago, then Curl was used (pycurl specifically with changes pushed upstream), but now I have been using normal Python 2.6 standard library functions which is much nicer. The default one distributed was not sufficient [...]]]></description>
			<content:encoded><![CDATA[<p>You can get <strong>coda_network</strong> <a href="http://github.com/garrybodsworth/coda_network">from GitHub here</a>.</p>
<p>Originally the networking code at <a href="http://www.camvine.com">Camvine</a> was based on httplib a very long time ago, then Curl was used (pycurl specifically with changes pushed upstream), but now I have been using normal Python 2.6 standard library functions which is much nicer.  The default one distributed was not sufficient so I had to make some fixes through deriving classes and monkeypatching.  That is a very basic history of the coda_network package's origins.</p>
<p>I've based these changes on the Python 2.6 maintenance branch so it should in theory work with all versions of 2.6 Python (and I suppose possibly the 2.7 release).  I did maintain my changes as patched derived classes, but I decided to integrate the changes into urllib2 and httplib directly in an attempt to eventually get these changes or something similar to them upstream.</p>
<p><a href="http://www.camvine.com">Camvine</a> have allowed me to publish the source code for all of these fixes so I am putting them on github with my often strange commit comments.  I'll get on to the functionality and fixes that I provide in a moment.  This all stemmed from attempting to fix tunnelling HTTPS through proxies and then having to fix it for NTLM.</p>
<p>In the repository there are the new httplib/urllib2 files which can be dropped in.  They have been made part of a coda_network package along with a few other helper files.  Below is the readme in the <a href="http://github.com/garrybodsworth/coda_network">github repository</a>.</p>
<h1>coda_network</h1>
<p>Author: Garry Bodsworth Website: <a href="http://www.programmerslog.com/">http://www.programmerslog.com</a></p>
<p>Thanks to Camvine <a href="http://www.camvine.com/">http://www.camvine.com</a> for allowing the source to be  published.</p>
<p>The changes are based on the Python 2.6 maintenance branch so it  should in theory work with all versions of 2.6 Python (and I suppose  possibly the 2.7 release).  The changes were maintained as patched  derived classes, but now they are integrated into urllib2 and httplib  directly in an attempt to eventually get these changes or something  similar to them upstream.</p>
<p>In the repository there are the new httplib/urllib2 files which can  be dropped in.  They have been made part of a coda_network package along  with a few other helper files.</p>
<div>
<h2>The Files</h2>
<p><strong>urllib2.py</strong> Based off <a href="http://svn.python.org/view/python/branches/release26-maint/Lib/urllib2.py?view=markup">http://svn.python.org/view/python/branches/release26-maint/Lib/urllib2.py?view=markup</a> revision 81637 The only public API change is that Request now has an optional "method"  parameter.</p>
<p><strong>httplib.py</strong> Based off <a href="http://svn.python.org/view/python/branches/release26-maint/Lib/httplib.py?view=markup">http://svn.python.org/view/python/branches/release26-maint/Lib/httplib.py?view=markup</a> revision 81688 The only public API change is that the HTTPResponse object has a tunnel  True/False parameter so we know if the response is from a normal request  or a tunnelling request.</p>
<p><strong>utilities.py</strong> Some simple wrappers I use to expose the functionality.  This also  provides a really basic do_download functions to do downloading with  minimum of fuss.  This stuff is a bit specific to me.</p>
<p><strong>connect.py</strong> This is to allow connecting to a vanilla socket whilst reusing all the  proxy auto code (rather than the rather painful process of not being  able to reuse it).</p>
<p><strong>ntlm_auth.py</strong> This provides the proxy and HTTP authentication handlers.</p>
<p><strong>ntlm subdirectory</strong> This is a copy of a portion of the code from python-ntlm <a href="http://code.google.com/p/python-ntlm/">http://code.google.com/p/python-ntlm/</a></p>
</div>
<div>
<h2>Fixes and features provided</h2>
<ul>
<li>The request object now provides a method.  This is handy for doing  requests like OPTIONS which are necessary for cross-domain javascript or  proper HEAD requests.</li>
<li>Allow digest proxy authentication to work by retrieving the correct  location and the correct password because these were previously designed  only for HTTP auto.  Also for digest auto of proxies it requires the  CONNECT information to generate the digest correctly.</li>
<li>Remove the cyclic dependency in constructing the response passed to  the higher levels thanks to a member function being assigned to a member  variable.  This is done in the simplest way possible by wrapper the  receiver in a simple class adapter, it could have been done by using  weakmethods, but it works.</li>
<li>Tunnelling HTTPS through proxies is fixed.</li>
<li>Added the optional socket_keepalive in order to do deliberately  long-lived connections (for long-poll).  This is available for HTTP and  HTTPS.</li>
<li>A very important part with CONNECT errors was to make sure it is  exposed at the right time.  This then allows for proxies and other  things that require retrying to work.  Previously a socket error was  thrown immediately, whereas now it is exposed through the getresponse()  function which allows the call stack to make the right judgements on the  error code.</li>
<li>Allow the specification of a certificate for HTTPS connections such  that secure connections to remote servers can be made.</li>
<li>Rather than using simple socket sends when doing tunnelling it now  uses the standard HTTPConnection putrequest(), putheader() and  endheaders().</li>
<li>Improve some of the messaging in the error handling so we can reason  about some of the errors.</li>
<li>Add the ability for connections to be kept alive with Keep-Alive  when the connection/proxy connection specifies it.  I noticed digest is  really not happy with this.</li>
<li>Add NTLM authentication using the python-ntlm files for generating  the hashes which in turn is from NTLMAPS as far as I can see.  This  works for both proxies and www-authenticate.  The connection Keep-Alive  is really important for NTLM as the Windows servers require the socket  connection to be kept open continually.</li>
</ul>
</div>
<div>
<h2>What coda_network can do</h2>
<ul>
<li>Use the following proxy types - normal, basic authentication, digest  authentication, NTLM authentication.</li>
<li>Authenticate websites - basic authentication, digest authentication,  NTLM authentication.</li>
<li>Request types - any you can think of.</li>
</ul>
</div>
<div>
<h2>Known limitations</h2>
<p>Digest authentication of a website when going through a proxy seems  broken.  This is probably due to the source of the request in generating  the hash.  It is such corner case that I am not looking into it right  now.</p>
</div>
<div>
<h2>FAQ</h2>
<dt><strong>What versions of Python are supported?</strong></dt>
<dd>It was written and tested on a Linux system with 2.6.4.  It has  worked with a couple of different revisions of 2.6.  In theory looking  at the code for 2.7 it should also work with that.</dd>
<dt><strong>Any plans to port to Python 3.0, 3.1, 3.2, etc?</strong></dt>
<dd>Nope.  I don't have a need for it right now, but I think it should  be possible to port these fixes when the time comes.</dd>
</div>
<img src="http://feeds.feedburner.com/~r/ProgrammersLog/~4/7LbtkRUSDic" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.programmerslog.com/?feed=rss2&amp;p=423</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.programmerslog.com/?p=423</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic page generated in 1.477 seconds. --><!-- Cached page generated by WP-Super-Cache on 2010-09-06 23:26:51 -->
