<?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>SQUARISM &#187; Blog</title>
	<atom:link href="http://squarism.com/category/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://squarism.com</link>
	<description>until lambs become lions</description>
	<lastBuildDate>Fri, 03 Feb 2012 05:13:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Sparkfun Free Day 2011</title>
		<link>http://squarism.com/2012/01/13/sparkfun-free-day-2011/</link>
		<comments>http://squarism.com/2012/01/13/sparkfun-free-day-2011/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 23:09:28 +0000</pubDate>
		<dc:creator>Dillon</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://squarism.com/?p=1498</guid>
		<description><![CDATA[Tried filling out hours and hours of captchas while watching the newborn. It didn&#8217;t go so well. I got sore hands and didn&#8217;t get $100 of free stuff. I ended up ordering a new arduino r3 anyway and a stepper motor to hopefully build a quiet baby rocker. I built a few previous iterations of [...]]]></description>
			<content:encoded><![CDATA[<p>Tried filling out hours and hours of captchas while watching the newborn.  It didn&#8217;t go so well.  I got sore hands and didn&#8217;t get $100 of free stuff.  I ended up ordering a new arduino r3 anyway and a stepper motor to hopefully build a quiet baby rocker.  I built a few previous iterations of a baby rocker out of Lego technic pieces but the motor was a little bit too loud and I&#8217;ve scrapped the project.</p>
<p>Anyway, here&#8217;s a screenshot to remind me of the captcha fun.</p>
<p><img src="http://squarism.com/wp-content/uploads/2012/01/sparkfun_captcha_forever.png" alt="" title="sparkfun_captcha_forever" width="544" height="640" class="aligncenter size-full wp-image-1499" /></p>
]]></content:encoded>
			<wfw:commentRss>http://squarism.com/2012/01/13/sparkfun-free-day-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Homebrew behind a proxy</title>
		<link>http://squarism.com/2010/12/14/homebrew-behind-a-proxy/</link>
		<comments>http://squarism.com/2010/12/14/homebrew-behind-a-proxy/#comments</comments>
		<pubDate>Tue, 14 Dec 2010 15:12:57 +0000</pubDate>
		<dc:creator>Dillon</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://squarism.com/?p=782</guid>
		<description><![CDATA[Git doesn&#8217;t work behind a proxy with homebrew (the macports new hotness). Because git:// is blocked at my office. There&#8217;s a patch here. Unfortunately, the drop-in replacement didn&#8217;t work for me (it&#8217;s an old commit). Instead I made the modifications myself. Be warned, that this file will probably only work for the version I&#8217;m using [...]]]></description>
			<content:encoded><![CDATA[<p>Git doesn&#8217;t work behind a proxy with homebrew (the macports new hotness).  Because git:// is blocked at my office.  There&#8217;s a patch <a href="https://github.com/wright/homebrew/commit/c6ecd3bd1c4e04d8d49cf863e9b62a33a4205d44">here</a>.  Unfortunately, the drop-in replacement didn&#8217;t work for me (it&#8217;s an old commit).  </p>
<p><del>Instead I made the modifications myself.  Be warned, that this file will probably only work for the version I&#8217;m using (0.7.1), in which case you&#8217;ll have to look at the SVN commit yourself.  :(</del></p>
<p><del><br />
<code>cd /usr/local/Library/Homebrew<br />
cp download_strategy.rb download_strategy.rb.orig<br />
wget http://squarism.com/files/download_strategy_proxy_fix.rb -O download_strategy.rb<br />
export HOMEBREW_GIT_VIA_HTTP=1<br />
brew install [something]<br />
</code><br />
</del></p>
<p><del>Any brew installs that use git should work now.  </del></p>
<p>But then there&#8217;s curl.  Curl doesn&#8217;t quite use the same env that others do.  So solve it like this:</p>
<p><code>export http_proxy=http://proxy:80<br />
export ALL_PROXY=$http_proxy</code></p>
<p>Curl likes that ALL_PROXY env for some reason.</p>
<p>After that, I was able to get my favorite homebrew apps installing:<br />
<code>brew install couchdb irssi git mysql watch lua p7zip htop openssl node npm nmap netcat</code></p>
<p><strong>Update</strong>: If the above still doesn&#8217;t work for you (I had problems with Git URLs), try this:<br />
<code>cd /usr/local/Library/Homebrew<br />
vi download_strategy.rb<br />
</code></p>
<p>Find the line <code>when %r[^git://] then GitDownloadStrategy</code> and replace (or comment it out) it with this:<br />
when %r[^git://]<br />
        url.gsub!(/^git\:\/\//, &#8216;http://&#8217;)<br />
        GitDownloadStrategy<br />
</code></p>
<p>Git should use the http:// method of downloading code and brew install should work.  Just to be clear, the relevant part of download_strategy.rb looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">  <span style="color:#9966CC; font-weight:bold;">when</span> <span style="color:#006600; font-weight:bold;">%</span>r<span style="color:#006600; font-weight:bold;">&#91;</span>^bzr:<span style="color:#006600; font-weight:bold;">//</span><span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#9966CC; font-weight:bold;">then</span> BazaarDownloadStrategy
  <span style="color:#008000; font-style:italic;">#when %r[^git://] then GitDownloadStrategy</span>
  <span style="color:#9966CC; font-weight:bold;">when</span> <span style="color:#006600; font-weight:bold;">%</span>r<span style="color:#006600; font-weight:bold;">&#91;</span>^git:<span style="color:#006600; font-weight:bold;">//</span><span style="color:#006600; font-weight:bold;">&#93;</span>
        url.<span style="color:#CC0066; font-weight:bold;">gsub!</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">/</span>^git\:\<span style="color:#006600; font-weight:bold;">/</span>\<span style="color:#006600; font-weight:bold;">//</span>, <span style="color:#996600;">'http://'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
        GitDownloadStrategy
  <span style="color:#9966CC; font-weight:bold;">when</span> <span style="color:#006600; font-weight:bold;">%</span>r<span style="color:#006600; font-weight:bold;">&#91;</span>^hg:<span style="color:#006600; font-weight:bold;">//</span><span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#9966CC; font-weight:bold;">then</span> MercurialDownloadStrategy</pre></div></div>

<p>Another thing to try is to edit ~/.curlrc to enable a SOCKS5 proxy if you have one.<br />
<code>socks5 = "yourserver:port"</code></p>
]]></content:encoded>
			<wfw:commentRss>http://squarism.com/2010/12/14/homebrew-behind-a-proxy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debugging Cucumber and Rails</title>
		<link>http://squarism.com/2010/12/06/debugging-cucumber-and-rails/</link>
		<comments>http://squarism.com/2010/12/06/debugging-cucumber-and-rails/#comments</comments>
		<pubDate>Mon, 06 Dec 2010 18:03:38 +0000</pubDate>
		<dc:creator>Dillon</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://squarism.com/?p=796</guid>
		<description><![CDATA[I was working on my game store app and I had some TDD things I wanted to finish up before creating a rails3 branch. I discuss it kind of randomly in that post linked there. I had left it to languish because I got stuck and frustrated with cucumber. My app was working but the [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://squarism.com/wp-content/uploads/2010/12/cucumber_green.png" alt="" title="cucumber_green" width="635" height="61" class="aligncenter size-full wp-image-800" /><br />
I was working on my <a href="http://squarism.com/2010/08/27/stream-of-thoughthose-game-store/">game store</a> app and I had some TDD things I wanted to finish up before creating a rails3 branch.  I discuss it kind of randomly in that post linked there.  I had left it to languish because I got stuck and frustrated with cucumber.  My app was working but the tests were failing (false negative).  The biggest problem was trying to understand how to debug a cucumber step.</p>
<p>The first problem is logging.  When cucumber runs webrat as a mock browser, I really expected to see the traffic in the server log (script/server).  But it didn&#8217;t.  Nothing.  No traffic at all.  The second problem was seeing what the browser sees.  It was reporting back that my login was failing.   The third problem is the problem itself.  It was saying &#8220;invalid login&#8221;.  I am using factorygirl to create mock users on the fly and authlogic for the authentication and so there was a possibility that something was wrong there.</p>
<h2>Logging</h2>
<p><img src="http://squarism.com/wp-content/uploads/2010/12/cucumber_console-249x300.png" alt="" title="cucumber_console" width="249" height="300" class="alignright size-medium wp-image-804" />So let&#8217;s go through this in order.  First the log problem.  The traffic I was not seeing in the script/server console was kind of confusing.  Cucumber&#8217;s traffic is actually redirected to log/cucumber.log.  So you can either tail -f that log or use the OSX console app (screenshot) to watch cucumber.log.  Either way, the traffic and any puts or STDOUT text will be there.  It&#8217;s pretty odd actually.  I don&#8217;t know how they pull this off.  The dev server (script/server) doesn&#8217;t even need to be running for the cucumber steps to work.  See below, I stopped the server and ran the tests successfully:</p>
<p><code>box:game_store chris$ script/server<br />
=> Booting WEBrick<br />
=> Rails 2.3.8 application starting on http://0.0.0.0:3000<br />
=> Call with -d to detach<br />
=> Ctrl-C to shutdown server<br />
[2010-12-05 00:21:34] INFO  WEBrick 1.3.1<br />
[2010-12-05 00:21:34] INFO  ruby 1.8.7 (2010-08-16) [i686-darwin10.4.0]<br />
[2010-12-05 00:21:34] INFO  WEBrick::HTTPServer#start: pid=23554 port=3000<br />
^C[2010-12-05 14:38:43] INFO  going to shutdown ...<br />
[2010-12-05 14:38:43] INFO  WEBrick::HTTPServer#start done.<br />
Exiting</p>
<p>box:game_store chris$ cucumber features/user_sessions.feature<br />
Using the default profile...<br />
WARNING: Nokogiri was built against LibXML version 2.7.7, but has dynamically loaded 2.7.3<br />
..........</p>
<p>2 scenarios (2 passed)<br />
10 steps (10 passed)<br />
0m0.508s<br />
</code></p>
<h2>Debugging Webrat</h2>
<p><img src="http://squarism.com/wp-content/uploads/2010/12/cucumber_save_and_open-300x281.png" alt="" title="cucumber_save_and_open" width="300" height="281" class="alignright size-medium wp-image-797" />Next, the &#8220;seeing what webrat sees&#8221; problem.  The invalid login error was based on detecting text.  In my test app, when you&#8217;re signed in you see the Logout link.  When you&#8217;re signed out, you see the Login link.  Webrat was telling me that it couldn&#8217;t sign in because Logout never appeared.  I had to figure out if it was lying because the app in my dev environment was working fine.  So I needed to see what webrat was seeing when launched from cucumber.</p>
<p>I had hunted down a function called save_and_open_page but it never worked for me.  It&#8217;s supposed to take a snapshot of the webrat client and open the web page in your browser so you can see what it sees.  It&#8217;s like debugging with puts.  So if you&#8217;re stuck on a step, just save_and_open_page and investigate.  Well unfortunately, I had left that option for dead a while ago because it wasn&#8217;t working.  I had missed a key step:</p>
<p>Install the launchy gem.<br />
<code>gem install launchy</code></p>
<p>Now your default browser should launch with a simple snapshop of the page.  It&#8217;s just a local file so you won&#8217;t be able to click on links back to your app (unless you have some awesome hardcoded urls everywhere that would take you back from anywhere).  The idea here is to just look at what the client is seeing on a basic level.  I was getting an invalid login error message so I was looking any evidence related to logins.  You can see in the screenshot to the right that I have a Login link available.  In my app, that means I&#8217;m not logged in.  I put the save_and_open_page in the logout feature step of cucumber so this is a good thing.</p>
<p>Ok, so at this point my save_and_open_page was launching two pages.  What?  One was correct but the other one was incorrect.  That is to say, one page was giving me an invalid login and the other one was signing in fine.  So what is going on?</p>
<h2>Factorygirl</h2>
<p>A key to my problem was how I was using factorygirl to create mock users and misunderstanding a convention.  First, here is the non-working features/step_definitions/user_session_steps.rb file:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">&quot;authlogic/test_case&quot;</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">&quot;factory_girl&quot;</span>
&nbsp;
Factory.<span style="color:#9900CC;">find_definitions</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">include</span> <span style="color:#6666ff; font-weight:bold;">Authlogic::TestCase</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">def</span> user
  <span style="color:#0066ff; font-weight:bold;">@user</span> <span style="color:#006600; font-weight:bold;">||</span>= Factory <span style="color:#ff3333; font-weight:bold;">:user</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">def</span> login
  user
  visit path_to<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;the homepage&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  click_link <span style="color:#996600;">&quot;Log in&quot;</span>
  fill_in <span style="color:#996600;">&quot;user_session_login&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:with</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;john&quot;</span> 
  fill_in <span style="color:#996600;">&quot;user_session_password&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:with</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;funkypass&quot;</span>
  click_button <span style="color:#996600;">&quot;Login&quot;</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
&nbsp;
<span style="color:#9966CC; font-weight:bold;">def</span> logout
  click_link <span style="color:#996600;">&quot;Logout&quot;</span>
  <span style="color:#008000; font-style:italic;">#save_and_open_page</span>
  visit path_to<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;the homepage&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
Given <span style="color:#006600; font-weight:bold;">/</span>^I am a registered user$<span style="color:#006600; font-weight:bold;">/</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  user
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">When</span> <span style="color:#006600; font-weight:bold;">/</span>^I login$<span style="color:#006600; font-weight:bold;">/</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  login
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
Given <span style="color:#006600; font-weight:bold;">/</span>^I am logged <span style="color:#9966CC; font-weight:bold;">in</span>$<span style="color:#006600; font-weight:bold;">/</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  login
  visit path_to<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;the homepage&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">When</span> <span style="color:#006600; font-weight:bold;">/</span>^I logout$<span style="color:#006600; font-weight:bold;">/</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  logout
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>The login method is all about clicking the Log in link and filling in the username and password boxes.  Now before you say, &#8220;what is john and funkypass?&#8221;.  I tried many different variations of passwords.  I tried my passwords out of my dev db, obviously this won&#8217;t work.  I tried foo1/foobar which actually led to my one working and one not case.</p>
<p>So here&#8217;s what went wrong.  My feature file defines two scenarios for one feature, logging in and logging out:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">Feature: User Sessions
&nbsp;
  So that I can blah, blah, blah
  As a registered user
  I want to log <span style="color:#9966CC; font-weight:bold;">in</span> <span style="color:#9966CC; font-weight:bold;">and</span> log out
&nbsp;
  Scenario: log <span style="color:#9966CC; font-weight:bold;">in</span>
    Given I am a registered user
    <span style="color:#9966CC; font-weight:bold;">And</span> I am on the homepage
    <span style="color:#9966CC; font-weight:bold;">When</span> I login
    <span style="color:#9966CC; font-weight:bold;">Then</span> I should see <span style="color:#996600;">&quot;Login successful!&quot;</span>
    <span style="color:#9966CC; font-weight:bold;">And</span> I should see <span style="color:#996600;">&quot;Cart&quot;</span>
&nbsp;
  Scenario: log out
    Given I am logged <span style="color:#9966CC; font-weight:bold;">in</span>
    <span style="color:#9966CC; font-weight:bold;">And</span> I am on the homepage
    <span style="color:#9966CC; font-weight:bold;">When</span> I logout
    <span style="color:#9966CC; font-weight:bold;">Then</span> I should see <span style="color:#996600;">&quot;Register&quot;</span>
    <span style="color:#9966CC; font-weight:bold;">And</span> I should see <span style="color:#996600;">&quot;Log In&quot;</span></pre></div></div>

<p>The &#8220;When I login&#8221; step fires the login method.  But so does the &#8220;Given I am logged in&#8221; step.  So there are my two save_and_open_page hits, the reason I see two pages open when debugging.  But why would one work and the other one wouldn&#8217;t?  I&#8217;m not changing anything.</p>
<p>The problem is factorygirl was creating a second user called foo2 for the <em>log out</em> scenario but rolling back the foo1 user that was created for the <em>log in</em> sceneario.  I didn&#8217;t realize this when I hardcoded <code>fill_in "user_session_login", :with => "foo1"</code> during integration.  So in the log out scenario, foo1 would log in but only foo2 would exist in the DB.</p>
<p>So I changed the login method to look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">def</span> login
  <span style="color:#0066ff; font-weight:bold;">@user</span> <span style="color:#006600; font-weight:bold;">||</span>= Factory <span style="color:#ff3333; font-weight:bold;">:user</span>
  visit path_to<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;the homepage&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
  click_link <span style="color:#996600;">&quot;Log in&quot;</span>
&nbsp;
  fill_in <span style="color:#996600;">&quot;user_session_login&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:with</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0066ff; font-weight:bold;">@user</span>.<span style="color:#9900CC;">login</span>
  fill_in <span style="color:#996600;">&quot;user_session_password&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:with</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0066ff; font-weight:bold;">@user</span>.<span style="color:#9900CC;">password</span>
&nbsp;
  click_button <span style="color:#996600;">&quot;Login&quot;</span>
  <span style="color:#008000; font-style:italic;">#save_and_open_page</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>I really wanted to create a user once (what the ||= is trying to do) but I couldn&#8217;t figure out how to properly use instance variables in a test step.  So I&#8217;ll just do it this way for now.  Notice that I&#8217;m using the fields on @user so it&#8217;ll always work.</p>
<h2>LibXML warning with Nokogiri</h2>
<p>You may have noticed that I was receiving an warning here:<br />
<code>WARNING: Nokogiri was built against LibXML version 2.7.7, but has dynamically loaded 2.7.3</code><br />
I&#8217;m on OSX and I&#8217;m not sure what OSX is using but xml2-config &#8211;version shows 2.7.3.  So I&#8217;m pretty sure that it&#8217;s using the shipped OS version.  Ok, no problem.  I&#8217;m running homebrew (a macports/fink replacement).  I&#8217;ll just install 2.7.7:<br />
<code><br />
$ brew search xml<br />
  blahtexml	  libwbxml	    xml-tooling-c     xmlrpc-c		xmltoman<br />
  gccxml		  libxml2	    xml2rfc	      xmlstarlet<br />
  html-xml-utils	  xml-security-c    xmlformat	      xmlto<br />
$ brew install libxml2<br />
==> Downloading ftp://xmlsoft.org/libxml2/libxml2-2.7.7.tar.gz<br />
######################################################################## 100.0%<br />
==> ./configure --disable-dependency-tracking --prefix=/usr/local/Cellar/libxml2/2.7.7<br />
==> make<br />
==> make install<br />
==> Caveats<br />
...<br />
$ brew info libxml2<br />
libxml2 2.7.7</p>
<p>http://xmlsoft.org</p>
<p>/usr/local/Cellar/libxml2/2.7.7 (293 files, 12M)</p>
<p>http://github.com/mxcl/homebrew/commits/master/Library/Formula/libxml2.rb</p>
<p></code></p>
<p>Ok so it installed correctly.  Now we need to reinstall nokogiri using the 2.7.7 libs.<br />
<code><br />
gem install nokogiri -- --with-xml2-lib=/usr/local/Cellar/libxml2/2.7.7/lib --with-xml2-include=/usr/local/Cellar/libxml2/2.7.7/include<br />
</code></p>
<p>Now when we run cucumber, we won&#8217;t get the error.  But here&#8217;s the problem.  Brew provides a way to link to the brew version of libxml2 by default with the `brew link libxml2` command but issues a warning about doing this.  The problem with using a path like /usr/local/Cellar/libxml2/2.7.7/lib is eventually brew will update it to 2.7.8 or something and it&#8217;s hard to say what the consequences will be.  Most likely, some binary will fail with lib errors.</p>
<h2>Wrapping up</h2>
<p>Another note is that I was futzing with all of this in a git branch called &#8220;tdd&#8221;, a branch I used to integrate cucumber/rspec and anything else related to testing.  I read some advice somewhere that a good practice is to branch a new feature and then roll it back into master when it&#8217;s done.</p>
<p>So I was already in the &#8220;tdd&#8221; branch had already committed everything.  It was time to merge the branches and get rid of the tdd branch:<br />
<code># switch back to master<br />
git checkout master<br />
# merge tdd into master<br />
git merge tdd<br />
# run the tests again for sanity<br />
cucumber features/user_sessions.feature<br />
# ok, passed, we don't need the tdd branch anymore<br />
git branch -d tdd<br />
# view branches<br />
git branch<br />
* master<br />
</code></p>
<p>After the merge, my code is up to date in the master branch and I can create a new branch called &#8220;rails3&#8243;, for example, if I want to play with upgrading the app to rails 3.  Or I could create a branch called refactor if I was going to majorly overhaul code.</p>
]]></content:encoded>
			<wfw:commentRss>http://squarism.com/2010/12/06/debugging-cucumber-and-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Geekcation</title>
		<link>http://squarism.com/2010/12/02/geekcation/</link>
		<comments>http://squarism.com/2010/12/02/geekcation/#comments</comments>
		<pubDate>Thu, 02 Dec 2010 19:01:18 +0000</pubDate>
		<dc:creator>Dillon</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://squarism.com/?p=684</guid>
		<description><![CDATA[Recently, I&#8217;ve resigned from my position to pursue a more flexible and collegiate atmosphere at another company. I&#8217;m recklessly optimistic almost always but I feel like this is a good change for me. Not that there weren&#8217;t smart people at Oracle, it was just a little crazy at times and I needed free time cycles [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I&#8217;ve resigned from my position to pursue a more flexible and collegiate atmosphere at another company.  I&#8217;m recklessly optimistic almost always but I feel like this is a good change for me.  Not that there weren&#8217;t smart people at Oracle, it was just a little crazy at times and I needed free time cycles to move into more bleeding edge areas instead of picking up more and more enterprise software skills.  Ok, enough about that.  The important part is that I negotiated a month off at the new place for studying and ramping up on new technologies.  Very awesome of them.</p>
<p>An interest of mine is NoSQL or alternative databases and scaling massive hashtables.  There&#8217;s a possibility that I might be working with a dataset so large that it can&#8217;t be solved with an <a href="http://en.wikipedia.org/wiki/Extract,_transform,_load">ETL</a> style process.  This is timely because I was just watching <a href="http://www.cloudera.com/videos/introduction_to_hive">a video from Cloudera</a> about Facebook having the same problems with large datasets on Oracle DB and then moving to Hive + Hadoop.  Hopefully, I can hack on this to expand out my DB skills (as a dev) to a non-relational platform.  There&#8217;s some guides on setting up a cheap cluster on EC2.  Although I have some hardware, I think I&#8217;ll go that route.  At the very least I&#8217;ll understand more about how Facebook scaled and how Mapreduce can be implemented.  I hope to find a non-trivial problem to solve (ie: something beyond counting words).</p>
<p>In addition to that very new and complex goal, there&#8217;s some other things I want to hack on:</p>
<ul>
<li><a href="http://www.mongodb.org/display/DOCS/Rails+3+-+Getting+Started">MongoDB</a>, especially as a horizontal scaling DB</li>
<li>Rails3 upgrade and testing of new gems on my RSS analyzer project</li>
<li>Cleaning up said RSS project to the point that I can share a 0.1 on github or what-not</li>
<li>Continuing to hack on my Tatris port to Obj-C / iOS</li>
<li>Break into node.js some more.  Play with <a href="http://dailyjs.com/2010/09/13/juggernaut/">websockets</a>.</li>
<li>Amazon is giving away EC2 dev instances and I&#8217;ve never played with their weird command line tools and AMI thingies.</li>
</ul>
<p>Of course there are distractions to all these very work relevant things.  I have a languishing tetris clone that I haven&#8217;t touched since the summer and I never got around to adding sound effects to that.  Producing the effects should be a problem but I&#8217;m not sure how hard it&#8217;s going to be to get back into that code.  Thar be ghosts and cobwebs.</p>
<p>Game and graphics aren&#8217;t very work relevant (I haven&#8217;t found a simulation job).  Even less so is playing around with my arduino.  There are a few basics I want to get down and then possibly integrate them all into a functional thing.  Something I would actually leave alone and serve some permanent purpose.  I have a few ideas but I don&#8217;t want to foretell or foreblog.  There&#8217;s also a RAD project I want to check out (Ruby on Arduino).  I have no idea how it works or if it&#8217;s what I want to use.  </p>
]]></content:encoded>
			<wfw:commentRss>http://squarism.com/2010/12/02/geekcation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fit-PC2 and Ubuntu 10.04</title>
		<link>http://squarism.com/2010/07/10/fit-pc2-and-ubuntu-10-04/</link>
		<comments>http://squarism.com/2010/07/10/fit-pc2-and-ubuntu-10-04/#comments</comments>
		<pubDate>Sat, 10 Jul 2010 14:51:02 +0000</pubDate>
		<dc:creator>Dillon</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://squarism.com/?p=619</guid>
		<description><![CDATA[I had Ubuntu 9.04 running on my Fit-PC2 and I wanted to move up to 10.04. I ran: sudo apt-get update; sudo apt-get dist-upgrade and it chugged along doing the update. Install went fine and I was impressed that you can jump major revs like that. Although there was one bit of weirdness: when I [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://squarism.com/wp-content/uploads/2010/07/fitpc2.jpg" alt="" title="fitpc2" width="620" height="382" class="aligncenter size-full wp-image-620" /></p>
<p>I had Ubuntu 9.04 running on my Fit-PC2 and I wanted to move up to 10.04.  I ran: <code>sudo apt-get update; sudo apt-get dist-upgrade</code> and it chugged along doing the update.  Install went fine and I was impressed that you can jump major revs like that.</p>
<p>Although there was one bit of weirdness: when I did the dist-upgrade I noticed that it was going to upgrade openoffice.  I didn&#8217;t want openoffice at all on there so I was going to remove it before it upgraded.  So I hit Ctrl-C which promptly locked the whole box.  I thought it was heat related and so I got an ice pack and wrapped the Fit in ice.  I tried it again, Ctrl-C locks the box.  Like, the whole box.  Caps lock dead.  Anyway, I&#8217;ve never seen that before.  When I let the dist-upgrade go, it worked fine.</p>
<p>When it booted 10.04, my display was set to 1280&#215;1024 and was running slow.  It was running the vesa driver.  So I downloaded the paulsbo driver for the GMA500 (the &#8216;gpu&#8217; that the Fit-PC2 uses) and although the module built fine, it really screwed up everything.  The screen would blank, X would be trying to start, there&#8217;d be video garbage doing all kinds of weird things.</p>
<p>So I wiped the whole thing and installed 9.10 and followed the 9.10 installation instructions on the Fit wiki.  I installed the netbook-remix distro (i386) and the install instructions still work.  Now I just need to get rid of the netbook-remix gui.  Too bad they don&#8217;t have desktop-switcher anymore.</p>
<p>Also, I was playing around with <a href="http://xmonad.org/">Xmonad</a> which is interesting if not a bit understated.  It reminds me of when I used Enlightenment back in 1999.  The styles are different but the amount of config editing is the same.</p>
]]></content:encoded>
			<wfw:commentRss>http://squarism.com/2010/07/10/fit-pc2-and-ubuntu-10-04/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Reversing sentences with Ruby.</title>
		<link>http://squarism.com/2010/05/01/reversing-sentences-with-ruby/</link>
		<comments>http://squarism.com/2010/05/01/reversing-sentences-with-ruby/#comments</comments>
		<pubDate>Sat, 01 May 2010 19:01:28 +0000</pubDate>
		<dc:creator>Dillon</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://squarism.com/?p=433</guid>
		<description><![CDATA[A question came up today about how to reverse a sentence. Word by word, preserving periods etc. I&#8217;ve done stuff like this before but I really saw an opportunity to solve this contrived quiz type question with TDD. It&#8217;s perfect really. Tedious string checking? Screw it. Let my test tell me when I&#8217;m done. Ok [...]]]></description>
			<content:encoded><![CDATA[<p>A question came up today about how to reverse a sentence.  Word by word, preserving periods etc.  I&#8217;ve done stuff like this before but I really saw an opportunity to solve this <em>contrived</em> quiz type question with <a href="http://en.wikipedia.org/wiki/Test-driven_development">TDD</a>.  It&#8217;s perfect really.  Tedious string checking?  Screw it.  Let my test tell me when I&#8217;m done.</p>
<p>Ok so I could have probably done this more comfortably in Java but it would have been more lines.  I banged this out in Ruby, including &#8220;learning&#8221; test cases (it&#8217;s really easy) in about an hour.  At one point I realized how easy string manipulation is in Ruby for this and I literally said, &#8220;holy shit Ruby is amazing&#8221;.  And then the edge cases started happening.  I was only handling periods and my algorithm fell over flat on three sentences because I was trying to do a string[start, end] when it&#8217;s really string[start, length].  I fixed it with learning the String#slice syntax.</p>
<p>Ok enough fanboi service.  There&#8217;s two files.  One&#8217;s the test and one&#8217;s the class.  Run the test and not the class (ie: ruby tc_reverser.rb).</p>
<p>tc_reverser.rb:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'test/unit'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'reverser'</span>
&nbsp;
  <span style="color:#008000; font-style:italic;"># Be wary of newlines in the test and expected trings.</span>
  <span style="color:#008000; font-style:italic;"># Do not try to word wrap with escapes.  It's very picky.</span>
<span style="color:#9966CC; font-weight:bold;">class</span> TestReverser <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#CC00FF; font-weight:bold;"><span style="color:#6666ff; font-weight:bold;">Test::Unit::TestCase</span></span>
  <span style="color:#008000; font-style:italic;"># Optional</span>
  <span style="color:#008000; font-style:italic;">#def setup</span>
  <span style="color:#008000; font-style:italic;">#end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> teardown
    <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#0066ff; font-weight:bold;">@test_passed</span> <span style="color:#9966CC; font-weight:bold;">then</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;<span style="color:#000099;">\n</span> #{@r.reverse}&quot;</span>  <span style="color:#008000; font-style:italic;"># more verbose for successful passes</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;#{@method_name.upcase} OK.<span style="color:#000099;">\n</span><span style="color:#000099;">\n</span>&quot;</span>
    <span style="color:#9966CC; font-weight:bold;">else</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;#{@method_name.upcase} FAIL.<span style="color:#000099;">\n</span><span style="color:#000099;">\n</span>&quot;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#008000; font-style:italic;"># simple test</span>
  <span style="color:#9966CC; font-weight:bold;">def</span> test_reverser
    test = <span style="color:#996600;">&quot;You space bastard.  You killed my pine.&quot;</span>
    expected = <span style="color:#996600;">&quot;Bastard space you.  Pine my killed you.&quot;</span>
    <span style="color:#0066ff; font-weight:bold;">@r</span> = Reverser.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>test<span style="color:#006600; font-weight:bold;">&#41;</span>
    assert_equal<span style="color:#006600; font-weight:bold;">&#40;</span>expected, <span style="color:#0066ff; font-weight:bold;">@r</span>.<span style="color:#9900CC;">reverse</span>, <span style="color:#996600;">&quot;Fail.&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>        
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#008000; font-style:italic;"># Test multiple sentence delimiters  </span>
  <span style="color:#9966CC; font-weight:bold;">def</span> test_multiple_sentence_delimiters
    test = <span style="color:#996600;">&quot;Shape up, man.  You're a slacker.  Do you want to be a slacker for the rest of your life?&quot;</span>
    expected = <span style="color:#996600;">&quot;Man, up shape.  Slacker a you're.  Life your of rest the for slacker a be to want you do?&quot;</span>
    <span style="color:#0066ff; font-weight:bold;">@r</span> = Reverser.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>test<span style="color:#006600; font-weight:bold;">&#41;</span>
    assert_equal<span style="color:#006600; font-weight:bold;">&#40;</span>expected, <span style="color:#0066ff; font-weight:bold;">@r</span>.<span style="color:#9900CC;">reverse</span>, <span style="color:#996600;">&quot;Fail.&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#008000; font-style:italic;"># Test no periods, question mark and commas</span>
  <span style="color:#9966CC; font-weight:bold;">def</span> test_question_comma
    test = <span style="color:#996600;">&quot;Then tell me, future boy, huh, who's president of the United States in 1985?&quot;</span>
    expected = <span style="color:#996600;">&quot;1985 in States United the of president who's, huh, boy future, me tell then?&quot;</span>
    <span style="color:#0066ff; font-weight:bold;">@r</span> = Reverser.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>test<span style="color:#006600; font-weight:bold;">&#41;</span>
    assert_equal<span style="color:#006600; font-weight:bold;">&#40;</span>expected, <span style="color:#0066ff; font-weight:bold;">@r</span>.<span style="color:#9900CC;">reverse</span>, <span style="color:#996600;">&quot;Fail.&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#008000; font-style:italic;"># Big test  </span>
  <span style="color:#9966CC; font-weight:bold;">def</span> test_everything
    test = <span style="color:#996600;">&quot;Our first television set. Dad just picked it up today. Do you have a television? Well, yeah, you know, we have two of them. Wow! You must be rich. Oh, honey, he's teasing you. Nobody has two television sets.&quot;</span>
    expected = <span style="color:#996600;">&quot;Set television first our.  Today up it picked just dad.  Television a have you do?  Them of two have we, know you, yeah, well.  Wow!  Rich be must you.  You teasing he's, honey, oh.  Sets television two has nobody.&quot;</span>
    <span style="color:#0066ff; font-weight:bold;">@r</span> = Reverser.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>test<span style="color:#006600; font-weight:bold;">&#41;</span>
    assert_equal<span style="color:#006600; font-weight:bold;">&#40;</span>expected, <span style="color:#0066ff; font-weight:bold;">@r</span>.<span style="color:#9900CC;">reverse</span>, <span style="color:#996600;">&quot;Fail.&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>I have to apologize for the scrollbars in the above posted code.  I tried many different ways of escaping carriage returns for better formatting but it would have required a lot of changes to deal with the \n and so on in the tests.  I had something nicely formatted working but the tabs and spaces for alignment then screwed the test and broke the pretty formatting a different way.</p>
<p>reverser.rb:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># A class that reverses sentences.</span>
<span style="color:#008000; font-style:italic;"># &quot;My dog has fleas.&quot; --&gt; &quot;Fleas has dog my.&quot;</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">class</span> Reverser
&nbsp;
  <span style="color:#008000; font-style:italic;"># tasty constructor, full of taste</span>
  <span style="color:#9966CC; font-weight:bold;">def</span> initialize<span style="color:#006600; font-weight:bold;">&#40;</span>text<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#0066ff; font-weight:bold;">@text</span> = text
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> reverse
    delim_location = <span style="color:#006666;">0</span>  <span style="color:#008000; font-style:italic;"># char by char, remember !?. for sentence determination</span>
    delim_last_location = <span style="color:#006666;">0</span>  <span style="color:#008000; font-style:italic;"># allows us to move on to the next sentence</span>
    delim_i = <span style="color:#006666;">0</span>  <span style="color:#008000; font-style:italic;"># an iterator</span>
&nbsp;
    new_sentence = <span style="color:#996600;">&quot;&quot;</span>  <span style="color:#008000; font-style:italic;"># inits an empty string for string methods to work</span>
&nbsp;
    new_sentence_array = <span style="color:#CC0066; font-weight:bold;">Array</span>.<span style="color:#9900CC;">new</span>
    punc_array = <span style="color:#CC0066; font-weight:bold;">Array</span>.<span style="color:#9900CC;">new</span>  <span style="color:#008000; font-style:italic;"># list of punctuation marks in order</span>
    <span style="color:#0066ff; font-weight:bold;">@text</span>.<span style="color:#9900CC;">each_char</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>char<span style="color:#006600; font-weight:bold;">|</span>
      delim_i <span style="color:#006600; font-weight:bold;">+</span>= <span style="color:#006666;">1</span>  <span style="color:#008000; font-style:italic;"># iterator</span>
      <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span>char == <span style="color:#996600;">&quot;.&quot;</span> <span style="color:#006600; font-weight:bold;">||</span> char == <span style="color:#996600;">&quot;?&quot;</span> <span style="color:#006600; font-weight:bold;">||</span> char == <span style="color:#996600;">&quot;!&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
        <span style="color:#008000; font-style:italic;"># we hit a deliminter (?!.), remember it</span>
        sentence = <span style="color:#0066ff; font-weight:bold;">@text</span>.<span style="color:#9900CC;">slice</span><span style="color:#006600; font-weight:bold;">&#40;</span>delim_last_location..<span style="color:#9900CC;">delim_i</span><span style="color:#006600; font-weight:bold;">&#41;</span> 
        sentence.<span style="color:#9900CC;">strip</span>!
        new_sentence_array.<span style="color:#9900CC;">push</span><span style="color:#006600; font-weight:bold;">&#40;</span>sentence<span style="color:#006600; font-weight:bold;">&#41;</span>
        punc_array.<span style="color:#9900CC;">push</span><span style="color:#006600; font-weight:bold;">&#40;</span>char<span style="color:#006600; font-weight:bold;">&#41;</span>             
        delim_last_location = delim_i  <span style="color:#008000; font-style:italic;"># remember our substring position</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    i = <span style="color:#006666;">0</span>
    new_sentence_array.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>s<span style="color:#006600; font-weight:bold;">|</span>
        returned_sentence = do_reverse<span style="color:#006600; font-weight:bold;">&#40;</span>s<span style="color:#006600; font-weight:bold;">&#41;</span>  <span style="color:#008000; font-style:italic;"># reverse words sentence by sentence</span>
        new_sentence <span style="color:#006600; font-weight:bold;">+</span>= <span style="color:#996600;">&quot;#{returned_sentence}#{punc_array[i]}&quot;</span>  <span style="color:#008000; font-style:italic;"># append the delimiter back</span>
&nbsp;
        <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span>i<span style="color:#006600; font-weight:bold;">+</span><span style="color:#006666;">1</span> != new_sentence_array.<span style="color:#9900CC;">length</span><span style="color:#006600; font-weight:bold;">&#41;</span>  <span style="color:#008000; font-style:italic;"># look ahead for last sentence</span>
          new_sentence <span style="color:#006600; font-weight:bold;">+</span>= <span style="color:#996600;">&quot;  &quot;</span>  <span style="color:#008000; font-style:italic;"># only append spaces if this is not the last sentence</span>
        <span style="color:#9966CC; font-weight:bold;">end</span>
        i <span style="color:#006600; font-weight:bold;">+</span>= <span style="color:#006666;">1</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
&nbsp;
    new_sentence  <span style="color:#008000; font-style:italic;"># return new_sentence</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> do_reverse<span style="color:#006600; font-weight:bold;">&#40;</span>s<span style="color:#006600; font-weight:bold;">&#41;</span>
    s.<span style="color:#CC0066; font-weight:bold;">chop!</span>  <span style="color:#008000; font-style:italic;"># trim delimiter</span>
    text_array = s.<span style="color:#CC0066; font-weight:bold;">split</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot; &quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>  <span style="color:#008000; font-style:italic;"># split on spaces to array</span>
    text_array<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">downcase</span>!  <span style="color:#008000; font-style:italic;"># downcase first word</span>
    text_array.<span style="color:#9900CC;">reverse</span>!  <span style="color:#008000; font-style:italic;"># destructive reverse</span>
&nbsp;
    <span style="color:#008000; font-style:italic;"># need to move commas back</span>
    text_array_i = <span style="color:#006666;">0</span>
    text_array.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>e<span style="color:#006600; font-weight:bold;">|</span>
       text_array_i <span style="color:#006600; font-weight:bold;">+</span>= <span style="color:#006666;">1</span>
        <span style="color:#9966CC; font-weight:bold;">if</span> e.<span style="color:#9966CC; font-weight:bold;">include</span>? <span style="color:#996600;">&quot;,&quot;</span>
          e.<span style="color:#CC0066; font-weight:bold;">chop!</span>   <span style="color:#008000; font-style:italic;"># modify original array</span>
          text_array<span style="color:#006600; font-weight:bold;">&#91;</span>text_array_i <span style="color:#006600; font-weight:bold;">-</span> <span style="color:#006666;">2</span><span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#006600; font-weight:bold;">+</span>= <span style="color:#996600;">&quot;,&quot;</span>
        <span style="color:#9966CC; font-weight:bold;">end</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    text_array<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">capitalize</span>!
    text_array = text_array.<span style="color:#9900CC;">join</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot; &quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>  <span style="color:#008000; font-style:italic;"># destructive join</span>
    text_array.<span style="color:#9900CC;">to_s</span>  <span style="color:#008000; font-style:italic;"># return reversed array</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>When you run the test case it looks like this:</p>
<blockquote><p>Loaded suite ~/src/ruby/tc_reverser<br />
Started</p>
<p> Set television first our.  Today up it picked just dad.  Television a have you do?  Them of two have we, know you, yeah, well.  Wow!  Rich be must you.  You teasing he&#8217;s, honey, oh.  Sets television two has nobody.<br />
TEST_EVERYTHING OK!</p>
<p>.<br />
 Man, up shape.  Slacker a you&#8217;re.  Life your of rest the for slacker a be to want you do?<br />
TEST_MULTIPLE_SENTENCE_DELIMITERS OK!</p>
<p>.<br />
 1985 in States United the of president who&#8217;s, huh, boy future, me tell then?<br />
TEST_QUESTION_COMMA OK!</p>
<p>.<br />
 Bastard space you.  Pine my killed you.<br />
TEST_REVERSER OK!</p>
<p>.<br />
Finished in 0.003567 seconds.<br />
<font color="green">4 tests, 4 assertions, 0 failures, 0 errors</font>
</p></blockquote>
<p>Marty McFly would be proud.  So some limitations.  First, I don&#8217;t handle elipsis (&#8230;) characters at all.  It splits on sentence delimiters which one is a period.  The eplisis would cause major weirdness.  I also don&#8217;t handle recapitalizing the word &#8220;Dad&#8221; as you can see in the &#8220;test_everything&#8221; test.  This would require language parsing or a massive pick list.  I also don&#8217;t handle slang or abbreviations.  For example, &#8220;You told &#8216;em?&#8221;  would turn into &#8220;&#8216;em told you?&#8221; which might not be exactly right.</p>
<p>There are many other edge cases that this thing would fall flat on.  My test case tests what functionality I wanted and nothing more.</p>
<p>Ruby&#8217;s String#slice was super handy on this as well as capitalize, reverse and even a regex split that I didn&#8217;t use (amazing!).  You can see it here.  It would split text into an array really easily:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">sentence_array = <span style="color:#0066ff; font-weight:bold;">@text</span>.<span style="color:#CC0066; font-weight:bold;">split</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#91;</span>\.\!\?<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#41;</span>  <span style="color:#008000; font-style:italic;"># split with regular expression</span>
&nbsp;
new_sentence_array = <span style="color:#CC0066; font-weight:bold;">Array</span>.<span style="color:#9900CC;">new</span>
sentence_array.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>s<span style="color:#006600; font-weight:bold;">|</span>
    new_sentence_array.<span style="color:#9900CC;">push</span><span style="color:#006600; font-weight:bold;">&#40;</span>do_reverse<span style="color:#006600; font-weight:bold;">&#40;</span>s<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#CC0066; font-weight:bold;">puts</span> sentence_array<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">2</span><span style="color:#006600; font-weight:bold;">&#93;</span>
<span style="color:#0000FF; font-weight:bold;">return</span></pre></div></div>

<p>But then I&#8217;d lose the delimiter character (!?. etc) and would have to save it, search it or some other nonsense.  Still, really neat that you can split on a regex.</p>
]]></content:encoded>
			<wfw:commentRss>http://squarism.com/2010/05/01/reversing-sentences-with-ruby/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>iPadDC 2010</title>
		<link>http://squarism.com/2010/04/17/ipaddc-2010/</link>
		<comments>http://squarism.com/2010/04/17/ipaddc-2010/#comments</comments>
		<pubDate>Sun, 18 Apr 2010 03:26:25 +0000</pubDate>
		<dc:creator>Dillon</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://squarism.com/?p=414</guid>
		<description><![CDATA[Some notes from the 2010 iPadDC conference, I typed as fast as I could. 2nd annual iPhone OS barcamp style un-conference with many good speakers and donuts. Yum. Full slides might be available under the #iPadDC hashtag. Rob Rhyne @capttaco iPad UI Design Walter Gropius, founded the Bauhaus. He loved Claire De Lune from Ocean&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://squarism.com/2010/04/17/ipaddc-2010/ipaddc/" rel="attachment wp-att-417"><img src="http://squarism.com/wp-content/uploads/2010/04/iPadDC-580x435.jpg" alt="" title="iPadDC" width="580" height="435" class="aligncenter size-large wp-image-417" /></a></p>
<p>Some notes from the 2010 iPadDC conference, I typed as fast as I could.  2nd annual iPhone OS barcamp style un-conference with many good speakers and donuts.  Yum.</p>
<p>Full slides might be available under the <a href="http://twitter.com/ipaddc">#iPadDC hashtag</a>.</p>
<h2>Rob Rhyne @capttaco</h2>
<h3>iPad UI Design</h3>
<p><a href="http://en.wikipedia.org/wiki/Walter_Gropius">Walter Gropius</a>, founded the Bauhaus.<br />
He loved Claire De Lune from Ocean&#8217;s Eleven, builds up in fountain scene.<br />
Find the simple.<br />
Discover the hook and bust your ass to make your app enjoyable.<br />
When in doubt, polish.<br />
Demo&#8217;d his mock up/wireframe iPhone app <a href="http://giveabrief.com/">Brief</a>.  Really looks nice.  http://giveabrief.com/<br />
Ruby based BS script for mock up movement.<br />
Mentioned we should check out a Brett Victor mock up talk at WWDC.  Video might be hard to find.</p>
<h2>Nic Schlueter @schlu</h2>
<h3>Pleasing Everyone</h3>
<p>blog.simpltry.com<br />
Taxi Magic (super awesome), PM Android and WebOS<br />
JSConf<br />
Very cool taxi booking and payment app.<br />
Order of market importance<br />
iPhone -> Android -> Blackberry -> iPad -> WebOS -> WinMobile Phone 7 -> WinMobile 6.5<br />
Basically WinMobile is dead.</p>
<p>Things to worry about<br />
- Isms (metaphors per platform)<br />
- Cross Device Within Platform<br />
- Location<br />
- Multitasking<br />
- App Stores</p>
<p>Androidisms<br />
Back button kills app. Home keeps it alive. These are hardware buttons so this is the way it is. You can&#8217;t disable this. Android phones don&#8217;t get latest versions of the OS. And they don&#8217;t care because they&#8217;re going to sell a newer phone. So you have to support old OS&#8217;s.</p>
<p>BlackBerryism<br />
- Learn to love the menus<br />
- Hardware back button<br />
- T-Mobile users prepare for pain<br />
- Blackberry users never upgrade their OS<br />
- Very low expectations</p>
<p>WebOSisms<br />
- hardware back<br />
- software swipe down menu, supported by almost all apps<br />
- most similar to iPhone</p>
<p>Platform Quirks (deep dive)<br />
Android<br />
- screen resolution<br />
     &#8211; biggest challenge<br />
     &#8211; must support landscape if you want cred!<br />
     &#8211; watch the font size<br />
     &#8211; large variety in PPI and resolution in phones<br />
     &#8211; so you have to use different pixel density features of fonts?<br />
- Which OS to Target<br />
     &#8211; 1.6 unless you have a good reason<br />
     &#8211; 6-9 mo you can safely target 2.0 or 2.1<br />
     &#8211; expensive to test old devices (subscriptions)<br />
     &#8211; device manufacturers don&#8217;t make it a priority to update device OS</p>
<p>Blackberry<br />
- layout manager not quite as flexible as Android, you have to do lots of detection on your end<br />
- Currently a lot of resolutions<br />
- In the future, should be less than Android<br />
- Which OS to target. The Blackberry App World allows you to submit apps targeted from 4.2.1+.<br />
- Enterprises might want you to target older devices.<br />
- Too many threads bug<br />
     &#8211; 6-7 threads seem to be the max. Nasty. A problem on older BBs.</p>
<p>Future Proof<br />
- build support into your price<br />
     &#8211; either the app is going to suck or you&#8217;ll be broke if you don&#8217;t<br />
- unreleased phones will break your app</p>
<p>T-Mobile<br />
- some crazy APN process to enable 3rd party internet support on your app</p>
<p>BB partner<br />
$2000/year to be a partner. They&#8217;ll send source code. 1-on-1 support person. If you&#8217;re serious about BB, it&#8217;s worth it.</p>
<p>WebOS<br />
- multi-resolutions, not that bad. It&#8217;s all CSS3.<br />
- Bottom position sticky to the bottom.<br />
- PDK makes games fairly trivial. C &#038; C++ are easily portable.<br />
- Single threaded, not a problem with Ajax async for network calls etc.<br />
- Ares web based IDE developing in the browser.<br />
- Is it worth it? Probably not. Still better than WindowsMobile! HAHA</p>
<p>iPhone location services are awesome, spoiled. Others aren&#8217;t as good. The Droid rate limits how frequently you can get a location. Even between app restarts. Check time on the last known location. Nasty behavior for him to figure out.</p>
<p>BB Location. Slow GPS only. Not on older phones.<br />
WebOS Location is basically fine.</p>
<p>Multitasking<br />
- Do not do things that kill the battery. Location or network.<br />
- Consider the user experience if a user comes back to a screen days later.<br />
Android<br />
- full access<br />
- prog con running<br />
- save state when users leave app<br />
- your app gets killed in low mem situtations<br />
BB<br />
- full access<br />
- your prog con running<br />
- do what you want (spawn, background, you can watch sms/email &#8211; poor man&#8217;s push)<br />
WebOS<br />
- full access<br />
- won&#8217;t kill your app, prevents users from starting a new app if too much mem in use<br />
- You must have a card or icon when running in bg, or prepare to be killed</p>
<p>App Stores<br />
Apple &#8211; submit, wait, pray (14 days to 24 hours to 3 days). Apple is the only one with identifiers for betas. 70/30<br />
Android &#8211; no permission, 325 character description limit, can only sell from certain countries. Money collected from Google Checkout. Betas run from your own server. Free to publish. 70/30<br />
Blackberry &#8211; 3ish day approval time. $2.99 minimum price. Betas run through your own server. $200 per app. 80/20 split<br />
WebOS &#8211; 5ish day approval. $50 per app. 70/30.</p>
<h2>Dana Nuon @wdnuon</h2>
<h3>iBooks Page Curl in Six Lines of Code</h3>
<p>Transforming page by page turning with deformation. Method returns a vector which is applied to a flat matrix. Each vertex in a matrix has an X/Y. The function adds a Z.</p>
<p>He basically showed how to implement the Apple iBook page turn effect in six lines of code using a Xerox algorithm from a one page PDF with some super heavy conic math. Super awesome demos he had.  He&#8217;s been doing this stuff for a while.  Very experienced, very nice chats after his talk.</p>
<h2>Luis de la Rosa @louielouie</h2>
<h3>Seven Ways to Improve Your App with Servers</h3>
<p>Pro: Access more data, differentiate<br />
Con: More work, maintenance</p>
<p>JSON vs XML<br />
JSON &#8211; smaller, more efficient &#8211; TouchJSON<br />
XML &#8211; built-in, ubiquitous &#8211; TouchXML<br />
runner-ups: plist (no server will recognize this), custom binary</p>
<p>API enables community (high score list). More processing power (upload image to amazon mechanical turk)</p>
<p>Debugging. Inspect traffic. Charles Proxy. Adjust WiFi proxy preference. Debug with proxy.</p>
<p>Push notification: Your Server -> Apple Push Server -> iPad -> Popup: Your App: Hello World!<br />
- Registration<br />
- Push message, badge, sound. Message 5lines, 24 char<br />
- Best Practice, custom data to highlight item. Push some JSON to highlight.</p>
<p>In-App Purchase<br />
Three types:<br />
- Consumable (example: uBoot torpedos).<br />
- Non-consumable (ie: uBoot levels) &#8211; usually built-in<br />
- Subscriptions (magazine)</p>
<p>In-App Purchase Server Product Model<br />
- App store handles CC but then passes it to you.<br />
iPad -> App Store -> Your Server -> iPad</p>
<p>Sync<br />
User data survives data / app loss. Or enable multiple devices per user. Out of scope: WiFi Sync (sync to mac) + GameKit (P2P)</p>
<p>Analytics<br />
- Track usage<br />
- Easy to setup<br />
- Best practice: Send specific custom data (which level are people playing the most?)<br />
- Best practice: Crash handler</p>
<p>Advertising<br />
- Make money with free app<br />
- Design: Dedicate some space<br />
- Animation may help</p>
<p>How to implement<br />
- Hire a consultant like Happy Apps<br />
- DIY<br />
- 3rd party providers like Millennial Media<br />
- Apple (they don&#8217;t do much)</p>
<h2>Christopher Brown</h2>
<h3>iPad Advertising</h3>
<p>Answered questions and talked about how to do analytics, marketing, ads and what iAds might affect the space.  He had solid metrics and graphs that I can&#8217;t type out like he did last year with his Tap Metrics talk.</p>
<h2>David Smith</h2>
<h3>14 Days and 11 Apps Later</h3>
<p>An amazing walkthrough his flurry of app submissions.  He walked through ideas he and his team had for the iPad, demo&#8217;d his <em>ELEVEN APPS</em> and showed sales results.  Shotgun approach gets a bit of cash but not really going to start a business.  He had a lot of great insight like, &#8220;it&#8217;s not about making money but about getting your $99 worth and learning&#8221;.  I&#8217;m not doing his talk justice.  Cool guy.</p>
<h2>James Norton @jnorton</h2>
<h3>OpenGL ES 2.0 &#038; the OpenGL Shading Language</h3>
<p>Graphics Pipeline<br />
Why 2.0?<br />
- Programmable shaders enable things that are difficult or impossible without them<br />
- Computations in the GPU<br />
- Can free up memory by replacing static textures</p>
<p>Shaders (introduced in 2.0)<br />
- Vertex Shaders operate on vertex data (attributes)<br />
     &#8211; Enables CPU to offload many vertex computations to GPU<br />
- Fragment Shaders operate on fragment (pixel) data<br />
     &#8211; Allow per-pixel effects like per-pixel lighting, procedural textures (bump mapping or env mapping), noise, etc</p>
<p>Shading Language<br />
- Based on C<br />
- Variables, structures, arrays, operators, functions, flow control<br />
- Additional types to support gfx operations (vectors and matrices)</p>
<p>Differences from C<br />
- Stricter type conversions<br />
- No pointers<br />
- Function parameters can be qualified with modification: in (default), inout, out<br />
- For loopers require iteration count to be known at compile time<br />
- Array indices must be constants</p>
<p>Variable Types<br />
- Scalars &#8211; float, int, bool</p>
<p>Vectors and Matrices<br />
- Ops work with vec and matrices too<br />
- Multiplication op handles vec matrix and mat/matrix multiplies correctly<br />
- Math ops likely to be HW accel<br />
- Position component access<br />
<code><br />
vec2 pos = vec2(0,1.0)<br />
float xPost = pos.x;<br />
float yPos = pos.y;<br />
</code></p>
<p>Variable Constructors<br />
<code>vec2 texCoord = vec2(0.5, 0.5);</code></p>
<p>Type conversion<br />
<code>int count = 4;<br />
float fCount = float(count);<br />
</code></p>
<p>Flexible<br />
<code>vec3 pos = vec3(1.0,1.0,1.0);<br />
vec2 something = vec2(pos);<br />
</code></p>
<p>Precision Qualifiers<br />
lowp,mediump,highp (high precision)<br />
highp vec4 color;<br />
MUST declare default or per var precision for float in frag shaders</p>
<p>Type Modifiers<br />
- Uniforms &#8211; readonly variables passed in by the application<br />
- Attributes &#8211; per-vertex input to the vertex shader<br />
- Varyings &#8211; user to communicate form vertex shaders to fragment shader</p>
<p>Simple Shaders<br />
Vertex Shader<br />
<code>attribute vec4 position;<br />
attribute vec2 texCoord;<br />
varying vec2 fTexCoord;</p>
<p>void main(void) {<br />
     gl_Position = position; // no view transformation<br />
     fTexCoord = texCoord; // will be linearly interpolated<br />
}<br />
</code></p>
<p>Fragment Shader<br />
<code>precision highp float;<br />
varying vec2 fTexCoord;</p>
<p>uniform sampler2D myTextureSampler;</p>
<p>void main(void) {<br />
     gl_FragColor = texture2D(myTextureSampler,fTexCoord);<br />
}<br />
</code></p>
<p>TV Noise Fade in Demo<br />
Sigmoid Function: s(t) = 1 / (1 + e^ -f(t-t0) )<br />
Vertex Shader simply passes position to gl_Position like before.</p>
<p>Fragment Shader preample<br />
<code>precision highp float;      // use high p as defaulit for floats<br />
uniforma smapler2D test_pattern_texture;     // texture sampler for text patter<br />
uniform highp float time;     //time since animation start<br />
varying highp vec2 vTexCoord;</p>
<p>void main() {<br />
     float weight = sigmoid(time);<br />
     float randStatic = rand(vTextCoord);<br />
     float randDynamic = rand(vec2(randStatic,weight));<br />
     vec4 texVal = texture2D(test_pattern_texture, vTexCoord);<br />
     //don't add noise to the black border<br />
     if(textVal != vec4(0,0,0,1)){<br />
          gl_FragColor = weight * texVal + (12.0 - weight) * randDynamic;<br />
     } else {<br />
          gl_FragColor = texVal;<br />
     }<br />
}</p>
<p>// sigmoid function<br />
float sigmoid(highp float t) {<br />
float f = 10.0;<br />
float t0 = 1.25;<br />
return 1.0 / (1.0 + exp(f * -(t - t0)));<br />
}</p>
<p>// pseudo random number generator<br />
float rand(highp vec2 pos){<br />
     return fract(sin(dot(pos, vec2(12.0909, 78 ....<br />
}<br />
</code></p>
<p>Final Thoughts<br />
- OpenGL ES 2.0 allows developers more flexibility than OpenGL ES 1.1. Only will run on 3GS, iPad<br />
- Gold book (the purple book).<br />
- Orange book later for advanced.</p>
]]></content:encoded>
			<wfw:commentRss>http://squarism.com/2010/04/17/ipaddc-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to pair a Bluetooth Keyboard with an iPad</title>
		<link>http://squarism.com/2010/04/03/how-to-pair-a-bluetooth-keyboard-with-an-ipad/</link>
		<comments>http://squarism.com/2010/04/03/how-to-pair-a-bluetooth-keyboard-with-an-ipad/#comments</comments>
		<pubDate>Sat, 03 Apr 2010 22:47:12 +0000</pubDate>
		<dc:creator>Dillon</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://squarism.com/?p=399</guid>
		<description><![CDATA[I figured out something that was a bit unintuitive. I have an Apple Wireless Bluetooth keyboard paired with a Mac. I wanted to see if it works on my iPad. I went to Bluetooth->Disconnect on the Mac and the keyboard showed up in the iPad Bluetooth discovery screen but it wouldn&#8217;t pair. I just happened [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://squarism.com/2010/04/03/how-to-pair-a-bluetooth-keyboard-with-an-ipad/bluetooth_keyboard_and_ipad/" rel="attachment wp-att-402"><img src="http://squarism.com/wp-content/uploads/2010/04/Bluetooth_Keyboard_and_iPad.png" alt="" title="Bluetooth_Keyboard_and_iPad" width="600" height="450" class="aligncenter size-full wp-image-402" /></a><br />
I figured out something that was a bit unintuitive.  I have an Apple Wireless Bluetooth keyboard paired with a Mac.  I wanted to see if it works on my iPad.  I went to Bluetooth->Disconnect on the Mac and the keyboard showed up in the iPad Bluetooth discovery screen but it wouldn&#8217;t pair.</p>
<p>I just happened to find a method to get this working:</p>
<ul>
<li>Select disconnect on the Mac.</li>
<li>Turn off bluetooth completely on the Mac.</li>
<li>Hold down the power button on the keyboard to turn it off.</li>
<li>Press the power button once on the keyboard to turn it on.</li>
<li>The keyboard will show up in the iPad bluetooth list as before but now when you click it, the keyboard light will start flashing as it pairs.</li>
<li>The iPad will tell you to type a code and enter.</li>
<li>Good to go!</li>
</ul>
<p><a href="http://squarism.com/2010/04/03/how-to-pair-a-bluetooth-keyboard-with-an-ipad/bluetooth_ipad/" rel="attachment wp-att-406"><img src="http://squarism.com/wp-content/uploads/2010/04/Bluetooth_iPad.png" alt="" title="Bluetooth_iPad" width="1024" height="261" class="aligncenter size-full wp-image-406" /></a></p>
<p>It works for text areas in the browser and email windows.  The on-screen keyboard doesn&#8217;t appear.  It&#8217;s way faster to enter a blog post like this (hehe).  It doesn&#8217;t seem to work for navigating menus (with the arrow keys or anything).  Think of it as a replacement for the on screen keyboard.</p>
<p>Also, be aware that you do have to unpair with the computer.  Pairing means 1-to-1.  Not 1-to-many.  This is how bluetooth (even on PC) works unfortunately.  If you want to broadcast keyboard strokes out to many computers you&#8217;ll have to use something like VNC.  Unfortunately there isn&#8217;t a VNC server that I know of for the iPad yet (if ever).  The iPhone versions of VNC require you to jailbreak your phone which can be a pain if you like &#8220;quick and easy&#8221;.  I rarely use my bluetooth keyboard on my media center so I didn&#8217;t buy a second one.  Your mileage may vary.</p>
<p><a href="http://squarism.com/2010/04/03/how-to-pair-a-bluetooth-keyboard-with-an-ipad/bluetooth_ipad_test/" rel="attachment wp-att-405"><img src="http://squarism.com/wp-content/uploads/2010/04/Bluetooth_iPad_test.png" alt="" title="Bluetooth_iPad_test" width="455" height="112" class="aligncenter size-full wp-image-405" /></a></p>
<p>Hope this helps someone!  Post a comment if it did.</p>
]]></content:encoded>
			<wfw:commentRss>http://squarism.com/2010/04/03/how-to-pair-a-bluetooth-keyboard-with-an-ipad/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>iPadcolypse</title>
		<link>http://squarism.com/2010/04/03/ipadcolypse/</link>
		<comments>http://squarism.com/2010/04/03/ipadcolypse/#comments</comments>
		<pubDate>Sat, 03 Apr 2010 22:25:22 +0000</pubDate>
		<dc:creator>Dillon</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://squarism.com/?p=397</guid>
		<description><![CDATA[The Wiff was using the yahoo tv guide (free app) and wants one. It&#8217;s got potential as a living room multitasker thingy. I got the 32gb. The 64gb is useless because you still have to pick your media you want to sync. Maybe the 16gb would have been better but I wanted to cram a [...]]]></description>
			<content:encoded><![CDATA[<p>The Wiff was using the yahoo tv guide (free app) and wants one.  It&#8217;s got potential as a living room multitasker thingy.  I got the 32gb.  The 64gb is useless because you still have to pick your media you want to sync.  Maybe the 16gb would have been better but I wanted to cram a bunch of stuff on it.  If they had a 1TB one (lol) then you could sync your whole iTunes library and movies etc etc.  I wish it had an SD slot and some other expansion stuff on it.  Like it just mounting up as a disk.</p>
<p>But I did grab an app called &#8220;GoodReader&#8221;.  It&#8217;ll probably be replaced by something better (a lot of apps are rushed first to market attempts) but it has DropBox download support (not sync).  So I just threw my ebook PDFs (like from other publishers such as PragProg other than the Kindle) and that&#8217;s how I got PDFs on it.</p>
<p>Among the star apps so far:<br />
- Kindle app (free), pretty nice.  Nicer than the Kindle.  I wish it had two page view like iBooks does.  iBooks doesn&#8217;t have shit for selection right now.  No tech books.  All my tech books are in the Kindle store or PDF.<br />
- Twitterific (widscreen is the best mode, probably more improvements later)<br />
- NY Times (please release digital Wired mag like this)<br />
- Yahoo Entertainment app<br />
- ABC app, plays episodes in crappy SD but free<br />
- Weatherbug (super slick Radar and forecast all in one huge data overload view)<br />
- Evernote (online notebook).  Not as slick as it should be.  No formatting options while editing.<br />
- BBC news (meh kinda redudant)<br />
- Plants vs Zombies (PvZ), perfect port</p>
<p>All the official apps are super polished.  I haven&#8217;t bought the iLife suite apps.  I don&#8217;t think I need them (maybe I will at work?).  I&#8217;m waiting for a few of my favorite devs to update their apps:<br />
- Mint<br />
- IRC chat called FlowChat<br />
- Lux Touch (woo multitouch strategy)<br />
- Some kind of SSH awesomeness.<br />
- Ruler app (just because I could measure bigger things?)<br />
- Official facebook app<br />
- How about a WoW auction app?!?!  COME ON!  Even if I don&#8217;t play.</p>
<p>Many apps are $10.  So I&#8217;m holding out for more free competition.</p>
<p>There&#8217;s a scrabble app that plays with your phone.  You put your tiles on your phone as the tile rack so you can hide your letters.  Everyone plays on the iPad.  I haven&#8217;t tried it but what a great idea!  I&#8217;d like to see the MS Surface stuff on these devices like that.  Imagine some geeky strategy game or RPG.  Or Battleship.</p>
<p>I have to figure out how to sync my calendar and all the stuff I set up on my phone.  I&#8217;m trying to keep the two devices separate.  For example, I don&#8217;t need any apps that scan barcodes because it doesn&#8217;t have a camera.  :P</p>
<p>I&#8217;m surprised how fast this thing is.  I see why so many games are coming out.  Sorry for the short write-up but I&#8217;m in toy overload mode.</p>
]]></content:encoded>
			<wfw:commentRss>http://squarism.com/2010/04/03/ipadcolypse/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Dokuwiki April Fools 2010</title>
		<link>http://squarism.com/2010/04/01/dokuwiki-april-fools-2010/</link>
		<comments>http://squarism.com/2010/04/01/dokuwiki-april-fools-2010/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 22:43:34 +0000</pubDate>
		<dc:creator>Dillon</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://squarism.com/?p=388</guid>
		<description><![CDATA[I was checking out some syntax on dokuwiki&#8217;s website and suddenly a duck appeared from the right hand side. When I hovered over it, I got a web browser crosshair. When I clicked on it (*bang*), a bullet hole image appeared in the web page and the duck (*quack*) fell to the bottom of the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://squarism.com/2010/04/01/dokuwiki-april-fools-2010/dokuwiki_april_fools_2010/" rel="attachment wp-att-389"><img src="http://squarism.com/wp-content/uploads/2010/04/dokuwiki_april_fools_2010.png" alt="" title="dokuwiki_april_fools_2010" width="482" height="226" class="aligncenter size-full wp-image-389" /></a></p>
<p>I was checking out some syntax on <a href="http://www.dokuwiki.org/dokuwiki">dokuwiki&#8217;s website</a> and suddenly a duck appeared from the right hand side.  When I hovered over it, I got a web browser crosshair.  When I clicked on it (*bang*), a bullet hole image appeared in the web page and the duck (*quack*) fell to the bottom of the browser window.</p>
<p>Duck hunt!</p>
<p>I didn&#8217;t see it blogged about yet so there ya go.  Techcrunch has <a href="http://techcrunch.com/april-fools-shenanigans/">a good wrap-up</a> of 2010 april fool&#8217;s jokes.  This year didn&#8217;t seem as big as last year&#8217;s.</p>
]]></content:encoded>
			<wfw:commentRss>http://squarism.com/2010/04/01/dokuwiki-april-fools-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

