<?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>Sean Cook</title>
	<atom:link href="http://www.seancook.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.seancook.com</link>
	<description>ramblings on mobile software, devices, and life</description>
	<lastBuildDate>Mon, 17 Aug 2009 15:40:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>String concatenations in Python</title>
		<link>http://www.seancook.com/2009/08/17/string-concatenations-in-python/</link>
		<comments>http://www.seancook.com/2009/08/17/string-concatenations-in-python/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 15:18:15 +0000</pubDate>
		<dc:creator>Sean</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.seancook.com/?p=76</guid>
		<description><![CDATA[Here is an excellent page that compares the efficiencies of various methods for String concatenation in Python.  The author uses long lists of integers as the strings to combine, which provides an interesting test case. The fastest method (according to &#8230; <a href="http://www.seancook.com/2009/08/17/string-concatenations-in-python/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Here is an excellent page that<a href="http://skymind.com/~ocrow/python_string/"> compares the efficiencies of various methods for String concatenation in Python</a>.  The author uses long lists of integers as the strings to combine, which provides an interesting test case.</p>
<p>The fastest method (according to the article) is:</p>
<pre class="brush: python; title: ; notranslate">
def method6():
     return ''.join([`num` for num in xrange(loop_count)])
</pre>
<p>The article also lists the following, more common approach:</p>
<pre class="brush: python; title: ; notranslate">
def method4():
    str_list = []
    for num in xrange(loop_count):
        str_list.append(`num`)

    return ''.join(str_list)
</pre>
<p>If I can find the spare time, I would really like to delve deeper in to the underlying reasons why the method6() is faster than the method 4().  In the meantime, I&#8217;ll continue to kick myself each time I throw a &#8220;+=&#8221; operator between two strings.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.seancook.com/2009/08/17/string-concatenations-in-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why I chose Python over Ruby</title>
		<link>http://www.seancook.com/2009/07/30/why-i-chose-python-over-ruby/</link>
		<comments>http://www.seancook.com/2009/07/30/why-i-chose-python-over-ruby/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 16:58:37 +0000</pubDate>
		<dc:creator>Sean</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.seancook.com/?p=66</guid>
		<description><![CDATA[I&#8217;m not one to weigh in on religious debates, but as someone who hops around from server to server I get tired of seeing this: When I almost always see this: It&#8217;s a matter of convenience for me.  It has &#8230; <a href="http://www.seancook.com/2009/07/30/why-i-chose-python-over-ruby/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m not one to weigh in on religious debates, but as someone who hops around from server to server I get tired of seeing this:</p>
<p><a href="http://www.seancook.com/wp-content/uploads/2009/07/ruby_FAIL.PNG"><img class="alignnone size-full wp-image-67" title="ruby_FAIL" src="http://www.seancook.com/wp-content/uploads/2009/07/ruby_FAIL.PNG" alt="ruby_FAIL" width="490" height="122" /></a></p>
<p>When I almost always see this:</p>
<p><a href="http://www.seancook.com/wp-content/uploads/2009/07/python_WIN.png"><img class="alignnone size-full wp-image-68" title="python_WIN" src="http://www.seancook.com/wp-content/uploads/2009/07/python_WIN.png" alt="python_WIN" width="571" height="142" /></a></p>
<p>It&#8217;s a matter of convenience for me.  It has nothing to do with any of the magic of Ruby, or my sadistic love for the whitespace of Python.  Instead, my choice is delegated to me by the sysadmins who control the boxes that I use.  On my personal machines I run both interpreters, and often jump between the two languages to keep my skillz up.  But, when it comes to production environments I&#8217;m a Pythonista.</p>
<p>And I&#8217;m OK with that.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.seancook.com/2009/07/30/why-i-chose-python-over-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sun VirtualBox + Ubuntu Frozen Screen</title>
		<link>http://www.seancook.com/2009/06/13/sun-virtualbox-ubuntu-frozen-screen/</link>
		<comments>http://www.seancook.com/2009/06/13/sun-virtualbox-ubuntu-frozen-screen/#comments</comments>
		<pubDate>Sat, 13 Jun 2009 16:31:39 +0000</pubDate>
		<dc:creator>Sean</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[virtualbox]]></category>

		<guid isPermaLink="false">http://www.seancook.com/?p=58</guid>
		<description><![CDATA[I&#8217;ve been using Sun&#8217;s VirtualBox for about a month now on my Windows XP laptop and absolutely love it.  This morning, while trying to squeeze as much performance as I could out of it, I bumped the amount of my &#8230; <a href="http://www.seancook.com/2009/06/13/sun-virtualbox-ubuntu-frozen-screen/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div id="attachment_59" class="wp-caption alignleft" style="width: 310px"><img class="size-medium wp-image-59 " style="border: 2px solid black; margin: 5px;" title="ubuntu-frozen-screen" src="http://www.seancook.com/wp-content/uploads/2009/07/ubuntu-frozen-screen-300x247.png" alt="Frozen Login Screen" width="300" height="247" /><p class="wp-caption-text">Frozen Login Screen</p></div>
<p>I&#8217;ve been using <a title="VirtualBox.org" href="http://www.virtualbox.org/">Sun&#8217;s VirtualBox</a> for about a month now on my Windows XP laptop and absolutely love it.  This morning, while trying to squeeze as much performance as I could out of it, I bumped the amount of my Ubuntu&#8217;s Virtual Machine&#8217;s Video Memory to 128MB and immediately noticed a problem:  when the VM would start up the screen was jumbled.  I bumped the setting back down to 64MB and things worked as they should.  If you are seeing something similar, try lowering the allotted video memory and see if that clears things up.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.seancook.com/2009/06/13/sun-virtualbox-ubuntu-frozen-screen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing mobile web pages in Firefox</title>
		<link>http://www.seancook.com/2008/09/24/testing-mobile-web-pages-in-firefox/</link>
		<comments>http://www.seancook.com/2008/09/24/testing-mobile-web-pages-in-firefox/#comments</comments>
		<pubDate>Wed, 24 Sep 2008 17:19:56 +0000</pubDate>
		<dc:creator>Sean</dc:creator>
				<category><![CDATA[Handsets]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[wap]]></category>
		<category><![CDATA[xhtml-mp]]></category>

		<guid isPermaLink="false">http://www.seancook.com/?p=45</guid>
		<description><![CDATA[The worst part of developing for the mobile web is ensuring that you&#8217;re accounting for the quirks of each of your target devices&#8217; browsers.  I often compare this to developing for the fixed web circa 1998&#8211;  no matter how great &#8230; <a href="http://www.seancook.com/2008/09/24/testing-mobile-web-pages-in-firefox/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The worst part of developing for the mobile web is ensuring that you&#8217;re accounting for the quirks of each of your target devices&#8217; browsers.  I often compare this to developing for the fixed web circa 1998&#8211;  no matter how great your site looked in one browser, you still had to hack it to pieces to make it render correctly in another browser (*cough* IE *cough*).  To accomodate these nuances, you typically have to implement per-device views that can make projects exponentially harder to test, and really take the fun out of mobile development.</p>
<p>Fortunately, I spend a lot of time writing both the client side of my mobile web apps, as well as the server side components  that power them.  The easiest way I&#8217;ve found to quickly test the rendering of my output per device User-Agent is to install the <a title="User Agent Switcher" href="https://addons.mozilla.org/en-US/firefox/addon/59">User Agent Switcher component for Firefox</a>.  This component allows you to quickly and easily  change the User-Agent header that your browser uses to identify itself to web servers.  With just a few clicks I can quickly run down a list of 10 devices and verify that device-specific logic is firing properly on the backend.  Additionally, I&#8217;ll often resize my Firefox window to the target device&#8217;s screen dimensions (e.g. 240&#215;320) to get a rough approximation of the overall look and feel of the page.</p>
<p>While there is no real substitute for testing on real devices, this technique has proven useful to me and hopefully someone else will also find it useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.seancook.com/2008/09/24/testing-mobile-web-pages-in-firefox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone screenshots are easy</title>
		<link>http://www.seancook.com/2008/09/22/iphone-screenshots-are-easy/</link>
		<comments>http://www.seancook.com/2008/09/22/iphone-screenshots-are-easy/#comments</comments>
		<pubDate>Mon, 22 Sep 2008 21:38:07 +0000</pubDate>
		<dc:creator>Sean</dc:creator>
				<category><![CDATA[Handsets]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://www.seancook.local/?p=43</guid>
		<description><![CDATA[If you have firmware version 2.0+ on your iPhone, you can quickly take a screenshot on the device by navigating to the screen you want to grab, holding down the home button, then pressing and releasing the sleep/awake button on &#8230; <a href="http://www.seancook.com/2008/09/22/iphone-screenshots-are-easy/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you have firmware version 2.0+ on your iPhone, you can quickly take a screenshot on the device by navigating to the screen you want to grab, holding down the home button, then pressing and releasing the sleep/awake button on the top of the phone.  Your screen will &#8220;flash&#8221; to indicate that the picture has been taken and you can find the picture in your camera roll library on the device.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.seancook.com/2008/09/22/iphone-screenshots-are-easy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Double Brace Initialization in Java</title>
		<link>http://www.seancook.com/2008/07/18/double-brace-initialization-in-java/</link>
		<comments>http://www.seancook.com/2008/07/18/double-brace-initialization-in-java/#comments</comments>
		<pubDate>Fri, 18 Jul 2008 18:10:57 +0000</pubDate>
		<dc:creator>Sean</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.seancook.local/?p=3</guid>
		<description><![CDATA[When I was working on my thesis for graduate school I spent months reading all that I could on optimizations that Java coders could consciously utilize while coding. While that was as exciting as it sounds*, I did manage to &#8230; <a href="http://www.seancook.com/2008/07/18/double-brace-initialization-in-java/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When I was working on my thesis for graduate school I spent months reading all that I could on optimizations that Java coders could consciously utilize while coding. While that was as exciting as it sounds*, I did manage to stumble across a few Java idioms that I’m surprised I don’t see used more often. One of my favorite idioms that I still use from time to time is called <a href="http://c2.com/cgi/wiki?DoubleBraceInitialization">Double Brace Initialization</a>.  It’s a simple way to initialize collections, and I personally feel that it makes code more readable.</p>
<p>Instead of this:</p>
<pre name="code" class="java">
private Map<Object,Integer> map = new HashMap<Object,Integer>();
map.put(obj1, 3);
map.put(obj2, 4);
/*  yada yada yada */
</pre>
<p>You can do this:</p>
<pre name="code" class="java">
private Map<Object,Integer> map = new HashMap<Object,Integer>(){{
put(obj1, 3);
put(obj2, 4);
/* yada yada yada */
}}
</pre>
<p>The first brace creates an anonymous inner class, and the second brace creates an initializer block that is executed when the anonymous class is created.</p>
<p>__</p>
<p>*it really wasn’t.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.seancook.com/2008/07/18/double-brace-initialization-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Programmatically obtain a phone&#8217;s ESN</title>
		<link>http://www.seancook.com/2008/07/03/programmatically-obtain-a-phones-esn/</link>
		<comments>http://www.seancook.com/2008/07/03/programmatically-obtain-a-phones-esn/#comments</comments>
		<pubDate>Thu, 03 Jul 2008 18:28:02 +0000</pubDate>
		<dc:creator>Sean</dc:creator>
				<category><![CDATA[Handsets]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[CDMA]]></category>
		<category><![CDATA[ESN]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.seancook.local/?p=8</guid>
		<description><![CDATA[Bitpim is an open-source program that allows a user to manipulate data on a CDMA handset, including the phone book, wallpapers, ringtones, and in some cases, the filesystem. While poking around the application’s source, which is written in python, I &#8230; <a href="http://www.seancook.com/2008/07/03/programmatically-obtain-a-phones-esn/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="content">
<p><a href="http://bitpim.org/">Bitpim</a> is an open-source program that allows a user to manipulate data on a CDMA handset, including the phone book, wallpapers, ringtones, and in some cases, the filesystem. While poking around the application’s source, which is written in python, I found a great class that provides a quick way to access the phone’s manufacturer, ESN, and firmware revision. Yes, this information is available through a small set of keystrokes on CDMA handsets, but I have often found cases where I would still prefer to provide an app to a user and have it do all the dirty work.</p>
<p>The class is called “phone_detect.py” and it’s located under the /src/ in the source tree. All that it really does is act as a wrapper for the AT commands that are necessary to switch the phone into the correct mode and also to ask the phone for it’s configuration info. You can get a good understanding of what it’s doing by following the calls to __get_esn(). There are plenty of references available online that show the full range of AT commands that phones respond to.</p>
<p>To play with the class, you’ll need to get an install python.  In addition to python, you will also need <a href="http://pyserial.sourceforge.net/">pySerial</a> in order to interface with your serial port. Once you have your handset connected to your computer you can call use the class directly by calling DetectPhone().detect(). There’s an example of using this call in setphone_wizard.py if you need one.</div>
]]></content:encoded>
			<wfw:commentRss>http://www.seancook.com/2008/07/03/programmatically-obtain-a-phones-esn/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GZIP content for mobile devices</title>
		<link>http://www.seancook.com/2008/07/02/gzip-content-for-mobile-devices/</link>
		<comments>http://www.seancook.com/2008/07/02/gzip-content-for-mobile-devices/#comments</comments>
		<pubDate>Wed, 02 Jul 2008 18:31:39 +0000</pubDate>
		<dc:creator>Sean</dc:creator>
				<category><![CDATA[Handsets]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[GZIP]]></category>
		<category><![CDATA[J2EE]]></category>

		<guid isPermaLink="false">http://www.seancook.local/?p=11</guid>
		<description><![CDATA[One of the easiest, most obvious ways to lower the data transfer footprint of your mobile apps is to compress data. For some reason, I still see mobile web decks that output XHTML-MP in plain text instead of very-easy-to-implement GZIP &#8230; <a href="http://www.seancook.com/2008/07/02/gzip-content-for-mobile-devices/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>One of the easiest, most obvious ways to lower the data transfer footprint of your mobile apps is to compress data. For some reason, I still see mobile web decks that output XHTML-MP in plain text instead of very-easy-to-implement <a href="http://en.wikipedia.org/wiki/Gzip">GZIP</a> compression. I’ve implemented GZIP output on multiple J2EE projects with the help of Jayson Falkner’s excellent GZIPFilter which is available in his article <a href="http://www.onjava.com/pub/a/onjava/2003/11/19/filters.html">Two Servlet Filters Every Web Application Should Have</a>.</p>
<p>To implement the filter in your own projects, download the three pieces of the filter: GZIPFilter, GZIPResponseStream, GZIPResponseWrapper and save them in your project. Then, in your web.xml add the following entries:</p>
<pre name="code" class="xml">
<filter>
<filter-name>Compress</filter-name>
<filter-class>GZIPFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>Compress</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
</pre>
<p>Remember to adjust the url-pattern to what’s appropriate for your webapp. I typically map my Spring MVC dispatcher servlet to *.do, but that’s just a hangover from Struts.</p>
<p>Once you’ve redeployed your webapp you should verify that output is rendering correctly in a desktop client such as Firefox.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.seancook.com/2008/07/02/gzip-content-for-mobile-devices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dave Matthews Band in Bristow, VA</title>
		<link>http://www.seancook.com/2008/06/30/dave-matthews-band-in-bristow-va/</link>
		<comments>http://www.seancook.com/2008/06/30/dave-matthews-band-in-bristow-va/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 18:41:56 +0000</pubDate>
		<dc:creator>Sean</dc:creator>
				<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://www.seancook.local/?p=15</guid>
		<description><![CDATA[&#8220;Eat, drink, and be merry for tomorrow we die&#8221; &#8211; Tripping Billies I caught DMB out at the Nissan Pavilion Saturday night for my 4th concert in 4 weeks (which brings my total ticket cost of this summer to more &#8230; <a href="http://www.seancook.com/2008/06/30/dave-matthews-band-in-bristow-va/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img src="http://seancook.com/images/concerts/dmb.jpg" alt="Dave Matthews Band - Bristow VA" /></p>
<p><br clear="all" /></p>
<p><em>&#8220;Eat, drink, and be merry for tomorrow we die&#8221; &#8211; Tripping Billies</em></p>
<p>I caught DMB out at the Nissan Pavilion Saturday night for my 4th concert in 4 weeks (which brings my total ticket cost of this summer to more than $500). They sounded great, and as always I found myself in awe of Carter Beauford’s mad chops.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.seancook.com/2008/06/30/dave-matthews-band-in-bristow-va/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Capistrano deploy script for Dreamhost</title>
		<link>http://www.seancook.com/2008/06/18/capistrano-deploy-script-for-dreamhost/</link>
		<comments>http://www.seancook.com/2008/06/18/capistrano-deploy-script-for-dreamhost/#comments</comments>
		<pubDate>Wed, 18 Jun 2008 18:58:56 +0000</pubDate>
		<dc:creator>Sean</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Capistrano]]></category>
		<category><![CDATA[Dreamhost]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.seancook.local/?p=19</guid>
		<description><![CDATA[I use the following Capistrano script to manage deployment of my blog to Dreamhost. It is a modified version of the deploy script provided on the Radiant CMS wiki, and it addresses two bugs involving the svn username and password. &#8230; <a href="http://www.seancook.com/2008/06/18/capistrano-deploy-script-for-dreamhost/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I use the following Capistrano script to manage deployment of my blog to <a href="http://dreamhost.com/">Dreamhost</a>.  It is a modified version of the deploy script provided on the <a href="http://wiki.radiantcms.org/How_To_Deploy_on_Dreamhost">Radiant CMS wiki</a>, and it addresses two bugs involving the svn username and password.</p>
<p>To use it, capify your working rails directory and then replace /config/deploy.rb with the code below:</p>
<pre name="code" class="ruby">
set :user, '' #dreamhost username goes here
set :application, "" #dreamhost domain name goes here
set :repository, "" #path to your svn repo
set :scm_username, "" #svn username 

# =============================================================================
# You shouldn't have to modify the rest of these
# =============================================================================

role :web, application
role :app, application
role :db,  application, :primary => true

set :deploy_to, "/home/#{user}/#{application}"
# set :svn, "/path/to/svn"       # defaults to searching the PATH
set :use_sudo, false
# set :restart_via, :run
set(:scm_password) { Capistrano::CLI.password_prompt }

# saves space by only keeping last 3 when running cleanup
set :keep_releases, 3 

# issues svn export instead of checkout
set :checkout, "checkout" 

# keeps a local checkout of the repository on the server to get faster deployments
set :deploy_via, :remote_cache

ssh_options[:paranoid] = false

# =============================================================================
# OVERRIDE TASKS
# =============================================================================
namespace :deploy do

  desc "Restart Passenger"
  task :restart, :roles => :app do
    run "touch #{current_path}/tmp/restart.txt"
  end

  desc <<-DESC
    Deploy and run pending migrations. This will work similarly to the \
    `deploy' task, but will also run any pending migrations (via the \
    `deploy:migrate' task) prior to updating the symlink. Note that the \
    update in this case it is not atomic, and transactions are not used, \
    because migrations are not guaranteed to be reversible.
  DESC
  task :migrations do
    set :migrate_target, :latest
    update_code
    migrate
    symlink
    restart
  end

end
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.seancook.com/2008/06/18/capistrano-deploy-script-for-dreamhost/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

