<?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>Werx Limited &#187; python</title> <atom:link href="http://werxltd.com/wp/category/software-development/python-software-development/feed/" rel="self" type="application/rss+xml" /><link>http://werxltd.com/wp</link> <description>We make IT work.</description> <lastBuildDate>Mon, 23 Jan 2012 23:03:59 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>Finding yesterday&#8217;s beginning and ending unix timestamp</title><link>http://werxltd.com/wp/2011/08/25/finding-yesterdays-beginning-and-ending-unix-timestamp/</link> <comments>http://werxltd.com/wp/2011/08/25/finding-yesterdays-beginning-and-ending-unix-timestamp/#comments</comments> <pubDate>Thu, 25 Aug 2011 20:03:58 +0000</pubDate> <dc:creator>wes</dc:creator> <category><![CDATA[python]]></category> <category><![CDATA[data]]></category> <category><![CDATA[data management]]></category> <category><![CDATA[database]]></category> <category><![CDATA[reports]]></category><guid
isPermaLink="false">http://werxltd.com/wp/?p=1047</guid> <description><![CDATA[When writing reports I&#8217;ve often come across the need to find the unix timestamp beginning and end of a day. Here is a Python snippet that does just that. yesterday = datetime.datetime.now() - datetime.timedelta(days = 1) yesterday_beginning = datetime.datetime(yesterday.year, yesterday.month, yesterday.day,0,0,0,0) yesterday_beginning_time = int(time.mktime(yesterday_beginning.timetuple())) yesterday_end = datetime.datetime(yesterday.year, yesterday.month, yesterday.day,23,59,59,999) yesterday_end_time = int(time.mktime(yesterday_end.timetuple())) print yesterday_beginning_time print [...]]]></description> <content:encoded><![CDATA[<p>When writing reports I&#8217;ve often come across the need to find the unix timestamp beginning and end of a day. Here is a Python snippet that does just that.</p><pre class="brush:python">
yesterday = datetime.datetime.now() - datetime.timedelta(days = 1)
yesterday_beginning = datetime.datetime(yesterday.year, yesterday.month, yesterday.day,0,0,0,0)
yesterday_beginning_time = int(time.mktime(yesterday_beginning.timetuple()))
yesterday_end = datetime.datetime(yesterday.year, yesterday.month, yesterday.day,23,59,59,999)
yesterday_end_time = int(time.mktime(yesterday_end.timetuple()))

