<?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>Whatever happened to Benjamin Ragheb?</title>
	<atom:link href="http://www.benzado.com/blog/feed" rel="self" type="application/rss+xml" />
	<link>http://www.benzado.com/blog</link>
	<description>I apologize that this blog is using the default Wordpress template.</description>
	<lastBuildDate>Thu, 06 May 2010 16:33:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>MetroCost is now free!</title>
		<link>http://www.benzado.com/blog/post/340/metrocost-is-now-free</link>
		<comments>http://www.benzado.com/blog/post/340/metrocost-is-now-free#comments</comments>
		<pubDate>Thu, 06 May 2010 16:33:46 +0000</pubDate>
		<dc:creator>Benjamin</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[MetroCost]]></category>

		<guid isPermaLink="false">http://www.benzado.com/blog/?p=340</guid>
		<description><![CDATA[I&#8217;ve decided to make MetroCost available for free! In case you haven&#8217;t met yet, MetroCost is an app for iPhone or iPod touch that keeps a record of when you ride public transit, then recommends whether a pay-per-ride or unlimited ride card is a better deal for you. It&#8217;s an app designed to save you [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve decided to make <a href="http://www.metrocost.com/">MetroCost</a> available for free! In case you haven&#8217;t met yet, MetroCost is an app for iPhone or iPod touch that keeps a record of when you ride public transit, then recommends whether a pay-per-ride or unlimited ride card is a better deal for you. <em>It&#8217;s an app designed to save you money, and now you can get it for no money!</em></p>
<p>I live in New York City. When I used to commute to an office, paying for a 30-day Unlimited Ride card was a no-brainer. But once I started working from home, I noticed there were days when I didn&#8217;t ride the train at all. I began to wonder if I would be better off with a pay-per-ride card, and that&#8217;s when I wrote MetroCost.</p>
<p>From last September through March, I have spent $498 on MetroCards: initially unlimited, then pay-per-ride, then recently switching back to unlimited. Each time I had to renew my card, I followed MetroCost&#8217;s recommendation. The result is that I spent an average of $83/month, a savings of $6/month over the MTA&#8217;s 30-day Unlimited Ride card. That&#8217;s $72 a year!</p>
<p>I could say that MetroCost pays for itself, but since it is now completely free, what&#8217;s really happening is that <em>I am giving you money</em>. How about that?</p>
<p>Two more things:</p>
<ul>
<li>MetroCost was designed with New York City in mind, but it is customizable. So, if your public transit system operates on a single fare-per-ride system, you can use it, too. San Francisco and Atlanta are supported out of the box. In a future update I may add support for Boston or even London (if you stay within one zone).</li>
<li>I am by no means abandoning this app. I just decided that I didn&#8217;t want to deal with the difficulty of trying to market a product designed for people who are trying to save money. I have a few ideas for updates, when I have the time.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.benzado.com/blog/post/340/metrocost-is-now-free/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Working vs. writing about work</title>
		<link>http://www.benzado.com/blog/post/338/working-vs-writing-about-work</link>
		<comments>http://www.benzado.com/blog/post/338/working-vs-writing-about-work#comments</comments>
		<pubDate>Thu, 29 Apr 2010 20:50:46 +0000</pubDate>
		<dc:creator>Benjamin</dc:creator>
				<category><![CDATA[Administrivia]]></category>

		<guid isPermaLink="false">http://www.benzado.com/blog/?p=338</guid>
		<description><![CDATA[I&#8217;m currently working on a web application for people who want to post a list of upcoming events on their websites. People like the performers I hang around a lot. I spent a few hours working on it yesterday, and for all that time I basically only improved the login page. It&#8217;s frustrating. To be [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently working on a web application for people who want to post a list of upcoming events on their websites. People like the performers I hang around a lot. I spent a few hours working on it yesterday, and for all that time I basically only improved the login page.</p>
<p>It&#8217;s frustrating. To be productive, I really need a large block of uninterrupted time. <a href="http://www.paulgraham.com/makersschedule.html">This is not a novel idea.</a> I&#8217;m not a morning person, which means I get the most done if I can work uninterrupted from the afternoon into the late evening. Unfortunately, somebody usually wants me to meet them somewhere around 6 or 7 p.m., which means that just as I get some momentum going, I have to stop and sit on a train for twenty minutes, irritated.</p>
<p>Simply knowing that I have to quit around 6 p.m. can discourage me from taking on anything big or complicated. And knowing I have to leave to get somewhere induces a low grade background anxiety. I&#8217;d like to lose myself in my work, but I&#8217;ve got to watch the clock instead.</p>
<p>The worst part of it is the feeling that my time does not belong to me. When I have to break away from my work to meet somebody, it makes me resent that person a little bit. It&#8217;s entirely unjustified, and by the end of the train ride it has usually dissipated, but it&#8217;s ugly and it&#8217;s real.</p>
<p>I am not a helpless victim. <strong>My situation is by no means unique and there are ways I can improve it.</strong> Waking up and getting started earlier would help. I&#8217;ve decided to quit personal training; I have a variety of reasons but the regular mid-day interruption is a major reason to quit.</p>
<p>Before this impromptu therapy session goes any further, let me get to my point: <strong>I need to write more about my work, especially about FatWatch and other projects.</strong> The trouble is that, when I have precious time, I feel like I should be spending it on code rather than English prose. I&#8217;ll have to figure out how to divide my time, but a good first step will be in deciding what goes where.</p>
<p>When I first released FatWatch nearly two years ago, I was <a href="http://benzado.livejournal.com/243451.html">still posting to LiveJournal</a>, and had just <a href="http://benzado.tumblr.com/post/36530665/a-milkshake-can-bring-a-boy-to-the-yard-but-it">started posting to Tumblr</a>. I also set up a <a href="http://fatwatch.tumblr.com/post/43454478/inaugural-post">tumblelog just for FatWatch</a>. Then in November I decided I was managing too many blogs, and the right thing to do was consolidate everything with a blog at benzado.com, the one you are reading right now.</p>
<p>That was a bad idea.</p>
<p>One-blog-for-everything, with categories and tags to divide up the content, sounds like a good idea, but it doesn&#8217;t really work in practice. People are going to look at a few posts on the main page and decide whether they want to subscribe, and if I&#8217;m trying to reach several distinct audiences through one publication, I&#8217;m just making a confusing mess.</p>
<p><strong>Here&#8217;s the new plan.</strong> This blog will be for longer posts about technical topics and general announcements about my work; <a href="http://benzado.tumblr.com/">my personal tumblelog</a> will be for all those &#8220;hey look at this neat thing&#8221; posts that I assume only my friends are interested in; and, I am rebooting <a href="http://log.fatwatchapp.com/">The FatWatch Weight Log</a> with a mildly clever title and a focus on FatWatch specifically and weight management in general.</p>
<p>By sharing my plans with you, I have <a href="http://sivers.org/zipit">doomed myself to failure</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benzado.com/blog/post/338/working-vs-writing-about-work/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone Apps: Two Kinds of Approval</title>
		<link>http://www.benzado.com/blog/post/335/iphone-apps-two-kinds-of-approval</link>
		<comments>http://www.benzado.com/blog/post/335/iphone-apps-two-kinds-of-approval#comments</comments>
		<pubDate>Mon, 01 Mar 2010 07:13:28 +0000</pubDate>
		<dc:creator>Benjamin</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[itunes app store]]></category>

		<guid isPermaLink="false">http://www.benzado.com/blog/?p=335</guid>
		<description><![CDATA[Apple recently removed about 5,000 apps from the iTunes App Store on the grounds that they featured &#8220;overtly sexual content.&#8221; John Gruber believes that Apple is trying to protect its image: I think what Apple was getting squeamish about wasn’t the sexy apps themselves, but the cheesiness that the sexy apps (and their prominence in [...]]]></description>
			<content:encoded><![CDATA[<p>Apple recently removed about 5,000 apps from the iTunes App Store on the grounds that they featured &#8220;overtly sexual content.&#8221; John Gruber believes that <a href="http://daringfireball.net/2010/02/tits_and_apps">Apple is trying to protect its image</a>:</p>
<blockquote><p>
I think what Apple was getting squeamish about wasn’t the sexy apps themselves, but the cheesiness that the sexy apps (and their prominence in best selling lists) was bestowing upon the general feel and vibe of the App Store. One thing I wasn’t aware of before the recent crackdown was the degree to which these apps were seeping into various non-entertainment categories. E.g., like half the “new” apps in the “productivity” category featured imagery of large-breasted bikini-clad women.</p>
<p>The App Store is never going to be like Apple’s retail stores, and Apple knows it. Apple’s retail stores, branding-wise, convey an image sort of like between the Gap and Banana Republic — friendly premium. The App Store is more Old Navy, or maybe even Target. But these sexy apps were casting the App Store into something junkier, bordering on the skeevy.
</p></blockquote>
<p>This interpretation makes the most sense to me, too. In fact, I sympathize. When I gave my brother an iPod touch for Christmas, I showed him the App Store, and was mildly embarrassed that the number one app that day was a fart sound effects generator.</p>
<p>Unfortunately, the App Store&#8217;s role as the <em>one and only way</em> to distribute an iPhone app means that we have a dilemma. To carry something in a store is an implicit endorsement, so any store owner should have the right to decide what products to include. However, a healthy economy for apps requires a free market. Rejecting apps for subjective reasons makes development more risky than it needs to be.</p>
<h3>Technical Requirements vs. Community Standards</h3>
<p>The source of this dilemma is that the app review process serves two distinct purposes: to approve apps for iPhone and to approve apps for the App Store. If separated, the dilemma can be resolved.</p>
<p>Suppose you have developed an app and submitted it to Apple. It complies with all the <i>technical requirements</i> of an approved app: it sticks to the Human Interface Guidelines, it doesn&#8217;t use any private frameworks, it doesn&#8217;t execute downloaded code. However, it fails to meet Apple&#8217;s <i>community standards</i>: it contains overtly sexual or politically controversial content.</p>
<p>Enforcing technical requirements is for the benefit of the platform. Enforcing community standards is really only about the App Store.</p>
<h3>Kick &#8216;em to the curb, but no further</h3>
<p>In theory, Apple could inform you that your app is permitted to run on iPhone OS but will not be included in the App Store. This could happen in at least two ways:</p>
<p>They could maintain iTunes as the sole distribution method for apps, but designate your app <em>unlisted</em>. Nobody will find it in the store by browsing or searching, and it won&#8217;t appear in the top seller lists. However, it will be reachable by direct link. Apple will still manage the hosting and payment processing, but if you want anybody to find it, you have to market it yourself.</p>
<p>I obviously don&#8217;t know how the store is set up, but I bet Apple could do this relatively easily. (I&#8217;ve already discovered that an iTunes reviews page is accessible via direct link as soon as you submit an app, before the review team has had a chance to see it.)</p>
<p>Alternatively, if Apple wants to completely wash their hands of these dirty apps, is to provide developers with a digitally signed IPA file. You distribute the file yourself; users install your app by dragging the file to iTunes. If you want to charge, you have to roll your own payment and registration system, just like desktop shareware developers do.</p>
<p>This method seems less likely, mostly because it adds a big loophole for those who want to circumvent the App Store for other reasons. On the other hand, if all developers had the option to sell outside the App Store, I think it would be an overall good for the platform. But now we&#8217;re going off on a tangent.</p>
<p>Obviously, everybody would rather be part of the iTunes App Store than operate outside of it, but if given a choice between &#8220;outside&#8221; and &#8220;nowhere&#8221; I think outside is a clear winner. Separating the notion of &#8220;approved for iPhone&#8221; and &#8220;approved for the App Store&#8221; would benefit Apple <em>and</em> developers.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benzado.com/blog/post/335/iphone-apps-two-kinds-of-approval/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Make Xcode nag you about unfinished TODOs</title>
		<link>http://www.benzado.com/blog/post/329/make-xcode-nag-you-about-unfinished-todos</link>
		<comments>http://www.benzado.com/blog/post/329/make-xcode-nag-you-about-unfinished-todos#comments</comments>
		<pubDate>Fri, 08 Jan 2010 08:51:15 +0000</pubDate>
		<dc:creator>Benjamin</dc:creator>
				<category><![CDATA[Nerdery]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://www.benzado.com/blog/?p=329</guid>
		<description><![CDATA[Add a simple Run Script Build Phase to your project and you'll never forget another TODO again.]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re like me, you often make promises to yourself in the form of TODO comments in your code. For example:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #11740a; font-style: italic;">// TODO: make sure file exists before opening!</span>
fooBar <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>FooBar alloc<span style="color: #002200;">&#93;</span> initWithFile<span style="color: #002200;">:</span>path<span style="color: #002200;">&#93;</span>;</pre></div></div>

<p>This is a reasonable thing to do, because sometimes you just want to get something working right now and aren&#8217;t in the mood to write all the required error checking code. But, you also know that you cannot trust your <a href="http://theinfosphere.org/Transcript:I,_Roommate#time-04-13">soft human brain</a> to remember to add the check later, so you write a comment to remind yourself to do it.</p>
<p>Xcode recognizes the TODO: keyword in your comments and helpfully <a href="http://developer.apple.com/mac/library/documentation/DeveloperTools/Conceptual/XcodeWorkspace/100-The_Text_Editor/text_editor.html#//apple_ref/doc/uid/TP40002679-SW10">adds items to the function popup menu</a> so that you can quickly navigate to them. In addition to <code>TODO:</code>, Xcode will also recognize <code>FIXME:</code> (when you know the code is broken), <code>???:</code> (when you don&#8217;t know what it does), and <code>!!!:</code> (when you wish you didn&#8217;t know).</p>
<p>That&#8217;s helpful when you&#8217;re editing a file, but what about a TODO tucked away in some dark corner of your source code that you haven&#8217;t visited in a while? You&#8217;re likely to forget about it, and how can you keep a promise you forgot that you made?</p>
<p>The answer, of course, is to have somebody nag you. Fortunately, there&#8217;s a way to have Xcode fill that role. All you have to do is add a simple Run Script Build Phase which turns them into Build Warnings.</p>
<p>Select <b>Project &gt; New Build Phase &gt; New Run Script Build Phase</b> from the menu bar. Then, copy and paste this into the script window:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">KEYWORDS</span>=<span style="color: #ff0000;">&quot;TODO:|FIXME:|\?\?\?:|\!\!\!:&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #800000;">${SRCROOT}</span> \<span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;*.h&quot;</span> <span style="color: #660033;">-or</span> <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;*.m&quot;</span> \<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #660033;">-print0</span> <span style="color: #000000; font-weight: bold;">|</span> \
    <span style="color: #c20cb9; font-weight: bold;">xargs</span> <span style="color: #660033;">-0</span> <span style="color: #c20cb9; font-weight: bold;">egrep</span> <span style="color: #660033;">--with-filename</span> <span style="color: #660033;">--line-number</span> <span style="color: #660033;">--only-matching</span> <span style="color: #ff0000;">&quot;(<span style="color: #007800;">$KEYWORDS</span>).*<span style="color: #000099; font-weight: bold;">\$</span>&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> \
    <span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;">-p</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;s/(<span style="color: #007800;">$KEYWORDS</span>)/ warning: <span style="color: #000099; font-weight: bold;">\$</span>1/&quot;</span></pre></td></tr></table></div>

<p>What does it mean?</p>
<p>Line 1 defines the keywords we want to search for. If you want to exclude a keyword or include a different one, edit this line.</p>
<p>Line 2 uses the <a href="http://developer.apple.com/mac/library/DOCUMENTATION/Darwin/Reference/ManPages/man1/find.1.html">find</a> command to generate a list of all files in your project directory (SRCROOT) having an .h or .m extension. If you want to search more files, you will need to edit this line.</p>
<p>Line 3 uses <a href="http://developer.apple.com/mac/library/DOCUMENTATION/Darwin/Reference/ManPages/man1/xargs.1.html">xargs</a> to pass those file names along to <a href="http://developer.apple.com/mac/library/DOCUMENTATION/Darwin/Reference/ManPages/man1/egrep.1.html">egrep</a>, which searches inside the files for lines containing one of the keywords. If any are found, it outputs the file name, line number, and the matching part of the line.</p>
<p>Line 4 uses Perl to format the lines as warnings.</p>
<p>The output of the script will look like this:</p>
<p><code>/Users/benzado/Projects/FooBart/Baz.m:42: warning: TODO: make sure file exists before opening!</code></p>
<p>Xcode will recognize lines in this format and treat them as first class build warnings. You can see them in the Build Results panel and, just like a warning from the compiler, a double click will open an editor window and take you directly to the offending line.</p>
<p><i>An Exercise For The Enterprising Reader: modify the script so that no warnings or errors are reported during Debug builds, but TODOs are flagged as errors in Release builds.</i></p>
]]></content:encoded>
			<wfw:commentRss>http://www.benzado.com/blog/post/329/make-xcode-nag-you-about-unfinished-todos/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Draw your own Disclosure Indicator</title>
		<link>http://www.benzado.com/blog/post/325/draw-your-own-disclosure-indicator</link>
		<comments>http://www.benzado.com/blog/post/325/draw-your-own-disclosure-indicator#comments</comments>
		<pubDate>Mon, 04 Jan 2010 03:21:17 +0000</pubDate>
		<dc:creator>Benjamin</dc:creator>
				<category><![CDATA[Nerdery]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.benzado.com/blog/?p=325</guid>
		<description><![CDATA[In which I share code for a function to draw an iPhone disclosure indicator.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m writing Cocoa Touch code to draw a button which, when pressed, pushes a new view controller onto the stack. If I was working with a UITableView, I&#8217;d simply set the cell&#8217;s accessory to be a <a href="http://developer.apple.com/iphone/library/documentation/UserExperience/Conceptual/MobileHIG/ContentViews/ContentViews.html#//apple_ref/doc/uid/TP40006556-CH12-SW13">disclosure indicator</a> (the little gray arrowhead) and call it a day.</p>
<p>But I&#8217;m not working with table cells, so even though the standard disclosure indicator is <em>perfect</em> for this situation, if I want one I&#8217;ll have to draw it myself.</p>
<p>In this situation I will usually take a screenshot of the real iPhone control, add the image file to my project, and then feel kind of guilty about it. I began to do this, but I realized that the disclosure indicator is really only two gray lines. Two lines! How hard can it be to just draw it in code?</p>
<p>It turns out that it&#8217;s not too hard, if you&#8217;re willing to spend some time experimenting with different numbers and seeing what looks right. Fortunately for you, I&#8217;ve saved you the trouble by posting the answer here:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #11740a; font-style: italic;">// Draws a disclosure indicator such that the tip of the arrow is at (x,y)</span>
<span style="color: #a61390;">void</span> BRDrawDisclosureIndicator<span style="color: #002200;">&#40;</span>CGContextRef ctxt, CGFloat x, CGFloat y<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
    <span style="color: #a61390;">static</span> <span style="color: #a61390;">const</span> CGFloat R <span style="color: #002200;">=</span> <span style="color: #2400d9;">4.5</span>; <span style="color: #11740a; font-style: italic;">// &quot;radius&quot; of the arrow head</span>
    <span style="color: #a61390;">static</span> <span style="color: #a61390;">const</span> CGFloat W <span style="color: #002200;">=</span> <span style="color: #2400d9;">3</span>; <span style="color: #11740a; font-style: italic;">// line width</span>
    CGContextSaveGState<span style="color: #002200;">&#40;</span>ctxt<span style="color: #002200;">&#41;</span>;
    CGContextMoveToPoint<span style="color: #002200;">&#40;</span>ctxt, x<span style="color: #002200;">-</span>R, y<span style="color: #002200;">-</span>R<span style="color: #002200;">&#41;</span>;
    CGContextAddLineToPoint<span style="color: #002200;">&#40;</span>ctxt, x, y<span style="color: #002200;">&#41;</span>;
    CGContextAddLineToPoint<span style="color: #002200;">&#40;</span>ctxt, x<span style="color: #002200;">-</span>R, y<span style="color: #002200;">+</span>R<span style="color: #002200;">&#41;</span>;
    CGContextSetLineCap<span style="color: #002200;">&#40;</span>ctxt, kCGLineCapSquare<span style="color: #002200;">&#41;</span>;
    CGContextSetLineJoin<span style="color: #002200;">&#40;</span>ctxt, kCGLineJoinMiter<span style="color: #002200;">&#41;</span>;
    CGContextSetLineWidth<span style="color: #002200;">&#40;</span>ctxt, W<span style="color: #002200;">&#41;</span>;
    CGContextStrokePath<span style="color: #002200;">&#40;</span>ctxt<span style="color: #002200;">&#41;</span>;
    CGContextRestoreGState<span style="color: #002200;">&#40;</span>ctxt<span style="color: #002200;">&#41;</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>Before calling the function, you should set the stroke color to 50% gray if you&#8217;re drawing on a white background or white if the control is highlighted and you&#8217;re drawing on a blue background. Or, <a href="http://stackoverflow.com/questions/1852672/best-way-to-change-the-color-view-of-disclosure-indicator-accessory-view-in-a-tab">you can use whatever color you like</a>.</p>
<p>To be honest, I only eyeballed the result, so it <em>might</em> not be a pixel-perfect reproduction of the real thing. However, I think my eyeballs are at least as good as most users&#8217; eyeballs, so I will confidently declare this code Good Enough.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benzado.com/blog/post/325/draw-your-own-disclosure-indicator/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows is still terrible</title>
		<link>http://www.benzado.com/blog/post/323/windows-is-terrible</link>
		<comments>http://www.benzado.com/blog/post/323/windows-is-terrible#comments</comments>
		<pubDate>Sat, 26 Dec 2009 06:49:48 +0000</pubDate>
		<dc:creator>Benjamin</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[eee pc]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.benzado.com/blog/?p=323</guid>
		<description><![CDATA[My brother got me an Eee PC mini notebook computer for Christmas. I want to say right off the bat that I&#8217;m very grateful for the gift: it will be useful for testing web sites on Windows as well as allowing me to run Adventure Game Studio. What follows is more a complaint about what [...]]]></description>
			<content:encoded><![CDATA[<p>My brother got me an Eee PC mini notebook computer for Christmas. I want to say right off the bat that I&#8217;m very grateful for the gift: it will be useful for testing web sites on Windows as well as allowing me to run <a href="http://www.adventuregamestudio.co.uk/">Adventure Game Studio</a>. What follows is more a complaint about what Windows users accept as how computers are.</p>
<p>It was <em>covered</em> in stickers. There were stickers on each side of the display, pointing out things that would presumably be on the screen when I turned it on. The trackpad had a sticker over it explaining the pinch-to-zoom gesture that everybody knows from the iPhone, yet iPhone users were never &#8220;helped&#8221; with a sticker on the screen.</p>
<p>When I powered it on <em>for the first time ever</em>, I was presented with the &#8220;Windows did not shut down properly, do you want to start in Safe Mode?&#8221; screen.</p>
<p>During Windows set up, it:</p>
<ol>
<li>Tried to connect to the Internet automatically.</li>
<li>Told me it could not connect to the Internet and I&#8217;d have to configure it myself later.</li>
<li>Immediately asked if I wanted to connect to the Internet to send my registration information to Microsoft.</li>
</ol>
<p>When I launched Outlook Express, a wizard walked me through the process of connecting to the Internet (even though I was already online), asking if I already had a dial-up account or wanted to sign up for one.</p>
<p>Fortunately, the PC wasn&#8217;t pre-loaded with too much crapware, which is a good thing. I&#8217;m finding it hard to read the thinly rendered text used in most of the system; fortunately Safari for Windows does it&#8217;s own text rendering. Like my MacBook, it supports two finger scrolling, but the cursor turns into a tiny scrollbar graphic (in case I don&#8217;t know what&#8217;s going on?) and the page jerks around instead of moving smoothly.</p>
<p>My dad bought a MacBook Air for my mom, and I spent a long time setting it up. On the whole, it was much more pleasant experience, though in the interest of fairness I&#8217;ll say that using Migration Assistant over a network connection is annoyingly unreliable.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benzado.com/blog/post/323/windows-is-terrible/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Don&#8217;t call it a comeback!</title>
		<link>http://www.benzado.com/blog/post/321/dont-call-it-a-comeback</link>
		<comments>http://www.benzado.com/blog/post/321/dont-call-it-a-comeback#comments</comments>
		<pubDate>Wed, 09 Dec 2009 17:59:38 +0000</pubDate>
		<dc:creator>Benjamin</dc:creator>
				<category><![CDATA[FatWatch]]></category>

		<guid isPermaLink="false">http://www.benzado.com/blog/?p=321</guid>
		<description><![CDATA[I confess, I have some minor narcissistic tendencies. For example, the App Store search bar on my iPhone usually contains my own name, so I can check on the ratings of my apps at a glance. That&#8217;s how I noticed this new review of FatWatch, my weight tracking app for iPhone: It does exactly what [...]]]></description>
			<content:encoded><![CDATA[<p>I confess, I have some minor narcissistic tendencies. For example, the App Store search bar on my iPhone usually contains my own name, so I can check on the ratings of my apps at a glance.</p>
<p>That&#8217;s how I noticed this new review of <a href="http://www.fatwatchapp.com/">FatWatch, my weight tracking app for iPhone</a>:</p>
<blockquote><p>It does exactly what it says it does, but it&#8217;s far too expensive and the developer seems to have abandoned it. Get one of the free weight apps and save yourself the dough.</p></blockquote>
<p>Ouch!</p>
<p>In a world of disposable mobile apps, FatWatch might seem expensive, but it&#8217;s actually quite cheap for what it does: tracking your weight <em>against a moving average</em> in a well-designed application. <a href="http://fourmilab.ch/hackdiet/e4/signalnoise.html">The average is key</a>; it&#8217;s the only useful way to track a human being&#8217;s weight, and none of the free apps can do the math for you.</p>
<p>For devotees of <a href="http://fourmilab.ch/hackdiet/">The Hacker&#8217;s Diet</a>, it also lets you import your weight history from the old Palm Eat Watch app and export it to your computer any time you choose.</p>
<p>As for the other concern, <strong>I assure you that FatWatch has not been abandoned.</strong> I use it every day! I suppose it is overdue for an update, but that&#8217;s only to add new features, as (save for a minor cosmetic issue) no bugs have been reported in FatWatch 1.4.</p>
<p>The good news is that I recently completed a contract project that puts me in a comfortable enough financial position to devote time to a FatWatch update. So, watch this space, and if you&#8217;re interested in beta testing, wait for an announcement soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benzado.com/blog/post/321/dont-call-it-a-comeback/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Nicer ways to view UNIX man pages</title>
		<link>http://www.benzado.com/blog/post/319/nicer-ways-to-view-unix-man-pages</link>
		<comments>http://www.benzado.com/blog/post/319/nicer-ways-to-view-unix-man-pages#comments</comments>
		<pubDate>Mon, 30 Nov 2009 02:38:57 +0000</pubDate>
		<dc:creator>Benjamin</dc:creator>
				<category><![CDATA[Nerdery]]></category>

		<guid isPermaLink="false">http://www.benzado.com/blog/?p=319</guid>
		<description><![CDATA[There is a wealth of information available in the UNIX manual pages, but it feels a little silly to be reading text out of a terminal window, especially since I paid so much money for all this fancy font rendering technology. Here are some alternatives: To view a man page in Xcode&#8217;s documentation window, simply [...]]]></description>
			<content:encoded><![CDATA[<p>There is a wealth of information available in the <a href="http://en.wikipedia.org/wiki/Man_page">UNIX manual pages</a>, but it feels a little silly to be reading text out of a terminal window, especially since I paid so much money for <a href="http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/TextArchitecture/Concepts/ArchitectureOverview.html">all this fancy font rendering technology</a>.</p>
<p>Here are some alternatives:</p>
<p>To view a man page in Xcode&#8217;s documentation window, simply select &#8220;Open man Page&#8230;&#8221; from the Help menu. For some reason, I hadn&#8217;t noticed that menu item until I read this <a href="http://toxicsoftware.com/manoxcode/">hint on accessing it via AppleScript</a>. Nicely formatted and references to other man pages are hyperlinked.</p>
<p><a href="http://bruji.com/bwana/index.html">Bwana</a> allows you to read man pages in any web browser, by registering itself as a protocol handler for <code>man:</code> URLs. Once installed, you can type <code>man:perl</code> in your browser&#8217;s address bar or <code>open man:perl</code> at a command prompt to read a manual page in your browser. Like Xcode, cross-references become hyperlinks, but it formats text using Courier. Source code is available, so I guess if I care enough I can do something about it.</p>
<p>Finally, a surprisingly short incantation will <a href="http://www.macosxhints.com/article.php?story=20051225101106519">open any man page as a beautifully formatted document in Preview</a>:</p>
<pre>man -t perl | open -f -a /Applications/Preview.app</pre>
<p>The <code>-t</code> option tells <code>man</code> to output PostScript, and the <code>-f</code> option tells <code>open</code> to put its input into a temporary file and pass that along to the specified application.</p>
<p>After reading that hint I set about writing a shell function so I could type <code>manp perl</code> to open Perl&#8217;s manual page in Preview. However, Preview&#8217;s PostScript to PDF conversion is kind of slow, so I wound up writing something slightly more sophisticated:</p>
<pre>function manp {
    local M=`man -w $*`               # Get path of page source.
    if [ -z $M ]; then return; fi     # Quit if it doesn't exist.
    local N=`basename $M .gz`         # Extract the name of the file and
    local P=$TMPDIR/man.$N.pdf        # use it to create a PDF file name.
    if [ ! -e $P ]; then              # If the PDF file doesn't exist,
        echo Creating PDF for $N...
        man -t $1 | pstopdf -i -o $P  # generate it.
    fi
    open $P                           # Open the PDF version.
}</pre>
<p>Then I went back and read the <a href="http://www.macosxhints.com/article.php?story=20051225101106519#comments">comments</a>, which contain a dozen or so different versions of the same idea. But mine&#8217;s the best! Copy and paste it into the your <code>.profile</code> if you agree.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benzado.com/blog/post/319/nicer-ways-to-view-unix-man-pages/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Don&#8217;t printf when you can tcpdump</title>
		<link>http://www.benzado.com/blog/post/317/dont-printf-when-you-can-tcpdump</link>
		<comments>http://www.benzado.com/blog/post/317/dont-printf-when-you-can-tcpdump#comments</comments>
		<pubDate>Tue, 10 Nov 2009 23:04:20 +0000</pubDate>
		<dc:creator>Benjamin</dc:creator>
				<category><![CDATA[Nerdery]]></category>
		<category><![CDATA[tcpdump]]></category>

		<guid isPermaLink="false">http://www.benzado.com/blog/?p=317</guid>
		<description><![CDATA[Instead of using print statements to debug network communication, use tcpdump and get a complete and accurate picture of what's on the wire.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working on an app that talks to a web service, and in the course of debugging it&#8217;s good to know what exactly is being sent to and from the web server. I had been doing so with the tried and true method of <a href="http://stackoverflow.com/questions/189562/what-is-the-proper-name-for-doing-debugging-by-adding-print-statements">printf() debugging</a> (this is Cocoa, so NSLog() debugging, actually), but it was getting to be a pain:</p>
<ol>
<li>If I print all network traffic all the time, it overwhelms my console, making it useless for any other kind of output. So instead, I&#8217;m constantly inserting or removing NSLog() statements as I work. Not to mention having to reproduce a request because the right logging statements weren&#8217;t in place the first time around.</li>
<li>NSURLConnection returns downloaded information as an NSData object, so simply passing it to NSLog() dumps a lot of useless hexadecimal code to the screen. That means I must first create an NSString from the data, print it, then release it. (I can&#8217;t use %s, the data isn&#8217;t null terminated.)</li>
<li>NSURLConnection does a lot of behind the scenes work, like storing cookies and setting Content-Length headers. That&#8217;s nice, but that makes it hard to know exactly what&#8217;s being sent on the wire.</li>
</ol>
<p>And that&#8217;s when it occurred to me: why not just watch what&#8217;s on the wire? tcpdump is a command line utility which monitors network traffic and prints out packets that you specify.</p>
<p>Here&#8217;s the incantation to monitor HTTP traffic to and from a specified host:</p>
<blockquote><p><code>sudo tcpdump -l -q -A "host <b>(Specified Host)</b> and tcp port 80 and (((ip[2:2] - ((ip[0]&#038;0xf)<<2)) - ((tcp[12]&#038;0xf0)>>2)) != 0)"</code></p></blockquote>
<p>To explain briefly, <code>sudo</code> runs the command as root, <code>-l</code> enables line buffering, <code>-q</code> hides some of the less interesting protocol information, and <code>-A</code> prints the content of each packet in ASCII. The filtering expression that follows selects packets to or from (Specified Host), to or from port 80, and ignoring SYN, FIN, ACK-only, and other non-data packets. I&#8217;ll confess, I don&#8217;t understand that last part completely, I copied it from the <a href="http://linux.die.net/man/8/tcpdump">tcpdump man page</a>.</p>
<p>To make the output a little easier to read, I pipe the output to a Perl script I quickly hacked together which watches for the packet header lines and outputs the <a href="http://isthe.com/chongo/tech/comp/ansi_escapes.html">ANSI escape codes</a> to render them in bold. But I&#8217;ll leave that as an exercise to you, dear reader.</p>
<p>There&#8217;s no need to download anything, tcpdump is already installed on your Mac. (I don&#8217;t know if it&#8217;s part of the standard install or the Developer Tools, but what do you care?)</p>
<p>Now, what would be <em>really</em> sweet is a graphical app to do this. I found <a href="http://www.tastycocoabytes.com/cpa/">Cocoa Packet Analyzer</a>, but it&#8217;s a little low-level for me. I don&#8217;t care about packet specifics; I&#8217;d prefer something that reconstructed the tcp streams in an easy to navigate way.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benzado.com/blog/post/317/dont-printf-when-you-can-tcpdump/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing MetroCost</title>
		<link>http://www.benzado.com/blog/post/313/introducing-metrocost</link>
		<comments>http://www.benzado.com/blog/post/313/introducing-metrocost#comments</comments>
		<pubDate>Thu, 29 Oct 2009 03:32:56 +0000</pubDate>
		<dc:creator>Benjamin</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[MetroCost]]></category>

		<guid isPermaLink="false">http://www.benzado.com/blog/?p=313</guid>
		<description><![CDATA[After writing my last post, I realized that I had never formally announced MetroCost on this blog. Well, now is as good a time as any, because until the end of the week I&#8217;m giving it away for free! MetroCost is an app for iPhone or iPod touch that helps you track your public transit [...]]]></description>
			<content:encoded><![CDATA[<p>After writing my last post, I realized that I had never formally announced MetroCost on this blog. Well, now is as good a time as any, because until the end of the week I&#8217;m giving it away for free!</p>
<p><strong><a href="http://www.metrocost.com/">MetroCost</a> is an app for iPhone or iPod touch that helps you track your public transit expenses.</strong> I live in New York City, so I use the subway a lot, but I&#8217;m a freelancer, so I don&#8217;t ride it every day. I began to wonder: should I really be paying $89 a month for an Unlimited Ride card, or would I save money if I paid $2.25 per ride?</p>
<p>Except it&#8217;s not that simple, because if you add $8 or more to a Pay-Per-Ride MetroCard, a 15% bonus is added to your total. As long as you add at least $8 at a time, a ride actually costs $1.96.</p>
<p>So, how does MetroCost help figure this out?</p>
<p><span id="more-313"></span>Each time you ride the subway or the bus, launch MetroCost and swipe a finger across the &#8220;magnetic&#8221; strip. It will keep a record and, based on your average ride count per day, compare the costs of an unlimited versus a pay-per-ride card.</p>
<p>If you&#8217;ve recorded 30 days&#8217; worth of rides, the calculations will be exact; if you&#8217;ve recorded less than that, you will still get a useful estimate. Either way, the next time you need to buy or refill your card, consult MetroCost to see which is best for you.</p>
<p>MetroCost is set up for New York City transit out of the box, but it&#8217;s totally customizable. As long as the fare doesn&#8217;t vary with distance traveled (sorry, Washington, DC) you can use MetroCost to save money.</p>
<p>You can also frivolously change MetroCost&#8217;s appearance to match your transit system&#8217;s color scheme.</p>
<p>MetroCost debuted at $1.99 but for this week only you can <a href="http://www.benzado.com/itunes/app326574369">get it for FREE on the iTunes App Store</a>. On Saturday I&#8217;m restoring the price, and maybe raising it, so you&#8217;d be crazy not to download it now.</p>
<p>Don&#8217;t be crazy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benzado.com/blog/post/313/introducing-metrocost/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
