<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom">
 
  <title>metrocat</title>
  <link href="http://metrocat.org/" />
  <link type="application/atom+xml" rel="self" href="http://metrocat.org/atom.xml" />
  <updated>2012-02-14T23:25:43-08:00</updated>
  <id>http://metrocat.org/</id>
  <author>
    <name>Jeff Watkins</name>
    <email>jeff@metrocat.org</email>
  </author>

  
  <entry>
    <id>http://metrocat.org/2012/02/more-unit-tests</id>
    <link type="text/html" rel="alternate" href="http://metrocat.org/2012/02/more-unit-tests" />
    <title>More Unit Tests</title>
    <updated>2012-02-06T00:00:00-08:00</updated>
    <author>
      <name></name>
      <uri>http://metrocat.org/</uri>
    </author>
    <content type="html">&lt;p&gt;For someone who professes to dislike writing unit tests, I seem to be writing a lot of them. In addition to the tests on my Markdown converter, this evening I started building a template engine. The syntax will be similar to &lt;a href='http://liquidmarkup.org/'&gt;Liquid&lt;/a&gt;, but of course, it&amp;#8217;ll be written in Objective-C.&lt;/p&gt;

&lt;p&gt;The scanner now has a host of tests covering everything from blank strings to incorrectly nested expressions. It&amp;#8217;s possible I&amp;#8217;ve missed some cases, but when the bugs crop up, I&amp;#8217;ll write tests to make certain they stay fixed.&lt;/p&gt;</content>
  </entry>
  
  <entry>
    <id>http://metrocat.org/2012/02/unit-tests-suck-but-theyre-important</id>
    <link type="text/html" rel="alternate" href="http://metrocat.org/2012/02/unit-tests-suck-but-theyre-important" />
    <title>Unit Tests Suck, But They're So Important</title>
    <updated>2012-02-02T00:00:00-08:00</updated>
    <author>
      <name>Jeff Watkins</name>
      <uri>http://metrocat.org/</uri>
    </author>
    <content type="html">&lt;p&gt;I&amp;#8217;ve been working on a little Mac application in my limited spare time. The component I&amp;#8217;ve been tackling lately involves conversion between &lt;a href='http://daringfireball.net/projects/markdown/'&gt;Markdown text&lt;/a&gt; and an &lt;code&gt;NSAttributedString&lt;/code&gt;. There&amp;#8217;s no good way to test the process, but what I&amp;#8217;ve settled on is the following:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Convert from Markdown to &lt;code&gt;NSAttributedString&lt;/code&gt;&lt;/li&gt;

&lt;li&gt;Convert from &lt;code&gt;NSAttributedString&lt;/code&gt; back to Markdown&lt;/li&gt;

&lt;li&gt;Convert from Markdown to HTML&lt;/li&gt;

&lt;li&gt;Convert the original Markdown to HTML&lt;/li&gt;

&lt;li&gt;Compare the result of step 3 and step 4&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Normally, I &lt;strong&gt;hate&lt;/strong&gt; writing unit tests. Even with a firm grasp of &lt;a href='http://en.wikipedia.org/wiki/Cyclomatic_complexity'&gt;cyclometric complexity&lt;/a&gt;, it&amp;#8217;s still a pain to figure out how many tests you need to write and what each test should actually test. But in this case, John Gruber already put together a pretty decent suite of &lt;a href='http://daringfireball.net/projects/downloads/MarkdownTest_1.0.zip'&gt;tests for Markdown&lt;/a&gt;. All I need do is run each source file through my conversion test.&lt;/p&gt;