print yesterday_beginning_time
print yesterday_end_time
</pre><div
class="betterrelated none"><p>No related content found.</p></div><p><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F08%2F25%2Ffinding-yesterdays-beginning-and-ending-unix-timestamp%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F08%2F25%2Ffinding-yesterdays-beginning-and-ending-unix-timestamp%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F08%2F25%2Ffinding-yesterdays-beginning-and-ending-unix-timestamp%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F08%2F25%2Ffinding-yesterdays-beginning-and-ending-unix-timestamp%2F&amp;count=none&amp;text=Finding%20yesterday%26%238217%3Bs%20beginning%20and%20ending%20unix%20timestamp" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F08%2F25%2Ffinding-yesterdays-beginning-and-ending-unix-timestamp%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F08%2F25%2Ffinding-yesterdays-beginning-and-ending-unix-timestamp%2F&amp;count=none&amp;text=Finding%20yesterday%26%238217%3Bs%20beginning%20and%20ending%20unix%20timestamp" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F08%2F25%2Ffinding-yesterdays-beginning-and-ending-unix-timestamp%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F08%2F25%2Ffinding-yesterdays-beginning-and-ending-unix-timestamp%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><a
class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F08%2F25%2Ffinding-yesterdays-beginning-and-ending-unix-timestamp%2F&amp;linkname=Finding%20yesterday%26%238217%3Bs%20beginning%20and%20ending%20unix%20timestamp" title="LinkedIn" rel="nofollow" target="_blank"><img
src="http://werxltd.com/wp/wp-content/plugins/add-to-any/icons/linkedin.png?9d7bd4" width="16" height="16" alt="LinkedIn"/></a><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F08%2F25%2Ffinding-yesterdays-beginning-and-ending-unix-timestamp%2F&amp;title=Finding%20yesterday%26%238217%3Bs%20beginning%20and%20ending%20unix%20timestamp" id="wpa2a_2">Share/Save</a></p>]]></content:encoded> <wfw:commentRss>http://werxltd.com/wp/2011/08/25/finding-yesterdays-beginning-and-ending-unix-timestamp/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Fun with heatmaps</title><link>http://werxltd.com/wp/2011/02/28/fun-with-heatmaps/</link> <comments>http://werxltd.com/wp/2011/02/28/fun-with-heatmaps/#comments</comments> <pubDate>Mon, 28 Feb 2011 15:00:50 +0000</pubDate> <dc:creator>wes</dc:creator> <category><![CDATA[c++]]></category> <category><![CDATA[hosting]]></category> <category><![CDATA[it industry]]></category> <category><![CDATA[javascript]]></category> <category><![CDATA[python]]></category> <category><![CDATA[software development]]></category> <category><![CDATA[big data]]></category> <category><![CDATA[canvas]]></category> <category><![CDATA[gRaphaël]]></category> <category><![CDATA[heatmap]]></category> <category><![CDATA[html5]]></category> <category><![CDATA[map reduce]]></category> <category><![CDATA[mongodb]]></category> <category><![CDATA[node.js]]></category> <category><![CDATA[nodejs]]></category> <category><![CDATA[raphael]]></category> <category><![CDATA[socket.io]]></category> <category><![CDATA[web scale]]></category><guid
isPermaLink="false">http://werxltd.com/wp/?p=903</guid> <description><![CDATA[Recently I&#8217;ve been playing with a few new technologies. Some are new to me while most are simply new. My base project to use these technologies is a heatmap visualization of churches in Georgia. While heatmaps in themselves aren&#8217;t exactly exciting, having the ability to map more than 10,000 data points at a time in [...]]]></description> <content:encoded><![CDATA[<p>Recently I&#8217;ve been playing with a few new technologies. Some are new to me while most are simply new. My base project to use these technologies is a <a
href="http://heatmap.reasontostand.org">heatmap visualization of churches in Georgia</a>. While heatmaps in themselves aren&#8217;t exactly exciting, having the ability to map more than 10,000 data points at a time in real-time is.</p><p>So here are the various technologies I used in the creation of my app.</p><h2>YQL</h2><p>To get the data for this project I used a simple Python script and <a
href="http://developer.yahoo.com/yql/">YQL</a> to get a list of locations in each Zip code in Georgia with the term &#8220;Church&#8221; in them. This yielded approximately 10,000 results, including a few from South Carolina.</p><h2>MongoDB</h2><p>I stored the data I got from YQL in <a
href="http://www.mongodb.org/">MongoDB</a>. Specifically, I used <a
href="https://mongolab.com/home/">MongoLab&#8217;s</a> to host the data because they have a generous free storage limit (256Meg) and can be accessed from a RackSpace server without incurring an additional bandwidth charge.</p><p>MongoDB is a JavaScript-based <a
href="http://en.wikipedia.org/wiki/NoSQL">NoSQL</a> solution used by sites like Foursquare. It has built-in support for Geo queries and is built to scale.</p><h2>node.js</h2><p>For the application layer I decided to try out <a
href="http://nodejs.org/">node.js</a>. Node is also JavaScript-based, based on <a
href="http://www.webkit.org/">WebKit</a>, the engine behind Google&#8217;s Chrome and Apple&#8217;s Safari browsers. Node is event-based which means it has the potential to be lightning fast.</p><h2>Canvas</h2><p>The biggest factor in how well a heatmap solution performs is the graphics package that&#8217;s used. After searching around I found a pretty decent <a
href="http://www.labsmedia.com/clickheat/156914.html">PHP heatmap solution</a>, but it used GD and was very slow. I also found <a
href="http://www.patrick-wied.at/static/heatmap/">a JavaScript solution</a> that used the new <a
href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html">HTML5 Canvas element</a>, but it choked when given a significant amount of datapoints to render all at once. So I decided to refactor some of the utility functions from the PHP solution and combine them with the Canvas function.</p><p>The great thing about the resulting solution is that it has the ability to run on either the client-side or the server-side. And in the end the heatmap application I built uses both. If the number of data points in a tile is less than a preset threshold defined per browser<sup><a
href="http://werxltd.com/wp/2011/02/28/fun-with-heatmaps/#footnote_0_903" id="identifier_0_903" class="footnote-link footnote-identifier-link" title="1000 for WebKit-based browsers, 250 for Mozilla-based browsers, and 0 for IE because IE still sucks.">1</a></sup> the raw data is sent back to the browser which renders the tiles client-side rather than consuming precious server resources.</p><h2>Web Sockets</h2><p>The usual way to serve tiles is by serving images to overlay the map. And while the heatmap solution I developed does serve static PNG files from cache, I decided to use the new <a
href="http://en.wikipedia.org/wiki/WebSockets">HTML5 Web Sockets</a> to make things a bit more interesting. What is great about web sockets is that it allows me to pass events between the server and client very easily. <a
href="http://socket.io/">Socket.io</a> made it easy to forget where the server ended and where the client began.</p><h2>ZeroMQ</h2><p>As applications scale to multiple threads, processes, and eventually across servers and networks, they need to have a way for each component to communicate with other components in an efficient manner. So add a bit of future-proofing to my solution I decided to use <a
href="http://www.zeromq.org/">ZeroMQ</a> to pass messages between the front-end web server component and the back-end tile generator component. This allows me to tune the performance of the application in both directions, up or down<sup><a
href="http://werxltd.com/wp/2011/02/28/fun-with-heatmaps/#footnote_1_903" id="identifier_1_903" class="footnote-link footnote-identifier-link" title="Tuning performance down comes in handy when you are on a shared server with limited resources.">2</a></sup>.</p><h2>Raphaël</h2><p>To add some extra pizzazz to the app I decided to add in the ability to display each individual data point along with some additional detailed information. I found that Google&#8217;s native Marker system was a bit slow when it came to displaying over 2,000 markers at a time so I decided to give the <a
href="http://raphaeljs.com/">Raphaël</a> graphics library a try. The results were impressive. Raphael was not only able to draw thousands of data points on the map seamlessly, but was able to do it with smooth animations. Look for <a
href="http://g.raphaeljs.com/">gRaphaël</a> to be employed in future renditions of this heatmap solution.</p><h2>Conclusion</h2><p>Every now and then I run across a programming challenge that reminds me why I love doing what I do. These technologies and this project have done that for me. Being able to throw together a large, complex project like this in a relatively quick manner reminded me of Fred Brooks&#8217;s comment on <a
href="http://werxltd.com/wp/2010/08/26/why-programming-is-fun/">why programming is fun</a>.</p><div
class="betterrelated"><p><strong>Related content:</strong></p><ol><li> <a
href="http://werxltd.com/wp/2010/10/12/fred-brooks-on-the-promise-of-object-oriented-programming/" title="Permanent link to Fred Brooks on the promise of object oriented programming">Fred Brooks on the promise of object oriented programming</a></li><li> <a
href="http://werxltd.com/wp/2010/09/27/mcafee-secure-url-shortener-firefox-add-on/" title="Permanent link to McAfee Secure URL Shortener Firefox Add-on">McAfee Secure URL Shortener Firefox Add-on</a></li><li> <a
href="http://werxltd.com/wp/2010/04/29/hiphop-for-php/" title="Permanent link to HipHop for PHP">HipHop for PHP</a></li><li> <a
href="http://werxltd.com/wp/2010/10/18/using-punycode-to-access-non-latin-domains/" title="Permanent link to Using punycode to access non-Latin domains">Using punycode to access non-Latin domains</a></li><li> <a
href="http://werxltd.com/wp/2011/03/26/simulating-markers-with-tile-layers/" title="Permanent link to Simulating Markers with Tile Layers">Simulating Markers with Tile Layers</a></li><li> <a
href="http://werxltd.com/wp/2009/08/26/getting-starte-with-hadoop-and-mapreduce/" title="Permanent link to Getting started with Hadoop and MapReduce">Getting started with Hadoop and MapReduce</a></li><li> <a
href="http://werxltd.com/wp/2010/09/22/mcafee-url-shortener-chrome-extension/" title="Permanent link to McAfee URL Shortener Chrome Extension">McAfee URL Shortener Chrome Extension</a></li><li> <a
href="http://werxltd.com/wp/2011/03/17/gtk-in-the-browser/" title="Permanent link to GTK in the browser">GTK in the browser</a></li><li> <a
href="http://werxltd.com/wp/2012/01/23/node-js-at-facebook/" title="Permanent link to node.js at Facebook">node.js at Facebook</a></li><li> <a
href="http://werxltd.com/wp/2011/03/08/calculate-a-color-gradient-in-javascript/" title="Permanent link to Calculate a color gradient in Javascript">Calculate a color gradient in Javascript</a></li></ol><a
class="thanks" style="font-size: smaller; text-decoration: none;" title="Related content found by the Better Related Posts plugin" href="http://www.nkuttler.de/wordpress-plugin/wordpress-related-posts-plugin/">Better Related Posts Plugin</a></div><ol
class="footnotes"><li
id="footnote_0_903" class="footnote">1000 for WebKit-based browsers, 250 for Mozilla-based browsers, and 0 for IE because IE still sucks.</li><li
id="footnote_1_903" class="footnote">Tuning performance down comes in handy when you are on a shared server with limited resources.</li></ol><p><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F02%2F28%2Ffun-with-heatmaps%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F02%2F28%2Ffun-with-heatmaps%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F02%2F28%2Ffun-with-heatmaps%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F02%2F28%2Ffun-with-heatmaps%2F&amp;count=none&amp;text=Fun%20with%20heatmaps" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F02%2F28%2Ffun-with-heatmaps%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F02%2F28%2Ffun-with-heatmaps%2F&amp;count=none&amp;text=Fun%20with%20heatmaps" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F02%2F28%2Ffun-with-heatmaps%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F02%2F28%2Ffun-with-heatmaps%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><a
class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F02%2F28%2Ffun-with-heatmaps%2F&amp;linkname=Fun%20with%20heatmaps" title="LinkedIn" rel="nofollow" target="_blank"><img
src="http://werxltd.com/wp/wp-content/plugins/add-to-any/icons/linkedin.png?9d7bd4" width="16" height="16" alt="LinkedIn"/></a><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F02%2F28%2Ffun-with-heatmaps%2F&amp;title=Fun%20with%20heatmaps" id="wpa2a_4">Share/Save</a></p>]]></content:encoded> <wfw:commentRss>http://werxltd.com/wp/2011/02/28/fun-with-heatmaps/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Fred Brooks on the promise of object oriented programming</title><link>http://werxltd.com/wp/2010/10/12/fred-brooks-on-the-promise-of-object-oriented-programming/</link> <comments>http://werxltd.com/wp/2010/10/12/fred-brooks-on-the-promise-of-object-oriented-programming/#comments</comments> <pubDate>Tue, 12 Oct 2010 12:00:26 +0000</pubDate> <dc:creator>wes</dc:creator> <category><![CDATA[c++]]></category> <category><![CDATA[general]]></category> <category><![CDATA[it industry]]></category> <category><![CDATA[java]]></category> <category><![CDATA[javascript]]></category> <category><![CDATA[perl]]></category> <category><![CDATA[php]]></category> <category><![CDATA[python]]></category> <category><![CDATA[software development]]></category> <category><![CDATA[fred brooks]]></category> <category><![CDATA[no silver bullet]]></category> <category><![CDATA[object oriented]]></category><guid
isPermaLink="false">http://werxltd.com/wp/?p=698</guid> <description><![CDATA[One view of object-oriented programming is that it is a discipline that enforces modularity and clean interfaces. A second view emphasizes encapsulation, the fact that one cannot see, much less design, the inner structure of the pieces. Another view emphasizes inheritance, with its concomitant hierarchical structure of classes, with virtual functions. Yet another view emphasizes strong abstract data-typing, with [...]]]></description> <content:encoded><![CDATA[<blockquote><p>One view of object-oriented programming is that it is a discipline that enforces modularity and clean interfaces. A second view emphasizes encapsulation, the fact that one cannot see, much less design, the inner structure of the pieces. Another view emphasizes inheritance, with its concomitant hierarchical structure of classes, with virtual functions. Yet another view emphasizes strong abstract data-typing, with its assurance that a particular data-type will be manipulated only by operations proper to it.</p><p>Now any of these disciplines can be had without taking the whole Smalltalk or C++ package—many of them predated object-oriented technology. The attractiveness of object-oriented approach is that of a multivitamin pill: in one fell swoop (that is, programmer retraining), one gets them all. It is a very promising concept.</p><p>Why has object-oriented technique grown slowly? In the nine years since &#8220;NSB,&#8221; the expectancy has steadily grown. Why has growth been slow? Theories abound. James Coggins, author for four years of the column, &#8220;The Best of comp.lang.c++ &#8221; in The C++ Report, offers this explanation:</p><blockquote><p>The problem is that programmers in O-O have been experimenting in incestuous applications and aiming low in abstraction, instead of high. For example, they have been building classes such as linked-list or set instead of classes such as user-interface or radiation beam or finite-element model. Unfortunately the self-same strong type checking in C++ that helps programmers to avoid errors also makes it hard to build big things out of little ones.</p></blockquote><p>He goes back to the basic software problem, and argues that one way to address unmet software needs is to increase the size of the intelligent workforce by enabling and coopting our clients. This argues for top-down design:</p><blockquote><p>we design large-grained classes that address concepts our clients are already working with, they can understand and question the design as it grows, and they can cooperate in the design of test cases. My ophthalmology collaborators don&#8217;t care about stacks; they do care about Legendre polynomial shape descriptions of corneas. Small encapsulations yield small benefits.</p></blockquote><p>David Parnas, whose paper was one of the origins of object-oriented concepts, sees the matter differently. He writes me:</p><blockquote><p>The answer is simple. It is because [O-O] has been tied to a variety of complex languages. Instead of teaching people that O-O is a type of design, and giving them design principles, people have taught that O-O is the use of a particular tool. We can write good or bad programs with any tool. Unless we teach people how to design, the languages matter very little. The result is that people do bad designs with these languages and get very little value from them. If the value is small, it won&#8217;t catch on.</p></blockquote><p><em>-Fred Brooks, The Mythical Man-Month, pg. 220</em></p></blockquote><div
class="betterrelated"><p><strong>Related content:</strong></p><ol><li> <a
href="http://werxltd.com/wp/2011/02/28/fun-with-heatmaps/" title="Permanent link to Fun with heatmaps">Fun with heatmaps</a></li><li> <a
href="http://werxltd.com/wp/2010/09/27/mcafee-secure-url-shortener-firefox-add-on/" title="Permanent link to McAfee Secure URL Shortener Firefox Add-on">McAfee Secure URL Shortener Firefox Add-on</a></li><li> <a
href="http://werxltd.com/wp/2010/04/29/hiphop-for-php/" title="Permanent link to HipHop for PHP">HipHop for PHP</a></li><li> <a
href="http://werxltd.com/wp/2009/08/26/getting-starte-with-hadoop-and-mapreduce/" title="Permanent link to Getting started with Hadoop and MapReduce">Getting started with Hadoop and MapReduce</a></li><li> <a
href="http://werxltd.com/wp/2010/08/26/why-programming-is-fun/" title="Permanent link to Why programming is fun">Why programming is fun</a></li><li> <a
href="http://werxltd.com/wp/2010/09/22/mcafee-url-shortener-chrome-extension/" title="Permanent link to McAfee URL Shortener Chrome Extension">McAfee URL Shortener Chrome Extension</a></li><li> <a
href="http://werxltd.com/wp/2010/11/04/javascript-performance/" title="Permanent link to Javascript performance">Javascript performance</a></li><li> <a
href="http://werxltd.com/wp/2009/06/29/cloud-computing-101/" title="Permanent link to Cloud computing 101">Cloud computing 101</a></li><li> <a
href="http://werxltd.com/wp/2009/09/04/quick-and-dirty-image-sorting-script/" title="Permanent link to Quick and dirty image sorting script">Quick and dirty image sorting script</a></li><li> <a
href="http://werxltd.com/wp/2009/12/01/hacking-your-router-for-effective-internet-monitoring/" title="Permanent link to Hacking your router for effective internet monitoring">Hacking your router for effective internet monitoring</a></li></ol><a
class="thanks" style="font-size: smaller; text-decoration: none;" title="Related content found by the Better Related Posts plugin" href="http://www.nkuttler.de/wordpress-plugin/wordpress-related-posts-plugin/">Better Related Posts Plugin</a></div><p><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F10%2F12%2Ffred-brooks-on-the-promise-of-object-oriented-programming%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F10%2F12%2Ffred-brooks-on-the-promise-of-object-oriented-programming%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F10%2F12%2Ffred-brooks-on-the-promise-of-object-oriented-programming%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F10%2F12%2Ffred-brooks-on-the-promise-of-object-oriented-programming%2F&amp;count=none&amp;text=Fred%20Brooks%20on%20the%20promise%20of%20object%20oriented%20programming" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F10%2F12%2Ffred-brooks-on-the-promise-of-object-oriented-programming%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F10%2F12%2Ffred-brooks-on-the-promise-of-object-oriented-programming%2F&amp;count=none&amp;text=Fred%20Brooks%20on%20the%20promise%20of%20object%20oriented%20programming" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F10%2F12%2Ffred-brooks-on-the-promise-of-object-oriented-programming%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F10%2F12%2Ffred-brooks-on-the-promise-of-object-oriented-programming%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><a
class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F10%2F12%2Ffred-brooks-on-the-promise-of-object-oriented-programming%2F&amp;linkname=Fred%20Brooks%20on%20the%20promise%20of%20object%20oriented%20programming" title="LinkedIn" rel="nofollow" target="_blank"><img
src="http://werxltd.com/wp/wp-content/plugins/add-to-any/icons/linkedin.png?9d7bd4" width="16" height="16" alt="LinkedIn"/></a><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F10%2F12%2Ffred-brooks-on-the-promise-of-object-oriented-programming%2F&amp;title=Fred%20Brooks%20on%20the%20promise%20of%20object%20oriented%20programming" id="wpa2a_6">Share/Save</a></p>]]></content:encoded> <wfw:commentRss>http://werxltd.com/wp/2010/10/12/fred-brooks-on-the-promise-of-object-oriented-programming/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>McAfee Secure URL Shortener Firefox Add-on</title><link>http://werxltd.com/wp/2010/09/27/mcafee-secure-url-shortener-firefox-add-on/</link> <comments>http://werxltd.com/wp/2010/09/27/mcafee-secure-url-shortener-firefox-add-on/#comments</comments> <pubDate>Mon, 27 Sep 2010 15:00:39 +0000</pubDate> <dc:creator>wes</dc:creator> <category><![CDATA[general]]></category> <category><![CDATA[it industry]]></category> <category><![CDATA[javascript]]></category> <category><![CDATA[python]]></category> <category><![CDATA[security]]></category> <category><![CDATA[software development]]></category> <category><![CDATA[add-on]]></category> <category><![CDATA[firefox]]></category> <category><![CDATA[mcaf.ee]]></category> <category><![CDATA[mcafee]]></category> <category><![CDATA[secure]]></category> <category><![CDATA[shortener]]></category><guid
isPermaLink="false">http://werxltd.com/wp/?p=756</guid> <description><![CDATA[Following the release of our extension allowing Chrome users to quickly shorten URLs using the cloud-backed security of the mcaf.ee service, we are pleased to announce the release of an add-on which allows Firefox users to quickly and securely shorten URLs to share with others. To download and install this extension, head on over to [...]]]></description> <content:encoded><![CDATA[<p><a
href="http://werxltd.com/wp/wp-content/uploads/2010/09/logo-128x128.png?9d7bd4"><img
class="size-full wp-image-760 alignright" style="margin: 5px;" title="McAfee" src="http://werxltd.com/wp/wp-content/uploads/2010/09/logo-128x128.png?9d7bd4" alt="McAfee Logo" width="128" height="128" /></a>Following the release of <a
href="http://werxltd.com/wp/2010/09/22/mcafee-url-shortener-chrome-extension/">our extension allowing Chrome users</a> to quickly shorten URLs using the cloud-backed security of the <a
href="mcaf.ee">mcaf.ee service</a>, we are pleased to announce <a
href="http://werxltd.com/wp/portfolio/mcafee-url-shortener-firefox-add-on/">the release of an add-on which allows Firefox users</a> to quickly and securely shorten URLs to share with others.</p><p>To download and install this extension, <a
href="https://addons.mozilla.org/en-US/firefox/addon/234939/">head on over to Firefox&#8217;s add-on site.</a></p><p>I also want to give a special thank you to the <a
href="https://jetpack.mozillalabs.com/">Mozilla JetPack</a> project for making the development of this extension not only less painful than it otherwise would have been, but actually fun. Thanks guys!</p><div
class="betterrelated"><p><strong>Related content:</strong></p><ol><li> <a
href="http://werxltd.com/wp/2010/10/12/fred-brooks-on-the-promise-of-object-oriented-programming/" title="Permanent link to Fred Brooks on the promise of object oriented programming">Fred Brooks on the promise of object oriented programming</a></li><li> <a
href="http://werxltd.com/wp/2010/09/22/mcafee-url-shortener-chrome-extension/" title="Permanent link to McAfee URL Shortener Chrome Extension">McAfee URL Shortener Chrome Extension</a></li><li> <a
href="http://werxltd.com/wp/2011/02/28/fun-with-heatmaps/" title="Permanent link to Fun with heatmaps">Fun with heatmaps</a></li><li> <a
href="http://werxltd.com/wp/2010/10/21/the-economist-on-biometrics/" title="Permanent link to The Economist on Biometrics">The Economist on Biometrics</a></li><li> <a
href="http://werxltd.com/wp/2009/12/01/hacking-your-router-for-effective-internet-monitoring/" title="Permanent link to Hacking your router for effective internet monitoring">Hacking your router for effective internet monitoring</a></li><li> <a
href="http://werxltd.com/wp/2010/10/05/the-state-of-automotive-computer-security/" title="Permanent link to The state of automotive computer security">The state of automotive computer security</a></li><li> <a
href="http://werxltd.com/wp/2010/10/19/do-the-images-you-post-online-pose-a-security-risk/" title="Permanent link to Do the images you post online pose a security risk?">Do the images you post online pose a security risk?</a></li><li> <a
href="http://werxltd.com/wp/2010/08/26/why-programming-is-fun/" title="Permanent link to Why programming is fun">Why programming is fun</a></li><li> <a
href="http://werxltd.com/wp/2010/11/04/javascript-performance/" title="Permanent link to Javascript performance">Javascript performance</a></li><li> <a
href="http://werxltd.com/wp/2009/11/12/beginners-guide-to-load-testing/" title="Permanent link to Beginner&#8217;s guide to load testing">Beginner&#8217;s guide to load testing</a></li></ol><a
class="thanks" style="font-size: smaller; text-decoration: none;" title="Related content found by the Better Related Posts plugin" href="http://www.nkuttler.de/wordpress-plugin/wordpress-related-posts-plugin/">Better Related Posts Plugin</a></div><p><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F09%2F27%2Fmcafee-secure-url-shortener-firefox-add-on%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F09%2F27%2Fmcafee-secure-url-shortener-firefox-add-on%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F09%2F27%2Fmcafee-secure-url-shortener-firefox-add-on%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F09%2F27%2Fmcafee-secure-url-shortener-firefox-add-on%2F&amp;count=none&amp;text=McAfee%20Secure%20URL%20Shortener%20Firefox%20Add-on" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F09%2F27%2Fmcafee-secure-url-shortener-firefox-add-on%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F09%2F27%2Fmcafee-secure-url-shortener-firefox-add-on%2F&amp;count=none&amp;text=McAfee%20Secure%20URL%20Shortener%20Firefox%20Add-on" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F09%2F27%2Fmcafee-secure-url-shortener-firefox-add-on%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F09%2F27%2Fmcafee-secure-url-shortener-firefox-add-on%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><a
class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F09%2F27%2Fmcafee-secure-url-shortener-firefox-add-on%2F&amp;linkname=McAfee%20Secure%20URL%20Shortener%20Firefox%20Add-on" title="LinkedIn" rel="nofollow" target="_blank"><img
src="http://werxltd.com/wp/wp-content/plugins/add-to-any/icons/linkedin.png?9d7bd4" width="16" height="16" alt="LinkedIn"/></a><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F09%2F27%2Fmcafee-secure-url-shortener-firefox-add-on%2F&amp;title=McAfee%20Secure%20URL%20Shortener%20Firefox%20Add-on" id="wpa2a_8">Share/Save</a></p>]]></content:encoded> <wfw:commentRss>http://werxltd.com/wp/2010/09/27/mcafee-secure-url-shortener-firefox-add-on/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Learning Languages: Python</title><link>http://werxltd.com/wp/2010/03/23/learning-languages-python/</link> <comments>http://werxltd.com/wp/2010/03/23/learning-languages-python/#comments</comments> <pubDate>Tue, 23 Mar 2010 12:00:37 +0000</pubDate> <dc:creator>wes</dc:creator> <category><![CDATA[python]]></category> <category><![CDATA[software development]]></category> <category><![CDATA[programming]]></category> <category><![CDATA[scripting]]></category><guid
isPermaLink="false">http://werxltd.com/wp/?p=529</guid> <description><![CDATA[Here are some helpful resources if you are looking to learn Python. Google I/O 2008 &#8211; Painless Python Part 1 of 2 Google I/O 2008 &#8211; Painless Python Part 2 of 2 Dive Into Python (excellent reference) No related content found.]]></description> <content:encoded><![CDATA[<p>Here are some helpful resources if you are looking to learn <a
href="http://www.python.org/">Python</a>.</p><p>Google I/O 2008 &#8211; Painless Python Part 1 of 2<br
/> <object
width="480" height="385"><param
name="movie" value="http://www.youtube.com/v/bDgD9whDfEY&#038;hl=en_US&#038;fs=1&#038;"></param><param
name="allowFullScreen" value="true"></param><param
name="allowscriptaccess" value="always"></param><embed
src="http://www.youtube.com/v/bDgD9whDfEY&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p><p>Google I/O 2008 &#8211; Painless Python Part 2 of 2<br
/> <object
width="480" height="385"><param
name="movie" value="http://www.youtube.com/v/y7vwZ20SDzc&#038;hl=en_US&#038;fs=1&#038;"></param><param
name="allowFullScreen" value="true"></param><param
name="allowscriptaccess" value="always"></param><embed
src="http://www.youtube.com/v/y7vwZ20SDzc&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p><p><a
href="http://diveintopython.org/">Dive Into Python</a> (excellent reference)</p><div
class="betterrelated none"><p>No related content found.</p></div><p><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F03%2F23%2Flearning-languages-python%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F03%2F23%2Flearning-languages-python%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F03%2F23%2Flearning-languages-python%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F03%2F23%2Flearning-languages-python%2F&amp;count=none&amp;text=Learning%20Languages%3A%20Python" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F03%2F23%2Flearning-languages-python%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F03%2F23%2Flearning-languages-python%2F&amp;count=none&amp;text=Learning%20Languages%3A%20Python" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F03%2F23%2Flearning-languages-python%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F03%2F23%2Flearning-languages-python%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><a
class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F03%2F23%2Flearning-languages-python%2F&amp;linkname=Learning%20Languages%3A%20Python" title="LinkedIn" rel="nofollow" target="_blank"><img
src="http://werxltd.com/wp/wp-content/plugins/add-to-any/icons/linkedin.png?9d7bd4" width="16" height="16" alt="LinkedIn"/></a><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F03%2F23%2Flearning-languages-python%2F&amp;title=Learning%20Languages%3A%20Python" id="wpa2a_10">Share/Save</a></p>]]></content:encoded> <wfw:commentRss>http://werxltd.com/wp/2010/03/23/learning-languages-python/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Quick and dirty image sorting script</title><link>http://werxltd.com/wp/2009/09/04/quick-and-dirty-image-sorting-script/</link> <comments>http://werxltd.com/wp/2009/09/04/quick-and-dirty-image-sorting-script/#comments</comments> <pubDate>Fri, 04 Sep 2009 18:00:32 +0000</pubDate> <dc:creator>wes</dc:creator> <category><![CDATA[general]]></category> <category><![CDATA[python]]></category> <category><![CDATA[software development]]></category> <category><![CDATA[image sorting]]></category> <category><![CDATA[script]]></category><guid
isPermaLink="false">http://werxltd.com/wp/?p=204</guid> <description><![CDATA[Recently my wife and I decided to try and wrangle our images into some sort of logical order for easy accessibility. After some thought we decided on a simple system of image-directory/year/month for our images and since our old images were spread out across several folders in no particular order I decided to write a [...]]]></description> <content:encoded><![CDATA[<p>Recently my wife and I decided to try and wrangle our images into some sort of logical order for easy accessibility. After some thought we decided on a simple system of <em>image-directory/year/month</em> for our images and since our old images were spread out across several folders in no particular order I decided to write a script to copy everything into the right folders.</p><p>Here is the Python script I wrote to sort all of our images by creation date into properly ordered folders.<sup><a
href="http://werxltd.com/wp/2009/09/04/quick-and-dirty-image-sorting-script/#footnote_0_204" id="identifier_0_204" class="footnote-link footnote-identifier-link" title="Directory walking code taken from here with slight modification to make patterns truly case insensitive.">1</a></sup></p><p>Usage:</p><pre class="brush:bash">./picturesorter.py /images/source /images/dest</pre><pre class="brush:python">
#!/usr/bin/python

