<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title><![CDATA[the scan artist]]></title>
  <link href="http://morganthall.com/atom.xml" rel="self"/>
  <link href="http://morganthall.com/"/>
  <updated>2015-06-02T12:46:23-04:00</updated>
  <id>http://morganthall.com/</id>
  <author>
    <name><![CDATA[Paul Morganthall]]></name>
    
  </author>
  <generator uri="http://octopress.org/">Octopress</generator>

  
  <entry>
    <title type="html"><![CDATA[Locating Sinatra views]]></title>
    <link href="http://morganthall.com/2013/sinatra-test-views"/>
    <updated>2013-04-29T12:55:00-04:00</updated>
    <id>http://morganthall.com/2013/sinatra-test-views</id>
    <content type="html"><![CDATA[<p>I have adhered to strict TDD as I build <a href="https://github.com/slothbear/cheap_buster">cheap buster</a>.
There wasn&#8217;t much need for views until now as I have been working
on the internal API. The original index action contained the simplest
Sinatra &#8216;view&#8217;, a string.</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="n">get</span> <span class="s1">&#39;/&#39;</span> <span class="k">do</span>
</span><span class='line'>  <span class="s1">&#39;&lt;h1&gt;cheap buster&lt;/h1&gt;Welcome&#39;</span>
</span><span class='line'><span class="k">end</span>
</span></code></pre></td></tr></table></div></figure>


<p>Now that I&#8217;m ready to build the first form, I figured the first step was to
move the view to a separate file.</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="n">get</span> <span class="s1">&#39;/&#39;</span> <span class="k">do</span>
</span><span class='line'>  <span class="n">erb</span> <span class="ss">:index</span>
</span><span class='line'><span class="k">end</span>
</span></code></pre></td></tr></table></div></figure>


<p>This works fine in the browser, but the <strong>test</strong> looks for the view one
level down in <em>test/views</em>:<br/>
<code>No such file or directory - /Users/adam/dev/cheap_buster/test/views/index.erb
</code></p>

<p>The only mention I could find of this behavior was an article by
<a href="http://blog.tobiascrawley.net/posts/2008/12/18/stepping-off-the-rails-part-1/">Tobias Crawley</a> from 2008. He fixed the problem by linking
<code>test/views</code> to <code>views</code>, but that feels extreme.
I looked through lots of Sinatra applications
<a href="http://www.sinatrarb.com/wild.html">in the wild</a>. Many had no tests, some didn&#8217;t test views.
None did anything special to help the tests locate the views.</p>

<p>This feels like some kind of configuration error on my part. For now,
I&#8217;ve solved the problem by adding a configuration setting to
the affected tests:<br/>
<code>app.set :views, File.expand_path('./views')</code></p>

<p>Hacky as that seems, at least the fix is quite localized, sitting right
next to the tests that need the workaround.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Should you learn to program?]]></title>
    <link href="http://morganthall.com/2013/should-you-learn-to-program"/>
    <updated>2013-03-04T20:32:00-05:00</updated>
    <id>http://morganthall.com/2013/should-you-learn-to-program</id>
    <content type="html"><![CDATA[<p>A relative of mine heading to college next year recently asked&#8230;</p>

<blockquote><p>The more I need to do things, the more  feel like I need to know how
to program, so that when something doesn&#8217;t do what I need it to do I
can develop something that does. I suspect though, that fixing a small
functionality preference like this would take an absurdly long time,
like the better part of a year. Maybe I&#8217;m better off getting rich
instead.</p></blockquote>

<p>By all means, get rich, but that doesn’t answer the question of whether
you should learn to program. If there is any question in your mind,
try it. There are so many ways to dip your toe in these days. It is
worthwhile to see if you like programming. If you’re good at
programming and don’t <em>hate</em> it, you could make some money even if
programming is not your main interest.</p>

<p>Where should you start? Try learning Ruby. There are many resources
available, and Ruby comes preloaded with an extremely helpful
community. If you end up needing to program in some other language,
most of your Ruby skills will be applicable. Ruby is on your MacBook
right now, and is easily installed on other systems.</p>

<ul>
<li>Have 15 minutes? <a href="http://tryruby.org/">Give Ruby a try right now!</a>
(works right in your web browser)</li>
<li>Rather read a book?
Try <a href="http://www.amazon.com/Learn-Program-Second-Facets-Ruby/dp/1934356360">Learn to Program</a>
by Chris Pine. (n.b. Your cousin and your uncle have the book and
might be willing to pair program.)</li>
<li>Like an off-beat approach? <a href="http://mislav.uniqpath.com/poignant-guide/">why’s poignant guide to Ruby</a>.
I could say more about this guide, but it really needs to
be experienced.</li>
</ul>


<p>Perhaps you don’t need to get rich <em>or</em> learn to program. If a
program doesn’t do what you need, perhaps another program does.
There are two parts to this question, both of which you’ll refine
over time.</p>

<ol>
<li>Is your computer system even <strong>capable</strong> of this function?</li>
<li>Has someone already created the program you want?</li>
</ol>


<p>Start by asking Google. Then
ask your uncles, many of whom share your platform. Over time, you’ll
get a feel for what is possible and what is available.
Until then, Learn Ruby!</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[round challah for Rosh Hashanah]]></title>
    <link href="http://morganthall.com/2009/round-challah-for-rosh-hashanah"/>
    <updated>2009-09-25T18:00:00-04:00</updated>
    <id>http://morganthall.com/2009/round-challah-for-rosh-hashanah</id>
    <content type="html"><![CDATA[<p><img src="http://morganthall.com/images/rosh/rh09_baked.jpg"></p>

<p>We went to our best friend&#8217;s house for Rosh Hashanah dinner.  I was honored
to bake the challahs for the celebration.  But. I&#8217;ve never made round
challah before.  Round is traditional for the New Year. I found a lot of
different descriptions of this tradition.  Most said the shape represents
God&#8217;s crown, or the cycle of the seasons.  The most interesting writeup said
the round challah for Rosh Hashanah may be the most common of all Jewish
practices, since the tradition is rooted in the practices of the original
twelve tribes.</p>

<p>The day before the celebration, I learned a lot by making a trial loaf.
A big round challah takes a <em>lot</em> longer to bake.  The weaving method
described many places on the net sounds hard, but is actually easier than
the typical 3-strand braid.  I practiced with Play-Doh.</p>

<p>The host requested I make one challah with raisins and one without.  I made
one large woven challah with golden raisins, and one braided round with flax
seed meal. For both loaves I used Maggie Glezer&#8217;s
<a href="http://www.finecooking.com/recipes/challah.aspx">challah recipe</a>
found at Fine Cooking.  I use that recipe whenever I need a fool-proof
loaf – except I can&#8217;t stop myself from experimenting.  This time, I used 9
oz. unbleached white flour, 4 oz. bread flour, and 4 oz. white whole wheat
(all King Arthur).  The article also describes a beautiful 6-strand braid
I&#8217;ve made many times. Watch this
<a href="http://www.finecooking.com/videos/braiding-challah.aspx">helpful video</a>
a couple of times before you start.</p>

<p>Both round loaves turned out quite well.  In the future I&#8217;ll make two
smaller woven loaves instead of the giant one (from 17 oz of flour).  The
big one looked impressive, but it was just too hard to bake.  I baked
the loaf for almost an hour.  Even then, the inside was a little underdone,
and the outside a little overdone.  No one complained.</p>

<p>This week&#8217;s
<a href="http://morganthall.com/2009/scan-artist/#thing_description">Thing</a>
is the baking of round challahs, something I&#8217;ve never
tried before.</p>

<p>This article was featured in the weekly roundup at
<a href="http://www.wildyeastblog.com/2009/10/02/yeastspotting-10-2-09/">YeastSpotting</a>,
one of my favorite blogs.</p>

<p><img src="http://morganthall.com/images/rosh/rh09_braided.jpg"></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[hoya carnosa flowers]]></title>
    <link href="http://morganthall.com/2009/hoya-carnosa"/>
    <updated>2009-08-28T11:32:00-04:00</updated>
    <id>http://morganthall.com/2009/hoya-carnosa</id>
    <content type="html"><![CDATA[<p><img class="right" src="http://morganthall.com/images/hoya/hindu_rope_c.jpg"></p>

<p>A friend gave me a Hindu Rope plant years ago.  I enjoyed
the way it looked, and the unique way new leaves grew.  One
of the leaves would grow a greyish-brown extension, looking
very much like dead plant.  Eventually the twig would unfurl
and green into a beautiful new leaf.</p>

<p>The plant grew nicely for years, then died.  I didn&#8217;t see any bugs
and I watered it appropriately.  It just died.  Before it passed on,
I took a clipping of the greenest part of the plant, and set it to
root in a coffee mug.  I&#8217;ve put a lot of clippings in mugs over the
years, but I can&#8217;t remember ever planting any of them in dirt.
I think some of them were there when we moved into the house.
Eighteen years ago.  I do add water to the mugs every week.
When I remember.</p>

<p>One day (after a couple of years) I noticed that an alien had landed
in the coffee cup.  That really was my first thought.  Upon closer
examination, the alien was growing out of the twig end of the Hindu
Rope.  A globe shaped collection of tiny pink pods.
It wasn&#8217;t an alien, but it did have alien heritage.</p>

<p><img src="http://morganthall.com/images/hoya/elephant_before.jpg"></p>

<p>Over the next couple of weeks, the pods opened into beautiful tiny
pink flowers.  Maybe they weren&#8217;t alien.  Maybe it was more like a
plea.</p>

<blockquote><p>Please sir, may I have some dirt?</p></blockquote>

<p><img src="http://morganthall.com/images/hoya/elephant_after.jpg"></p>

<p>This flowering has happened three time now.  You think I&#8217;d get the
message.  But if I put the plant in dirt, will it ever flower again?</p>

<p>Maybe we could compromise.  First I&#8217;ll nurse the plant back to
health.  Once it has enough to share, I&#8217;ll snip off a few sprigs for
flowering.</p>

<p><img src="http://morganthall.com/images/hoya/elephant_art.jpg"></p>

<p>This week&#8217;s
<a href="http://morganthall.com/2009/scan-artist/#thing_description">Thing</a>
is the story of my Hindu Rope plant
in words and pictures.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[What is a scan artist?]]></title>
    <link href="http://morganthall.com/2009/scan-artist"/>
    <updated>2009-07-24T21:32:00-04:00</updated>
    <id>http://morganthall.com/2009/scan-artist</id>
    <content type="html"><![CDATA[<p><em>scan artist</em> = <em>scanner</em> + <em>scam artist</em></p>

<p>According to <a href="http://www.barbarasher.com/">Barbara Sher</a> in her book <a href="http://www.amazon.com/gp/product/1594863032">Refuse to Choose</a>:</p>

<blockquote><p>Scanners love to read and write, to fix and invent things, to design
projects and businesses, to cook and sing, and to create the perfect
dinner party. (You’ll notice I didn’t use the word “or,” because Scanners
don’t love to do one thing or the other; they love them all.) A Scanner
might be fascinated with learning how to play bridge or bocce, but once
she gets good at it, she might never play it again. &#8230; To Scanners the
world is like a big candy store full of fascinating opportunities,
and all they want is to reach out and stuff their pockets.</p></blockquote>

<p><em>scam artist</em>: person who gains the confidence
of someone in order to defraud them</p>

<p>When I create, I often feel like a fraud. I&#8217;m not really an
artist. I&#8217;m not really a creator.</p>

<p>I just program computers and bake bread and knit and study ants and read
tarot and I Ching and solve Sudoku and love science fiction and cook and
teach the <a href="http://baxter.cerier.com">dog</a> tricks and think of ways to do laundry better and
remember which way each key turns in the lock and play games and program
games and speak Esperanto and build in Second Life and grow
vegetables and look at the stars in my telescope and am probably in the
90th percentile of 3x5 card and imported Japanese pen collectors.</p>

<p>Huh. The list is incomplete and it already sounds pretty creative.
I&#8217;m definitely a Scanner. And an artist. What I lack is a way
to hold myself accountable for production.</p>

<h2><a name="thing_description"></a> Thing A Week</h2>

<p>For inspiration, it doesn&#8217;t get much better than
<a href="http://www.jonathancoulton.com/">Jonathan Coulton</a>. He quit his tech job to become a songwriter
and performer. He has done really well. JoCo describes the beginning of
his <a href="http://www.jonathancoulton.com/2005/09/16/work-vs-play/">Thing A Week</a>:</p>

<blockquote><p>To keep the juices flowing, I am going to post one piece of work per
week until further notice. This may be a complete song, or it may be
some kind of experimental thing, a mashup, a remix, some audio of me
eating cheese, who knows. Not every one will be good, or even tolerable.
Many of these things will not makeany sense to anyone but me, and some
of them will certainly suck. But there will be one a week, so that’s got
to be worth something.</p></blockquote>

<p>I&#8217;m going to adopt the <em>Thing A Week</em> practice. It worked really well
for Mr. Coulton. Some of the songs he produced were genius
(<a href="http://www.youtube.com/watch?v=UQYjZc7gKXc">Re Your Brains</a>).  Some seemed kind of lame, but later
turned into sensations (<a href="http://www.youtube.com/watch?v=pC-DeXhZvuQ">Mr. Fancy Pants</a>).
But he produced <em>something</em> every week, for 52 weeks.</p>

<p>That&#8217;s the plan. Each week I am going to publish something. It might
be a Ruby program, or a loaf of bread, or a photo of fresh-picked
green beans. It might even be art.</p>

<p>This week&#8217;s Thing is <em><em>the scan artist</em></em> blog. All done now. Come back next week.</p>
]]></content>
  </entry>
  
</feed>
