<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>What's Chris Doing? &#187; General</title>
	<atom:link href="http://whatschrisdoing.com/blog/category/general/feed/" rel="self" type="application/rss+xml" />
	<link>http://whatschrisdoing.com/blog</link>
	<description>Programming, photography, music and life.</description>
	<lastBuildDate>Sun, 30 Oct 2011 22:07:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Making HTTPS Requests secure in Python</title>
		<link>http://whatschrisdoing.com/blog/2011/10/30/making-https-requests-secure-in-python/</link>
		<comments>http://whatschrisdoing.com/blog/2011/10/30/making-https-requests-secure-in-python/#comments</comments>
		<pubDate>Sun, 30 Oct 2011 22:07:19 +0000</pubDate>
		<dc:creator>Christopher Lambacher</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://whatschrisdoing.com/blog/?p=119</guid>
		<description><![CDATA[Python 2.7 does not automatically validate certificates on HTTPS requests. The following seems to be the cleanest, though not necessarily fully secure method to get there. This will work with:]]></description>
			<content:encoded><![CDATA[<p>Python 2.7 does not automatically validate certificates on HTTPS requests. The following seems to be the cleanest, though not necessarily fully secure method to get there.</p>
<p>This will work with:</p>
<ul>
<li><a href=http://docs.python.org/library/httplib.html">httplib</a></li>
<li><a href="http://docs.python.org/library/urllib.html">urllib</a></li>
<li><a href="http://docs.python.org/library/urllib2.html">urlib2<a /></a></li>
<li><a href="http://python-requests.org/">requests</a></li>
</ul>
<p>It may work with other libs that depend on the HTTPSConnection class from httplib in the Python Standard Library.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">httplib</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">socket</span>
<span style="color: #ff7700;font-weight:bold;">import</span> ssl
<span style="color: #ff7700;font-weight:bold;">from</span> backports.<span style="color: black;">ssl_match_hostname</span> <span style="color: #ff7700;font-weight:bold;">import</span> match_hostname
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> install_validating_https<span style="color: black;">&#40;</span>cert_file<span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">def</span> validating_connect<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
        <span style="color: #483d8b;">&quot;Connect to a host on a given (SSL) port.&quot;</span>
&nbsp;
        sock = <span style="color: #dc143c;">socket</span>.<span style="color: black;">create_connection</span><span style="color: black;">&#40;</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">host</span>, <span style="color: #008000;">self</span>.<span style="color: black;">port</span><span style="color: black;">&#41;</span>,
                                        <span style="color: #008000;">self</span>.<span style="color: black;">timeout</span>, <span style="color: #008000;">self</span>.<span style="color: black;">source_address</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">self</span>._tunnel_host:
            <span style="color: #008000;">self</span>.<span style="color: black;">sock</span> = sock
            <span style="color: #008000;">self</span>._tunnel<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">sock</span> = ssl.<span style="color: black;">wrap_socket</span><span style="color: black;">&#40;</span>sock, <span style="color: #008000;">self</span>.<span style="color: black;">key_file</span>, <span style="color: #008000;">self</span>.<span style="color: black;">cert_file</span>, cert_reqs=ssl.<span style="color: black;">CERT_REQUIRED</span>, ca_certs=cert_file<span style="color: black;">&#41;</span>
        match_hostname<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">sock</span>.<span style="color: black;">getpeercert</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>, <span style="color: #008000;">self</span>.<span style="color: black;">host</span><span style="color: black;">&#41;</span>
&nbsp;
&nbsp;
&nbsp;
    <span style="color: #dc143c;">httplib</span>.<span style="color: black;">HTTPSConnection</span>.<span style="color: black;">connect</span> = validating_connect</pre></div></div>

<p>Okay, that&#8217;s the basics. backports.ssl_match_hostname is available in pypi, the rest is stdlib. This should work with 2.6+, for &lt; 2.6 you&#8217;ll want to get the ssl library from pypi (I don&#8217;t know the implications for the HTTPSConnection lib for anything other than 2.7).</p>
<p>Somewhere in your app, call <code>install_validating_https</code> and pass it the path to your root ca collection file. Oh, wait, what&#8217;s that? Well it probably would be a pem encoding of the <a href="https://hg.mozilla.org/mozilla-central/file/tip/security/nss/lib/ckfw/builtins/certdata.txt">Mozilla NSS certdata.txt</a>. The pem encoding can be done with the <a href="http://www.heikkitoivonen.net/blog/2008/09/30/root-certificates-for-python-programs-using-python/">certdata2pem.py script that comes with M2Crypto</a> or you can get a <a href="http://curl.haxx.se/ca/cacert.pem">pre-built one</a> from the <a href="http://curl.haxx.se/">curl project</a> (depending on your level of paranoia since you can&#8217;t download the curl version over https).</p>
<p>Much of the initial info that went into my final solution came from <a href="http://wiki.python.org/moin/SSL">the SSL Topic on the Python Wiki</a> and <a href="http://stackoverflow.com/questions/1087227/validate-ssl-certificates-with-python">the &#8220;How to validate SSL Certificates with Python&#8221; question on Stack Overflow</a> with a sprinkling of <a href="http://bugs.python.org/">Python bug reports</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://whatschrisdoing.com/blog/2011/10/30/making-https-requests-secure-in-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Notes on localization and jQueryUI Datepicker.</title>
		<link>http://whatschrisdoing.com/blog/2010/06/04/notes-on-localization-and-jqueryui-datepicker/</link>
		<comments>http://whatschrisdoing.com/blog/2010/06/04/notes-on-localization-and-jqueryui-datepicker/#comments</comments>
		<pubDate>Fri, 04 Jun 2010 15:24:50 +0000</pubDate>
		<dc:creator>Christopher Lambacher</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://whatschrisdoing.com/blog/?p=103</guid>
		<description><![CDATA[The current documentation for the jQuery UI Datepickercontrol and localization are a little bit sparse. The overview tab has a blurb about the the $.datepicker.regional object containing a set of localizations indexed by locale code (&#8216;fr&#8217;, &#8216;en-GB&#8217;, etc) and that those locales return an object with the attributes that provide a basis for the options [...]]]></description>
			<content:encoded><![CDATA[<p>The current <a href="http://jqueryui.com/demos/datepicker/">documentation for the jQuery UI Datepicker</a>control and localization are a little bit sparse. The overview tab has a blurb about the the $.datepicker.regional object containing a set of localizations indexed by locale code (&#8216;fr&#8217;, &#8216;en-GB&#8217;, etc) and that those locales return an object with the attributes that provide a basis for the options object to be provided to the $(&#8216;selector&#8217;).datepicker() function, then there is a link to the localization files in Subversion. Lets be clear about how the $.datepicker.regional object is populated and how to use it:</p>
<ol style="text-align: left;">
<li>You can get all of the locales as one big file from the Google CDN as: <a href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/i18n/jquery-ui-i18n.min.js">http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/i18n/jquery-ui-i18n.min.js</a></li>
<li>Even though you can, you probably should not include the giant file of all locales from the Google CDN because it will add 9.5KB compressed or 50KB uncompressed. Include the locales you need in a combined minified file for you site (perhaps combined with the rest of the scripts for your site)</li>
<li>The $.datepicker.regional object will not fall back to a less specific locale, i.e. if you give it fr-CA, it will not fall back to fr if it does not have it, you would have to come up with that logic yourself.</li>
</ol>
<p>Points 1 and 2 can be improved by adding the ability to select the locales in the <a href="http://jqueryui.com/download">jQuery UI Download builder tool</a>. Point 3 can be improved by adding a $.datepicker.getregion() function that returns a valid object based on the normal locale parsing rules.<br />
The function might look like:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$.<span style="color: #660066;">datepicker</span>.<span style="color: #660066;">getregion</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>region<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> retval <span style="color: #339933;">=</span> $.<span style="color: #660066;">datepicker</span>.<span style="color: #660066;">regional</span><span style="color: #009900;">&#91;</span>region<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>retval<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">return</span> retval<span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  region <span style="color: #339933;">=</span> region.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'-'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  retval <span style="color: #339933;">=</span> $.<span style="color: #660066;">datepicker</span>.<span style="color: #660066;">regional</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>region.<span style="color: #660066;">length</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">2</span> <span style="color: #339933;">&amp;&amp;</span> retval<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">return</span> retval<span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000066; font-weight: bold;">return</span> $.<span style="color: #660066;">datepicker</span>.<span style="color: #660066;">regional</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">''</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://whatschrisdoing.com/blog/2010/06/04/notes-on-localization-and-jqueryui-datepicker/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.NET MVC and Ionic.Zip</title>
		<link>http://whatschrisdoing.com/blog/2010/03/22/asp-net-mvc-and-ionic-zip/</link>
		<comments>http://whatschrisdoing.com/blog/2010/03/22/asp-net-mvc-and-ionic-zip/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 15:19:10 +0000</pubDate>
		<dc:creator>Christopher Lambacher</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://whatschrisdoing.com/blog/?p=98</guid>
		<description><![CDATA[I wanted to stream a dynamically generated Zip file in a ASP.NET MVC site. Ionic.Zip looked like the best option for Zip library. The Create a downloadable zip within ASP.NET example looked pretty close to what I needed, but I wanted to have a suitable ActionResult class to use in my controller. Here is what [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to stream a dynamically generated Zip file in a ASP.NET MVC site. <a href="http://dotnetzip.codeplex.com/">Ionic.Zip</a> looked like the best option for Zip library. The <a href="http://dotnetzip.codeplex.com/wikipage?title=CS-Examples&#038;referringTitle=Examples">Create a downloadable zip within ASP.NET example</a> looked pretty close to what I needed, but I wanted to have a suitable ActionResult class to use in my controller. Here is what I came up with:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">    <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
    <span style="color: #008080; font-style: italic;">/// A content result which can accepts a DotNetZip ZipFile object to write to the output stream</span>
    <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> ZipFileResult <span style="color: #008000;">:</span> ActionResult
    <span style="color: #008000;">&#123;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">public</span> ZipFile zip <span style="color: #008000;">&#123;</span>get<span style="color: #008000;">;</span>set<span style="color: #008000;">;</span><span style="color: #008000;">&#125;</span>
        <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">string</span> filename <span style="color: #008000;">&#123;</span>get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span><span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">public</span> ZipFileResult<span style="color: #008000;">&#40;</span>ZipFile zip<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">zip</span> <span style="color: #008000;">=</span> zip<span style="color: #008000;">;</span>
            <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">filename</span> <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
        <span style="color: #0600FF; font-weight: bold;">public</span> ZipFileResult<span style="color: #008000;">&#40;</span>ZipFile zip, <span style="color: #6666cc; font-weight: bold;">string</span> filename<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">zip</span> <span style="color: #008000;">=</span> zip<span style="color: #008000;">;</span>
            <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">filename</span> <span style="color: #008000;">=</span> filename<span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">override</span> <span style="color: #6666cc; font-weight: bold;">void</span> ExecuteResult<span style="color: #008000;">&#40;</span>ControllerContext context<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            var Response <span style="color: #008000;">=</span> context<span style="color: #008000;">.</span><span style="color: #0000FF;">HttpContext</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Response</span><span style="color: #008000;">;</span>
&nbsp;
            Response<span style="color: #008000;">.</span><span style="color: #0000FF;">ContentType</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;application/zip&quot;</span><span style="color: #008000;">;</span>
            Response<span style="color: #008000;">.</span><span style="color: #0000FF;">AddHeader</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Content-Disposition&quot;</span>, <span style="color: #666666;">&quot;attachment;&quot;</span> <span style="color: #008000;">+</span> <span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">.</span><span style="color: #0000FF;">IsNullOrEmpty</span><span style="color: #008000;">&#40;</span>filename<span style="color: #008000;">&#41;</span> <span style="color: #008000;">?</span> <span style="color: #666666;">&quot;&quot;</span> <span style="color: #008000;">:</span> <span style="color: #666666;">&quot;filename=&quot;</span> <span style="color: #008000;">+</span> filename<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
&nbsp;
            zip<span style="color: #008000;">.</span><span style="color: #0000FF;">Save</span><span style="color: #008000;">&#40;</span>Response<span style="color: #008000;">.</span><span style="color: #0000FF;">OutputStream</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            Response<span style="color: #008000;">.</span><span style="color: #0000FF;">End</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
    <span style="color: #008000;">&#125;</span></pre></div></div>

<p>The example noted above becomes:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> MyZipFileController <span style="color: #008000;">:</span> Controller
<span style="color: #008000;">&#123;</span>
&nbsp;
    <span style="color: #0600FF; font-weight: bold;">public</span> ActionResult Index<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        <span style="color: #6666cc; font-weight: bold;">string</span> ReadmeText<span style="color: #008000;">=</span> <span style="color: #666666;">&quot;This is a zip file dynamically generated at &quot;</span> <span style="color: #008000;">+</span> <span style="color: #000000;">System</span><span style="color: #008000;">.</span><span style="color: #0000FF;">DateTime</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Now</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;G&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #6666cc; font-weight: bold;">string</span> filename <span style="color: #008000;">=</span> <span style="color: #000000;">System.<span style="color: #0000FF;">IO</span></span><span style="color: #008000;">.</span><span style="color: #0000FF;">Path</span><span style="color: #008000;">.</span><span style="color: #0000FF;">GetFileName</span><span style="color: #008000;">&#40;</span>ListOfFiles<span style="color: #008000;">.</span><span style="color: #0000FF;">SelectedItem</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Text</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;.zip&quot;</span><span style="color: #008000;">;</span>
&nbsp;
        ZipFile zip <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> ZipFile<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        zip<span style="color: #008000;">.</span><span style="color: #0000FF;">AddFile</span><span style="color: #008000;">&#40;</span>ListOfFiles<span style="color: #008000;">.</span><span style="color: #0000FF;">SelectedItem</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Text</span>, <span style="color: #666666;">&quot;files&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        zip<span style="color: #008000;">.</span><span style="color: #0000FF;">AddEntry</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Readme.txt&quot;</span>, <span style="color: #666666;">&quot;&quot;</span>, ReadmeText<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #0600FF; font-weight: bold;">return</span> <span style="color: #008000;">new</span> ZipFileResult<span style="color: #008000;">&#40;</span>zip, filename<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://whatschrisdoing.com/blog/2010/03/22/asp-net-mvc-and-ionic-zip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Camera</title>
		<link>http://whatschrisdoing.com/blog/2009/07/01/new-camera/</link>
		<comments>http://whatschrisdoing.com/blog/2009/07/01/new-camera/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 20:47:51 +0000</pubDate>
		<dc:creator>Christopher Lambacher</dc:creator>
				<category><![CDATA[Amara]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Photography]]></category>

		<guid isPermaLink="false">http://whatschrisdoing.com/blog/?p=85</guid>
		<description><![CDATA[My 30th birthday came and went on the 21st of June. I got a couple of toys including a new Canon G10 Camera. I have been carrying it with me everywhere and have a few pictures up already. Most are from trips to the park. But there are also a couple from Amara&#8217;s end of [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://whatschrisdoing.com/gallery/v/people/parkshots/IMG_0054.JPG.html"><img src="http://whatschrisdoing.com/gallery/d/24750-2/IMG_0054.JPG" hspace="10" vspace="5" align="right"/></a> My 30th birthday came and went on the 21st of June. I got a couple of toys including a new <a href="http://www.dpreview.com/news/0809/08091702canon_g10.asp">Canon G10 Camera</a>. I have been carrying it with me everywhere and have a few pictures up already. Most are from trips to the <a href="http://whatschrisdoing.com/gallery/v/people/parkshots/">park</a>. But there are also a couple from <a href="http://whatschrisdoing.com/gallery/v/amara/year3/?g2_page=2">Amara&#8217;s end of school year pageant</a> (look for the pictures in the church). Unfortunately for the pageant shots there were a lot of pushy parents trying to get pictures, so there are no shots of Amara singing.</p>
<p><a href=""><img src="http://whatschrisdoing.com/gallery/d/24768-2/IMG_0075.JPG" hspace="10" vspace="5" align="left"/></a> The camera is taking some getting used to. The controls are very different from my 300D (Digital Rebel) but I think I am starting to get the hang of them. My main problem is that I am not as fast with the G10 as I am with the SLR. The zoom reacts much slower that I can with the manual zoom on the SLR so composition takes longer with that. I also am still getting the hang of changing the auto focus location.</p>
<p>The G10 does, however, have a snappy start up and I have yet to see it have a problem keeping up with the speed I want to take pictures at, a problem that has been plaguing me with the 300D. One of the reasons I wanted the G10 was that I can capture in RAW. My big disappointment so far has been that <a href="http://www.bibblelabs.com/">Bibble</a>, the software I use for my photo work does not yet have G10 support as they are between major releases. For the time being I am making due with the software that comes with the Camera, but it certainly does not have an optimized work flow. I don&#8217;t want to have to shell out for something like <a href="http://www.adobe.com/products/photoshoplightroom/">Adobe Lightroom</a> but if Bibble does not get their act together soon, that might be the way I am headed.</p>
]]></content:encoded>
			<wfw:commentRss>http://whatschrisdoing.com/blog/2009/07/01/new-camera/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pictures, Pictures, Pictures</title>
		<link>http://whatschrisdoing.com/blog/2009/06/13/pictures-pictures-pictures/</link>
		<comments>http://whatschrisdoing.com/blog/2009/06/13/pictures-pictures-pictures/#comments</comments>
		<pubDate>Sat, 13 Jun 2009 21:38:07 +0000</pubDate>
		<dc:creator>Christopher Lambacher</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://whatschrisdoing.com/blog/?p=71</guid>
		<description><![CDATA[I just posted lots of pictures to my Picture Gallery. There are some from our trip to Florida and some from Zane&#8217;s welcome party and some random pictures of Amara. I&#8217;ll also post a few choice picks to my Flickr Stream.]]></description>
			<content:encoded><![CDATA[<div style="float: right; margin-left: 10px;"><a href="http://whatschrisdoing.com/gallery/v/trips/florida_2009_04/CRW_2472.jpg.html"><img src="http://whatschrisdoing.com/gallery/d/24337-2/CRW_2472.jpg"/></a></div>
<p> I just posted lots of pictures to my <a href="/gallery/">Picture Gallery</a>. There are some from our <a href="http://whatschrisdoing.com/gallery/v/trips/florida_2009_04">trip to Florida</a> and some from <a href="http://whatschrisdoing.com/gallery/v/events/welcomezane/">Zane&#8217;s welcome party</a> and some <a href="http://whatschrisdoing.com/gallery/v/amara/year3/">random pictures of Amara</a>.  I&#8217;ll also post a few choice picks to my <a href="http://www.flickr.com/photos/chris_lambacher/">Flickr Stream</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://whatschrisdoing.com/blog/2009/06/13/pictures-pictures-pictures/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Winterlicious X2 / AGO / Dirty Dancing</title>
		<link>http://whatschrisdoing.com/blog/2009/02/06/winterlicious-x2-ago-dirty-dancing/</link>
		<comments>http://whatschrisdoing.com/blog/2009/02/06/winterlicious-x2-ago-dirty-dancing/#comments</comments>
		<pubDate>Fri, 06 Feb 2009 14:15:34 +0000</pubDate>
		<dc:creator>Christopher Lambacher</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://whatschrisdoing.com/blog/2009/02/06/winterlicious-x2-ago-dirty-dancing/</guid>
		<description><![CDATA[Yesterday Kate and I had a very indulgent day. The Winterlicious promotion is happening in Toronto right now and we decided to take full advantage of it. We booked a lunch and dinner reservation and then built a day in Toronto around it. First we went to Barootes for lunch. I had the Chicken, Leek [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday Kate and I had a very indulgent day. The <a href="http://www.toronto.com/winterlicious">Winterlicious</a> promotion is happening in Toronto right now and we decided to take full advantage of it. We booked a lunch and dinner reservation and then built a day in Toronto around it.</p>
<p>First we went to <a href="http://www.toronto.com/winterlicious/listing/125305">Barootes</a> for lunch. I had the Chicken, Leek and Barley soup while Kate had the Baby Organic Greens with Apple Cider Vinaigrette. The we both had Penne with Spicy Italian sausage in Basil Tomato Sauce and finished it off with their &#8220;Special of the Week&#8221; which was Chocolate Layer Cake. Yummy.</p>
<p>Once we left there we walked to the <a href="http://www.ago.net/">AGO</a> to check out the new building and have a look through the new collections. The walk was a <em>chilly</em> at -8C but we got there quick enough that we did completely loose the feeling in our extremities (about 10-15 minutes).</p>
<p>The <a href="http://www.ago.net/new-building">new AGO building</a> is a welcome change. It makes the building much more interesting and the extra exhibit space made for the opportunity to see many works that were locked away in the vaults before. Add the new works, and even if you were very familiar with what used to be on display, I am sure you will find something new to see.  The <a href="http://www.ago.net/transformation-ago-new-building">new centrepiece staircase</a> goes all the way up to the 5th floor and is outside the main structure of the building between the 4th and 5th floors similar to <a href="http://www.ago.net/new-building">the staircase on the other side of the building</a>. Disappointingly, they are having a major problem with condensation on the glass between the 4th and 5th floors of the staircase. They had to close that section of the staircase and the water is damaging the dry wall in places. After all the money and effort that went into the <a href="http://www.ago.net/transformation/">transformation</a> I hope they will be able to find a quick solution to the problem and it is just a matter of working out the kinks.</p>
<p>After about 4 hours at the AGO, it was time for the cold walk back to King St for our dinner at <a href="http://www.toronto.com/winterlicious/listing/213111">Marcel&#8217;s Bistro</a>. Both Kate and I had the Salad to start, followed by Pork tenderloin in a tomato sauce with mashed potatoes &#038; seasonal vegetables. We shared a 1/2L of the Italian Terrazze Della Luna Pinot Grigio 2007. For desert Kate had Vanilla ice cream with hot chocolate sauce in puff pastry while I had the chocolate mouse cake. Again yummy, but I think Barootes was better.</p>
<p>To complete the day, we had tickets to <a href="http://www.dirtydancingtoronto.ca/">Dirty Dancing</a>. We had excellent seats, 3rd row, first balcony center which we got for the <a href="http://www.redflagdeals.com/deals/main.php/alldeals/comments/mirvish_productions_dirty_dancing_tickets_30_sound_of_music_family_pack_4_s">ridiculously low price of $30 each</a>. Thank you <a href="http://www.redflagdeals.com/">Red Flag Deals</a>. The play was good, but not your traditional the story line is sung kind of musical. It was more like a play with a lot of music and dancing in it. If you liked the movie, you&#8217;ll probably like the play.</p>
<p>In all it was a very long, fun, expensive but high value day.</p>
]]></content:encoded>
			<wfw:commentRss>http://whatschrisdoing.com/blog/2009/02/06/winterlicious-x2-ago-dirty-dancing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More ISAPI-WSGI and TurboGears</title>
		<link>http://whatschrisdoing.com/blog/2008/07/27/more-isapi-wsgi-and-turbogears/</link>
		<comments>http://whatschrisdoing.com/blog/2008/07/27/more-isapi-wsgi-and-turbogears/#comments</comments>
		<pubDate>Mon, 28 Jul 2008 02:26:22 +0000</pubDate>
		<dc:creator>Christopher Lambacher</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://whatschrisdoing.com/blog/2008/07/27/more-isapi-wsgi-and-turbogears/</guid>
		<description><![CDATA[Apparently my last post was not sufficiently detailed for some people. Well, okay, so far only one person, but I am sure I will eventually get a deluge of comments asking for clarification, so I decided to beat them to it :) The best place to start is at the beginning. IIS exposes a programming [...]]]></description>
			<content:encoded><![CDATA[<p>Apparently my <a href="http://whatschrisdoing.com/blog/2008/07/10/turbogears-isapi-wsgi-iis/">last post</a> was not <a href="http://compoundthinking.com/blog/index.php/2008/07/25/host-tg-on-iis/#comment-211784">sufficiently detailed</a> for some people.  Well, okay, so far only <a href="http://www.jaraco.com/">one person</a>, but I am sure I will eventually get a deluge of comments asking for clarification, so I decided to beat them to it :)</p>
<p>The best place to start is at the beginning.  IIS exposes a programming interface through DLLs that can be loaded into IIS called ISAPI.  There are two flavours of ISAPI, <a href="http://msdn.microsoft.com/en-us/library/ms525282.aspx">extensions</a> and <a href="http://msdn.microsoft.com/en-us/library/ms525103.aspx">filters</a>.  Filters operate against every request, while extensions target particular file types.  Often filters are used to implement things like <a href="http://www.codeplex.com/IIRF">URL rewriters</a> and gzip encoders, while extensions are used to add new file type handlers like php and asp.  Extensions can also handle .* files, which is special IIS lingo for &#8220;send all requests to this extension&#8221;.</p>
<p>The first problem we have is that we need to create a DLL that is loadable by IIS and exposes the expected interface.  Luckily <a href="http://sourceforge.net/projects/pywin32/">Python for Windows Extensions</a> provides a method for doing just that.  As part of the distribution, you get PyISAPI_loader.dll which can be found in the isapi module under site packages.  This DLL can be copied out into your work folder and renamed with a leading underscore, something like <tt>_tgload.dll</tt>.  When added to your IIS web site and loaded, it will embed python into IIS and load a python file that is named like the DLL but without the underscore (<tt>tgload.py</tt>).  </p>
<p>You can program for either ISAPI filters or extensions with this DLL as the interface that IIS expects does not conflict and is dictated by how you load the DLL.  In our case we are creating an extension, so we add the DLL via the application settings section of the tab that might be named one of &#8220;virtual directory&#8221;, &#8220;home directory&#8221; or just plain &#8220;directory&#8221;.  If you haven&#8217;t already done so you will need to click the &#8220;Create&#8221; button.  Click the &#8220;Configuration&#8230;&#8221; button to open the &#8220;Application Configuration&#8221; dialog.  Under the mappings tab, remove all of the existing application mappings and add a new one.  The executable should point to the dll from above, which does not need to and should not exist in the directory that would normally be served by IIS.  Set the extension to &#8220;.*&#8221; in order to catch all URLs, select &#8220;All Verbs&#8221; and uncheck both &#8220;Script Engine&#8221; and &#8220;Check that file exists&#8221;.</p>
<p>Programming an ISAPI extension in Python is essentially the same as in C because the isapi module that ships with Python for Windows Extensions does an excellent job of emulating the native interface.  <a href="http://msdn.microsoft.com/en-us/library/ms524338.aspx">Microsoft&#8217;s documentation applies</a> equally well to Python as it does to C.  There are a couple of minor differences which I will document here as well as a couple of tips that will hopefully keep you from pulling your hair out when something goes wrong.  First, add the following lines to the top of your file:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">hasattr</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>, <span style="color: #483d8b;">&quot;isapidllhandle&quot;</span><span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">import</span> win32traceutil</pre></div></div>

<p>This will detect when the file is loaded as an ISAPI extension or filter DLL and redirect stdout and stderr to the win32traceutil output collector.  You can run the trace utility by executing <tt>python -m win32traceutil</tt> in order to see any output from your DLL, including uncaught exception backtraces.</p>
<p>You also need to export the <tt>__ExtensionFactory__()</tt> function, which returns an object that exposes the <tt>GetExtensionVersion</tt>, <tt>HttpExtensionProc</tt> and <tt>TerminateExtension</tt> methods that operate as described in the Microsoft documentation with the exception that the first variable passed will be <tt>self</tt>.</p>
<p>Luckily you don&#8217;t need to worry about the details of how all this works, because <a href="http://code.google.com/p/isapi-wsgi/">ISAPI-WSGI</a> provides this object for you.  It translates the ISAPI interface into the Python <a href="http://www.wsgi.org/">WSGI</a> interface.  If you haven&#8217;t heard of it before, WSGI is <b>THE</b> standard for connecting Python applications to web servers in all their forms.  At this point all of the Python Frameworks talk WSGI so it is a pretty good bet for being able to connect to a Python Web app. </p>
<p>ISAPI-WSGI provides 2 flavours of ISAPI interface objects, <tt>ISAPISimpleHandler</tt> and <tt>ISAPIThreadPoolHandler</tt>.  The <tt>ISAPISimpleHandler</tt> can only handle one request at a time, while the <tt>ISAPIThreadPoolHandler</tt> does not block IIS and offloads the handling of the URL onto a pool of threads that call back into IIS when there is data to transmit back to the client.  The exposed interface is identical, so you can go ahead and use whatever your are comfortable with.</p>
<p>Okay so we are going to be returning an instance of <tt>ISAPISimpleHandler</tt> or <tt>ISAPIThreadPoolHandler</tt> from our module&#8217;s <tt>__ExtensionFactory__()</tt> function.  All we need to do is instantiate our choice of object and pass it our WSGI App interface.  For TurboGears, all of our HTTP requests are handled by <a href="http://cherrypy.org">CherryPy</a> so we need to dig into how CherryPy exposes a WSGI App.  That is what my <a href="http://whatschrisdoing.com/blog/2008/07/10/turbogears-isapi-wsgi-iis/">previous article</a> is supposed to explain.</p>
<p>All of this should work without a hitch on 32bit Windows, but 64bit opens up a whole big set of problems.  You cannot load 32bit DLLs into 64bit applications.  There is no <em>official</em> build of the Python for Windows Extensions.  I was able to find an <a href="http://mail.python.org/pipermail/python-list/2007-January/423258.html">old build for Python 2.4</a> and a <a href="http://sourceforge.net/project/platformdownload.php?group_id=78018">current (official) build for Python 2.6</a>, but I found no version for Python 2.5.</p>
<p>Now this does not mean you are dead in the water, IIS 6 (Windows Server 2003 and Windows XP) will let you choose to run IIS in 32bit mode, but <em>everything</em> must run in 32 bit mode.  If you want to do this, <a href="http://www.google.ca/search?q=asp.net+1+windows+x64&#038;ie=utf-8&#038;oe=utf-8&#038;aq=t&#038;rls=org.mozilla:en-GB:official&#038;client=firefox-a">search for ASP.NET 1.x and Windows x64</a>.  If you are sharing the server with other apps that you want to be running in 64bit, like ASP or ASP.NET 2+, you will need to find an alternative deployment method (I am going with TurboGears and IIS behind an Apache reverse proxy).  If you are on IIS 7 (Windows Server 2008 and Windows Vista) you can configure individual application pools to run in either 64bit or 32bit mode.  I don&#8217;t have access to an IIS 7 server to try it out.  Anyone who can should report back in the comments.</p>
<p>Hopefully that fills the gaps that I left in the last article.  I&#8217;ll leave it to someone else to distill this into newbie friendly documentation that can go on the TurboGears or ISAPI-WSGI Web sites.</p>
]]></content:encoded>
			<wfw:commentRss>http://whatschrisdoing.com/blog/2008/07/27/more-isapi-wsgi-and-turbogears/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>TurboGears + ISAPI-WSGI + IIS</title>
		<link>http://whatschrisdoing.com/blog/2008/07/10/turbogears-isapi-wsgi-iis/</link>
		<comments>http://whatschrisdoing.com/blog/2008/07/10/turbogears-isapi-wsgi-iis/#comments</comments>
		<pubDate>Thu, 10 Jul 2008 17:18:08 +0000</pubDate>
		<dc:creator>Christopher Lambacher</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://whatschrisdoing.com/blog/2008/07/10/turbogears-isapi-wsgi-iis/</guid>
		<description><![CDATA[On June 19, 2008, Louis wrote to the isapi_wsgi-dev Google Group asking about how to get CherryPy to work with ISAPI-WSGI. Since ISAPI-WSGI was how I was going to connect my Turbo Gears app up to IIS, I recording what I did here for posterity. The first caveat to this is that you will not [...]]]></description>
			<content:encoded><![CDATA[<p>On June 19, 2008, Louis <a href="http://groups.google.com/group/isapi_wsgi-dev/browse_thread/thread/310c8e3de00d22e5">wrote</a> to the <a href="http://groups.google.com/group/isapi_wsgi-dev">isapi_wsgi-dev</a> Google Group asking about how to get <a href="http://www.cherrypy.org/">CherryPy</a> to work with <a href="http://code.google.com/p/isapi-wsgi/">ISAPI-WSGI</a>.  Since ISAPI-WSGI was how I was going to connect my <a href="http://turbogears.com/">Turbo Gears</a> app up to IIS, I recording what I did here for posterity.</p>
<p>The first caveat to this is that you will not get this to work with IIS in 64 bit mode unless you can get a build of <a href="http://sourceforge.net/projects/pywin32/">PyWin32</a> for x64.  If you running a 64bit Windows architecture you will need to set IIS to 32bit mode and only run 32bit ISAPI dlls.  On IIS6 (Windows 2003/XP) this will mean you can only run 32bit DLLs.  If you are using IIS7 (Windows 2008), you will, apparently, be able to have 64bit and 32bit process pools.  This situation could get better in Python 2.6 since PyWin32 seems to have a x64 build for the 2.6 alphas. </p>
<p>Okay, on to the explanation.  The first thing to do in your DLL Python file, is to include these lines:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">hasattr</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>, <span style="color: #483d8b;">&quot;isapidllhandle&quot;</span><span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">import</span> win32traceutil</pre></div></div>

<p>This checks that we are running as an ISAPI DLL and imports win32traceutil, which redirects stdin and stdout so that you can view them with the win32traceutil message collector (just run the module on its own: python -m win32traceutil).  If things go wrong, at least you will have a way of knowing what is going wrong.</p>
<p>My __ExtensionFactory__() looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">def</span> __ExtensionFactory__<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
    <span style="color: #808080; font-style: italic;"># Do some pre import setup</span>
    <span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">os</span>
&nbsp;
    app_dir = <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">dirname</span><span style="color: black;">&#40;</span>__file__<span style="color: black;">&#41;</span>, <span style="color: #483d8b;">'..'</span>, <span style="color: #483d8b;">'app'</span><span style="color: black;">&#41;</span>
    app_dir = <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">normpath</span><span style="color: black;">&#40;</span>app_dir<span style="color: black;">&#41;</span>
    <span style="color: #dc143c;">sys</span>.<span style="color: black;">path</span>.<span style="color: black;">append</span><span style="color: black;">&#40;</span>app_dir<span style="color: black;">&#41;</span>
    <span style="color: #dc143c;">os</span>.<span style="color: black;">chdir</span><span style="color: black;">&#40;</span>app_dir<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #808080; font-style: italic;"># import my app creator</span>
    <span style="color: #ff7700;font-weight:bold;">import</span> wsgi_myapp
    <span style="color: #ff7700;font-weight:bold;">return</span> ISAPIThreadPoolHandler<span style="color: black;">&#40;</span>wsgi_myapp.<span style="color: black;">wsgiApp</span><span style="color: black;">&#41;</span></pre></div></div>

<p>In the do some pre-import setup, we add the application dir to the import path and change directories so that the current working dir is where the TurboGears app is (start-yourproject.py).</p>
<p>Then I have the module that sets up the TurboGears/CherryPy WSGI app.  I started with the TurboGears start-yourapp.py file and made modifications that were appropriate for making it work properly with WSGI:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!c:\Python25\python.exe</span>
<span style="color: #ff7700;font-weight:bold;">from</span> turbogears <span style="color: #ff7700;font-weight:bold;">import</span> config, update_config
<span style="color: #ff7700;font-weight:bold;">import</span> cherrypy
cherrypy.<span style="color: black;">lowercase_api</span> = <span style="color: #008000;">True</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># first look on the command line for a desired config file,</span>
<span style="color: #808080; font-style: italic;"># if it's not on the command line, then</span>
<span style="color: #808080; font-style: italic;"># look for setup.py in this directory. If it's not there, this script is</span>
<span style="color: #808080; font-style: italic;"># probably installed</span>
update_config<span style="color: black;">&#40;</span>configfile=<span style="color: #483d8b;">&quot;prod.cfg&quot;</span>,modulename=<span style="color: #483d8b;">&quot;yourapp.config&quot;</span><span style="color: black;">&#41;</span>
config.<span style="color: black;">update</span><span style="color: black;">&#40;</span><span style="color: #008000;">dict</span><span style="color: black;">&#40;</span>package=<span style="color: #483d8b;">&quot;yourapp&quot;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">from</span> yourapp.<span style="color: black;">controllers</span> <span style="color: #ff7700;font-weight:bold;">import</span> Root
&nbsp;
cherrypy.<span style="color: black;">root</span> = Root<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
cherrypy.<span style="color: black;">server</span>.<span style="color: black;">start</span><span style="color: black;">&#40;</span>initOnly=<span style="color: #008000;">True</span>, serverClass=<span style="color: #008000;">None</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">from</span> cherrypy._cpwsgi <span style="color: #ff7700;font-weight:bold;">import</span> wsgiApp</pre></div></div>

<p>The CherryPy critical components (for CherryPy 2.2) are:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;"># Grab your Root object</span>
<span style="color: #ff7700;font-weight:bold;">from</span> yourapp.<span style="color: black;">controllers</span> <span style="color: #ff7700;font-weight:bold;">import</span> Root
&nbsp;
<span style="color: #808080; font-style: italic;"># set the root object and initialize the server</span>
cherrypy.<span style="color: black;">root</span> = Root<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
cherrypy.<span style="color: black;">server</span>.<span style="color: black;">start</span><span style="color: black;">&#40;</span>initOnly=<span style="color: #008000;">True</span>, serverClass=<span style="color: #008000;">None</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># expose the wsgiApp to be imported by the isapidll.py file above.</span>
<span style="color: #ff7700;font-weight:bold;">from</span> cherrypy._cpwsgi <span style="color: #ff7700;font-weight:bold;">import</span> wsgiApp</pre></div></div>

<p>Louis is using CherryPy 3 which changes things slightly from what I have done.  CherryPy 3 is all WSGI all the time so we need to do less fiddling.  Here is what he had for __ExtensionFactory__():</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">def</span> __ExtensionFactory__<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">try</span>:
        <span style="color: #808080; font-style: italic;">#cpwsgiapp = cherrypy.Application(HelloWorld(),'F:\python-work')</span>
        app = cherrypy.<span style="color: black;">tree</span>.<span style="color: black;">mount</span><span style="color: black;">&#40;</span>HelloWorld<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
        cherrypy.<span style="color: black;">engine</span>.<span style="color: black;">start</span><span style="color: black;">&#40;</span>blocking=<span style="color: #008000;">False</span><span style="color: black;">&#41;</span>
        <span style="color: #808080; font-style: italic;">#wsgi_apps = [('/blog', blog), ('/forum', forum)]</span>
&nbsp;
        <span style="color: #808080; font-style: italic;">#server = wsgiserver.CherryPyWSGIServer(('localhost', 8080), HelloWorld(), server_name='localhost')</span>
&nbsp;
        <span style="color: #ff7700;font-weight:bold;">return</span> isapi_wsgi.<span style="color: black;">ISAPISimpleHandler</span><span style="color: black;">&#40;</span>app<span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">finally</span>:
        <span style="color: #808080; font-style: italic;"># This ensures that any left-over threads are stopped as well.</span>
        cherrypy.<span style="color: black;">engine</span>.<span style="color: black;">stop</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>I left in his extra comments because they show how he got to where he is.  This looks like the basic start a server code shown in the tutorial.  I think the key issues here are the cherrypy.engine calls.  The <a href="http://www.cherrypy.org/wiki/WSGI">CherryPy WSGI Wiki page</a> does not mention the engine at all.  I would guess that what he actually needs is:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">def</span> __ExtensionFactory__<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
    app = cherrypy.<span style="color: black;">tree</span>.<span style="color: black;">mount</span><span style="color: black;">&#40;</span>HelloWorld<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> isapi_wsgi.<span style="color: black;">ISAPISimpleHandler</span><span style="color: black;">&#40;</span>app<span style="color: black;">&#41;</span></pre></div></div>

<p>That said, I have not used CherryPy 3, so I have no direct experience.</p>
<p><b>Update</b>: Don&#8217;t use autoreload with ISAPI-WSGI.  It won&#8217;t work and if you don&#8217;t use the win32traceutil you won&#8217;t know why. </p>
<p>Also, I have added more background detail on how to use ISAPI with Python and the ISAPI-WSGI package <a href="http://whatschrisdoing.com/blog/2008/07/27/more-isapi-wsgi-and-turbogears/">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://whatschrisdoing.com/blog/2008/07/10/turbogears-isapi-wsgi-iis/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Maybe I Should Have Been A Photographer</title>
		<link>http://whatschrisdoing.com/blog/2007/06/19/maybe-i-should-have-been-a-photographer/</link>
		<comments>http://whatschrisdoing.com/blog/2007/06/19/maybe-i-should-have-been-a-photographer/#comments</comments>
		<pubDate>Tue, 19 Jun 2007 17:22:02 +0000</pubDate>
		<dc:creator>Christopher Lambacher</dc:creator>
				<category><![CDATA[Amara]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Photography]]></category>

		<guid isPermaLink="false">http://whatschrisdoing.com/blog/2007/06/19/maybe-i-should-have-been-a-photographer/</guid>
		<description><![CDATA[The last couple of weeks I have been taking a lot of pictures. Two weeks ago I took some pictures of some of my wife&#8217;s new mommy friends and their kids (see right). This is the first of 3 get-togethers this group will have that we will attend before we move back to Burlington. The [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://whatschrisdoing.com/gallery/v/events/mommies_2007_06_06/CRW_8868.jpg.html"><img vspace="5" hspace="10" border="1" align="right" src="http://whatschrisdoing.com/gallery/d/18137-2/CRW_8868.jpg"/></a> The last couple of weeks I have been taking a lot of pictures.  Two weeks ago I took some <a href="http://whatschrisdoing.com/gallery/v/events/mommies_2007_06_06/">pictures of some of my wife&#8217;s new mommy friends and their kids</a> (see right).  This is the first of 3 get-togethers this group will have that we will attend before we move back to Burlington.  The <a href="http://whatschrisdoing.com/gallery/v/events/mommies_2007_06_13/">second set</a>, from last Wednesday is already up and we are supposed to meet up with this group again tomorrow, which will hopefully also yield some good pictures.</p>
<p><a href="http://whatschrisdoing.com/gallery/v/events/mommies_2007_06_13/CRW_9054.jpg.html"><img vspace="5" hspace="10" border="1" align="left" src="http://whatschrisdoing.com/gallery/d/19075-2/CRW_9054.jpg"/></a>All the get-togethers are supposed to happen outside at a park, but it was too cold for the first one and we headed over to <a href="http://bayshore.shopping.ca/">Bayshore Mall</a>.  The <a href="http://www.theweathernetwork.com/index.php?product=historical&#038;placecode=caon0512">temperature issue sorted itself out</a> for last week&#8217;s get-together and so all of the pictures are outside.  Each environment proved to have tricky lighting conditions.  The mall had a mix of incandescent and fluorescent lighting that was sometimes too dim.  I punched some of the pictures up with a flash bounced off the ceiling, but found the children did not cooperate with being in the good light.</p>
<p>The second shoot, was supposedly at the wrong time of day to be shooting.  Best light is closest to dawn or dusk which provides a nice soft light, but we were shooting under the harsh mid day sun.  I think the fact that everyone was sitting under a shady tree worked out well.  There was plenty of light and the washed out sunny backgrounds look really good (above left).</p>
<p><a href="http://whatschrisdoing.com/gallery/v/events/TarasBridalShower/CRW_9024.jpg.html"><img vspace="5" hspace="10" border="1" align="right" src="http://whatschrisdoing.com/gallery/d/19240-2/CRW_9024.jpg"/></a>In between those two photographic opportunities I went to <a href="http://whatschrisdoing.com/gallery/v/events/TarasBridalShower/">my wife&#8217;s sister-in-law to be (Tara)&#8217;s bridal shower</a>.  Again the available light made things a bit challenging.  The pictures were taken between 3:30 and 5:30 which does not mean harsh mid day sun, but is still not the subdued soft lighting of dusk.  There was a lot of shots half in, half out of shade, as well as some with full on sun and a couple in door.  Even so, I think there were quite a number of good shots.  As kids tend to do, this little guy and his grandma (left) to the left provided the standout shots.  I&#8217;ll have to corner <a href="http://whatschrisdoing.com/gallery/v/events/TarasBridalShower/CRW_9008.jpg.html">Tara</a> and <a href="http://whatschrisdoing.com/gallery/v/events/TarasBridalShower/CRW_9046.jpg.html">Christian</a> at their wedding and make sure they get to be in a picture with some kids :)</p>
<p><a href="http://whatschrisdoing.com/gallery/v/events/SoulierBBQ/CRW_9200.jpg.html"><img vspace="5" hspace="10" border="1" align="left" src="http://whatschrisdoing.com/gallery/d/19292-2/CRW_9200.jpg"/></a>  On Saturday Kate and I visited with Mike and Maria and their kids for a <a href="http://whatschrisdoing.com/gallery/v/events/SoulierBBQ/">BBQ</a>.  I think I am getting the child photography thing down.  It helps that Jaan (left) and Aisha (below right) are too cute for words.  Between wanting to be photographed and being shy, they proved to be almost perfect photographic subjects.</p>
<p><a href="http://whatschrisdoing.com/gallery/v/events/SoulierBBQ/CRW_9193.jpg.html"><img vspace="5" hspace="10" border="1" align="right" src="http://whatschrisdoing.com/gallery/d/19283-2/CRW_9193.jpg"/></a>  Here again I was contending with what is supposed to not be ideal light, but I think the lighting really enhances the mood of these two photos.  Some of my success here is happy accident, but I have been getting more and more keeper shots, so I think some degree of my success is that I really am getting better at figuring out where to point the camera, what to keep in frame, when to take the picture and what to do about bad (and good) lighting.</p>
<p><a href="http://whatschrisdoing.com/gallery/v/amara/month4/CRW_9342.jpg.html"><img vspace="5" hspace="10" border="1" align="left" src="http://whatschrisdoing.com/gallery/d/19383-2/CRW_9342.jpg"/></a>I don&#8217;t just take pictures of other people&#8217;s kids.  If you have looked though the galleries linked above, you may have found one or two of <a href="http://whatsamaradoing.com/blog/">Amara</a>.  She of course also has her own <a href="http://whatschrisdoing.com/gallery/v/amara/">section in the gallery</a>. </p>
<p>Sunday was father&#8217;s day so I got a bit of a day off, both from picture taking and looking after Amara.  Kate took a <a href="http://whatschrisdoing.com/gallery/v/amara/month4/?g2_page=2">couple of pictures with Amara and I</a> in Strathcona Park to commemorate my first father&#8217;s day.  I think they turned out pretty well.  I didn&#8217;t totally stop taking pictures that day, I took this picture of Kate and Amara (left) at Strathcona Park also.</p>
<p>Some of the mothers from the get-togethers that did not know much about me, assumed from my comfort with the camera and the resulting pictures that I am a pro photographer.  I have also been getting more and more comments that my pictures look like they were taken by a professional.  Maybe I missed my calling.  In any case, I am seriously thinking about selling my services, at least as a child photographer, to help supplement the camera equipment lust that has developed over the last couple of years.  What do you think?  Would you pay me to photograph your child.  I am sure that I would be cheaper than <a href="http://www.canadianbaby.com/">Canadian Baby Photographers</a> and I would&#8217;t make you buy your prints through me :)</p>
]]></content:encoded>
			<wfw:commentRss>http://whatschrisdoing.com/blog/2007/06/19/maybe-i-should-have-been-a-photographer/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>This Little Piggie Cried &#8220;Wii, Wii, Wii,&#8221; All The Way Home!</title>
		<link>http://whatschrisdoing.com/blog/2007/05/30/this-little-piggie-cried-wii-wii-wii-all-the-way-home/</link>
		<comments>http://whatschrisdoing.com/blog/2007/05/30/this-little-piggie-cried-wii-wii-wii-all-the-way-home/#comments</comments>
		<pubDate>Thu, 31 May 2007 04:01:18 +0000</pubDate>
		<dc:creator>Christopher Lambacher</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://whatschrisdoing.com/blog/2007/05/30/this-little-piggie-cried-wii-wii-wii-all-the-way-home/</guid>
		<description><![CDATA[A Nintendo Wii has arrived in our family room. We were in Wal-Mart today and they had them in stock. It was the first time I have been anywhere when they had them in stock. We got the console plus an extra Wii Remote controller. They were out of stock on the Nunchuck, and we [...]]]></description>
			<content:encoded><![CDATA[<p>A Nintendo <a href="http://wii.nintendo.com/">Wii</a> has arrived in our family room.  We were in <a href="http://walmart.ca">Wal-Mart</a> today and they had them in stock.  It was the first time I have been anywhere when they had them in stock.  </p>
<p>We got the <a href="http://wii.nintendo.com/console.jsp">console</a> plus an extra <a href="http://wii.nintendo.com/controller.jsp">Wii Remote controller</a>.  They were out of stock on the Nunchuck, and we opted out of getting the Classic Controller for the time being.  We did not get any other games so for the time being all we have is <a href="http://wii.nintendo.com/software_wiisports.jsp">Wii Sports</a></p>
<p>Wii Sports is super fun.  I worked up a sweat playing, but I am not sure if that is because I was working really hard or because the house is really hot.  It&#8217;s probably more about the house being hot ;)</p>
<p>The browser is also cool.  I can now watch <a href="http://youtube.com/">YouTube</a> and <a href="http://video.google.com/">Google Video</a> on my TV, but for some reason <a href="http://ted.com/talks">TED Talks</a> did not seem to work.  I&#8217;ll have to look into that.</p>
<p>In all I am quite impressed with my first little go with the Wii and can&#8217;t wait to play with it more.  Hmm&#8230;. Perhaps I will catch up on my sleep a bit first though.</p>
]]></content:encoded>
			<wfw:commentRss>http://whatschrisdoing.com/blog/2007/05/30/this-little-piggie-cried-wii-wii-wii-all-the-way-home/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