import sys, shutil, os, time, tempfile
from os.path import join, getsize
from stat import *

if len(sys.argv) != 3:
	print "Usage: "+sys.argv[0]+" [source] [target]"
	sys.exit(-1)

if not os.path.isdir(sys.argv[1]):
	print "'"+sys.argv[1] +"' is not a valid source directory"
	sys.exit(-1)

if not os.path.isdir(sys.argv[2]):
	print "'"+sys.argv[2] + "' is not a valid destination directory"
	sys.exit(-1)

#Define your system's copy command here
copyCmd = "cp -f"

def walk( root, recurse=0, pattern='*', return_folders=0 ):
	import fnmatch, os, string

	result = []

	try:
		names = os.listdir(root)
	except os.error:
		return result

	pattern = pattern or '*'
	pat_list = string.splitfields( pattern , ';' )

	for name in names:
		fullname = os.path.normpath(os.path.join(root, name))

		for pat in pat_list:
			if fnmatch.fnmatch(name, pat.upper()) or fnmatch.fnmatch(name, pat.lower()):
				if os.path.isfile(fullname) or (return_folders and os.path.isdir(fullname)):
					result.append(fullname)
				continue

		if recurse:
			if os.path.isdir(fullname) and not os.path.islink(fullname):
				result = result + walk( fullname, recurse, pattern, return_folders )

	return result