&lt;p&gt;Right now, out of 19 tests, only 12 are failing. After I add support for HTML encoding unicode characters (which isn&amp;#8217;t &lt;em&gt;really&lt;/em&gt; necessary if you declare your content to be in UTF-8, but nevertheless) the rest of the errors relate to whitespace wrapping in HTML. I&amp;#8217;m going to try adding some sort of HTML tidying to the test to see if I can losslessly massage the HTML to be more similar.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: After adding support for encoding non-ascii characters and piping the HTML through &lt;code&gt;tidy&lt;/code&gt;, all tests pass.&lt;/p&gt;</content>
  </entry>
  
  <entry>
    <id>http://metrocat.org/2012/01/doing-battle-with-chase-bank</id>
    <link type="text/html" rel="alternate" href="http://metrocat.org/2012/01/doing-battle-with-chase-bank" />
    <title>Doing Battle With Chase Bank</title>
    <updated>2012-01-31T00:00:00-08:00</updated>
    <author>
      <name>Jeff Watkins</name>
      <uri>http://metrocat.org/</uri>
    </author>
    <content type="html">&lt;p&gt;Today I spent almost two hours on the phone with Chase Bank trying to get my money back. Being on the phone for that long is bad enough, but I had to call twice, because the first time, I was put on hold and abandoned for more than 30 minutes until I finally hung up.&lt;/p&gt;

&lt;p&gt;I was calling to find out what had happened to &lt;strong&gt;two&lt;/strong&gt; online bill payments to Molly&amp;#8217;s former after school care facility, CDC. Both payments were for $664. The first payment was on 14 December and the second on 23 December. When I spoke to the folks at CDC, they assured me the payments hadn&amp;#8217;t been received.&lt;/p&gt;

&lt;p&gt;With a paper check, you write the check, seal it in an envelope and mail it to the merchant. If something goes horribly wrong and the postman assigned to deliver the mail is sucked into an intergalactic vortex and never seen by humans again, you can simply write another check and try again… because the money never left your account.&lt;/p&gt;

&lt;p&gt;With Chase fuck-you!-customer Online Bill Payment, you schedule the payment, Chase removes the money from your account, magic happens, and the merchant is paid. In this case, the magic &lt;em&gt;didn&amp;#8217;t&lt;/em&gt; happen and the merchant didn&amp;#8217;t get paid. &lt;strong&gt;TWICE.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There&amp;#8217;s an important point to remember: before delivering the payment, &lt;strong&gt;Chase removes the money from your account&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;So for the last 39 days, Chase has been gleefully earning interest on $1328 of mine to which they had no moral right. They had the original payment of $664 for a whopping 48 days. From what I was told today, they wouldn&amp;#8217;t have automatically refunded the money until they received the misaddressed mail. And if the check was never returned by the Post? Well, it would be my responsibility to ask for the money back.&lt;/p&gt;

&lt;p&gt;Fuckers.&lt;/p&gt;

&lt;p&gt;The first customer dis-service drone happily issued a stop payment on the two checks. She then informed me that Chase would continue holding onto my money for up to five more days. Perhaps they realised I would only spend it on frivolous things, like Molly&amp;#8217;s tuition or replacement tires for the Mini Cooper. I expect Chase has far more important uses for &lt;strong&gt;my&lt;/strong&gt; money. After all, they&amp;#8217;ve become accustomed to having it floating around in their coffers for the last 39 days.&lt;/p&gt;

&lt;p&gt;I asked, politely, for her to pass me along to her supervisor. She put me on hold for about five minutes — presumably to punish me for not accepting the moldy crumbs of comfort Chase Bank so graciously offered me. Her supervisor came on the line, she repeated the party line: no return of my money for up to five days. She was unmoved by my request that because Chase Bank had already had plenty of time with my money, I really would rather have it back immediately.&lt;/p&gt;

&lt;p&gt;I asked, slightly less politely this time, for her to pass me along to &lt;em&gt;her&lt;/em&gt; supervisor. She was very abrupt. She said her supervisor was in a meeting and she&amp;#8217;d have to put me on hold. I waited on hold for more than thirty minutes before it became abundantly clear I was being punished once again.&lt;/p&gt;

&lt;p&gt;I called back. This time I was livid, but I &lt;strong&gt;tried&lt;/strong&gt; to continue being polite. After all, it wasn&amp;#8217;t this new person&amp;#8217;s fault I&amp;#8217;d received such horrific &amp;#8220;service&amp;#8221; on the previous call. First I asked her to share with me my call tracking number.&lt;sup id='fnref:1'&gt;&lt;a href='#fn:1' rel='footnote'&gt;1&lt;/a&gt;&lt;/sup&gt; The new woman wanted to put me on hold while she consulted with someone; I explained how I&amp;#8217;d been left on hold by the previous batch and I was unwilling to be put on hold again. She patched in someone from another department. I repeated my story, again. Again I received the standard response: up to five more days before my money and I could be reunited.&lt;/p&gt;

&lt;p&gt;Once again I explained they had already had the pleasure of my money&amp;#8217;s company for 39 days (48 days for the first batch), I missed my money and &lt;em&gt;really&lt;/em&gt; felt it was time for it to come home. I reiterated that there wasn&amp;#8217;t any conceivable reason why the payments wouldn&amp;#8217;t have arrived at the merchant &lt;em&gt;had they been sent&lt;/em&gt;. Clearly, the party at fault here was Chase Bank. It was therefore, rather unfair that after screwing up two payments in a row, they would be unwilling to refund my money immediately.&lt;/p&gt;

&lt;p&gt;I think this new woman was cornered. It was abundantly clear I wasn&amp;#8217;t going to accept Chase Bank&amp;#8217;s &lt;em&gt;gracious&lt;/em&gt; offer to continue hosting my money in their vast corporate coffers, nor was I going to hang up, nor could she put me on hold and abandon me there&lt;sup id='fnref:2'&gt;&lt;a href='#fn:2' rel='footnote'&gt;2&lt;/a&gt;&lt;/sup&gt;. Finally, she relented and issued me an immediate refund.&lt;/p&gt;

&lt;p&gt;I guess what I don&amp;#8217;t understand is why Chase withdraws the money from my account before making the payment. They&amp;#8217;re a bank for crying out loud. If they need to send a paper check, instead of printing out a generic check, &lt;strong&gt;put my account information on it&lt;/strong&gt;. Of course, this would be obvious if Chase Bank actually gave a rat&amp;#8217;s ass about its customers.&lt;/p&gt;

&lt;p&gt;On 4 February, the CD we have associated with these accounts will mature. That&amp;#8217;s when we&amp;#8217;ll cease being Chase Bank customers. I don&amp;#8217;t know where we&amp;#8217;ll be taking our (meager) bushel of cash, but it won&amp;#8217;t stay with those fuckers at Chase Bank.&lt;/p&gt;
&lt;div class='footnotes'&gt;&lt;hr /&gt;&lt;ol&gt;&lt;li id='fn:1'&gt;
&lt;p&gt;In case you&amp;#8217;re not aware, all customer &amp;#8220;service&amp;#8221; centers have software that assigns each incoming call an unique number. If you have this number, you can use it to link subsequent calls to the previous call. In my case, if I was put on hold and abandoned again, I&amp;#8217;d be able to pinpoint by whom.&lt;/p&gt;
&lt;a href='#fnref:1' rev='footnote'&gt;&amp;#8617;&lt;/a&gt;&lt;/li&gt;&lt;li id='fn:2'&gt;
&lt;p&gt;Because I had the call tracking number, the next person I called would be able to look up who did it.&lt;/p&gt;
&lt;a href='#fnref:2' rev='footnote'&gt;&amp;#8617;&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;</content>
  </entry>
  
  <entry>
    <id>http://metrocat.org/2012/01/importance-of-equality</id>
    <link type="text/html" rel="alternate" href="http://metrocat.org/2012/01/importance-of-equality" />
    <title>The Importance of Equality</title>
    <updated>2012-01-29T00:00:00-08:00</updated>
    <author>
      <name>Jeff Watkins</name>
      <uri>http://metrocat.org/</uri>
    </author>
    <content type="html">&lt;p&gt;I&amp;#8217;ve been working on a converter from Markdown to &lt;code&gt;NSAttributedString&lt;/code&gt; and while running my unit tests against John Gruber&amp;#8217;s Markdown test suite, I couldn&amp;#8217;t understand why one specific test was failing&lt;sup id='fnref:1'&gt;&lt;a href='#fn:1' rel='footnote'&gt;1&lt;/a&gt;&lt;/sup&gt;. Here&amp;#8217;s the test Markdown source:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Just a [URL](/url/).

[URL and title](/url/ &amp;quot;title&amp;quot;).

[URL and title](/url/  &amp;quot;title preceded by two spaces&amp;quot;).

[URL and title](/url/	&amp;quot;title preceded by a tab&amp;quot;).

[Empty]().&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;What was confusing me was that the &lt;code&gt;NSAttributedString&lt;/code&gt; that resulted from calling &lt;code&gt;+[NSAttributedString attributedStringByConvertingMarkdown:test withStyles:styles]&lt;/code&gt; seemed to repeat the first four links and follow up with the correct fifth link. This didn&amp;#8217;t make any sense.&lt;/p&gt;

&lt;p&gt;My first thought was that maybe &lt;code&gt;NSAttributedString&lt;/code&gt; wasn&amp;#8217;t retaining the &lt;code&gt;MCLink&lt;/code&gt; instances (which are a subclass of &lt;code&gt;NSURL&lt;/code&gt;). And sure enough, after putting some logging into &lt;code&gt;-dealloc&lt;/code&gt;, the evidence was clear: the second, third and fourth links were not retained. Only the first and fifth were retained.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;m not certain why it took me so long to realise that &lt;code&gt;NSAttributedString&lt;/code&gt; was probably comparing the new URLs against those already in the string and when it discovered a match, it reused an existing one.&lt;/p&gt;

&lt;p&gt;After a quick implementation of &lt;code&gt;-isEqual:&lt;/code&gt; and &lt;code&gt;-hash&lt;/code&gt;, all was working gloriously.&lt;/p&gt;
&lt;div class='footnotes'&gt;&lt;hr /&gt;&lt;ol&gt;&lt;li id='fn:1'&gt;
&lt;p&gt;Just to be clear, I currently have fifteen failing tests, but this &lt;strong&gt;particular&lt;/strong&gt; failure was very confusing.&lt;/p&gt;
&lt;a href='#fnref:1' rev='footnote'&gt;&amp;#8617;&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;</content>
  </entry>
  
  <entry>
    <id>http://metrocat.org/2011/09/rolling-backpacks</id>
    <link type="text/html" rel="alternate" href="http://metrocat.org/2011/09/rolling-backpacks" />
    <title>Rolling Backpacks</title>
    <updated>2011-09-01T00:00:00-07:00</updated>
    <author>
      <name></name>
      <uri>http://metrocat.org/</uri>
    </author>
    <content type="html">&lt;p&gt;What the hell is going on with all the kids dragging rolling backpacks to school? It&amp;#8217;s bad enough many of them have huge backpacks (which are mostly empty judging by the way they swing around) but an incredible number seem to have rolling backpacks.&lt;/p&gt;</content>
  </entry>
  
  <entry>
    <id>http://metrocat.org/2011/09/circle-of-enemies</id>
    <link type="text/html" rel="alternate" href="http://metrocat.org/2011/09/circle-of-enemies" />
    <title>Circle of Enemies, by Harry Connolly</title>
    <updated>2011-09-01T00:00:00-07:00</updated>
    <author>
      <name></name>
      <uri>http://metrocat.org/</uri>
    </author>
    <content type="html">&lt;p&gt;I just finished reading &lt;em&gt;Circle of Enemies&lt;/em&gt; by Harry Connolly last night. I first heard of his work when he was the &lt;a href='http://www.antipope.org/charlie/blog-static/2011/02/introducing-harry-connolly.html'&gt;guest blogger on Charles Stross&amp;#8217; Web site&lt;/a&gt;. Stross writes the excellent Laundry series and also the Merchant Prince series, both of which I&amp;#8217;ve enjoyed tremendously. So when he recommended Connolly&amp;#8217;s work, I took the plunge and downloaded it to my iPad.&lt;/p&gt;

&lt;p&gt;Connolly tells compelling stories while giving readers a small glimpse into the world he&amp;#8217;s crafted. My only complaint is they&amp;#8217;re a quick read. So waiting for the next book will be challenging.&lt;/p&gt;</content>
  </entry>
  
  <entry>
    <id>http://metrocat.org/2011/08/feeling-better</id>
    <link type="text/html" rel="alternate" href="http://metrocat.org/2011/08/feeling-better" />
    <title>Feeling Better</title>
    <updated>2011-08-31T00:00:00-07:00</updated>
    <author>
      <name></name>
      <uri>http://metrocat.org/</uri>
    </author>
    <content type="html">&lt;p&gt;This morning Molly returned to Kindergarten. The rule is kids have to be fever free for 24 hours before they can go back. She woke yesterday without a fever and drove Anna nuts all day long. I was delighted to be able to walk to school with my sweetie again.&lt;/p&gt;</content>
  </entry>
  
  <entry>
    <id>http://metrocat.org/2011/08/plague-victim</id>
    <link type="text/html" rel="alternate" href="http://metrocat.org/2011/08/plague-victim" />
    <title>Plague Victim</title>
    <updated>2011-08-28T00:00:00-07:00</updated>
    <author>
      <name>Jeff Watkins</name>
      <uri>http://metrocat.org/</uri>
    </author>
    <content type="html">&lt;p&gt;Poor Molly brought back some sort of plague from the wilds of Seattle. Yesterday, she woke around 7:30 (about an hour later than usual) and declared she was still tired. After drinking some juice and visiting the bathroom, she went back to bed and slept until almost 10. When she finally woke, she complained of a headache; we found she was running a temperature of 101°F. Worrisome, but not an emergency. So we rested about the house most of the day.&lt;/p&gt;

&lt;p&gt;This morning, Molly woke me around 6am to let me know she had a headache again. I gave her an Advil and some Benedryl before checking her temperature: 102.5°F. Worrisome enough to pay a visit to the Urgent Care clinic up in Mountain View. No strep throat, thank goodness. But she won&amp;#8217;t be able to go to school tomorrow.&lt;/p&gt;

&lt;p&gt;I wish there were something I could do, but at least she&amp;#8217;s sleeping now.&lt;/p&gt;</content>
  </entry>
  
  <entry>
    <id>http://metrocat.org/2011/08/crumpet-for-breakfast</id>
    <link type="text/html" rel="alternate" href="http://metrocat.org/2011/08/crumpet-for-breakfast" />
    <title>A Crumpet for Breakfast</title>
    <updated>2011-08-27T00:00:00-07:00</updated>
    <author>
      <name>Jeff Watkins</name>
      <uri>http://metrocat.org/</uri>
    </author>
    <content type="html">&lt;p&gt;Anna and Molly returned last night from their overnight trip to Seattle. They went up to attend the preschool graduation ceremony for the school Molly attended until we moved down to California. In addition to visiting with Molly&amp;#8217;s old chums from preschool, they also stopped at my favourite place to have breakfast: The Crumpet Shop.&lt;/p&gt;
&lt;figure&gt;&lt;a href='http://www.flickr.com/photos/jeffwatkins/6085429567/' title='Molly Enjoys Her Crumpet before School by jeffwatkins, on Flickr'&gt;&lt;img class='photo' src='http://farm7.static.flickr.com/6086/6085429567_b6a19b5e7c.jpg' alt='Molly Enjoys Her Crumpet before School' /&gt;&lt;/a&gt;
    &lt;figcaption&gt;Molly enjoys her crumpet before school.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;When we lived in Seattle, Molly and I would go to The Crumpet Shop every morning for breakfast. Molly would usually have a crumpet cut in quarters with a side of jam to dip in (shown in the photo above) and often she&amp;#8217;d have a hot cocoa. In addition to a crumpet with jam, I&amp;#8217;d have cup after cup of delicious tea. We&amp;#8217;d often read a comic book together before heading down to the Pike Market Preschool.&lt;/p&gt;

&lt;p&gt;I think of all the things we left behind in Seattle, I miss The Crumpet Shop the most. It was my spot. Whenever I played hooky from work, I would invariably wind up there. Sometimes I&amp;#8217;d read; sometimes I&amp;#8217;d work on my `puter; and sometimes I&amp;#8217;d just chat with Nancy, Rob, Sarah or one of the friendly customers. I even had my own spot in the shop: at the far end of the counter near the back door. It was perfect, I was out of the way, but close enough to the center of things to chat with whomever was behind the counter when things slowed down.&lt;/p&gt;

&lt;p&gt;This morning, I enjoyed one of the crumpets Anna and Molly brought back from their trip. It was a tiny reminder of home and everything I miss. California&amp;#8217;s nice, but someday we&amp;#8217;ll move back to Seattle. We&amp;#8217;ll move back home.&lt;/p&gt;</content>
  </entry>
  
  <entry>
    <id>http://metrocat.org/2011/08/front-page-news</id>
    <link type="text/html" rel="alternate" href="http://metrocat.org/2011/08/front-page-news" />
    <title>Front Page News</title>
    <updated>2011-08-26T00:00:00-07:00</updated>
    <author>
      <name>Jeff Watkins</name>
      <uri>http://metrocat.org/</uri>
    </author>
    <content type="html">&lt;p&gt;Molly made a favourable impression on the photographer from the Cupertino Courier on the first day of Kindergarten, because she&amp;#8217;s made the news. I made the news on my first day of Kindergarten as well, but I think it was more along the lines of a police bulletin: be on the look out for this red-headed trouble maker…&lt;/p&gt;
&lt;figure&gt;&lt;img class='photo' src='/assets/2011/front-page.png' /&gt;&lt;/figure&gt;</content>
  </entry>
  
 
</feed>
