<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>metazin</title>
	<atom:link href="http://metazin.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://metazin.wordpress.com</link>
	<description>about developing slideboxx</description>
	<lastBuildDate>Thu, 28 Aug 2008 04:01:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='metazin.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>metazin</title>
		<link>http://metazin.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://metazin.wordpress.com/osd.xml" title="metazin" />
	<atom:link rel='hub' href='http://metazin.wordpress.com/?pushpress=hub'/>
		<item>
		<title>dilbert and powerpoint</title>
		<link>http://metazin.wordpress.com/2008/08/27/dilbert-and-powerpoint/</link>
		<comments>http://metazin.wordpress.com/2008/08/27/dilbert-and-powerpoint/#comments</comments>
		<pubDate>Thu, 28 Aug 2008 04:01:20 +0000</pubDate>
		<dc:creator>metazin</dc:creator>
				<category><![CDATA[powerpoint]]></category>
		<category><![CDATA[funny]]></category>

		<guid isPermaLink="false">http://metazin.wordpress.com/?p=139</guid>
		<description><![CDATA[This is too funny!   http://dilbert.com/strips/comic/2008-08-22/   enjoy!<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=metazin.wordpress.com&amp;blog=4118880&amp;post=139&amp;subd=metazin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is too funny!</p>
<p> </p>
<p>http://dilbert.com/strips/comic/2008-08-22/</p>
<p> </p>
<p>enjoy!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/metazin.wordpress.com/139/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/metazin.wordpress.com/139/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/metazin.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/metazin.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/metazin.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/metazin.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/metazin.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/metazin.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/metazin.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/metazin.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/metazin.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/metazin.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/metazin.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/metazin.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/metazin.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/metazin.wordpress.com/139/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=metazin.wordpress.com&amp;blog=4118880&amp;post=139&amp;subd=metazin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://metazin.wordpress.com/2008/08/27/dilbert-and-powerpoint/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8b628ff5cf046eab6ed4374ac93d1fcd?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">metazin</media:title>
		</media:content>
	</item>
		<item>
		<title>wsgiref can be slow with large payloads</title>
		<link>http://metazin.wordpress.com/2008/08/21/wsgiref-can-be-slow-with-large-payloads/</link>
		<comments>http://metazin.wordpress.com/2008/08/21/wsgiref-can-be-slow-with-large-payloads/#comments</comments>
		<pubDate>Thu, 21 Aug 2008 15:22:14 +0000</pubDate>
		<dc:creator>metazin</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[wsgiref]]></category>

		<guid isPermaLink="false">http://metazin.wordpress.com/?p=124</guid>
		<description><![CDATA[I mentioned using wsgiref in my previous entry regarding architecture of my PowerPoint search application, slideboxx.  Part of slideboxx delivers PowerPoint files to the browser, as you might imagine, this can result in large payloads of data to transmit.  During early prototyping and development things went smoothly; however, when I started testing with larger, more [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=metazin.wordpress.com&amp;blog=4118880&amp;post=124&amp;subd=metazin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I mentioned using <a href="http://www.python.org/doc/lib/module-wsgiref.html" target="_blank">wsgiref</a> in my <a href="http://metazin.wordpress.com/2008/08/15/architecture-of-a-python-flex-application/" target="_self">previous entry regarding architecture</a> of my <a href="http://www.slideboxx.com" target="_blank">PowerPoint search application, slideboxx</a>.  Part of slideboxx delivers PowerPoint files to the browser, as you might imagine, this can result in large payloads of data to transmit.  During early prototyping and development things went smoothly; however, when I started testing with larger, more real life data I noticed a substantial slowdown. The reason seems perhaps obvious in retrospect but was subtle at the time.  If you work your way back through the object hierarchy you find that by default SimpleHandler in wsgiref iterates through the value that it is asked to return (SimpleHandler inherits this behaviour from BaseHandler) [line 12 of the snippet from <span style="font-family:courier;">wsgiref/handlers.py</span>]:</p>
<pre class="brush: python;">
    def finish_response(self):
        &quot;&quot;&quot;Send any iterable data, then close self and the iterable

        Subclasses intended for use in asynchronous servers will
        want to redefine this method, such that it sets up callbacks
        in the event loop to iterate over the data, and to call
        'self.close()' once the response is finished.
        &quot;&quot;&quot;

        if not self.result_is_file() or not self.sendfile():
            for data in self.result:
                self.write(data)
            self.finish_content()
        self.close()
</pre>
<p>So if you return a string to the handler it will send each character or byte of the string individually. For a multimegabyte file this can be quite slow.  The solution is to wrap any strings you return in a list. Alternatively if you are expecting a very large file, because file objects are iterable, you can return a file object directly.  There are likely some optimizations possible here but for my purposes this simple method works.  Here&#8217;s some example code to demonstrate the differences, first a simple server with methods to return as a string, as a list, and as a file, respectively:</p>
<pre class="brush: python;">
from wsgiref import simple_server
import time

def returnAsString( env, start_response ) :
    t0 = time.time( )
    bytes = file( 'example.ppt', 'rb+' ).read( )
    t1 = time.time( )
    print 'Time to read %d bytes = %.2f seconds' % ( len( bytes ), t1 - t0 )
    headers = [ ('Content-type', 'application/vnd.ms-powerpoint' ) ]
    start_response( '200 OK', headers )
    return bytes

def returnAsList( env, start_response ) :
    t0 = time.time( )
    bytes = file( 'example.ppt', 'rb+' ).read( )
    t1 = time.time( )
    print 'Time to read %d bytes = %.2f seconds' % ( len( bytes ), t1 - t0 )
    headers = [ ('Content-type', 'application/vnd.ms-powerpoint' ) ]
    start_response( '200 OK', headers )
    return [ bytes ]

def returnAsFile( env, start_response ) :
    f = file( 'example.ppt', 'rb+' )
    headers = [ ('Content-type', 'application/vnd.ms-powerpoint' ) ]
    start_response( '200 OK', headers )
    return f

def exampleApp( env, start_response ) :
    '''dispatch to according to URL'''
    pathInfo = env[ 'PATH_INFO' ] 
    if pathInfo == '/returnAsString' :
        return returnAsString( env, start_response )
    if pathInfo == '/returnAsList' :
        return returnAsList( env, start_response )
    if pathInfo == '/returnAsFile' :
        return returnAsFile( env, start_response )
httpd = simple_server.make_server( 'localhost', 8081, exampleApp )
httpd.serve_forever( )
</pre>
<p>Then a simple driver using HTTPlib to make requests and time the results:</p>
<pre class="brush: python;">
import httplib
import time

connection = httplib.HTTPConnection( 'localhost', 8081 )
connection.connect( )

t0 = time.time( )
connection.request( 'GET', '/returnAsString' )
data = connection.getresponse( ).read( )
t1 = time.time( )
dtString = t1 - t0
print 'Time to fetch %d bytes as string = %.2f seconds' % \
    ( len( data ), dtString )

del data
data = None
t0 = time.time( )
connection.request( 'GET', '/returnAsList' )
data = connection.getresponse( ).read( )
t1 = time.time( )
dtList = t1 - t0
print 'Time to fetch %d bytes as list = %.2f seconds' % \
    ( len( data ),  dtList )

del data
data = None

t0 = time.time( )
connection.request( 'GET', '/returnAsFile' )
data = connection.getresponse( ).read( )
t1 = time.time( )
dtList = t1 - t0
print 'Time to fetch %d bytes as file = %.2f seconds' % \
    ( len( data ),  dtList )
</pre>
<p>And the results:</p>
<pre>Time to fetch 688128 bytes as string = 16.84 seconds
Time to fetch 688128 bytes as list = 0.01 seconds
Time to fetch 688128 bytes as file = 0.07 seconds</pre>
<p>so you can see that pulling the entire file into memory and sending as one string by passing it back to the wsgi handler as a list containing the string is the fastest and returning one byte at a time is much much slower; returning the file object to the wsgiref handler is a good alternative as well.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/metazin.wordpress.com/124/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/metazin.wordpress.com/124/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/metazin.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/metazin.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/metazin.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/metazin.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/metazin.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/metazin.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/metazin.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/metazin.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/metazin.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/metazin.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/metazin.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/metazin.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/metazin.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/metazin.wordpress.com/124/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=metazin.wordpress.com&amp;blog=4118880&amp;post=124&amp;subd=metazin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://metazin.wordpress.com/2008/08/21/wsgiref-can-be-slow-with-large-payloads/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8b628ff5cf046eab6ed4374ac93d1fcd?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">metazin</media:title>
		</media:content>
	</item>
		<item>
		<title>Architecture of a Python + Flex application</title>
		<link>http://metazin.wordpress.com/2008/08/15/architecture-of-a-python-flex-application/</link>
		<comments>http://metazin.wordpress.com/2008/08/15/architecture-of-a-python-flex-application/#comments</comments>
		<pubDate>Fri, 15 Aug 2008 15:08:33 +0000</pubDate>
		<dc:creator>metazin</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[RIA]]></category>

		<guid isPermaLink="false">http://metazin.wordpress.com/?p=106</guid>
		<description><![CDATA[My product, slideboxx, has an unusual architecture.  It is a desktop application but follows a client-server model.  This creates some challenges but also strongly enforces some good design such as separating application logic from data presentation.  I&#8217;ll discuss why I use a Flex front end in a future post. The challenges include: must serialize Python [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=metazin.wordpress.com&amp;blog=4118880&amp;post=106&amp;subd=metazin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>My product, <a href="http://www.slideboxx.com">slideboxx</a>, has an unusual architecture.  It is a desktop application but follows a client-server model.  This creates some challenges but also strongly enforces some good design such as separating application logic from data presentation.  I&#8217;ll discuss why I use a <a href="http://www.adobe.com/products/flex/" target="_blank">Flex</a> front end in a future post.</p>
<p>The challenges include:</p>
<ul>
<li>must serialize Python objects/data to something that <a href="http://en.wikipedia.org/wiki/ActionScript" target="_blank">Actionscript</a> can understand</li>
<li>since slideboxx runs in the browser, it can&#8217;t see the filesystem so the server (Python) code needs to act as a proxy for interactions with the filesystem (I realize AIR applications can see the filesystem, but felt AIR would not be sufficiently familiar [yet] to our customers)</li>
<li>many changes in application state, such as setting a preference, require a trip to the server &#8212; this is cumbersome but not technically challenging</li>
<li>debugging can be difficult because you sometimes need to correlate tracebacks between client and server</li>
</ul>
<p>Serializing the data is probably the most fundamental issue.  Fortunately it is generally easy to solve.  I use a mix of XML and <a href="http://json.org/" target="_blank">JSON</a> to serialize data.  The mix is partly historical and partly to fit in easily with the Flex framework. The historical part of this is that I originally wrote the slideboxx interface in Javascript using the <a href="http://developer.yahoo.com/yui/" target="_blank">YUI library</a> and at that point YUI did not have JSON handling.  An example of fitting into the Flex framework is that XML result sets can be translated directly to ArrayCollections.  So for results that are going to target something like a Flex List component, returning an XML result set means I don&#8217;t need to write any parsing code.  The relevant part of the XML I use to pass slide search results from Python to Flex looks something like this:</p>
<div>
<pre class="brush: xml;">
&lt;ResultSet&gt;
    &lt;Result&gt;
        &lt;ID&gt;...&lt;/ID&gt;
        &lt;name&gt;...&lt;/name&gt;
        etc...
    &lt;/Result&gt;
    &lt;Result&gt;
         ...
    &lt;/Result&gt;
    ...
&lt;/ResultSet&gt;
</pre>
<p>You can see it is a <span style="font-family:courier;">&lt;ResultSet&gt;</span> with a list of <span style="font-family:courier;">&lt;Result&gt;</span> elements.  I generate it using string operations in Python, which in this case is straightfoward.</p>
<p>On the Flex side this becomes an ArrayCollection which is bound as a dataProvider for a TileList element:<br />
In the Actionscript part:</p>
<pre class="brush: xml;">
[Bindable]
public var feed:ArrayCollection = new ArrayCollection( );
...
private function resultHandler( event : ResultEvent ) : void {
    ...
    try {
        feed = event.result.ResultSet.Result; 
    } catcht( e : Error ) {
        feed = new ArrayCollection( ArrayUtil.toArray( event.result.ResultSet.Result ) ) ;
   }
   ...
}
</pre>
<p>and in the MXML:</p>
<pre class="brush: xml;">
&lt;mx:TileList ... id=&quot;theList&quot; dataProvider=&quot;{feed}&quot; ...&gt;
    &lt;mx:itemRenderer&gt;
        &lt;mx:Component&gt;
            &lt;!-- put some custom component here that can bind some
                 the elements of each &lt;Result&gt;, these will be referenced
                 as &quot;{data.&lt;elementName&gt;}&quot; e.g., &quot;{data.ID}&quot; --&gt;
        &lt;/mx:Component&gt;
     &lt;/mx:itemRenderer&gt;
&lt;/mx:TileList&gt;
</pre>
<p>I realize there is a <a href="http://pyamf.org/" target="_blank">library for serializing Python objects to AMF</a>.  I&#8217;ve tried to keep the external dependencies to a minimum so I didn&#8217;t use PyAMF.  We don&#8217;t currently see any performance issues using XML and JSON but will continue to evaluate if/when it makes sense to introduce PyAMF.</p>
<p>I should also mention that communication between client and server happens over HTTP using the <span style="font-family:courier;">WSGIServer</span> from the <span style="font-family:courier;">wsgiref.simple_server</span> module with a threading mixin and over sockets using <span style="font-family:courier;">asyncore</span> (I use sockets for cases where I need to push notifications from the Python code to the Flex GUI).  I do not use the <span style="font-family:courier;">SimpleXMLRPCServer</span> in Python.</div>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/metazin.wordpress.com/106/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/metazin.wordpress.com/106/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/metazin.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/metazin.wordpress.com/106/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/metazin.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/metazin.wordpress.com/106/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/metazin.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/metazin.wordpress.com/106/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/metazin.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/metazin.wordpress.com/106/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/metazin.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/metazin.wordpress.com/106/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/metazin.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/metazin.wordpress.com/106/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/metazin.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/metazin.wordpress.com/106/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=metazin.wordpress.com&amp;blog=4118880&amp;post=106&amp;subd=metazin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://metazin.wordpress.com/2008/08/15/architecture-of-a-python-flex-application/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8b628ff5cf046eab6ed4374ac93d1fcd?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">metazin</media:title>
		</media:content>
	</item>
		<item>
		<title>How to work with PowerPoint files in Python</title>
		<link>http://metazin.wordpress.com/2008/08/12/how-to-work-with-powerpoint-files-in-python/</link>
		<comments>http://metazin.wordpress.com/2008/08/12/how-to-work-with-powerpoint-files-in-python/#comments</comments>
		<pubDate>Tue, 12 Aug 2008 19:57:37 +0000</pubDate>
		<dc:creator>metazin</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[powerpoint]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://metazin.wordpress.com/?p=86</guid>
		<description><![CDATA[Working with PowerPoint files is a substantial part of the problem to solve in building a tool to search PowerPoint files and build new presentations. In this application, we have to be able to read and write PowerPoint files.  I looked at a number of solutions including using code from the POI project.  This was [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=metazin.wordpress.com&amp;blog=4118880&amp;post=86&amp;subd=metazin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Working with PowerPoint files is a substantial part of the problem to solve in building a <a href="http://www.slideboxx.com" target="_blank">tool to search PowerPoint files and build new presentations</a>.  In this application, we have to be able to read <em>and</em> write PowerPoint files.  I looked at a number of solutions including using code from the <a href="http://poi.apache.org/hslf/index.html" target="_blank">POI project</a>.  This was not a good idea for at least two reasons: interfacing Python to Java (doable, but not something I wanted to spend time on) and POI-HSLF does not work with .pptx (PowerPoint 2007) files.  The best way to work with PowerPoint files (and MS-Office files in general) programmatically is to use PowerPoint/MS-Office itself &#8212; <a href="http://www.joelonsoftware.com/items/2008/02/19.html" target="_blank">this is explained very well by Joel Spolsky</a>.</p>
<p>Now, I&#8217;m not going to &#8220;give away the farm&#8221;, but I am going to show you where it is&#8230;</p>
<p>To start with, you need the <a href="https://sourceforge.net/projects/pywin32/" target="_blank">Python for Windows extensions (a.k.a. pywin32) package</a>.  This gives you the bits you need to work with COM automation.  The other critical piece of information is the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=9c0aa0f6-a164-4f87-a01a-1bc17e698e22&amp;displaylang=en" target="_blank">PowerPoint Visual Basic for Applications (VBA) reference</a> &#8212; this is your map to the object model you access via COM.</p>
<p>Connecting to PowerPoint and opening a presentation is a few of lines of code:</p>
<pre class="brush: python;">

import pythoncom
import win32com.client

pythoncom.CoInitializeEx( pythoncom.COINIT_APARTMENTTHREADED )
myPowerPoint = win32com.client.DispatchEx( 'Powerpoint.Application' )
thePresentation = myPowerPoint.Presentations.Open( ppt, True, False, False )
</pre>
<p>You can look up what to do with <span style="font-family:courier;">thePresentation</span> object in the VBA reference (usually installed in <span style="font-family:courier;">C:\Program Files\Microsoft Office\OFFICE11\1033\vbapp10.chm</span> (if not there, search your drive for <span style="font-family:courier;">vbapp10.chm</span>).</p>
<p>For example, you can retrieve the number of slides in a presentation, via the Count property of the Slides collection:</p>
<p><span style="font-family:'Courier New';line-height:18px;white-space:pre;">
<pre class="brush: python;">
nSlides = thePresentation.Slides.Count
</pre>
<p></span></p>
<p>When you&#8217;re done, be sure to clean up after yourself&#8230;.</p>
<pre class="brush: python;">
thePresentation.Close( ) #or thePresentation.Save(...), depending on what you need
del thePresentation
del myPowerPoint #the connection to PowerPoint
pythoncom.CoUninitialize( )
</pre>
<p>This approach to working with MS-Office documents will work for Excel and (presumably, I haven&#8217;t tried it myself) Word.  There are some good examples for those applications in Mark Hammond&#8217;s &#8220;Python Programming on Win32&#8243; (this book is extremely helpful if you&#8217;re doing Windows stuff with Python).</p>
<p>By using PowerPoint to &#8220;do the heavy lifting&#8221; as Joel Spolsky put it, we are able to use the same code to drive PowerPoint versions 2000 through 2007.  I&#8217;ve found the COM/VBA interface/API/whatever to be quite stable across PowerPoint releases.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/metazin.wordpress.com/86/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/metazin.wordpress.com/86/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/metazin.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/metazin.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/metazin.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/metazin.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/metazin.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/metazin.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/metazin.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/metazin.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/metazin.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/metazin.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/metazin.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/metazin.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/metazin.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/metazin.wordpress.com/86/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=metazin.wordpress.com&amp;blog=4118880&amp;post=86&amp;subd=metazin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://metazin.wordpress.com/2008/08/12/how-to-work-with-powerpoint-files-in-python/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8b628ff5cf046eab6ed4374ac93d1fcd?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">metazin</media:title>
		</media:content>
	</item>
		<item>
		<title>how to kill a process in Windows using Python</title>
		<link>http://metazin.wordpress.com/2008/08/09/how-to-kill-a-process-in-windows-using-python/</link>
		<comments>http://metazin.wordpress.com/2008/08/09/how-to-kill-a-process-in-windows-using-python/#comments</comments>
		<pubDate>Sun, 10 Aug 2008 02:36:06 +0000</pubDate>
		<dc:creator>metazin</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://metazin.wordpress.com/?p=67</guid>
		<description><![CDATA[While checking some facts for my previous post &#8220;how to find a process by name in Windows using Python&#8221; I came across a post about &#8220;how to kill a process in Windows using Python&#8220;.  I realize I have code for an alternate approach to doing such a thing so figured I&#8217;d post a sequel. Once [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=metazin.wordpress.com&amp;blog=4118880&amp;post=67&amp;subd=metazin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>While checking some facts for my previous post &#8220;<a href="http://metazin.wordpress.com/2008/08/08/how-to-find-a-process-by-name-in-windows-using-python/">how to find a process by name in Windows using Python</a>&#8221; I came across a post about &#8220;<a href="http://blogs.sun.com/rajkumar/entry/how_to_kill_a_process" target="_blank">how to kill a process in Windows using Python</a>&#8220;.  I realize I have code for an alternate approach to doing such a thing so figured I&#8217;d post a sequel.</p>
<p>Once you have the process identifier in hand using the method described in my previous post, you can get the handle to the process like this (assume <span style="font-family:courier;">pid</span> is the process identifier returned by <span style="color:#00ffff;"><a href="http://metazin.wordpress.com/2008/08/08/how-to-find-a-process-by-name-in-windows-using-python/">GetProcessID</a></span>):</p>
<pre class="brush: python;">

import win32api, win32con

handle = win32api.OpenProcess( win32con.PROCESS_TERMINATE, 0, pid )
</pre>
<p>If you already have the handle (<em>e.g.</em>, if you had started the process in the same bit of code as Rajkumar did in his blog), then you can go straight to terminating the process:</p>
<pre class="brush: python;">

win32api.TerminateProcess( handle, 0 )

win32api.CloseHandle( handle )
</pre>
<p>I&#8217;m not sure of the context in which the other author needed to kill a process, so the approach may not fit his needs.  Anyway, it&#8217;s an alternative in case anyone&#8217;s looking&#8230;.</p>
<p>That&#8217;s all, hope it helps!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/metazin.wordpress.com/67/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/metazin.wordpress.com/67/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/metazin.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/metazin.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/metazin.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/metazin.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/metazin.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/metazin.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/metazin.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/metazin.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/metazin.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/metazin.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/metazin.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/metazin.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/metazin.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/metazin.wordpress.com/67/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=metazin.wordpress.com&amp;blog=4118880&amp;post=67&amp;subd=metazin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://metazin.wordpress.com/2008/08/09/how-to-kill-a-process-in-windows-using-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8b628ff5cf046eab6ed4374ac93d1fcd?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">metazin</media:title>
		</media:content>
	</item>
		<item>
		<title>[sourcecode] and Safari</title>
		<link>http://metazin.wordpress.com/2008/08/09/sourcecode-and-safari/</link>
		<comments>http://metazin.wordpress.com/2008/08/09/sourcecode-and-safari/#comments</comments>
		<pubDate>Sun, 10 Aug 2008 02:32:14 +0000</pubDate>
		<dc:creator>metazin</dc:creator>
				<category><![CDATA[technology]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[browser wars]]></category>
		<category><![CDATA[Safari]]></category>

		<guid isPermaLink="false">http://metazin.wordpress.com/?p=69</guid>
		<description><![CDATA[Hi all: Since I started posting source code examples, I am using the awesome short code for WordPress.  I was a bit frustrated because the nice highlighting and line numbering wasn&#8217;t showing up.  I read somewhere that doesn&#8217;t work with all themes so I tried a bunch of themes. It turns out everything looks great [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=metazin.wordpress.com&amp;blog=4118880&amp;post=69&amp;subd=metazin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hi all:</p>
<p>Since I started posting source code examples, I am using the <a href="http://faq.wordpress.com/2007/09/03/how-do-i-post-source-code/" target="_blank">awesome  short code for WordPress</a>.  I was a bit frustrated because the nice highlighting and line numbering wasn&#8217;t showing up.  I read somewhere that  doesn&#8217;t work with all themes so I tried a bunch of themes.</p>
<p>It turns out everything looks great in IE or FireFox but you don&#8217;t get all the same goodness when viewing using Safari.  So, sorry to all you Safari users, I feel your pain.</p>
<p>Does anyone know why this happens in Safari?  and/or a way to make it work?</p>
<p>Thanks!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/metazin.wordpress.com/69/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/metazin.wordpress.com/69/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/metazin.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/metazin.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/metazin.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/metazin.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/metazin.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/metazin.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/metazin.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/metazin.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/metazin.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/metazin.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/metazin.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/metazin.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/metazin.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/metazin.wordpress.com/69/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=metazin.wordpress.com&amp;blog=4118880&amp;post=69&amp;subd=metazin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://metazin.wordpress.com/2008/08/09/sourcecode-and-safari/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8b628ff5cf046eab6ed4374ac93d1fcd?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">metazin</media:title>
		</media:content>
	</item>
		<item>
		<title>how to find a process by name in Windows using Python</title>
		<link>http://metazin.wordpress.com/2008/08/08/how-to-find-a-process-by-name-in-windows-using-python/</link>
		<comments>http://metazin.wordpress.com/2008/08/08/how-to-find-a-process-by-name-in-windows-using-python/#comments</comments>
		<pubDate>Fri, 08 Aug 2008 15:30:57 +0000</pubDate>
		<dc:creator>metazin</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://metazin.wordpress.com/?p=45</guid>
		<description><![CDATA[Here&#8217;s an interesting and useful tidbit. There&#8217;s a part of slideboxx where I need to find out whether a particular process is running. I used the method in killProcName.py referenced in &#8220;Python Programming on Win32&#8243; (assuming you installed win32all a.k.a. pywin32 a.k.a. Python for Windows extensions, the code can be found in $PYTHONHOME\Lib\site-packages\win32\scripts). The code [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=metazin.wordpress.com&amp;blog=4118880&amp;post=45&amp;subd=metazin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s an interesting and useful tidbit.</p>
<p>There&#8217;s a part of slideboxx where I need to find out whether a particular process is running.  I used the method in killProcName.py referenced in &#8220;Python Programming on Win32&#8243; (assuming you installed <a href="https://sourceforge.net/projects/pywin32/" target="_blank">win32all a.k.a. pywin32 a.k.a. Python for Windows extensions</a>, the code can be found in $PYTHONHOME\Lib\site-packages\win32\scripts).  The code I was using looks something like this: </p>
<pre class="brush: python;">
import win32pdhutil
win32pdhutil.GetPerformanceAttributes( 'Process', 'ID Process', 'process_name' )
processIDs = win32pdhutil.FindPerformanceAttributesByName( 'process_name' )
</pre>
<p>This worked fine on my test system; however, I received reports from users that the functionality that called this code was slow. As an aside, it&#8217;s almost always a challenge to go from the report of &#8220;it&#8217;s too slow when I click on this&#8221; to knowing what part of the code is causing the problem, especially when you can&#8217;t reproduce the issue!  After narrowing down the issue, I hit up google for help and came across a <a href="http://coding.derkeiler.com/Archive/Python/comp.lang.python/2007-10/msg00717.html" target="_blank">newsgroup message with a solution</a> and ended up using the following code:</p>
<pre class="brush: python;">
import win32pdh
def GetProcessID( name ) :
    object = &quot;Process&quot;
    items, instances = win32pdh.EnumObjectItems( None, None, object,
                                                 win32pdh.PERF_DETAIL_WIZARD )
    val = None
    if name in instances :
        hq = win32pdh.OpenQuery()
        hcs = [ ]
        item = &quot;ID Process&quot;
        path = win32pdh.MakeCounterPath( ( None, object, name, None, 0, item ) )
        hcs.append( win32pdh.AddCounter( hq, path ) )
        win32pdh.CollectQueryData( hq )
        time.sleep( 0.01 )
        win32pdh.CollectQueryData( hq )

       for hc in hcs:
            type, val = win32pdh.GetFormattedCounterValue( hc, win32pdh.PDH_FMT_LONG )
            win32pdh.RemoveCounter( hc )
       win32pdh.CloseQuery( hq )
       return val
</pre>
<p>With that change in place, users reported no more lag in that part of the program.  I don&#8217;t understand Windows internals well enough to know why there is a difference.  What I do know is that it works and it improves the user experience.  If anyone can explain the difference, I&#8217;d appreciate it (and I&#8217;m sure others would too) if you left a comment with an explanation.  Thanks!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/metazin.wordpress.com/45/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/metazin.wordpress.com/45/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/metazin.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/metazin.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/metazin.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/metazin.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/metazin.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/metazin.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/metazin.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/metazin.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/metazin.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/metazin.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/metazin.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/metazin.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/metazin.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/metazin.wordpress.com/45/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=metazin.wordpress.com&amp;blog=4118880&amp;post=45&amp;subd=metazin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://metazin.wordpress.com/2008/08/08/how-to-find-a-process-by-name-in-windows-using-python/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8b628ff5cf046eab6ed4374ac93d1fcd?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">metazin</media:title>
		</media:content>
	</item>
		<item>
		<title>opensource</title>
		<link>http://metazin.wordpress.com/2008/08/06/opensource/</link>
		<comments>http://metazin.wordpress.com/2008/08/06/opensource/#comments</comments>
		<pubDate>Thu, 07 Aug 2008 01:14:04 +0000</pubDate>
		<dc:creator>metazin</dc:creator>
				<category><![CDATA[technology]]></category>
		<category><![CDATA[opensource]]></category>

		<guid isPermaLink="false">http://metazin.wordpress.com/?p=35</guid>
		<description><![CDATA[Thank you to open source developers around the world!  We built slideboxx using a number of open source technologies including Python, SQLite (now comes with Python), py2exe, Lucene, Ferret, Python Imaging Library, pywin32, flex, and simplejson.  We want to give back to the community by 1. contributing some code I developed and 2. some sort [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=metazin.wordpress.com&amp;blog=4118880&amp;post=35&amp;subd=metazin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Thank you to open source developers around the world!  We built slideboxx using a number of open source technologies including Python, SQLite (now comes with Python), py2exe, Lucene, Ferret, Python Imaging Library, pywin32, flex, and simplejson.  We want to give back to the community by 1. contributing some code I developed and 2. some sort of discount or product give-away (once we have more revenue!) Not sure what we&#8217;ll do here, any ideas? leave a comment&#8230;&#8230;</p>
<p>Thanks again!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/metazin.wordpress.com/35/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/metazin.wordpress.com/35/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/metazin.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/metazin.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/metazin.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/metazin.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/metazin.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/metazin.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/metazin.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/metazin.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/metazin.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/metazin.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/metazin.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/metazin.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/metazin.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/metazin.wordpress.com/35/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=metazin.wordpress.com&amp;blog=4118880&amp;post=35&amp;subd=metazin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://metazin.wordpress.com/2008/08/06/opensource/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8b628ff5cf046eab6ed4374ac93d1fcd?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">metazin</media:title>
		</media:content>
	</item>
		<item>
		<title>powerpoint 1</title>
		<link>http://metazin.wordpress.com/2008/07/31/powerpoint-1/</link>
		<comments>http://metazin.wordpress.com/2008/07/31/powerpoint-1/#comments</comments>
		<pubDate>Fri, 01 Aug 2008 00:17:49 +0000</pubDate>
		<dc:creator>metazin</dc:creator>
				<category><![CDATA[powerpoint]]></category>
		<category><![CDATA[presentation]]></category>

		<guid isPermaLink="false">http://metazin.wordpress.com/?p=18</guid>
		<description><![CDATA[PowerPoint.  It&#8217;s common that people have a love-hate relationship with PowerPoint.  I think PowerPoint is a fantastic, liberating tool.  I&#8217;ve been doing presentations for a sufficiently long time that I recall needing to have my slides ready days before leaving for a conference because I needed time to shoot them to film and have the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=metazin.wordpress.com&amp;blog=4118880&amp;post=18&amp;subd=metazin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>PowerPoint.  It&#8217;s common that people have a <a href="http://www.unboundedition.com/content/view/1308/50/" target="_blank">love</a>-<a href="http://onstartups.com/home/tabid/3339/bid/4683/Why-I-Hate-PowerPoint-and-You-Probably-Do-Too.aspx" target="_blank">hate</a> relationship with PowerPoint.  I think PowerPoint is a fantastic, liberating tool.  I&#8217;ve been doing presentations for a sufficiently long time that I recall needing to have my slides ready days before leaving for a conference because I needed time to shoot them to film and have the film processed &#8212; yes those were <strong>real</strong> slides, the 35mm kind.  With PowerPoint I can revise and tweak a presentation until I have to give it; what a fantastic capability for when you are inevitably generating data until it&#8217;s time to catch a plane to wherever you are presenting.</p>
<p>That&#8217;s the &#8220;love&#8221; part.  What about the &#8220;hate?&#8221;  We&#8217;ve all heard about &#8220;<a href="http://lifehacker.com/software/presentations/stop-death-by-powerpoint-323554.php" target="_blank">death by PowerPoint</a>&#8221; and how to <a href="http://particletree.com/notebook/powerpoint-and-presentation-tips/" target="_blank">avoid it</a> by listening to the <a href="http://www.presentationzen.com/" target="_self">good people</a> who <a href="http://www.beyondbulletpoints.com/" target="_blank">have advice</a> on <a href="http://slideology.com/" target="_blank">how to prepare</a> and <a onclick="return mugicPopWin(this,event);" oncontextmenu="mugicRightClick(this);" href="http://www.amazon.com/gp/redirect.html?ie=UTF8&amp;location=http%3A%2F%2Fwww.amazon.com%2FCraft-Scientific-Presentations-Critical-Succeed%2Fdp%2F0387955550&amp;tag=metazin-20&amp;linkCode=ur2&amp;camp=1789&amp;creative=9325" target="_blank">give good scientific</a> and<a href="http://www.tbenjaminlarsen.com/files/f1bfbde77ca4ae2745659021c616da6d-47.php" target="_blank"> technical presentations</a><img style="border:none !important;margin:0 !important;" src="http://www.assoc-amazon.com/e/ir?t=metazin-20&amp;l=ur2&amp;o=1" border="0" alt="" width="1" height="1" />.  They say it better than I can so I won&#8217;t belabor those points.  Another thing that frustrates me about PowerPoint in a research organization is how much information can be hidden away in PowerPoint slide decks, again it&#8217;s not PowerPoint itself but how people use it.</p>
<p>I&#8217;ve found through experience that no amount of organizational structure can solve the problem of information getting lost in PowerPoint presentations.  When you&#8217;re working on a team (even a team of one) each person&#8217;s way to organize will be different.  Who is to define the organizational structure? and will it make sense to anyone else? and who will enforce the structure?  I think all those questions lead to a waste of time and mental effort.  That&#8217;s one of the reasons we developed slideboxx: don&#8217;t worry too much about where to put the information, we&#8217;ll <a href="http://www.slideboxx.com" target="_blank">search for the slides</a>!</p>
<p>In closing, I want to ask you: what are your frustrations with PowerPoint?  particularly in the culture around PowerPoint and how people use it in your organization?  Please leave a comment with your thoughts.  Thank you!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/metazin.wordpress.com/18/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/metazin.wordpress.com/18/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/metazin.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/metazin.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/metazin.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/metazin.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/metazin.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/metazin.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/metazin.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/metazin.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/metazin.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/metazin.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/metazin.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/metazin.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/metazin.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/metazin.wordpress.com/18/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=metazin.wordpress.com&amp;blog=4118880&amp;post=18&amp;subd=metazin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://metazin.wordpress.com/2008/07/31/powerpoint-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8b628ff5cf046eab6ed4374ac93d1fcd?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">metazin</media:title>
		</media:content>

		<media:content url="http://www.assoc-amazon.com/e/ir?t=metazin-20&#38;l=ur2&#38;o=1" medium="image" />
	</item>
		<item>
		<title>python</title>
		<link>http://metazin.wordpress.com/2008/07/15/python/</link>
		<comments>http://metazin.wordpress.com/2008/07/15/python/#comments</comments>
		<pubDate>Tue, 15 Jul 2008 15:32:33 +0000</pubDate>
		<dc:creator>metazin</dc:creator>
				<category><![CDATA[technology]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[RIA]]></category>

		<guid isPermaLink="false">http://metazin.wordpress.com/?p=16</guid>
		<description><![CDATA[Why Python? The short answer is because I know it and I know I&#8217;m fast with it. I&#8217;ve been developing in Python for about eight years, prior to Python I coded in Basic, Pascal, Fortran, C, Tcl, Expect, C++, Java, and Perl; so I&#8217;ve seen a few things. I settled on Python because my employer at [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=metazin.wordpress.com&amp;blog=4118880&amp;post=16&amp;subd=metazin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Why Python? The short answer is because I know it and I know I&#8217;m fast with it.</p>
<p>I&#8217;ve been developing in Python for about eight years, prior to Python I coded in Basic, Pascal, Fortran, C, Tcl, Expect, C++, Java, and Perl; so I&#8217;ve seen a few things. I settled on Python because my employer at the time used it, I continue to use it because I&#8217;ve not found another language in which I generally can get so much done in short periods of time. Part of it is the expressive syntax, and part of it is all the built-in libraries. I adore the significance of indentation, which almost forces one to write readable code. Python is the only language I&#8217;ve used where it is easy to figure out what you (or even someone else) meant by reading the code at a later time.</p>
<p>Python is expressive and efficient. It doesn&#8217;t take a lot of typing to get things done. slideboxx has an http server builtin, it talks to the frontend over http using XML and JSON, it also talks to the frontend using sockets, it stores some information in a relation database, it interacts with an indexing library, and controls PowerPoint using COM automation. slideboxx has a lot going on &#8212; all the bits you need for any Rich Internet Application (RIA, for short). The source code for slideboxx is less than 4000 lines of Python, and I don&#8217;t use a lot of tricks to make the code compact, I keep it simple so it&#8217;s easy to maintain. With some refactoring I could trim the LOC count.</p>
<p>Python includes a number of high-quality libraries built-in. As of Python 2.5 sqlite and ElementTree are there &#8212; a great embeded relational database and a nice simple way of dealing with XML. slideboxx is not computationally intensive so speed is not a huge concern. If it were, we&#8217;d rewrite the slow parts in C.</p>
<p>Now all this Python love doesn&#8217;t mean it&#8217;s right for you. I looked at using this project as a way to teach myself Ruby, but I knew that for me Python would be faster and could do everything. I&#8217;m hoping to do a Ruby project soon!</p>
<p>I believe in Python. I hope if you get a chance, you&#8217;ll give it a try on a future project!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/metazin.wordpress.com/16/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/metazin.wordpress.com/16/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/metazin.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/metazin.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/metazin.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/metazin.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/metazin.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/metazin.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/metazin.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/metazin.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/metazin.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/metazin.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/metazin.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/metazin.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/metazin.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/metazin.wordpress.com/16/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=metazin.wordpress.com&amp;blog=4118880&amp;post=16&amp;subd=metazin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://metazin.wordpress.com/2008/07/15/python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8b628ff5cf046eab6ed4374ac93d1fcd?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">metazin</media:title>
		</media:content>
	</item>
	</channel>
</rss>