def getTime(file):
	result = []
	try:
		st = os.stat(file)
	except IOError:
		print "failed to get information about", file
	else:
		result = time.localtime(st[ST_MTIME])
	return result

if __name__ == '__main__':
	log_fd, logfilename = tempfile.mkstemp (".log","psort_")
	logfile = os.fdopen(log_fd, 'w+')
	print "Scanning '%s' for images..." % sys.argv[1]
	files = walk(sys.argv[1], 1, '*.jpg;*.gif;*.png;*.psd;*.tif', 0)

	logfile.write("Found %d images in '%s'...\n" % (len(files), sys.argv[1]))
	print "Copying %d images to '%s'" % (len(files),sys.argv[2])
	for file in files:
		fileTime = getTime(file)

		destination = os.path.join(sys.argv[2], "%s" % fileTime.tm_year)

		if not os.path.isdir(destination):
			os.mkdir(destination)
			logfile.write("Created directory '%s''n" % destination)

		destination = os.path.join(destination, time.strftime("%m", fileTime))

		if not os.path.isdir(destination):
			os.mkdir(destination)
			logfile.write("Created directory '%s''\n" % destination)

		os.system("%s \"%s\" \"%s\"" % (copyCmd, file, destination))
		if os.path.isfile(os.path.join(destination,os.path.basename(file))):
			print ".",
			logfile.write("'%s' => '%s''\n" % (file,destination))
		else:
			logfile.write("[FAIL] '%s' => '%s''\n" % (file,destination))

	print "Finished copying files, log file avaliable at %s" % logfilename
	logfile.close()
