<?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>danwin.com &#187; works</title>
	<atom:link href="https://danwin.com/category/works/feed/" rel="self" type="application/rss+xml" />
	<link>https://danwin.com</link>
	<description>Words, photos, and code by Dan Nguyen. The &#039;g&#039; is mostly silent.</description>
	<lastBuildDate>Thu, 21 Nov 2019 12:29:57 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.2.39</generator>
	<item>
		<title>Soft-launching Stanford&#8217;s Computational Journalism Lab</title>
		<link>https://danwin.com/2015/10/soft-launching-stanfords-computational-journalism-lab/</link>
		<comments>https://danwin.com/2015/10/soft-launching-stanfords-computational-journalism-lab/#comments</comments>
		<pubDate>Sun, 04 Oct 2015 18:54:20 +0000</pubDate>
		<dc:creator><![CDATA[Dan]]></dc:creator>
				<category><![CDATA[works]]></category>
		<category><![CDATA[computational journalism]]></category>
		<category><![CDATA[stanford]]></category>

		<guid isPermaLink="false">https://danwin.com/?p=2715</guid>
		<description><![CDATA[<p>Last week, my Stanford colleagues and I launched the website for the Computational Journalism Lab. It&#8217;s a soft-launch, as the lab isn&#8217;t a physical lab, but more of an umbrella for the computational work and meetups that we are planning, such as a Computational Journalism conference in 2016, our collaboration in the California Civic Data [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://danwin.com/2015/10/soft-launching-stanfords-computational-journalism-lab/">Soft-launching Stanford&#8217;s Computational Journalism Lab</a> appeared first on <a rel="nofollow" href="https://danwin.com">danwin.com</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Last week, my Stanford colleagues and I launched the website for the <a href="http://cjlab.stanford.edu/">Computational Journalism Lab</a>. It&#8217;s a soft-launch, as the lab isn&#8217;t a <em>physical</em> lab, but more of an umbrella for the computational work and meetups that we are planning, such as a Computational Journalism conference in 2016, our collaboration in the <a href="http://cjlab.stanford.edu/projects/california-civic-data-coalition/">California Civic Data Coalition</a>, and of course, our <a href="http://cjlab.stanford.edu/initiatives/#courses-section">coursework</a>.</p>
<p>Also, as I&#8217;ve mentioned before on this blog, <a href="http://blog.danwin.com/">pretty much all of my future blogging is going to happen at blog.danwin.com</a>, which is built in Jekyll. Not coincidentally, the Computational Journalism Lab site is also built in <a href="https://jekyllrb.com/">Jekyll</a> &#8212; see <a href="https://github.com/compjolab/cjlab-homepage">its Github here</a>.</p>
<p>The post <a rel="nofollow" href="https://danwin.com/2015/10/soft-launching-stanfords-computational-journalism-lab/">Soft-launching Stanford&#8217;s Computational Journalism Lab</a> appeared first on <a rel="nofollow" href="https://danwin.com">danwin.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://danwin.com/2015/10/soft-launching-stanfords-computational-journalism-lab/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A guide to using Github for non-developers</title>
		<link>https://danwin.com/2014/04/a-guide-to-using-github-for-non-developers/</link>
		<comments>https://danwin.com/2014/04/a-guide-to-using-github-for-non-developers/#comments</comments>
		<pubDate>Mon, 14 Apr 2014 04:34:19 +0000</pubDate>
		<dc:creator><![CDATA[Dan]]></dc:creator>
				<category><![CDATA[works]]></category>
		<category><![CDATA[tutorial programming github]]></category>

		<guid isPermaLink="false">https://danwin.com/?p=2662</guid>
		<description><![CDATA[<p>I&#8217;m constantly being asked by friends to help me with their websites, and I&#8217;m constantly not at all enthusiastic to do it. I mean, I enjoy helping friends out and creating things, but web development is not at all the &#8220;fun part.&#8221; It&#8217;s a complex field, but more annoyingly, it&#8217;s difficult to scaffold a site [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://danwin.com/2014/04/a-guide-to-using-github-for-non-developers/">A guide to using Github for non-developers</a> appeared first on <a rel="nofollow" href="https://danwin.com">danwin.com</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m constantly being asked by friends to help me with their websites, and I&#8217;m constantly not at all enthusiastic to do it. I mean, I enjoy helping friends out and creating things, but web development is not at all the &#8220;fun part.&#8221; It&#8217;s  a complex field, but more annoyingly, it&#8217;s difficult to scaffold a site so that a web-novice can maintain it. So you either have to settle for being the site&#8217;s maintenance person in perpetuity, or, not be bothered that your friends will waste countless hours hacking and breaking a brittle, barely visited website.</p>
<p>Github Pages has been a great and convenient way to publish websites. So I&#8217;ve been telling my non-dev friends, hey, just create a Github account and publish away! Unfortunately, while there are many great Github and Git resources, all of them presume that you actually want to use the many cool collaborative, developer-focused features of Git/Github. Whereas I want my non-dev friends just to piggyback off of <a href="http://dannguyen.github.io/github-for-portfolios/">Github to quickly build a website from scratch</a>.</p>
<p>So in the past month, I&#8217;ve slowly been putting together a guide that is as basic as possible, even to the point of showing which buttons to click, and explaining how HTML is different than raw text. Check it out here: <a href="http://dannguyen.github.io/github-for-portfolios/">Build a Web Portfolio from Scratch with Github Pages</a>.</p>
<p><a href="http://www.reddit.com/r/learnprogramming/comments/22f2ta/im_working_on_a_howtouse_github_guide_aimed_at/">Check out the Reddit discussion here</a>. To my surprise, even aspiring developers have found it useful, even though the guide is aimed at people who do not intend to be web developers.</p>
<p>Creating this guide isn&#8217;t an act of altruism for me, though. It&#8217;s another way to experiment with online publishing, namely, how to reduce the friction between thinking of things to write about and getting them onto the Web. I stuck to using Jekyll but kind of wish I had gone with using Middleman. In any case, I feel much further along in having a refined CMS-workflow than I did with the <a href="http://ruby.bastardsbook.com/">Bastards Books</a> and with my <a href="http://www.smalldatajournalism.com/">Small Data Journalism site</a>, which is also built on Jekyll.</p>
<p>The post <a rel="nofollow" href="https://danwin.com/2014/04/a-guide-to-using-github-for-non-developers/">A guide to using Github for non-developers</a> appeared first on <a rel="nofollow" href="https://danwin.com">danwin.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://danwin.com/2014/04/a-guide-to-using-github-for-non-developers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Github activity for 2013: 1,500+ commits, 52-day-streak</title>
		<link>https://danwin.com/2013/12/github-activity-for-2013-1500-commits-52-day-streak/</link>
		<comments>https://danwin.com/2013/12/github-activity-for-2013-1500-commits-52-day-streak/#comments</comments>
		<pubDate>Mon, 02 Dec 2013 05:35:53 +0000</pubDate>
		<dc:creator><![CDATA[Dan]]></dc:creator>
				<category><![CDATA[works]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[oss]]></category>

		<guid isPermaLink="false">https://danwin.com/?p=2639</guid>
		<description><![CDATA[<p>Just noticed that because of that damned Thanksgiving break, my latest Github commit streak ended at 52 days in a row. My public profile doesn&#8217;t show most of my commits as I&#8217;ve been using Github for Skift company projects, but I&#8217;ve been tentatively trying to design some open-source utilities. One of them is yearbook, yet [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://danwin.com/2013/12/github-activity-for-2013-1500-commits-52-day-streak/">Github activity for 2013: 1,500+ commits, 52-day-streak</a> appeared first on <a rel="nofollow" href="https://danwin.com">danwin.com</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Just noticed that because of that damned Thanksgiving break, <a href="https://github.com/dannguyen">my latest Github commit streak ended at 52 days in a row</a>. My <a href="https://github.com/dannguyen">public profile</a> doesn&#8217;t show most of my commits as I&#8217;ve been using Github for <a href="http://skift.com">Skift company projects</a>, but I&#8217;ve been tentatively trying to design some open-source utilities. One of them is <a href="https://github.com/dannguyen/yearbook">yearbook</a>, yet another attempt (for me) to wrap face-recognition and mugshot-cropping into a convenient command-line interface. Another gem, which I just started on today, is <a href="https://github.com/dannguyen/spodunk">spodunk</a>, probably a futile attempt to make Google Spreadsheets more of a CMS. And of course, there&#8217;s <a href="https://github.com/dannguyen/smalldata_journalism">small-data-journalism</a>, which contains all the content for my <a href="http://smalldatajournalism.com">Small Data Journalism site</a>.</p>
<p>In the heat-graph of my private and public Github commits, you can see how relatively intense my commit activity has been in the past couple of weeks. The fruit of that labor is <a href="https://iq.skift.com/">SkiftIQ</a>, a site for better tracking how the travel industry performs and behaves on social media.</p>
<p>Earlier this year I made it a goal every day to contribute to someone else&#8217;s project, even if it was simple grammar and spelling fixes. I&#8217;ve fallen away from that but not for lack of interest: being able to wade through a large codebase and isolate (and sometimes fix) even just minor bugs is probably the best programming/critical-thinking exercise I&#8217;ve put myself through&#8230;and sometimes it actually helps other people.</p>
<p>The post <a rel="nofollow" href="https://danwin.com/2013/12/github-activity-for-2013-1500-commits-52-day-streak/">Github activity for 2013: 1,500+ commits, 52-day-streak</a> appeared first on <a rel="nofollow" href="https://danwin.com">danwin.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://danwin.com/2013/12/github-activity-for-2013-1500-commits-52-day-streak/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>small data Journalism &#8211; practical lessons of data journalism</title>
		<link>https://danwin.com/2013/09/small-data-journalism-practical-lessons-of-data-journalism/</link>
		<comments>https://danwin.com/2013/09/small-data-journalism-practical-lessons-of-data-journalism/#comments</comments>
		<pubDate>Tue, 17 Sep 2013 02:22:35 +0000</pubDate>
		<dc:creator><![CDATA[Dan]]></dc:creator>
				<category><![CDATA[works]]></category>
		<category><![CDATA[journalism]]></category>
		<category><![CDATA[nyu]]></category>

		<guid isPermaLink="false">https://danwin.com/?p=2610</guid>
		<description><![CDATA[<p>Next week, my short course on data journalism at New York University (SCPS) begins. It&#8217;s only five weeks long, but I wanted the material and readings I used for the class to be accessible for anyone. You can check it out at smalldatajournalism.com, a site I built using Jekyll and which will serve as the [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://danwin.com/2013/09/small-data-journalism-practical-lessons-of-data-journalism/">small data Journalism &#8211; practical lessons of data journalism</a> appeared first on <a rel="nofollow" href="https://danwin.com">danwin.com</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Next week, my short course on <a href="http://www.smalldatajournalism.com/class/">data journalism at New York University (SCPS) begins</a>. It&#8217;s only five weeks long, but I wanted the material and readings I used for the class to be accessible for anyone. You can check it out at <a href="http://www.smalldatajournalism.com/">smalldatajournalism.com</a>, a site I built using Jekyll and which will serve as the home for future musings and data projects. </p>
<p>The post <a rel="nofollow" href="https://danwin.com/2013/09/small-data-journalism-practical-lessons-of-data-journalism/">small data Journalism &#8211; practical lessons of data journalism</a> appeared first on <a rel="nofollow" href="https://danwin.com">danwin.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://danwin.com/2013/09/small-data-journalism-practical-lessons-of-data-journalism/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;Better know a developer&#8221; at AAJA 2013</title>
		<link>https://danwin.com/2013/08/2602/</link>
		<comments>https://danwin.com/2013/08/2602/#comments</comments>
		<pubDate>Sun, 25 Aug 2013 03:46:56 +0000</pubDate>
		<dc:creator><![CDATA[Dan]]></dc:creator>
				<category><![CDATA[works]]></category>
		<category><![CDATA[journalism]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">https://danwin.com/?p=2602</guid>
		<description><![CDATA[<p>I had the privilege of being on a panel with the New York Times&#8217;s Chase Davis and former YouTube designer Hong Qu at this year&#8217;s Asian American Journalists Association convention The panel was titled, &#8220;Better Know a Developer&#8221; and my part of it was to discuss how non-programming journalists can work best with programmers. You [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://danwin.com/2013/08/2602/">&#8220;Better know a developer&#8221; at AAJA 2013</a> appeared first on <a rel="nofollow" href="https://danwin.com">danwin.com</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>I had the privilege of being on a panel with the New York Times&#8217;s <a href="https://twitter.com/chasedavis">Chase Davis</a> and former YouTube designer <a href="https://twitter.com/hqu">Hong Qu</a> at this year&#8217;s <a href="http://www.aaja.org/category/convention/new-york-2013/">Asian American Journalists Association convention</a></p>
<p>The panel was titled, <a href="http://t.co/L7wxhcoBSn">&#8220;Better Know a Developer&#8221;</a> and my part of it was to discuss how non-programming journalists can work best with programmers.</p>
<p><a href="https://docs.google.com/presentation/d/1maV8OhmH9rbIQwPWiWiDRXoSzSVBJhgoBaCmp7MHBR0/pub?start=false&#038;loop=false&#038;delayms=3000#slide=id.ge463945d_63">You can see the slides here</a>. The advice boils down to: Don&#8217;t believe in magic. Think about <em>how</em> you would do it yourself. And use a spreadsheet.</p>
<p>The post <a rel="nofollow" href="https://danwin.com/2013/08/2602/">&#8220;Better know a developer&#8221; at AAJA 2013</a> appeared first on <a rel="nofollow" href="https://danwin.com">danwin.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://danwin.com/2013/08/2602/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby MiniTest Cheat Sheet, Unit and Spec reference</title>
		<link>https://danwin.com/2013/03/ruby-minitest-cheat-sheet/</link>
		<comments>https://danwin.com/2013/03/ruby-minitest-cheat-sheet/#comments</comments>
		<pubDate>Fri, 29 Mar 2013 21:19:00 +0000</pubDate>
		<dc:creator><![CDATA[Dan]]></dc:creator>
				<category><![CDATA[works]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[tdd]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">https://danwin.com/?p=2406</guid>
		<description><![CDATA[<p>Ruby&#8217;s standard testing suite, MiniTest, is in dire need of a quick-and-handy reference for its syntax. I&#8217;ve put one together comparing the unit syntax (assert/refute) and the spec syntax (must/wont). You can see it below or download the Google Spreadsheet I made and roll your own sheet (HTML, XLS) Test syntax Unit Spec Arguments Examples [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://danwin.com/2013/03/ruby-minitest-cheat-sheet/">Ruby MiniTest Cheat Sheet, Unit and Spec reference</a> appeared first on <a rel="nofollow" href="https://danwin.com">danwin.com</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Ruby&#8217;s standard testing suite, <a href="http://www.ruby-doc.org/stdlib-2.0/libdoc/minitest/rdoc/MiniTest.html">MiniTest</a>, is in dire need of a quick-and-handy reference for its syntax. I&#8217;ve put one together comparing the <code>unit</code> syntax (assert/refute) and the <code>spec</code> syntax (must/wont). You can see it below or download the Google Spreadsheet I made and roll your own sheet (<a href="https://docs.google.com/spreadsheet/pub?key=0At3Q3D3lDxXcdGFRUHA1UnlyWm9ONWlkZU9oYmNzZlE&amp;output=html">HTML</a>, <a href="https://docs.google.com/spreadsheet/pub?key=0At3Q3D3lDxXcdGFRUHA1UnlyWm9ONWlkZU9oYmNzZlE&#038;output=xls">XLS</a>) </p>
<h3 id="test_syntax">Test syntax</h3>
<style>
</style>
<table class="table table-striped table-bordered vert">
<thead>
<tr>
<th>Unit</th>
<th>Spec</th>
<th>Arguments</th>
<th>Examples</th>
</tr>
</thead>
<tbody>
<tr>
<td class="exp">
		  <code class="large br"><br />
assert_empty<br />
refute_empty<br />
		  </code>
		</td>
<td class="exp">
		  <code class="large br"><br />
must_be_empty<br />
wont_be_empty<br />
		  </code>
		</td>
<td>
		  <code><br />
obj, msg=nil<br />
		  </code>
		</td>
<td>
<p><code class="br">assert_empty []</code><br /><code class="br">refute_empty [1,2,3]</code><br /><code class="br">[].must_be_empty</code><br /><code class="br">[1,2,3].wont_be_empty</code><br /></p>
</td>
</tr>
<tr>
<td class="exp">
		  <code class="large br"><br />
assert_equal<br />
refute_equal<br />
		  </code>
		</td>
<td class="exp">
		  <code class="large br"><br />
must_equal<br />
wont_equal<br />
		  </code>
		</td>
<td>
		  <code><br />
exp, act, msg=nil<br />
		  </code>
		</td>
<td>
<p><code class="br">assert_equal 2, 2</code><br /><code class="br">refute_equal 2,1</code><br /><code class="br">2.must_equal 2</code><br /><code class="br">2.wont_equal 1</code><br /></p>
</td>
</tr>
<tr>
<td class="exp">
		  <code class="large br"><br />
assert_in_delta<br />
refute_in_delta<br />
		  </code>
		</td>
<td class="exp">
		  <code class="large br"><br />
must_be_within_delta<br />
wont_be_within_delta<br />
		  </code>
		</td>
<td>
		  <code><br />
exp, act, dlt=0.001, msg=nil<br />
		  </code>
		</td>
<td>
<p><code class="br">assert_in_delta 2012, 2010, 2</code><br /><code class="br">refute_in_delta 2012, 3012, 2</code><br /><code class="br">2012.must_be_within_delta 2010, 2</code><br /><code class="br">2012.wont_be_within_delta 3012, 2</code><br /></p>
</td>
</tr>
<tr>
<td class="exp">
		  <code class="large br"></p>
<p>		  </code>
		</td>
<td class="exp">
		  <code class="large br"><br />
must_be_close_to<br />
wont_be_close_to<br />
		  </code>
		</td>
<td>
		  <code><br />
act, dlt=0.001, msg=nil<br />
		  </code>
		</td>
<td>
<p><code class="br">2012.must_be_close_to 2010, 2</code><br /><code class="br">2012.wont_be_close_to 3012, 2</code><br /></p>
</td>
</tr>
<tr>
<td class="exp">
		  <code class="large br"><br />
assert_in_epsilon<br />
refute_in_epsilon<br />
		  </code>
		</td>
<td class="exp">
		  <code class="large br"><br />
must_be_within_epsilon<br />
wont_be_within_epsilon<br />
		  </code>
		</td>
<td>
		  <code><br />
a, b, eps=0.001, msg=nil<br />
		  </code>
		</td>
<td>
<p><code class="br">assert_in_epsilon 1.0, 1.02, 0.05</code><br /><code class="br">refute_in_epsilon 1.0, 1.06, 0.05</code><br /><code class="br">1.0.must_be_within_epsilon 1.02, 0.05</code><br /><code class="br">1.0.wont_be_within_epsilon 1.06, 0.05</code><br /></p>
</td>
</tr>
<tr>
<td class="exp">
		  <code class="large br"><br />
assert_includes<br />
refute_includes<br />
		  </code>
		</td>
<td class="exp">
		  <code class="large br"><br />
must_include<br />
wont_include<br />
		  </code>
		</td>
<td>
		  <code><br />
collection, obj, msg=nil<br />
		  </code>
		</td>
<td>
<p><code class="br">assert_includes [1, 2], 2</code><br /><code class="br">refute_includes [1, 2], 3</code><br /><code class="br">[1, 2].must_include 2</code><br /><code class="br">[1, 2].wont_include 3</code><br /></p>
</td>
</tr>
<tr>
<td class="exp">
		  <code class="large br"><br />
assert_instance_of<br />
refute_instance_of<br />
		  </code>
		</td>
<td class="exp">
		  <code class="large br"><br />
must_be_instance_of<br />
wont_be_instance_of<br />
		  </code>
		</td>
<td>
		  <code><br />
klass, obj, msg=nil<br />
		  </code>
		</td>
<td>
<p><code class="br">assert_instance_of String, &quot;bar&quot;</code><br /><code class="br">refute_instance_of String, 100</code><br /><code class="br">&quot;bar&quot;.must_be_instance_of String</code><br /><code class="br">100.wont_be_instance_of String</code><br /></p>
</td>
</tr>
<tr>
<td class="exp">
		  <code class="large br"><br />
assert_kind_of<br />
refute_kind_of<br />
		  </code>
		</td>
<td class="exp">
		  <code class="large br"><br />
must_be_kind_of<br />
wont_be_kind_of<br />
		  </code>
		</td>
<td>
		  <code><br />
klass, obj, msg=nil<br />
		  </code>
		</td>
<td>
<p><code class="br">assert_kind_of Numeric, 100</code><br /><code class="br">refute_kind_of Numeric, &quot;bar&quot;</code><br /><code class="br">100.must_be_kind_of Numeric</code><br /><code class="br">&quot;bar&quot;.wont_be_kind_of Numeric</code><br /></p>
</td>
</tr>
<tr>
<td class="exp">
		  <code class="large br"><br />
assert_match<br />
refute_match<br />
		  </code>
		</td>
<td class="exp">
		  <code class="large br"><br />
must_match<br />
wont_match<br />
		  </code>
		</td>
<td>
		  <code><br />
exp, act, msg=nil<br />
		  </code>
		</td>
<td>
<p><code class="br">assert_match /\d/, &quot;42&quot;</code><br /><code class="br">refute_match /\d/, &quot;foo&quot;</code><br /><code class="br">&quot;42&quot;.must_match /\d/        </code><br /><code class="br">&quot;foo&quot;.wont_match /\d/</code><br /></p>
</td>
</tr>
<tr>
<td class="exp">
		  <code class="large br"><br />
assert_nil<br />
refute_nil<br />
		  </code>
		</td>
<td class="exp">
		  <code class="large br"><br />
must_be_nil<br />
wont_be_nil<br />
		  </code>
		</td>
<td>
		  <code><br />
obj, msg=nil<br />
		  </code>
		</td>
<td>
<p><code class="br">assert_nil [].first</code><br /><code class="br">refute_nil [1].first</code><br /><code class="br">[].first.must_be_nil</code><br /><code class="br">[1].first.wont_be_nil</code><br /></p>
</td>
</tr>
<tr>
<td class="exp">
		  <code class="large br"><br />
assert_operator<br />
refute_operator<br />
		  </code>
		</td>
<td class="exp">
		  <code class="large br"><br />
must_be<br />
wont_be<br />
		  </code>
		</td>
<td>
		  <code><br />
o1, op, o2, msg=nil<br />
		  </code>
		</td>
<td>
<p><code class="br">assert_operator 1, :&lt;, 2</code><br /><code class="br">refute_operator 1, :&gt;, 2</code><br /><code class="br">1.must_be :&lt;, 2</code><br /><code class="br">1.wont_be :&gt;, 2</code><br /></p>
</td>
</tr>
<tr>
<td class="exp">
		  <code class="large br"><br />
assert_output<br />
		  </code>
		</td>
<td class="exp">
		  <code class="large br"><br />
must_output<br />
		  </code>
		</td>
<td>
		  <code><br />
stdout = nil, stderr = nil<br />
		  </code>
		</td>
<td>
<p><code class="br">assert_output(&quot;hi\n&quot;){ puts &quot;hi&quot; }</code><br /><code class="br">Proc.new{puts &quot;hi&quot;}.must_output &quot;hi\n&quot;</code><br /></p>
</td>
</tr>
<tr>
<td class="exp">
		  <code class="large br"><br />
assert_raises<br />
		  </code>
		</td>
<td class="exp">
		  <code class="large br"><br />
must_raise<br />
		  </code>
		</td>
<td>
		  <code><br />
*exp<br />
		  </code>
		</td>
<td>
<p><code class="br">assert_raises(NoMethodError){ nil! }</code><br /><code class="br">Proc.new{nil!}.must_raise NoMethodError</code><br /></p>
</td>
</tr>
<tr>
<td class="exp">
		  <code class="large br"><br />
assert_respond_to<br />
refute_respond_to<br />
		  </code>
		</td>
<td class="exp">
		  <code class="large br"><br />
must_respond_to<br />
wont_respond_to<br />
		  </code>
		</td>
<td>
		  <code><br />
obj, meth, msg=nil<br />
		  </code>
		</td>
<td>
<p><code class="br">assert_respond_to &quot;foo&quot;,:empty?</code><br /><code class="br">refute_respond_to 100, :empty?</code><br /><code class="br">&quot;foo&quot;.must_respond_to  :empty?</code><br /><code class="br">100.wont_respond_to :empty?</code><br /></p>
</td>
</tr>
<tr>
<td class="exp">
		  <code class="large br"><br />
assert_same<br />
refute_same<br />
		  </code>
		</td>
<td class="exp">
		  <code class="large br"><br />
must_be_same_as<br />
wont_be_same_as<br />
		  </code>
		</td>
<td>
		  <code><br />
exp, act, msg=nil<br />
		  </code>
		</td>
<td>
<p><code class="br">assert_same :foo, :foo</code><br /><code class="br">refute_same  ['foo'], ['foo']</code><br /><code class="br">:foo.must_be_same_as :foo</code><br /><code class="br">['foo'].wont_be_same_as ['foo']</code><br /></p>
</td>
</tr>
<tr>
<td class="exp">
		  <code class="large br"><br />
assert_silent<br />
		  </code>
		</td>
<td class="exp">
		  <code class="large br"><br />
must_be_silent<br />
		  </code>
		</td>
<td>
		  <code><br />
-<br />
		  </code>
		</td>
<td>
<p><code class="br">assert_silent{ 1 + 1 }</code><br /><code class="br">Proc.new{ 1 + 1}.must_be_silent</code><br /></p>
</td>
</tr>
<tr>
<td class="exp">
		  <code class="large br"><br />
assert_throws<br />
		  </code>
		</td>
<td class="exp">
		  <code class="large br"><br />
must_throw<br />
		  </code>
		</td>
<td>
		  <code><br />
sym, msg=nil<br />
		  </code>
		</td>
<td>
<p><code class="br">assert_throws(:up){ throw :up}</code><br /><code class="br">Proc.new{throw :up}.must_throw :up</code><br /></p>
</td>
</tr>
</tbody>
</table>
<h3 id="test-setup">Test Setup</h3>
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Unit</th>
<th>Spec</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>setup()</code></td>
<td><code>before(type = nil, &#038;block)</code></td>
</tr>
<tr>
<td><code>teardown()</code></td>
<td><code>after(type = nil, &#038;block)</code></td>
</tr>
</tbody>
</table>
<h3 id="mocks">Mocks</h3>
<p>via <a href="http://www.ruby-doc.org/stdlib-2.0/libdoc/minitest/mock/rdoc/MiniTest/Mock.html" title="Class: MiniTest::Mock (Ruby 2.0)">MiniTest::Mock</a></p>
<ul>
<li><code>expect(name, retval, args=[])</code> &ndash;	Expect that method name is called, optionally with args or a blk, and returns retval.
<p>Example:</p>
<pre>
@mock.expect(:meaning_of_life, 42)
@mock.meaning_of_life # => 42

@mock.expect(:do_something_with, true, [some_obj, true])
@mock.do_something_with(some_obj, true) # => true

@mock.expect(:do_something_else, true) do |a1, a2|
   a1 == "buggs" &#038;&#038; a2 == :bunny
end
</pre>
</li>
<li><code>verify</code> &ndash; Verify that all methods were called as expected. Raises MockExpectationError if the mock object was not called as expected.
</li>
</ul>
<h3 id="other_syntax">Other syntax</h3>
<ul>
<li><code>def flunk(msg=nil)</code></li>
<li><code>def pass(msg=nil)</code></li>
<li><code>def skip(msg=nil, bt=caller)</code></li>
<li><code>def it (desc="anonymous", &#038;block)</code></li>
<li><code>i_suck_and_my_tests_are_order_dependent!()</code> &ndash; Call this at the top of your tests when you absolutely positively need to have ordered tests. <strong>In doing so, youâ€™re admitting that you suck and your tests are weak.</strong> (<a href="http://www.ruby-doc.org/stdlib-2.0/libdoc/minitest/unit/rdoc/MiniTest/Unit/TestCase.html" title="Class: MiniTest::Unit::TestCase (Ruby 2.0)">TestCase public class method</a>)</li>
<li><code>parallelize_me!()</code> &ndash; Call this at the top of your tests when you want to run your tests in parallel. <strong>In doing so, youâ€™re admitting that you rule and your tests are awesome.</strong>
</li>
<li><code>make_my_diffs_pretty!()</code> &ndash; Make diffs for this TestCase use pretty_inspect so that diff in assert_equal can be more details. NOTE: this is much slower than the regular inspect but much more usable for complex objects.
</li>
</ul>
<h3 id="tutorials">Tutorials</h3>
<ul>
<li><a href="http://www.rubyinside.com/a-minitestspec-tutorial-elegant-spec-style-testing-that-comes-with-ruby-5354.html">A MiniTest::Spec Tutorial: Elegant Spec-Style Testing, by Peter Cooper </a></li>
<li><a href="http://blog.arvidandersson.se/2012/03/28/minimalicous-testing-in-ruby-1-9">Minimalicious testing in Ruby 1.9 with MiniTest, by Arvid Anderson</a></li>
<li><a href="http://mattsears.com/articles/2011/12/10/minitest-quick-reference">Minitest Quick Reference, by Matt Sears</a></li>
</ul>
<h3 id="reference">Reference</h3>
<ul>
<li><a href="http://www.ruby-doc.org/stdlib-2.0/libdoc/minitest/rdoc/MiniTest.html">MiniTest&#8217;s official readme</a></li>
<li><a href="http://www.ruby-doc.org/stdlib-2.0/libdoc/minitest/spec/rdoc/">Ruby 2.0 Rdocs for MiniTest::Spec</a></li>
<li><a href="http://www.ruby-doc.org/stdlib-2.0/libdoc/minitest/unit/rdoc/">Ruby 2.0 Rdocs for MiniTest::Unit</a></li>
<li><a href="https://github.com/seattlerb/minitest">MiniTest on Github</a></li>
<li>My <a href="https://docs.google.com/spreadsheet/pub?key=0At3Q3D3lDxXcdGFRUHA1UnlyWm9ONWlkZU9oYmNzZlE&amp;output=html">Google Spreadsheet of MiniTest calls, as Excel</a></li>
<li>StackOverflow:<a href="http://stackoverflow.com/questions/7211086/how-do-i-stub-things-in-minitest"> How do I mock things in MiniTest?</a></li>
</ul>
<p>The post <a rel="nofollow" href="https://danwin.com/2013/03/ruby-minitest-cheat-sheet/">Ruby MiniTest Cheat Sheet, Unit and Spec reference</a> appeared first on <a rel="nofollow" href="https://danwin.com">danwin.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://danwin.com/2013/03/ruby-minitest-cheat-sheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Bastards Book of Regular Expressions</title>
		<link>https://danwin.com/2013/01/the-bastards-book-of-regular-expressions/</link>
		<comments>https://danwin.com/2013/01/the-bastards-book-of-regular-expressions/#comments</comments>
		<pubDate>Tue, 22 Jan 2013 03:51:04 +0000</pubDate>
		<dc:creator><![CDATA[Dan]]></dc:creator>
				<category><![CDATA[thoughts]]></category>
		<category><![CDATA[works]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[publishing]]></category>
		<category><![CDATA[regular expressions]]></category>

		<guid isPermaLink="false">https://danwin.com/?p=2266</guid>
		<description><![CDATA[<p>Well, I&#8217;m not quite done with my promised revision of the Bastards Book of Ruby. Or of Photography&#8230;but I&#8217;ve decided, oh what the hell, I should write something about regular expressions. Actually, there is some method to this madness. As part of the process of updating the Ruby book, I realized I needed to spin [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://danwin.com/2013/01/the-bastards-book-of-regular-expressions/">The Bastards Book of Regular Expressions</a> appeared first on <a rel="nofollow" href="https://danwin.com">danwin.com</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Well, I&#8217;m not quite done with my promised revision of the <a href="http://ruby.bastardsbook.com/">Bastards Book of Ruby</a>. Or of <a href="http://photography.bastardsbook.com/">Photography</a>&#8230;but I&#8217;ve decided, oh what the hell, I should write something <a href="https://leanpub.com/bastards-regexes">about regular expressions</a>.</p>
<p>Actually, there is some method to this madness. As part of the process of updating the Ruby book, I realized I needed to spin off some of the larger, <a href="http://ruby.bastardsbook.com/chapters/regexes/">non-Ruby related topics</a>. So, at some point, there will be mini-books about HTML and SQL. Regular expressions, as I keep telling people who want to deal with data, are incredibly important, even if you think you never want to learn programming. Hopefully this mini-book will make a strong case for learning regexes.</p>
<p>The second motive is I&#8217;ve been looking for a html/text-to-pdf workflow. So this is my experiment with Leanpub, which promises to turn a set of Markdown files into PDF/mobi/etc, while handling the selling process. I don&#8217;t expect to sell any copies of the <a href="https://leanpub.com/bastards-regexes">BBoRegexes</a>, but I hope to get a lot of insight about the mechanics behind Leanpub and if it presents a viable way for me to publish my other projects.</p>
<p>Check out the Leanpub homepage for my tentatively tiled book, <a href="https://leanpub.com/bastards-regexes">The Bastards Book of Regular Expressions</a>. Or, you could just read the mega-chapter <a href="http://ruby.bastardsbook.com/chapters/regexes/">on regexes in my Ruby book</a>.</p>
<p>The post <a rel="nofollow" href="https://danwin.com/2013/01/the-bastards-book-of-regular-expressions/">The Bastards Book of Regular Expressions</a> appeared first on <a rel="nofollow" href="https://danwin.com">danwin.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://danwin.com/2013/01/the-bastards-book-of-regular-expressions/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>First-year traffic stats for the Bastards Book of Ruby (and Photography): 140,000 unique visitors</title>
		<link>https://danwin.com/2012/12/bastards-book-birthday/</link>
		<comments>https://danwin.com/2012/12/bastards-book-birthday/#comments</comments>
		<pubDate>Mon, 03 Dec 2012 14:31:16 +0000</pubDate>
		<dc:creator><![CDATA[Dan]]></dc:creator>
				<category><![CDATA[thoughts]]></category>
		<category><![CDATA[works]]></category>

		<guid isPermaLink="false">https://danwin.com/?p=2192</guid>
		<description><![CDATA[<p>Last year, I wanted programming to be more accessible. So I published a rough draft of what I called the &#8220;Bastards Book of Ruby&#8221; and then never added to it again. It&#8217;s interesting to see how much actual traction it got. Here&#8217;s a screenshot of the Google Analytics visitors overview: Caveat: Unfortunately, I never figured [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://danwin.com/2012/12/bastards-book-birthday/">First-year traffic stats for the Bastards Book of Ruby (and Photography): 140,000 unique visitors</a> appeared first on <a rel="nofollow" href="https://danwin.com">danwin.com</a>.</p>
]]></description>
				<content:encoded><![CDATA[<div id="attachment_2193" style="width: 650px" class="wp-caption aligncenter"><a href="http://ruby.bastardsbook.com/chapters/web-inspecting-html/"><img src="https://danwin.com/words/wp-content/uploads/2012/12/web-inspecting-html-640x380.jpg" alt="" title="web-inspecting-html" width="640" height="380" class="size-large wp-image-2193" /></a><p class="wp-caption-text">The majority of this <a href="http://www.flickr.com/photos/zokuga/5786407390/in/photostream/">photo&#8217;s Flickr pageviews</a> comes from the <a href="http://ruby.bastardsbook.com/chapters/web-inspecting-html/">Meet Your Web Inspector chapter</a>, probably from readers who  click the photo to see what exactly the hell is going on. Here&#8217;s the story: One day, a queen bee decided to take residence on a Chinatown mailbox. Her hive decided to follow her, causing the city to block off the corner so the bee inspectors could pluck her out. My friend from China who was visiting NYC for the first time said to me later that this was the most exciting thing she saw in New York all week. Coincidentally, <a href="http://ruby.bastardsbook.com/chapters/web-inspecting-html/">the web inspector chapter</a> is probably the most useful part (for beginners) of my programming book.</p></div>
<p>Last year, I wanted programming to be <a href="http://ruby.bastardsbook.com/about/">more accessible</a>. So I published a rough draft of what I called the &#8220;<a href="http://ruby.bastardsbook.com">Bastards Book of Ruby</a>&#8221; and then never added to it again. It&#8217;s interesting to see how much actual traction it got. Here&#8217;s a screenshot of the Google Analytics visitors overview:</p>
<div id="attachment_2194" style="width: 650px" class="wp-caption aligncenter"><a href="https://danwin.com/2012/12/year-bastards-book-140000-unique-visitors-470000-pageviews/pageviews-graph/" rel="attachment wp-att-2194"><img src="https://danwin.com/words/wp-content/uploads/2012/12/pageviews-graph-640x163.png" alt="" title="pageviews-graph Bastards Book" width="640" height="163" class="size-large wp-image-2194" /></a><p class="wp-caption-text">Google Analytics Pageviews for bastardsbook.com</p></div>
<p><a href="https://danwin.com/2012/12/year-bastards-book-140000-unique-visitors-470000-pageviews/pageviews-stats/" rel="attachment wp-att-2195"><img src="https://danwin.com/words/wp-content/uploads/2012/12/pageviews-stats-640x265.png" alt="" title="pageviews-stats-bastardsbook" width="640" height="265" class="aligncenter size-large wp-image-2195" /></a></p>
<p><strong>Caveat:</strong> <em>Unfortunately, I never figured out how to get Google Analytics to do multiple subdomains, so this report includes the July traffic boost from the <a href="http://photography.bastardsbook.com">Bastards Book of Photography</a>, which, day-to-day, is not as popular as the Ruby book</em>.</p>
<p>In absolute terms, fewer than half a million pageviews in a year is not impressive for a free website (this 2 min. video I took of <a href="http://www.youtube.com/watch?v=HZmw_cLLco8">some guys playing Super Mario Brothers in the subway</a> is already at 250K visits). But given that it&#8217;s a book about programming and that each single page consists of a &#8220;chapter&#8221; and is &ndash; in retrospect &ndash; way too long (the Ruby book is about 75,000 words altogether), I&#8217;ll pretend that they&#8217;re more &#8220;substantial&#8221; page views. At least a few visitors saved pages for offline viewing and really, after you&#8217;ve gone through the chapters you care about, there&#8217;s not much reason to return to the book since I never really updated it. </p>
<p>However, according to the <strong>% New Visits</strong> metric, there&#8217;s been a steady increase in percentage of new visitors:</p>
<div id="attachment_2196" style="width: 650px" class="wp-caption aligncenter"><a href="https://danwin.com/2012/12/year-bastards-book-140000-unique-visitors-470000-pageviews/newvisits/" rel="attachment wp-att-2196"><img src="https://danwin.com/words/wp-content/uploads/2012/12/newvisits-640x198.png" alt="New visits to bastardsbook.com" title="New visits to bastardsbook.com" width="640" height="198" class="size-large wp-image-2196" /></a><p class="wp-caption-text">Google Analytics % of new visits to bastardsbook.com</p></div>
<p>Some traffic high points:</p>
<ul>
<li><em>12/5/2011</em> &ndash; Bastards Book of Ruby is released. It made it to Hacker News&#8217;s front page:  <strong>11,566 pageviews</strong></li>
<li><em>12/22/2011</em> &ndash; Once in awhile, either me or someone else would submit individual chapters to various sites. The chapter I had about scraping the <a href="http://ruby.bastardsbook.com/chapters/jail-logs-pcso/">Putnam County Sheriff&#8217;s Office</a> got a few upvotes on HN: <strong>6,528 pageviews</strong></li>
<li><em>5/16/2012</em> &ndash; The Ruby book makes it to the top of HN, possibly in response to Jeff Atwood&#8217;s &#8220;<a href="http://www.codinghorror.com/blog/2012/05/please-dont-learn-to-code.html">Please Don&#8217;t Learn to Code</a>&#8221; published the day before: <strong>38,359 pageviews</strong></li>
<li><em>6/21/2012</em> &ndash; <a href="http://photography.bastardsbook.com">The Bastards Book of Photography</a> is published. It took me about two weeks to put together and I wanted to try out <a href="http://octopress.org">Octopress</a> as a CMS to replace the hack Rails-to-static-file system I wrote for the Ruby book. It made the front of HN as well as Reddit&#8217;s photography and howto subreddits: <strong>45,519</strong></li>
</ul>
<p>In the last few months, the average number of visitors <strong>per week</strong> ranges from <strong>3,000</strong> to <strong>4,000</strong> visitors.</p>
<h3 id="promotional_work_and_referrals">Promotional work and referrals</h3>
<p>The BBoR was aimed toward journalism professionals trying to learn coding but didn&#8217;t formally pitch it outside of Twitter, listing it on my <a href="http://www.journalismfestival.com/speaker/dan-nguyen">online bios</a> and mentioning it on <a href="http://www.ire.org/nicar/">the NICAR mailing list</a>. Other hacker journalists were <a href="http://www.niemanlab.org/2012/09/brian-boyer-welcome-to-hacker-journalism-101-take-your-seats/">kind enough to give it a few  shout-outs</a>.</p>
<p>Most of the referrals overall came from technical audiences such as Hacker News and Reddit&#8217;s technical subreddits (again, the photo book numbers are mixed in here, which I think accounts for most of the social media traffic):</p>
<ol>
<li>news.ycombinator.com    38,817</li>
<li>reddit.com  16,297</li>
<li>t.co    7,062</li>
<li>petapixel.com   6,372</li>
<li>facebook.com    4,630</li>
<li>danwin.com  3,704</li>
<li>google.com  2,540</li>
<li>citizen428.net  2,476</li>
<li>news.ycombinator.org    1,348</li>
<li>wired.com   1,015</li>
</ol>
<h3 id="the_most_read_topics">The most-read topics</h3>
<p>The most popular section of the Ruby book is the <a href="http://ruby.bastardsbook.com/chapters/web-scraping/">five-chapter-series I wrote on web scraping</a>, which is of particular interest to journalists dealing with cruddy government websites that will never have an API. The <a href="http://ruby.bastardsbook.com/chapters/html-parsing/">Parsing HTML with Nokogiri</a> is the most popular individual chapter.</p>
<p>In my own cookie-wiped Google Search, the book is the top result for &#8220;<a href="http://www.google.com/#hl=en&amp;q=ruby+web+scraping">ruby web scraping</a>&#8221;.</p>
<p>Here are the top 20 search terms that don&#8217;t include the word &#8220;bastard&#8221;. Apparently the Bastards Book doesn&#8217;t rank high at all for any photography search terms:</p>
<ol>
<li>alter positions in a list ruby</li>
<li>ruby io safe io video stream</li>
<li>parse image path with ruby</li>
<li>putnam county jail log</li>
<li>ruby mechanize</li>
<li>nokogiri</li>
<li>ruby web crawler</li>
<li>`</li>
<li>ruby if else</li>
<li>web scraping ruby</li>
<li>finding curly bracket special characters in excel</li>
<li>ruby nokogiri</li>
<li>ruby collections</li>
<li>ruby parse html</li>
<li>ruby web scraping</li>
<li>text editor using wrong version of ruby</li>
<li>nokogiri book</li>
<li>ruby open html</li>
<li>how to run a saved program in ruby</li>
<li>ruby inline if</li>
</ol>
<div id="attachment_2199" style="width: 650px" class="wp-caption aligncenter"><a href="https://danwin.com/2012/12/year-bastards-book-140000-unique-visitors-470000-pageviews/bb-covers/" rel="attachment wp-att-2199"><img src="https://danwin.com/words/wp-content/uploads/2012/12/bb-covers-640x241.jpg" alt="The respective covers of the books." title="bb-covers" width="640" height="241" class="size-large wp-image-2199" /></a><p class="wp-caption-text">The respective covers of the books.</p></div>
<h3 id="general_interest_in_programming">General interest in programming</h3>
<p>Besides fixing typos and errors, I never did fulfill the promise of making major updates (to either of the books) this year and I&#8217;ve rarely mentioned the book after its first month &ndash; except in discussions about journalism and programming, which are pretty rare in general. To my surprise though, daily traffic has been generally steady. As I mentioned earlier, the two books receive about 3 to 4 thousand visitors weekly. When the Ruby book peaked on Hacker News in May, the average jumped from <strong>1,500 visitors to 2,500 visitors</strong>. The current average has been the status quo since the photo book was released in July.</p>
<p>It would seem that the photo book accounts for the majority of the difference. But anecdotally, I get thank-you emails and tweets every week about the Ruby book and almost never hear feedback on the photo book. Sure, there are plenty of in-depth photography guides in comparison to programming books. But there&#8217;s far fewer aspiring programmers than photographers.</p>
<p>I hope to help change that and so have been working on a major update to the BBoR (including converting it to PDF form, probably the most requested feature). Earlier than later, hopefully, and as my off-work hours permit.</p>
<p>Sometime after March 2011 was when I started thinking about writing a programming book. This was after I had tried teaching the first <a href="http://hackshackers.com/blog/2011/03/15/coding-for-beginners-taught-by-dan-nguyen-at-general-assembly-thursday-324-8-pm/">learn-to-code class</a> at General Assembly, an 8PM Thursday class called: &#8220;<a href="http://codingforbeginners.eventbrite.com/">Coding for Beginners: Data Mashing with APIs</a>&#8221;. Here&#8217;s the description I wrote up for the class:</p>
<blockquote>
<p>Students will learn the fundamentals of programming by creating simple yet powerful scripts to collect and organize the data found in Web services such as Twitter, Google Maps, and Foursquare. The class will walk through sample Ruby code to understand the basic theory of programming, including variables, methods, arrays and loops. At the end, students will be able to write a fully-functional custom script to access and scrape website data.</p>
<p>This class is intended for absolute newbies and those beginning to learn how to code. Laptops are optional. Code for the lesson will be provided so that students can follow along during class and after. Prerequisites: None.</p>
</blockquote>
<p>(<em>Before you spit out your coffee, I do reflect below about how hilariously absurd this synopsis is, in retrospect</em>)</p>
<p><a href="https://twitter.com/jenny8lee">Jenny 8. Lee</a> at <a href="(http://hackshackers.com/blog/2011/03/15/coding-for-beginners-taught-by-dan-nguyen-at-general-assembly-thursday-324-8-pm/">Hacks/Hackers</a>) introduced me to GA but I remember the GA coordinator and I both thinking, &#8220;Who the hell actually wants to learn basic programming?&#8221;  I don&#8217;t know what the average price for a GA class was then. But I know when we set the price at $30 for a 2-3 hour class, I thought it was too high and we&#8217;d end up with a pretty bare turnout. </p>
<p>And I was wrong: it was the fastest-selling class in GA&#8217;s then-young history and sold out in a day. And thankfully, the interest doesn&#8217;t seem to be a fluke: GA today regularly holds beginners&#8217; programming classes, ranging from <a href="http://www.eventbrite.com/event/4927758057/53c0e1defb6203fddd3bf20fc13b70ac">price of $175</a> for an afternoon to <a href="http://generalassemb.ly/education/126/intro-to-rails?where=new-york-city">$3,000 for an eight-week Rails course (including Ruby fundamentals)</a>.</p>
<p>My own class didn&#8217;t go terribly well because, as I&#8217;ve found out since then, it&#8217;s kind of difficult to cover in 3 hours the programming fundamentals (variables/methods/if statements/for-loops in order to create a mashup from Twitter and Foursquare APIs) that it takes <em>real</em> teachers a semester to cover, especially to an audience mostly unfamiliar with the command line. </p>
<p>So the Ruby book was an attempt to create a resource that might actually be helpful for aspiring coders. Less than half a million pageviews might not much. But it&#8217;s been gratifying to see the Ruby book continue to be used even in its messy draft form by beginners who are incredibly committed to learning new things in life. I hope the next revision of the Ruby book will be even more useful to them.</p>
<p><strong>Other resources: </strong><em>Who knows when I&#8217;ll actually finish. In the meantime, a lot of great programming resources have come out this past year, too many to list so I&#8217;ll just point out the Ruby ones. Free resources include Zed Shaw&#8217;s <a href="http://ruby.learncodethehardway.org/">Ruby version of his Learn to Code the Hard Way</a> and Codecademy&#8217;s <a href="http://www.codecademy.com/tracks/ruby">Ruby track</a>. Sau Sheong Chang&#8217;s <a href="http://www.amazon.com/Exploring-Everyday-Things-Ruby-Learning/dp/1449315151">Exploring Everyday Things with R and Ruby</a> is one of my favorite books I&#8217;ve bought this year and it follows a philosophy similar to mine: use code <a href="http://blog.airbrake.io/guest-post/exploring-everything/">to do creative, real-world problem  solving</a>.</em></p>
<p>The post <a rel="nofollow" href="https://danwin.com/2012/12/bastards-book-birthday/">First-year traffic stats for the Bastards Book of Ruby (and Photography): 140,000 unique visitors</a> appeared first on <a rel="nofollow" href="https://danwin.com">danwin.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://danwin.com/2012/12/bastards-book-birthday/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to convert Access .mdb files to .csv or SQL using Mac OS X</title>
		<link>https://danwin.com/2012/09/convert-access-mdb-files-csv-sql-mac-os/</link>
		<comments>https://danwin.com/2012/09/convert-access-mdb-files-csv-sql-mac-os/#comments</comments>
		<pubDate>Tue, 25 Sep 2012 21:06:47 +0000</pubDate>
		<dc:creator><![CDATA[Dan]]></dc:creator>
				<category><![CDATA[works]]></category>

		<guid isPermaLink="false">https://danwin.com/?p=2164</guid>
		<description><![CDATA[<p>Update Travis Swicegood, of the Texas Tribune, pointed out that mdbtools has a homebrew recipe (brew install mdbtools), which avoids this thorny problem. While waiting for the homebrew recipe to install, though, I found this mdb-sqlite project, which uses the Java library Jackcess, to allow command-line conversion&#8230;which is lacking in the solution I originally posted [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://danwin.com/2012/09/convert-access-mdb-files-csv-sql-mac-os/">How to convert Access .mdb files to .csv or SQL using Mac OS X</a> appeared first on <a rel="nofollow" href="https://danwin.com">danwin.com</a>.</p>
]]></description>
				<content:encoded><![CDATA[<div id="attachment_2165" style="width: 497px" class="wp-caption aligncenter"><a href="http://itunes.apple.com/us/app/mdblite/id487704620?ls=1&amp;mt=12"><img src="https://danwin.com/words/wp-content/uploads/2012/09/Screen-Shot-2012-09-25-at-5.05.13-PM.png" alt="MDBLite on the Mac App Store" title="Screen Shot 2012-09-25 at 5.05.13 PM" width="487" height="273" class="size-full wp-image-2165" /></a><p class="wp-caption-text">A life-changing app for data enthusiasts.</p></div>
<p><strong>Update</strong> <a href="http://www.travisswicegood.com/">Travis Swicegood</a>, of the Texas Tribune, pointed out that mdbtools has a homebrew recipe (brew install mdbtools), which <a href="https://github.com/brianb/mdbtools/issues/17">avoids this thorny problem</a>. While waiting for the homebrew recipe to install, though, I found this <a href="http://code.google.com/p/mdb-sqlite/">mdb-sqlite project</a>, which uses the Java library Jackcess, to allow command-line conversion&#8230;which is lacking in the solution I originally posted below. Still, it was the most productive $1.99 I&#8217;ve spent in a while.</p>
<p><a href="http://itunes.apple.com/us/app/mdblite/id487704620?ls=1&#038;mt=12">MDBLite, $1.99 in the Mac App Store</a>, allows you to convert Microsoft Access mdb files into SQL, CSV, or SQLite databases.</p>
<p>For the past few years, I&#8217;ve kept an old Windows XP laptop around just to open Access databases to convert them to Excel or CSV. I only found out about <a href="http://itunes.apple.com/us/app/mdblite/id487704620?ls=1&#038;mt=12">MDBLite</a> after digging through some obscure discussion groups that mentioned in passing. The entire purpose of this blog post is to inform all other poor souls who use Macs but must still deal with government data. If that is the most important thing my blog provides for the Internet, I&#8217;d still be proud.</p>
<p>So far, it works as well as advertised. Which is pretty amazing if you&#8217;ve ever had to deal with Access conversions.</p>
<p>The post <a rel="nofollow" href="https://danwin.com/2012/09/convert-access-mdb-files-csv-sql-mac-os/">How to convert Access .mdb files to .csv or SQL using Mac OS X</a> appeared first on <a rel="nofollow" href="https://danwin.com">danwin.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://danwin.com/2012/09/convert-access-mdb-files-csv-sql-mac-os/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bastards Book of Ruby has a Hacker News revival</title>
		<link>https://danwin.com/2012/05/bastards-book-of-ruby-has-a-hacker-news-revival/</link>
		<comments>https://danwin.com/2012/05/bastards-book-of-ruby-has-a-hacker-news-revival/#comments</comments>
		<pubDate>Sun, 20 May 2012 16:15:42 +0000</pubDate>
		<dc:creator><![CDATA[Dan Nguyen]]></dc:creator>
				<category><![CDATA[works]]></category>

		<guid isPermaLink="false">https://danwin.com/?p=1985</guid>
		<description><![CDATA[<p>I&#8217;ve procrastinated in updating my book of practical Ruby coding. But the site got an unexpected boost in interest and traffic when someone posted it to Hacker News this past week, possibly in response to the &#8220;Please Don&#8217;t Learn to Code&#8221; debate started by Jeff Atwood. Sidenote: The Bastards Book did reach the front page [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://danwin.com/2012/05/bastards-book-of-ruby-has-a-hacker-news-revival/">Bastards Book of Ruby has a Hacker News revival</a> appeared first on <a rel="nofollow" href="https://danwin.com">danwin.com</a>.</p>
]]></description>
				<content:encoded><![CDATA[<div id="attachment_1986" style="width: 650px" class="wp-caption aligncenter"><img src="https://danwin.com/words/wp-content/uploads/2012/05/Screen-shot-2012-05-20-at-12.14.23-PM-640x326.png" alt="Bastards Book HN spike" title="Screen shot 2012-05-20 at 12.14.23 PM" width="640" height="326" class="size-large wp-image-1986" /><p class="wp-caption-text">The Hacker News traffic spike for the Bastards Book of Ruby</p></div>
<p>I&#8217;ve procrastinated in updating my <a href="http://ruby.bastardsbook.com/">book of practical Ruby coding</a>. But the site got an unexpected boost in interest and traffic when <a href="http://news.ycombinator.com/item?id=3981480">someone posted it to Hacker News this past week</a>, possibly in response to the <a href="http://www.codinghorror.com/blog/2012/05/please-dont-learn-to-code.html">&#8220;Please Don&#8217;t Learn to Code&#8221; debate started by Jeff Atwood</a>. </p>
<p>Sidenote: The Bastards Book did reach the front page when I submitted its introductory essay, aptly titled &#8220;<a href="http://news.ycombinator.com/item?id=3314679">Programming is for Anyone</a>.&#8221; That sprawling essay needs to be revised but I believe it in even more.</p>
<p>The <a href="http://news.ycombinator.com/item?id=3981480">HN posting reached the top</a>, something I couldn&#8217;t get it to do back when I originally posted the draft. It was encouraging to see the need for something like this out there and makes me want to jump back into this as a summer project. I&#8217;ve definitely thought of many more examples to include and have hopefully become a better writer. </p>
<p>The main &#8220;fix&#8221; will be moving it from my totally-overkill Ruby-on-Rails system, structuring the book&#8217;s handmade HTML code into something simple enough for Markdown, and pushing it to Github. I&#8217;ve since gotten familiar with <a href="https://github.com/mojombo/jekyll">Jekyll</a>, which is mostly painless with the <a href="http://jekyllbootstrap.com/usage/jekyll-quick-start.html">jekyll-bootstrap gem</a>.</p>
<p>The post <a rel="nofollow" href="https://danwin.com/2012/05/bastards-book-of-ruby-has-a-hacker-news-revival/">Bastards Book of Ruby has a Hacker News revival</a> appeared first on <a rel="nofollow" href="https://danwin.com">danwin.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://danwin.com/2012/05/bastards-book-of-ruby-has-a-hacker-news-revival/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