</pre><div
class="betterrelated"><p><strong>Related content:</strong></p><ol><li> <a
href="http://werxltd.com/wp/2010/10/12/fred-brooks-on-the-promise-of-object-oriented-programming/" title="Permanent link to Fred Brooks on the promise of object oriented programming">Fred Brooks on the promise of object oriented programming</a></li><li> <a
href="http://werxltd.com/wp/2010/09/27/mcafee-secure-url-shortener-firefox-add-on/" title="Permanent link to McAfee Secure URL Shortener Firefox Add-on">McAfee Secure URL Shortener Firefox Add-on</a></li></ol><a
class="thanks" style="font-size: smaller; text-decoration: none;" title="Related content found by the Better Related Posts plugin" href="http://www.nkuttler.de/wordpress-plugin/wordpress-related-posts-plugin/">Better Related Posts Plugin</a></div><ol
class="footnotes"><li
id="footnote_0_204" class="footnote">Directory walking code taken from <a
href="http://code.activestate.com/recipes/52664/">here</a> with slight modification to make patterns truly case insensitive.</li></ol><p><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F09%2F04%2Fquick-and-dirty-image-sorting-script%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F09%2F04%2Fquick-and-dirty-image-sorting-script%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F09%2F04%2Fquick-and-dirty-image-sorting-script%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F09%2F04%2Fquick-and-dirty-image-sorting-script%2F&amp;count=none&amp;text=Quick%20and%20dirty%20image%20sorting%20script" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F09%2F04%2Fquick-and-dirty-image-sorting-script%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F09%2F04%2Fquick-and-dirty-image-sorting-script%2F&amp;count=none&amp;text=Quick%20and%20dirty%20image%20sorting%20script" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F09%2F04%2Fquick-and-dirty-image-sorting-script%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F09%2F04%2Fquick-and-dirty-image-sorting-script%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><a
class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F09%2F04%2Fquick-and-dirty-image-sorting-script%2F&amp;linkname=Quick%20and%20dirty%20image%20sorting%20script" title="LinkedIn" rel="nofollow" target="_blank"><img
src="http://werxltd.com/wp/wp-content/plugins/add-to-any/icons/linkedin.png?9d7bd4" width="16" height="16" alt="LinkedIn"/></a><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F09%2F04%2Fquick-and-dirty-image-sorting-script%2F&amp;title=Quick%20and%20dirty%20image%20sorting%20script" id="wpa2a_12">Share/Save</a></p>]]></content:encoded> <wfw:commentRss>http://werxltd.com/wp/2009/09/04/quick-and-dirty-image-sorting-script/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using apc
Page Caching using apc
Database Caching 2/46 queries in 0.823 seconds using apc
Object Caching 1219/1326 objects using apc

Served from: werxltd.com @ 2012-02-09 21:32:16 -->
