<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>a tumblelog by jrheard

var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));

try {
var pageTracker = _gat._getTracker("UA-7013093-5");
pageTracker._trackPageview();
} catch(err) {}</description><title>a page of tumbling madness</title><generator>Tumblr (3.0; @jrheard)</generator><link>http://jrheard.tumblr.com/</link><item><title>Explorations in Clojure's core.logic</title><description>&lt;p&gt;I first heard of &lt;a href="https://github.com/clojure/core.logic" target="_blank"&gt;core.logic&lt;/a&gt; three or four months ago, and I&amp;#8217;ve been trying to learn more about it ever since. It&amp;#8217;s apparently an implementation of miniKanren in Clojure, where &lt;a href="http://stackoverflow.com/tags/minikanren/info" target="_blank"&gt;miniKanren&lt;/a&gt; is a small language implemented in Scheme that&amp;#8217;s a stripped-down version of a system called KANREN.&lt;br/&gt;&lt;span&gt;Long story short, core.logic is a library that lets you do logic programming in Clojure. &lt;/span&gt;&lt;/p&gt;
&lt;h3&gt;Okay, so what&amp;#8217;s logic programming?&lt;/h3&gt;
&lt;p&gt;&lt;span&gt;I&amp;#8217;d never heard of &lt;a href="http://en.wikipedia.org/wiki/Logic_programming" target="_blank"&gt;logic programming&lt;/a&gt; before, probably because I didn&amp;#8217;t pay as much attention in school as I should have. Wikipedia says that it&amp;#8217;s one of the four main programming paradigms, the other three being object-oriented, imperative, and functional. Here&amp;#8217;s a simple logic program:&lt;/span&gt;&lt;/p&gt;
&lt;div class="gist"&gt;&lt;a href="https://gist.github.com/jrheard/76d49b27516df0cdf077" target="_blank"&gt;https://gist.github.com/jrheard/76d49b27516df0cdf077&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;Let&amp;#8217;s look at this program one step at a time. We&amp;#8217;re invoking &lt;code&gt;run*&lt;/code&gt;, which is a macro that gives you a fresh &lt;strong&gt;logic variable&lt;/strong&gt; (which we&amp;#8217;ve bound to the name &lt;code&gt;q&lt;/code&gt;), lets you specify a series of &lt;strong&gt;goals&lt;/strong&gt; that might relate to that logic variable, and returns &lt;strong&gt;a list containing all of the values that the logic variable can possibly take on&lt;/strong&gt; in order for those goals to be fulfilled.&lt;/p&gt;
&lt;p&gt;Here&amp;#8217;s another simple program:&lt;/p&gt;
&lt;div class="gist"&gt;&lt;a href="https://gist.github.com/jrheard/357fa4576d01e5601835" target="_blank"&gt;https://gist.github.com/jrheard/357fa4576d01e5601835&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;The result of this program is a list containing one value, &lt;code&gt;_0&lt;/code&gt;. &lt;code&gt;_0&lt;/code&gt; denotes a &lt;strong&gt;fresh&lt;/strong&gt; logic variable; the fact that our program returns &lt;code&gt;_0&lt;/code&gt; means that &lt;code&gt;q&lt;/code&gt; can take on any value at all and the goals in the body of the &lt;code&gt;run*&lt;/code&gt; call will still hold true. Neat!&lt;/p&gt;
&lt;p&gt;At this point, I&amp;#8217;d like to refer you to Ryan Senior&amp;#8217;s post &lt;a href="http://objectcommando.com/blog/2011/11/04/the-magical-island-of-kanren-core-logic-intro-part-1/" target="_blank"&gt;&amp;#8220;The Magical Island of Kanren&amp;#8221;&lt;/a&gt;. I like the metaphor he uses in that post; he also has some great examples, and he introduces &lt;code&gt;conde&lt;/code&gt;, which we&amp;#8217;ll be using in a second. You&amp;#8217;ll need to have read and understood that post in order to make sense of the rest of this one. It&amp;#8217;s short and simple, go read it and come right back!&lt;/p&gt;
&lt;h3&gt;DOM-logic&lt;/h3&gt;
&lt;p&gt;Okay: now that we have the beginnings of an understanding of core.logic&amp;#8217;s vocabulary, let&amp;#8217;s get to the reason I wrote this post.&lt;/p&gt;
&lt;p&gt;core.logic allows you to ask questions about your data in a declarative way. It&amp;#8217;s kind of like SQL in that respect, but it&amp;#8217;s embedded in Clojure (so you have all of your favorite functional-programming tools available) and you don&amp;#8217;t need to send all of your data over to a database before you can ask questions about it. Ryan Senior&amp;#8217;s &lt;a href="http://www.infoq.com/presentations/core-logic" target="_blank"&gt;&amp;#8220;Practical core.logic&amp;#8221;&lt;/a&gt; talk (particularly minutes 7 through 13) really helped crystallize that for me, and right after watching it, I thought to myself - wouldn&amp;#8217;t it be fun to write a simple core.logic program that implements &lt;code&gt;document.getElementsByClassName&lt;/code&gt;? So I did. Let&amp;#8217;s look at it!&lt;/p&gt;
&lt;p&gt;To get started, we&amp;#8217;ll need to import some libraries, pull down a Web page, and parse its HTML into a DOM-tree representation. Here&amp;#8217;s some code that does that:&lt;/p&gt;
&lt;div class="gist"&gt;&lt;a href="https://gist.github.com/jrheard/d854c12384108ef12a3e" target="_blank"&gt;https://gist.github.com/jrheard/d854c12384108ef12a3e&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;Now that we&amp;#8217;ve got our data, let&amp;#8217;s start writing our logic program. core.logic programs are expressed using &lt;strong&gt;relations&lt;/strong&gt;, which is another way of saying &amp;#8220;functions that return goals&amp;#8221;. We&amp;#8217;ll need to write a relation that takes a node and a classname and then returns a goal that says that the node should have the specified classname. Here&amp;#8217;s one:&lt;/p&gt;
&lt;div class="gist"&gt;&lt;a href="https://gist.github.com/jrheard/3c09a19e9a99947aad63" target="_blank"&gt;https://gist.github.com/jrheard/3c09a19e9a99947aad63&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;We introduce a relation called &lt;code&gt;secondo&lt;/code&gt;, and use it to bind a fresh logic variable named &lt;code&gt;attrs&lt;/code&gt; to the second element of the node, since the second element of a node is a map containing the node&amp;#8217;s HTML attributes. Once we&amp;#8217;ve done that, we can say that &lt;code&gt;attrs&lt;/code&gt; should contain a k/v pair like e.g. &lt;span&gt;&lt;code&gt;{:class "user-passport"}&lt;/code&gt;. Goal written!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Now that we&amp;#8217;ve got a way of saying that a logic variable that represents an HTML node should have a certain class name, we&amp;#8217;re going to have to give ourselves a way of applying that goal to every element of the DOM tree. Here&amp;#8217;s what that looks like:&lt;/p&gt;
&lt;div class="gist"&gt;&lt;a href="https://gist.github.com/jrheard/16269f93dfc51d511792" target="_blank"&gt;https://gist.github.com/jrheard/16269f93dfc51d511792&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;One step at a time: to start off, we introduce a relation called &lt;code&gt;childreno&lt;/code&gt;. It takes two logic variables, one representing an HTML node, and one representing the node&amp;#8217;s children, and then uses &lt;code&gt;resto&lt;/code&gt; twice to unify &lt;code&gt;children&lt;/code&gt; with the (potentially empty) list of all elements in &lt;code&gt;node&lt;/code&gt; after the first two elements, because that&amp;#8217;s where the node stores its children.&lt;/p&gt;
&lt;p&gt;Next up is &lt;code&gt;nodes-existo&lt;/code&gt;, which is the workhorse of this program. This relation takes a relation and a couple of logic variables. It starts by using &lt;code&gt;conso&lt;/code&gt; to split the passed-in &lt;code&gt;nodes&lt;/code&gt; lvar apart into &lt;code&gt;node&lt;/code&gt; and &lt;code&gt;remaining-nodes&lt;/code&gt;. Now we use a &lt;code&gt;conde&lt;/code&gt; to say that we want our program to check each of three cases. (And when I say &amp;#8220;each&amp;#8221;, I mean &amp;#8220;each and every!&amp;#8221; Note that while, as pg says, a &lt;code&gt;cond&lt;/code&gt; expression will evaluate &amp;#8220;only an L-shaped path of its subexpressions&amp;#8221;, a &lt;code&gt;conde&lt;/code&gt; doesn&amp;#8217;t short-circuit like that - once it&amp;#8217;s done checking one of its lines, it&amp;#8217;ll backtrack out and check the next, regardless of whether the first line&amp;#8217;s goals succeeded or failed.)&lt;/p&gt;
&lt;p&gt;The first line&amp;#8217;s simple enough: we say that if the goal returned by a call to &lt;code&gt;(condition node)&lt;/code&gt; succeeds, then &lt;code&gt;node&lt;/code&gt; should be unified with &lt;code&gt;out&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;In the next line, we introduce an lvar called &lt;code&gt;children&lt;/code&gt;, use &lt;code&gt;childreno&lt;/code&gt; to unify it with &lt;code&gt;node&lt;/code&gt;&amp;#8217;s children, and recur on those children.&lt;/p&gt;
&lt;p&gt;In the third line, we recur on &lt;code&gt;remaining-nodes&lt;/code&gt;, which we used &lt;code&gt;conso&lt;/code&gt; earlier to unify with the rest of the nodes in &lt;code&gt;nodes&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;And that&amp;#8217;s basically it! All that&amp;#8217;s left is &lt;code&gt;get-elements-by-class-name&lt;/code&gt;, which is a plain old function that takes a node and a classname and uses &lt;code&gt;nodes-existo&lt;/code&gt; and &lt;code&gt;has-classnameo&lt;/code&gt; to tell &lt;code&gt;run*&lt;/code&gt; how to identify the possible values of &lt;code&gt;q&lt;/code&gt;. Simple!&lt;/p&gt;
&lt;h3&gt;So, what has this bought us?&lt;/h3&gt;
&lt;p&gt;At this point, the program we&amp;#8217;ve written doesn&amp;#8217;t look &lt;strong&gt;that&lt;/strong&gt; much different from how we would have written it without core.logic. What&amp;#8217;s the logic-programming approach bought us so far?&lt;/p&gt;
&lt;p&gt;Well, for starters, we haven&amp;#8217;t had to worry at all about assembling the list of nodes that we want to return. All we do is tell our program how to identify the sort of values we&amp;#8217;re interested in, and tell it where it can look to potentially find more of them, and &lt;code&gt;run*&lt;/code&gt; handles the rest. So that&amp;#8217;s cool! One other cool property about this program is that you can run it backwards trivially - you can give it a classname and one or more nodes with that classname, and it&amp;#8217;ll generate all of the possible DOM trees that could contain that node; but that&amp;#8217;s not exactly useful in this particular situation.&lt;/p&gt;
&lt;p&gt;So at this point, I&amp;#8217;d say that core.logic has let us write our program slightly more declaratively, but this program probably isn&amp;#8217;t a lot shorter than the non-core.logic version of it would have been.&lt;/p&gt;
&lt;h3&gt;Enter matche&lt;/h3&gt;
&lt;p&gt;I noticed in Ryan Senior&amp;#8217;s talk - as well as in his article on &lt;a href="http://objectcommando.com/blog/2011/10/13/appendo-the-great/" target="_blank"&gt;appendo the great&lt;/a&gt; - that he used a construct called &lt;code&gt;matche&lt;/code&gt;, which brings the joy of pattern matching to your core.logic programs. As far as I can tell, it&amp;#8217;s only fully documented in Appendix C of &lt;a href="https://scholarworks.iu.edu/dspace/bitstream/handle/2022/8777/Byrd_indiana_0093A_10344.pdf" target="_blank"&gt;William Byrd&amp;#8217;s thesis&lt;/a&gt;, but Ambrose Bonnaire-Sergeant has a good introduction to it near the end of his great &lt;a href="https://github.com/frenchy64/Logic-Starter/wiki" target="_blank"&gt;core.logic intro&lt;/a&gt;. Let&amp;#8217;s take it out for a spin!&lt;/p&gt;
&lt;p&gt;As long as we&amp;#8217;re making changes, let&amp;#8217;s first make &lt;code&gt;has-classnameo&lt;/code&gt; a little more general - let&amp;#8217;s rename it to &lt;code&gt;has-attrso&lt;/code&gt;, and have it take a map of attributes (e.g. &lt;code&gt;{:class "foo" :id "bar"}&lt;/code&gt;) that we want matching nodes to have. We can define it using &lt;code&gt;defne&lt;/code&gt;, which is just shorthand for defining a function that does a &lt;code&gt;matche&lt;/code&gt; on its arguments:&lt;/p&gt;
&lt;div class="gist"&gt;&lt;a href="https://gist.github.com/jrheard/c5a6e8919995e985ffa2" target="_blank"&gt;https://gist.github.com/jrheard/c5a6e8919995e985ffa2&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;Note that we&amp;#8217;re able to completely throw &lt;code&gt;secondo&lt;/code&gt; away - we just say: this is what a node looks like, and here is a constraint that we want to apply to the node&amp;#8217;s attributes. Neat! Now let&amp;#8217;s take a look at the redefinition of big bad &lt;code&gt;nodes-existo&lt;/code&gt;:&lt;/p&gt;
&lt;div class="gist"&gt;&lt;a href="https://gist.github.com/jrheard/ad1027a4b2f8fcdef54c" target="_blank"&gt;https://gist.github.com/jrheard/ad1027a4b2f8fcdef54c&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;We&amp;#8217;re able to inline the opening &lt;code&gt;conso&lt;/code&gt; and &lt;code&gt;fresh&lt;/code&gt; calls into the implied &lt;code&gt;matche&lt;/code&gt; expression, which is cool. The first two lines of the &lt;code&gt;conde&lt;/code&gt; look pretty familiar, but the line concerning the node&amp;#8217;s children has changed a lot. We&amp;#8217;re now using another &lt;code&gt;matche&lt;/code&gt; in order to pull &lt;code&gt;?node&lt;/code&gt; apart and get at its &lt;code&gt;?children&lt;/code&gt;. This saves us a &lt;code&gt;fresh&lt;/code&gt; call, a &lt;code&gt;childreno&lt;/code&gt; call, and actually lets us delete the definition of &lt;code&gt;childreno&lt;/code&gt; entirely.&lt;/p&gt;
&lt;p&gt;Here&amp;#8217;s our final program in its entirety:&lt;/p&gt;
&lt;div class="gist"&gt;&lt;a href="https://gist.github.com/jrheard/f1d3fc8b7e4d45e5a0f5" target="_blank"&gt;https://gist.github.com/jrheard/f1d3fc8b7e4d45e5a0f5&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;This is about as declarative as it gets, folks. Our program grabs some data, and then very simply and succinctly (the meat of the program is ten lines of code!) tells &lt;code&gt;run*&lt;/code&gt;: this is what the nodes we&amp;#8217;re interested in look like, and this is where the rest of the nodes you&amp;#8217;ll want to look at are; please find the good ones for us. Logic programming and pattern matching are a truly fearsome combination. I&amp;#8217;m really excited about core.logic - it seems like a really useful tool.&lt;/p&gt;
&lt;h3&gt;Notes&lt;/h3&gt;
&lt;p&gt;Here&amp;#8217;s an earlier version of &lt;code&gt;nodes-existo&lt;/code&gt;:&lt;/p&gt;
&lt;div class="gist"&gt;&lt;a href="https://gist.github.com/jrheard/a0d103dbb4f64f51aecd" target="_blank"&gt;https://gist.github.com/jrheard/a0d103dbb4f64f51aecd&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;It has a subtle bug, because out of reflex, I thought I had to define a base case. Can you find it? How do you think the bug will change the behavior of the program? Do you understand why the code works when that line is removed?&lt;/p&gt;
&lt;p&gt;Also: our code to get elements by class name won&amp;#8217;t work on elements that have multiple class names - that is, if we use this code to search for elements that have the class &lt;code&gt;"foo"&lt;/code&gt;, elements that have the classes &lt;code&gt;"foo bar"&lt;/code&gt; won&amp;#8217;t be matched. Enhancing this code to support that behavior is left as an exercise for the reader.&lt;/p&gt;
&lt;h3&gt;Resources&lt;/h3&gt;
&lt;p&gt;If you want to start diving into this stuff, here&amp;#8217;s how I&amp;#8217;d recommend doing it:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Read the &lt;a href="https://github.com/clojure/core.logic/wiki/A-Core.logic-Primer" target="_blank"&gt;official core.logic primer&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Watch &lt;a href="http://www.youtube.com/watch?v=5Q9x16uIsKA" target="_blank"&gt;this video&lt;/a&gt; by the miniKanren guys. It has what I seriously think is the coolest demo of anything ever. You&amp;#8217;ll know what I&amp;#8217;m talking about when you see it. &lt;/li&gt;
&lt;li&gt;Watch &lt;a href="http://www.youtube.com/watch?v=fHK-uS-Iedc" target="_blank"&gt;this other video&lt;/a&gt; by the same guys.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.infoq.com/presentations/miniKanren" target="_blank"&gt;Here&amp;#8217;s another one&lt;/a&gt; - it shares a lot of content with the first two videos, but in the final fifteen minutes they build and demo a working type inferencer from scratch for the hell of it. It&amp;#8217;s really a treat to see these guys at work.&lt;/li&gt;
&lt;li&gt;Read &lt;a href="http://www.amazon.com/Reasoned-Schemer-Daniel-P-Friedman/dp/0262562146" target="_blank"&gt;The Reasoned Schemer&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;That&amp;#8217;s actually about as far as I&amp;#8217;ve gotten so far - I bought a copy of &amp;#8220;The Art of Prolog&amp;#8221; that I&amp;#8217;ll read at some point, and I&amp;#8217;m working on getting a hard copy of Byrd&amp;#8217;s thesis to read through. I also have core.logic&amp;#8217;s source code open in a tab and will hopefully read it all one of these days, and the author of core.logic has a &lt;a href="http://dosync.posterous.com/a-logic-programming-reading-list" target="_blank"&gt;recommended reading list&lt;/a&gt;. Aside from that, though, I&amp;#8217;m not aware of many other resources besides the ones I cited throughout this post - this field is the coolest thing I&amp;#8217;ve ever heard of, but it seems relatively small as of yet. Hopefully that&amp;#8217;ll change as more and more people are introduced to it via core.logic!&lt;/p&gt;
&lt;p&gt;(Acknowledgements: I&amp;#8217;d like to thank the miniKanren guys and David Nolen for existing, everyone whose articles and documentation I cited for writing those things, and my roommates&amp;#8217; cat &lt;a href="http://i.imgur.com/H85sTlG.jpg" target="_blank"&gt;Isis&lt;/a&gt; for sitting on me for the entire five hours I spent writing this post.)&lt;/p&gt;</description><link>http://jrheard.tumblr.com/post/43575891007</link><guid>http://jrheard.tumblr.com/post/43575891007</guid><pubDate>Wed, 20 Feb 2013 10:06:00 -0800</pubDate><category>clojure</category></item><item><title>getting started with clojure</title><description>&lt;p&gt;I’m about to try to teach a bunch of people (primarily Python devs running OS X) how to use Clojure, and I’m not satisfied with any of the &lt;a href="http://clojure.org/getting_started" target="_blank"&gt;currently&lt;/a&gt; &lt;a href="http://dev.clojure.org/display/doc/Getting+Started" target="_blank"&gt;existing&lt;/a&gt; &lt;a href="http://dev.clojure.org/display/doc/Getting+Started+for+Beginners" target="_blank"&gt;documentation&lt;/a&gt; on how to get up and running from scratch. When I was going through all this myself a few months back, there was a weird period of a good few weeks when I had basically no mental map of the Clojure ecosystem and had no idea how to assemble one.&lt;/p&gt;
&lt;p&gt;My goal for this post is to create the resource I wish I had six months ago. I’ll assume that you’re running on OS X and have a non-zero amount of programming experience.&lt;/p&gt;
&lt;h3&gt;The Clojure Book&lt;/h3&gt;
&lt;p&gt;Your first step should be to buy and begin reading &lt;a href="http://www.clojurebook.com/" target="_blank"&gt;Clojure Programming&lt;/a&gt;. There’s another book called (confusingly enough) “Programming Clojure”, and I can’t vouch for whether it’s better or worse, but I used “Clojure Programming” and liked it very much, so it’s what I recommend. It’s written by people whose names you’re going to get used to seeing everywhere as you explore the Clojure ecosystem; all the main figures in the Clojure community seem to be inhumanly prolific.&lt;/p&gt;
&lt;h3&gt;Let’s Get Started&lt;/h3&gt;
&lt;p&gt;Now, let’s start getting your environment assembled. Get &lt;a href="http://mxcl.github.com/homebrew/" target="_blank"&gt;Homebrew&lt;/a&gt; - “the missing package manager for OS X” - if you don’t have it already, and then run&lt;/p&gt;
&lt;pre&gt;brew install leiningen&lt;/pre&gt;
&lt;p&gt;Congratulations, now you have &lt;a href="https://github.com/technomancy/leiningen" target="_blank"&gt;Leiningen&lt;/a&gt;! (Make sure you ended up with version 2.0 or greater - you can check that by running &lt;code&gt;lein --version&lt;/code&gt;.)&lt;/p&gt;
&lt;h3&gt;So what the hell is Leiningen?&lt;/h3&gt;
&lt;p&gt;Leiningen’s the main tool you’ll be using for:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;starting up a REPL&lt;/li&gt;
&lt;li&gt;downloading+installing libraries&lt;/li&gt;
&lt;li&gt;running your programs&lt;/li&gt;
&lt;li&gt;starting a server to run the webapps you’ve written&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Go ahead and run `lein repl`. You&amp;#8217;ve now got a working Clojure REPL! In addition, if you run that command from the top-level directory of one of your Clojure projects, it’ll deal with wiring up classpaths and whatnot so that you’ll be able to import and play around with your project’s code and the libraries that it depends on. We’ll get to that later. Right now, let’s create a skeleton project for us to play around with by running&lt;/p&gt;
&lt;pre&gt;lein new foo&lt;/pre&gt;
&lt;p&gt;When that’s done, cd into foo and you’ll see that it’s already got some files and directories:&lt;/p&gt;
&lt;pre&gt;[jrheard@jrheard-air:~/dev/foo] $ ll
total 16
-rw-r--r--  1 jrheard  staff   193B Jan  5 15:17 README.md
-rw-r--r--  1 jrheard  staff   263B Jan  5 15:17 project.clj
drwxr-xr-x  3 jrheard  staff   102B Jan  5 15:17 src
drwxr-xr-x  3 jrheard  staff   102B Jan  5 15:17 test
&lt;/pre&gt;
&lt;p&gt;Whenever you write a Clojure library/program/anything, your source code will live in the “src” directory and your tests will live in the “test” directory. Straightforward enough. Let’s take a look around in src:&lt;/p&gt;
&lt;pre&gt;[jrheard@jrheard-air:~/dev/foo] $ cat src/foo/core.clj&lt;/pre&gt;
&lt;pre class="prettyprint lang-clj"&gt;(ns foo.core)

(defn foo
  "I don't do a whole lot."
  [x]
  (println x "Hello, World!"))
&lt;/pre&gt;
&lt;p&gt;Looks like Leiningen’s already created a file called “src/foo/core.clj”. It’s a Clojure program that defines a namespace called “foo.core” and then declares that that namespace contains a function called “foo”. Let’s check it out. Start up a repl with `lein repl` and poke around. Remember when I mentioned earlier that leiningen takes care of setting up your classpath and associated goop such that you’re able to access your project’s code from the REPL? Check this out:&lt;/p&gt;
&lt;pre&gt;user=&amp;gt; &lt;span class="user-input"&gt;(use 'foo.core)&lt;/span&gt;
nil
user=&amp;gt; &lt;span class="user-input"&gt;foo&lt;/span&gt;
#&amp;lt;core$foo foo.core$foo@6ad591a6&amp;gt;
user=&amp;gt; &lt;span class="user-input"&gt;(foo "jrheard")&lt;/span&gt;
jrheard Hello, World!
nil
&lt;/pre&gt;
&lt;p&gt;Awesome - we were able to import our code and run it. The `use` function basically serves the same purpose as `from foo.core import *` would in Python, and its use in source code is similarly discouraged for the same reasons that import * is discouraged. Like import *, though, It’s pretty useful to have when you’re poking around in the REPL.&lt;/p&gt;
&lt;p&gt;So that’s cool - we’ve created a project, it’s got code in it, we’ve found out how to start up a working REPL that can play around with that code. Bullet point 1: accomplished. Let’s take a look at the second bullet point:&lt;/p&gt;
&lt;h3&gt;Downloading and installing libraries&lt;/h3&gt;
&lt;p&gt;You’re probably used to getting your libraries by running something from the command-line,&lt;br/&gt; e.g. `pip install this_great_library_i_found`, which would download the specified library and install it either globally or within your current virtualenv. Things work a little bit differently in Clojure.&lt;/p&gt;
&lt;p&gt;First, you’ve got to find a library that looks useful. &lt;a href="http://www.clojure-toolbox.com/" target="_blank"&gt;The Clojure Toolbox&lt;/a&gt; is a &lt;strong&gt;fantastic &lt;/strong&gt;tool for this, and is the best such resource I’ve found. Let&amp;#8217;s choose a library to play around with: making HTTP requests is fun - let’s go down to the “HTTP Clients” section and see what our options are. Looks like we’ve got to pick between &lt;a href="https://github.com/dakrone/clj-http" target="_blank"&gt;clj-http&lt;/a&gt; and &lt;a href="https://github.com/neotyk/http.async.client" target="_blank"&gt;http.async.client&lt;/a&gt; - but how do we choose?&lt;/p&gt;
&lt;p&gt;Currently, my favorite way of deciding between competing libraries is: pull up their respective github repos, compare the number of stars+forks, and give bonus points to any libraries that have commits from within the past month or two. Not exactly scientific, but it’s served me well so far as a good proxy for the strength of the library’s community/influence/adoption. As of this writing, clj-http has 242 stars to http.async.client’s 127, so let’s pick clj-http.&lt;/p&gt;
&lt;h3&gt;So… how do we get it?&lt;/h3&gt;
&lt;p&gt;Let’s go to &lt;a href="https://github.com/dakrone/clj-http" target="_blank"&gt;clj-http’s github repo&lt;/a&gt;. Check out how the README’s installation section has this block of code:&lt;/p&gt;
&lt;pre&gt;[clj-http "0.6.3"]&lt;/pre&gt;
&lt;p&gt;That’s the information we need - it’s a Clojure vector with two items, the first of which is the name of the library, and the second of which identifies the most up-to-date stable version available. We’re going to add this to our project.clj, which you saw earlier when we looked at the contents of the ‘foo’ directory. Open up project.clj, it’ll look like this:&lt;/p&gt;
&lt;pre class="prettyprint lang-clj"&gt;(defproject foo "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.4.0"]]) 
&lt;/pre&gt;
&lt;p&gt;Note the &lt;strong&gt;:dependencies&lt;/strong&gt; section - it’s a Clojure vector containing one item, and that item is itself a Clojure vector containing two items. This vector indicates to Leiningen that we want our project to run on version 1.4.0 of Clojure. Fair enough - now let’s add the clj-http vector we saw earlier. Our project.clj should now look like this:&lt;/p&gt;
&lt;pre class="prettyprint lang-clj"&gt;(defproject foo "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.4.0"]
                 &lt;strong&gt;[clj-http "0.6.3"]&lt;/strong&gt;])
&lt;/pre&gt;
&lt;p&gt;And that’s it! We’ve now specified to Leiningen that we want the clj-http library, and which version we need. Let’s try it out - start a REPL with `lein repl`, and let’s play around with our fancy new library. Notice that Leiningen will first download clj-http before starting up the REPL - that’s because it first runs `lein deps` behind the scenes any time you ask it to do basically anything, and that causes it to scan your project.clj and make sure that it’s already fetched all the dependencies you’ve asked it to.&lt;/p&gt;
&lt;p&gt;Okay, back to our REPL session. Looks like clj-http’s github repo’s README suggests that you require it in the REPL by running&lt;/p&gt;
&lt;pre&gt;(require '[clj-http.client :as client])&lt;/pre&gt;
&lt;p&gt;So let’s do that - it’s the same thing as `from clj.http import client` in Python (as opposed to `from clj.http.client import *`, which is again what the `use` function does.)&lt;/p&gt;
&lt;pre&gt;user=&amp;gt; &lt;span class="user-input"&gt;(require '[clj-http.client :as client])&lt;/span&gt;
nil
user=&amp;gt; &lt;span class="user-input"&gt;(client/get "http://www.yelp.com")&lt;/span&gt;
;; a big huge blob of data pops out!
&lt;/pre&gt;
&lt;p&gt;Okay, wow, looks like that worked! That’s sort of hard to read - you’ll notice that the big huge blob of data ends with a “}”, which is a hint that it might be a Clojure map. Let’s try poking at it:&lt;/p&gt;
&lt;pre&gt;user=&amp;gt; &lt;span class="user-input"&gt;(def resp (client/get "http://www.yelp.com"))&lt;/span&gt;
#'user/resp
user=&amp;gt; &lt;span class="user-input"&gt;(type resp)&lt;/span&gt;
clojure.lang.PersistentArrayMap
user=&amp;gt; &lt;span class="user-input"&gt;(keys resp)&lt;/span&gt;
(:cookies :trace-redirects :request-time :status :headers :body)
user=&amp;gt; &lt;span class="user-input"&gt;(:status resp)&lt;/span&gt;
200
user=&amp;gt; &lt;span class="user-input"&gt;(:headers resp)&lt;/span&gt;
{"server" "Apache", "content-encoding" "gzip", "x-proxied" "lb2",
"content-type" "text/html; charset=UTF-8", "date" "Sun, 06 Jan 2013 00:02:58 GMT",
"cache-control" "private", "vary" "Accept-Encoding,User-Agent",
"transfer-encoding" "chunked", "x-node" "wsgi, web40, www_all",
"x-mode" "ro", "connection" "close"}
&lt;/pre&gt;
&lt;p&gt;And there you have it - we’ve found an HTTP client library, downloaded it, and figured out how to use it interactively in the REPL!&lt;/p&gt;
&lt;p&gt;It took me a while to figure this all out - after beating my head against a wall for a day, I eventually had to jump into the #clojure IRC channel and plead for help. Now you don’t have to! For further reading, check out &lt;a href="https://github.com/technomancy/leiningen/blob/master/doc/TUTORIAL.md" target="_blank"&gt;the official Leiningen tutorial&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;Putting it all together&lt;/h3&gt;
&lt;p&gt;Let’s finish up by figuring out how to actually run a Clojure program. Let’s try a good old `lein run`:&lt;/p&gt;
&lt;pre&gt;[jrheard@jrheard-air:~/dev/foo] $ lein run
No :main namespace specified in project.clj.&lt;/pre&gt;
&lt;p&gt;Okay, that didn’t work. Referring back to the Leiningen tutorial mentioned earlier and doing a search for :main, we see that you can define a :main key in your project.clj definition that specifies the namespace that `lein run` will run, and that said namespace has to contain a `-main` function, which serves as the entry point into your program. Let’s add this line to our project.clj spec:&lt;/p&gt;
&lt;pre&gt;:main foo.core&lt;/pre&gt;
&lt;p&gt;And finally let’s modify src/foo/core.clj so that it looks like this:&lt;/p&gt;
&lt;pre class="prettyprint lang-clj"&gt;(ns foo.core
  (:require [clj-http.client :as client]))

(defn -main
  "Prints the first 50 characters of the HTML source of yelp.com."
  [&amp;amp; args]
  (println (apply str
                  (take 50
                        (:body (client/get "http://www.yelp.com"))))))
&lt;/pre&gt;
&lt;p&gt;Here we go - let’s try it out with `lein run`!&lt;/p&gt;
&lt;pre&gt;[jrheard@jrheard-air:~/dev/foo] $ lein run
Compiling foo.core
&amp;lt;!DOCTYPE HTML&amp;gt;

&amp;lt;!--[if lt IE 7 ]&amp;gt; &amp;lt;html xmlns:fb
&lt;/pre&gt;
&lt;p&gt;It works!&lt;/p&gt;
&lt;p&gt;That’s it for now - you now have a working REPL to play around with, the ability to install and use libraries, the knowledge to give your programs access to those libraries and run them, and a really good book that’ll take you through everything else you need to know about the Clojure language.&lt;/p&gt;
&lt;h3&gt;The reason I had to write this post&lt;/h3&gt;
&lt;p&gt;Clojure’s still a pretty young language. The community is extremely small relative to e.g. Python’s, and although the core language’s API is (I’m told) remarkably stable, a lot of the tools around it are new and in a state of rapid change. Add on top of that the fact that most of the up-to-date documentation you’ll find has poor SEO - to the degree that a lot of your Google searches will turn up documentation on richhickey.github.com that’s years out of date and deprecated - and you’ll find that getting started from scratch can be a little tricky.&lt;/p&gt;
&lt;p&gt;I hope that this post has helped save you the few weeks of bewilderment that I went through when I was getting started - I promise that the joy of actually programming in Clojure is well worth putting up with these growing pains.&lt;/p&gt;
&lt;h3&gt;Assorted resources&lt;/h3&gt;
&lt;ul&gt;&lt;li&gt;Watch these two lectures by Rich Hickey, the creator of Clojure: &lt;a href="http://www.infoq.com/presentations/Are-We-There-Yet-Rich-Hickey" target="_blank"&gt;“Are We There Yet?”&lt;/a&gt; and &lt;a href="http://www.infoq.com/presentations/Simple-Made-Easy" target="_blank"&gt;“Simple Made Easy”&lt;/a&gt;. In particular, watch the first one three or four times over the course of several months.&lt;/li&gt;
&lt;li&gt;I’ve spent the past few weekends watching a whole lot of Clojure lectures. The &lt;a href="http://www.youtube.com/clojuretv" target="_blank"&gt;official Clojure youtube channel&lt;/a&gt; is a great resource, and the amount of &lt;a href="http://www.infoq.com/bycategory/contentbycategory.action?idx=3&amp;amp;alias=Clojure&amp;amp;ct=5" target="_blank"&gt;great content on InfoQ &lt;/a&gt;is really astounding, I’ve probably watched at least 25 lectures there.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.clojure-toolbox.com/" target="_blank"&gt;The Clojure Toolbox&lt;/a&gt;, mentioned above.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go" target="_blank"&gt;Where Did Clojure.Contrib Go&lt;/a&gt; - you&amp;#8217;re going to see references to libraries like &amp;#8220;clojure.contrib.monads&amp;#8221; as you explore. clojure.contrib no longer exists, and this page will tell you where the libraries it used to contain have gone.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/technomancy/leiningen/blob/master/sample.project.clj" target="_blank"&gt;This example project.clj&lt;/a&gt; shows you how to take advantage of the thousand different hooks Leiningen provides for customizing how your project is built and run.&lt;/li&gt;
&lt;li&gt;Assorted core members of the Clojure community worth following on Twitter: @cgrand, @cemerick, @marick, @weavejester, @stuartsierra, @seancorfield, @Baranonsky, @richhickey&lt;/li&gt;
&lt;li&gt;Read &lt;a href="http://joyofclojure.com/" target="_blank"&gt;&amp;#8220;The Joy of Clojure&amp;#8221;&lt;/a&gt; once you&amp;#8217;re done with &amp;#8220;Clojure Programming&amp;#8221;.&lt;/li&gt;
&lt;li&gt;Heads up - Noir is deprecated. Use Compojure instead.&lt;/li&gt;
&lt;/ul&gt;</description><link>http://jrheard.tumblr.com/post/40024238467</link><guid>http://jrheard.tumblr.com/post/40024238467</guid><pubDate>Tue, 08 Jan 2013 10:27:00 -0800</pubDate><category>clojure</category></item><item><title>"It takes an awful lot of work to be the sixth most impressive thing Scoble (or the New York Times,..."</title><description>“It takes an awful lot of work to be the sixth most impressive thing Scoble (or the New York Times, or Techcrunch, or $PICK_A_GATEKEEPER) will see this week. It takes much, much less work to offer a better user experience than a) an Excel spreadsheet sent over email, b) having your office manager act as the endpoint to a REST API, or c) doing anything involving actual paper.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;patio11&lt;/em&gt;</description><link>http://jrheard.tumblr.com/post/12886713325</link><guid>http://jrheard.tumblr.com/post/12886713325</guid><pubDate>Wed, 16 Nov 2011 10:00:47 -0800</pubDate></item><item><title>dropping all tables on postgres using flask-sqlalchemy</title><description>&lt;p&gt;Archiving this so I don&amp;#8217;t forget it: in Flask-SQLAlchemy on a Postgres DB, db.drop_all() can fail silently. This can be somewhat infuriating.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.luckydonkey.com/2007/11/23/postgresql-sqlalchemy-dropping-all-tables-and-sequences/" target="_blank"&gt;This link&lt;/a&gt; sums up the situation pretty well. There are a bunch of hacky fixes floating around Google, none of which work, except for a particularly simple one which Mike Bayer himself proposes in the comments of that same link:&lt;/p&gt;
&lt;pre class="jrheard-code"&gt;db.reflect()
db.drop_all()
&lt;/pre&gt;
&lt;p&gt;db.reflect() is the secret sauce that makes the drop operation work. Which makes sense, I guess.&lt;/p&gt;
&lt;p&gt;The catch is that db.reflect() is &lt;a href="https://github.com/mitsuhiko/flask-sqlalchemy/issues/53" target="_blank"&gt;100% broken&lt;/a&gt; in the current version of Flask-SQLAlchemy. Hopefully that gets fixed soon. In any case, if anyone else is living in a world where db.drop_all() doesn&amp;#8217;t drop any of their tables: call db.reflect() first.&lt;/p&gt;</description><link>http://jrheard.tumblr.com/post/12759432733</link><guid>http://jrheard.tumblr.com/post/12759432733</guid><pubDate>Sun, 13 Nov 2011 14:53:00 -0800</pubDate></item><item><title>How to add a free shared PostgreSQL db to your python app running on Heroku</title><description>&lt;p&gt;Heroku&amp;#8217;s documentation claims that &lt;a href="http://devcenter.heroku.com/articles/database" target="_blank"&gt;&amp;#8220;New apps created on Heroku automatically have a shared database installed.&amp;#8221;&lt;/a&gt; Unfortunately, that isn&amp;#8217;t at all true for Flask apps: if you create a new Flask app on Heroku, you don&amp;#8217;t have any database at all by default.&lt;/p&gt;
&lt;p&gt;I spent a couple of hours Googling and digging through documentation to try to figure out how to get a database for my app to use, and was finally helped out by user &lt;strong&gt;lukemelia&lt;/strong&gt; in #heroku. If you find yourself in the position I was in, here&amp;#8217;s all you need to do:&lt;/p&gt;
&lt;pre class="jrheard-code"&gt;(moody) [jrheard@jrheard:~/envs/moody] (master) $ heroku addons:add shared-database:5mb
-----&amp;gt; Adding shared-database:5mb to moody... done, v11 (free)&lt;/pre&gt;
&lt;p&gt;Problem solved.&lt;/p&gt;</description><link>http://jrheard.tumblr.com/post/12433205552</link><guid>http://jrheard.tumblr.com/post/12433205552</guid><pubDate>Sun, 06 Nov 2011 12:25:00 -0800</pubDate></item><item><title>a personal fitbit dashboard</title><description>&lt;p&gt;I bought a &lt;a href="http://fitbit.com" target="_blank"&gt;Fitbit&lt;/a&gt; in July, and ever since, I&amp;#8217;ve been walking a lot. I walk home from work most nights, and on the weekends I like to walk to the ocean. I&amp;#8217;ve been trying to walk fifty miles a week for the past few months, and I&amp;#8217;ve hit that goal most of those weeks.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m doing mainly because the Fitbit universe is made of progress bars, and if you put a progress bar in front of me, I will walk on hot coals if it&amp;#8217;ll make the thing move a little bit to the right.&lt;/p&gt;
&lt;p&gt;This is a snippet of what the main Fitbit web interface looks like:&lt;/p&gt;
&lt;p&gt;&lt;img alt="fitbit dashboard" height="464" src="https://img.skitch.com/20111103-n31k9aup8ymbjp297cjs8wugta.jpg" width="750"/&gt;&lt;/p&gt;
&lt;p&gt;You&amp;#8217;ll note that the dang thing is &lt;strong&gt;covered&lt;/strong&gt; in progress bars. I&amp;#8217;m helpless here.&lt;/p&gt;
&lt;p&gt;The most important progress bar is the one in the top right: the weekly mileage goal. When I first got the gadget, I sort of just started walking a lot, and found that I could hit 35 miles per week without too much effort. From there, I just kept bumping up the goal until it actually took a little bit of work to reach, and now it&amp;#8217;s set to 50. Also, 50&amp;#8217;s a nice round number, so that was probably a factor too.&lt;/p&gt;
&lt;p&gt;The thing is, since the weekly progress bar resets at midnight on Monday morning, if I don&amp;#8217;t remember to check the thing before I go to bed on Sunday, I&amp;#8217;ll have no idea whether or not I hit that weekly goal. That&amp;#8217;s where the weekly Fitbit progress report email comes in:&lt;/p&gt;
&lt;p&gt;&lt;img alt="weekly email" height="598" src="https://img.skitch.com/20111103-1uqux2exu8i56wfgkbbscr822p.jpg" width="750"/&gt; &lt;/p&gt;
&lt;p&gt;So that&amp;#8217;s pretty cool: every Monday afternoon, I get a pretty email that tells me whether or not I hit my weekly goal. Hunky-dory. In fact, I really much prefer the weekly email to the current Fitbit dashboard. Look at the font size on those numbers!&lt;/p&gt;
&lt;p&gt;After a few weeks, I found myself wishing for a Fitbit web dashboard that was a lot more like the weekly email, with big numbers, a focus on how much you&amp;#8217;ve accomplished so far this week, and what you&amp;#8217;d need to do for the rest of the week in order to meet your goal.&lt;/p&gt;
&lt;p&gt;So I built one. It&amp;#8217;s really simple.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://jrheard.com/fitbit" target="_blank"&gt;&lt;img alt="image" height="378" src="https://img.skitch.com/20111103-maf3kt9g7rrpgd3y8nyeqfgqt9.jpg" width="750"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I have a cron job that updates this data every few hours, and always leave a tab open on this page so I can see where I&amp;#8217;m at at any given point during the week. Take a look at what it looks like &lt;a href="http://jrheard.com/fitbit/wednesday.html" target="_blank"&gt;midway through the week&lt;/a&gt;, when I&amp;#8217;ve still got lots of work left to do, or &lt;a href="http://jrheard.com/fitbit/sunday.html" target="_blank"&gt;on a Sunday&lt;/a&gt;  of a particularly productive week.&lt;/p&gt;
&lt;h3&gt;Code Notes&lt;/h3&gt;
&lt;p&gt;If you&amp;#8217;re a Fitbit user and want to use this thing yourself, feel free: the full source code for this dashboard is available at &lt;a href="http://github.com/jrheard/fitbit" target="_blank"&gt;github.com/jrheard/fitbit&lt;/a&gt;. The two files where the meat of the work is done are &lt;a href="https://github.com/jrheard/fitbit/blob/master/fitbit.py" target="_blank"&gt;fitbit.py&lt;/a&gt; and &lt;a href="https://github.com/jrheard/fitbit/blob/master/index.tmpl" target="_blank"&gt;index.tmpl&lt;/a&gt;; I wrote this as a one-off side project in a weekend, so this isn&amp;#8217;t exactly production code - prepare yourself for &amp;lt;table&amp;gt; tags and a constant named DISTANCE_TO_PORTLAND.&lt;/p&gt;
&lt;p&gt;When I made this thing, I was under the impression that Fitbit didn&amp;#8217;t have a web API, so I approximated one by just scraping a few logged-in pages. On further reading, it looks like they &lt;strong&gt;do&lt;/strong&gt; in fact&lt;a href="https://wiki.fitbit.com/display/API/Resource-Access-API" target="_blank"&gt; have an API &lt;/a&gt;that would have probably given me the information I needed, but it&amp;#8217;s sort of unintuitively named and didn&amp;#8217;t jump out at me when I was browsing their developer site. Oh well!&lt;/p&gt;
&lt;p&gt;This was my first time playing with the &lt;a href="http://www.makotemplates.org/" target="_blank"&gt;Mako&lt;/a&gt; templating engine. Overall, I was pretty pleased with how simple it was: I like the general flow of &amp;#8220;come up with a dict of key/value pairs, feed it to the template, there is no third step.&amp;#8221; Simple is good.&lt;/p&gt;
&lt;p&gt;This was also my first time using the python &lt;a href="http://docs.python-requests.org/en/latest/index.html" target="_blank"&gt;Requests&lt;/a&gt; library, which proved to be pretty indispensable. Its session object let me log in on fitbit.com and then stay logged in while I made requests to other pages in order to retrieve additional information, which would have been a pain to do with urllib. The relevant code looks something like this:&lt;/p&gt;
&lt;pre class="jrheard-code"&gt;import requests

with requests.session() as session:
  # log in
  session.post('https://fitbit.com/login', data={'username': 'foo', 'password': 'bar'})

  # remain logged in by continuing to use the same session object to make further requests
  response = session.get('http://www.fitbit.com/my_personal_info')
  print response.content
&lt;/pre&gt;
&lt;p&gt;&lt;a href="http://pypi.python.org/pypi/pyquery" target="_blank"&gt;PyQuery&lt;/a&gt; came in handy as always - I think I&amp;#8217;ve used it in at least half of my random side projects at this point. Beats the hell out of BeautifulSoup. &lt;/p&gt;
&lt;p&gt;That&amp;#8217;s about it for this post. Major props to the Fitbit team for building a neat product that&amp;#8217;s keeping me healthy and giving me an excuse to explore the city I live in. Hit me up on twitter at &lt;a href="http://twitter.com/jrheard" target="_blank"&gt;@jrheard&lt;/a&gt; if you&amp;#8217;ve got any suggestions for a killer feature I left out of the dashboard.&lt;/p&gt;</description><link>http://jrheard.tumblr.com/post/12287378182</link><guid>http://jrheard.tumblr.com/post/12287378182</guid><pubDate>Thu, 03 Nov 2011 09:47:00 -0700</pubDate></item><item><title>"Another thing, very important for problem solving, is asking my colleagues, “How would you..."</title><description>“&lt;p&gt;Another thing, very important for problem solving, is asking my colleagues, “How would you solve this?”&lt;/p&gt;

&lt;p&gt;It happens so many times that you go to them and you say, “I’ve been wondering about whether I should do it this way or that way. I’ve got to choose between A and B,” and you describe A and B to them and then halfway through that you go, “Yeah, B. Thank you, thank you very much.”&lt;/p&gt;”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;Joe Armstrong, inventor of Erlang&lt;/em&gt;</description><link>http://jrheard.tumblr.com/post/11488239312</link><guid>http://jrheard.tumblr.com/post/11488239312</guid><pubDate>Sat, 15 Oct 2011 12:06:31 -0700</pubDate></item><item><title>"By and large, writing code is more essay than puzzle."</title><description>“By and large, writing code is more essay than puzzle.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;a href="http://duartes.org/gustavo/blog/post/lucky-to-be-a-programmer" target="_blank"&gt;http://duartes.org/gustavo/blog/post/lucky-to-be-a-programmer&lt;/a&gt;&lt;/em&gt;</description><link>http://jrheard.tumblr.com/post/3906040332</link><guid>http://jrheard.tumblr.com/post/3906040332</guid><pubDate>Wed, 16 Mar 2011 14:50:42 -0700</pubDate></item><item><title>Photo</title><description>&lt;img src="http://24.media.tumblr.com/tumblr_le8aomyo401qb4d1jo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;</description><link>http://jrheard.tumblr.com/post/2523902388</link><guid>http://jrheard.tumblr.com/post/2523902388</guid><pubDate>Wed, 29 Dec 2010 22:43:34 -0800</pubDate></item><item><title>me: just got into work, just glanced at the last couple of lines i typed before leaving last night&#13;</title><description>me: just got into work, just glanced at the last couple of lines i typed before leaving last night&lt;br /&gt;&#13;
me: [jrheard@dev09:~/pg/loc] (category_ordering)  $ grep -ir f[u+]ck *&lt;br /&gt;&#13;
me: ai/trie/ctrie.pyx:              #   "If your strings are longer than 1024, why the fuck are you using a trie?"&lt;br /&gt;&#13;
me: ctrl-C'd before it got farther than that, evidently&lt;br /&gt;&#13;
pepper: haha&lt;br /&gt;&#13;
pepper: ha&lt;br /&gt;&#13;
pepper: haha&lt;br /&gt;&#13;
pepper: if you did that to the microsoft word code, i put a "gimme a fucking console biotch" in there somewhere</description><link>http://jrheard.tumblr.com/post/1526382614</link><guid>http://jrheard.tumblr.com/post/1526382614</guid><pubDate>Tue, 09 Nov 2010 10:27:57 -0800</pubDate></item><item><title>know thyself</title><description>&lt;p&gt;i&amp;#8217;ve been working on a completely friggin&amp;#8217; awesome project with a couple of really smart guys for the past couple of months. as agreed, i split off from the development of the primary aspect of the project a couple of weeks ago in order to focus exclusively on creating its social-network-esque website counterpart, with my teammates continuing to work on preparing the main part of the project for its upcoming 1.0 release.&lt;/p&gt;
&lt;p&gt;so, as a result, i&amp;#8217;ve been working as the sole committer on a separate (and private, thankyouverymuch) github repo for the past couple of weeks. as it turns out, one neat feature that github has is the ability to show you really cool graphs about your repository, among them the &amp;#8220;punchcard&amp;#8221; graph, which plots your project&amp;#8217;s commit activity over a period of time.&lt;/p&gt;
&lt;p&gt;&lt;img alt="my coding habits" src="http://img.skitch.com/20100519-rkt27waph5tjfw3n5ta4hmrcpb.jpg" height="321" width="750"/&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;that&amp;#8217;s me up there&lt;/strong&gt;. those are my sleeping habits, my working habits, my partying habits, over the course of two weeks. the bigger the dots are, the more i worked at that intersection of day and hour.&lt;/p&gt;
&lt;p&gt;that is &lt;strong&gt;so wild.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;equally wild is the fact that the main project - the one that jhurwich and &lt;a href="http://danielmacdougall.com/" target="_blank"&gt;dmacdougall&lt;/a&gt; are still hard at work on finishing up (and which my buddy &lt;a href="http://jackiengo.com/" target="_blank"&gt;jackie&lt;/a&gt; is busily designing a few icons for) - has eerie, unintended parallels with this Punchcard graph thing: it&amp;#8217;ll also tell you a whole lot that you may not have known about yourself and your habits, albeit in a completely different way. even though that wasn&amp;#8217;t really what we had intended. at all. more on that in a couple of weeks.&lt;/p&gt;</description><link>http://jrheard.tumblr.com/post/612292836</link><guid>http://jrheard.tumblr.com/post/612292836</guid><pubDate>Tue, 18 May 2010 22:20:00 -0700</pubDate></item><item><title>seven more albums of awesome coding/studying music</title><description>&lt;p&gt;&lt;a href="http://jrheard.com/music/mice_parade.zip" target="_blank"&gt;http://jrheard.com/music/mice_parade.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.last.fm/music/Mice+Parade" target="_blank"&gt;http://www.last.fm/music/Mice+Parade&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;bem-vinda vontade&amp;#8217;s my favorite.&lt;/p&gt;</description><link>http://jrheard.tumblr.com/post/455907399</link><guid>http://jrheard.tumblr.com/post/455907399</guid><pubDate>Wed, 17 Mar 2010 21:09:19 -0700</pubDate></item><item><title>snippets from the craigslist computer gigs RSS feed</title><description>&lt;blockquote&gt;In return for assistance, you will receive the following:&lt;br/&gt;&lt;br/&gt; * improved resume&lt;/blockquote&gt;
&lt;p&gt;-&lt;/p&gt;
&lt;blockquote&gt;I am looking for the best of the best with JAVA skills. I need Architects, Engineers, BI/Data Modeling guys, UI and even predictive engine engineer. This is a big deal. I dont think this level of brain will be looking on here&amp;#8230;. but I do think that some of us who know these elite top 1%&amp;#8217;ers might be on here. SO, if you can refer me to a genius, and it results in a hire I will give you a $1,000 referral fee. It is that simple.&lt;/blockquote&gt;
&lt;p&gt;-&lt;/p&gt;
&lt;blockquote&gt;I have an outdated website and am looking to have a new one built. I am offering trade for yoga therapy/ and or therapeutic massage therapy. I would like to find someone who is a yogi and or marketing expert who at least understands the industry. [&amp;#8230;] Afterall isnt that the point is for people to find us on the web? I am clear about what I would like to have, this includes a you tube video of my work on the website, a blog, and equipped to be found on twitter, facebook, a schedule,etc. I have new artwork of a logo I would like to have built in so this would be helpful if someone understands graphics and how to get the art work into digital form that can be used as a template for the website or used in the website somehow.&lt;/blockquote&gt;
&lt;p&gt;-&lt;/p&gt;
&lt;blockquote&gt;We need and intern to help with a quick / powerpoint / Apple Keynote Presentation.&lt;br/&gt;&lt;br/&gt;This is an unpaid intern gig for a new media group. (Lots of people we tried just did not have the skills.&lt;br/&gt;&lt;br/&gt;But if your presentation rocks we will hire you on a project basis for the next gig and we have plenty in the pipeline!!&lt;br/&gt;&lt;br/&gt;Please send resume with a cover letter imbeded in the response. No cover letter&lt;br/&gt;(Their is a dude from Mumbai that just sends resumes to everyone and the SPAM is killing us._&lt;/blockquote&gt;
&lt;p&gt;-&lt;/p&gt;
&lt;blockquote&gt;We would love to be your first client and would gladly advertise your services!&lt;br/&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;br/&gt;&lt;br/&gt;&lt;/p&gt;</description><link>http://jrheard.tumblr.com/post/441532655</link><guid>http://jrheard.tumblr.com/post/441532655</guid><pubDate>Thu, 11 Mar 2010 10:00:00 -0800</pubDate></item><item><title>on functional programming</title><description>&lt;h3&gt;an eye-opening comment&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;b&gt;Our programming model does  not have to match how our computer works.&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;I think one of the biggest intellectual hurdles with  functional programming is that we know, deep down, that &lt;b&gt;modern computers  don&amp;#8217;t work like that&lt;/b&gt;. They do have side-effects and changing, carried  state. It&amp;#8217;s a revelation to realize that the programming model you use  to write programs doesn&amp;#8217;t have to match how the computations will be  physically carried out.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;- HN user &lt;a href="http://news.ycombinator.com/user?id=scott_s" target="_blank"&gt;scott_s&lt;/a&gt; in response to &lt;a href="http://news.ycombinator.com/item?id=1173854" target="_blank"&gt;Ask HN: Functional Programming Differences&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;this is a concept i&amp;#8217;m still coming to terms with.&lt;/h3&gt;
&lt;p&gt;a few weeks ago, brian carper wrote &lt;a href="http://briancarper.net/blog/making-an-rpg-in-clojure-part-one-of-many" target="_blank"&gt;an article&lt;/a&gt; in which he detailed the process he was going through while writing a final-fantasy-style RPG in clojure, from scratch, despite his oft-repeated assertion that he had &amp;#8220;no idea what i&amp;#8217;m doing.&amp;#8221; one of the things about his writeup that came pretty close to blowing my mind was the way in which the game world was handled in functional-programming-land.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I&amp;#8217;m sometimes amazed how far I can get before I need mutable state at  all.  The vast majority of my functions &lt;b&gt;take a world value&lt;/b&gt; (a plain old  hash-map) as an argument, and &lt;b&gt;return a new world value&lt;/b&gt; after making  changes to it.  The current state of the world is whatever value is  currently in the global WORLD ref.&lt;/p&gt;
&lt;p&gt;The render loop grabs a snapshot of the world from the ref on each  iteration, and then draws it.  Thanks to Clojure refs, the snapshot of  the world is guaranteed to be consistent (e.g. no NPC objects in the  middle of mutating themselves) and persistent (the world value sticks  around as long as the renderer needs it, even if the WORLD ref is  changing in another thread).  &lt;b&gt;Once it&amp;#8217;s been drawn, the renderer throws  the world snapshot away and it&amp;#8217;s garbage-collected later&lt;/b&gt;.&lt;/p&gt;
&lt;p&gt;This all happens around 50-100 times per second in my game, and  there&amp;#8217;s &lt;b&gt;no noticeable lag&lt;/b&gt;.  So that&amp;#8217;s a good thing.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;wait a second. he&amp;#8217;s passing &lt;b&gt;the entire game world&lt;/b&gt; into most of his functions, and that&amp;#8217;s still cool?&lt;/p&gt;
&lt;h3&gt;what the hell?&lt;/h3&gt;
&lt;p&gt;i&amp;#8217;ve spent most of my past four years at stanford — and, hell, most of my life as a programmer — learning that this is basically the complete opposite of what you&amp;#8217;re ever supposed to do, ever, because on the face of it, it looks like you&amp;#8217;re wasting more resources than a Goddamned Hummer. i thought it was supposed to be &lt;a href="http://www.eflorenzano.com/blog/post/its-caches-all-way-down/" target="_blank"&gt;caches all the way down!&lt;/a&gt; aren&amp;#8217;t you supposed to cache the game world and just make incremental updates to the parts that change? doesn&amp;#8217;t throwing away a hundred copies a second waste incredible amounts of memory and put holes in the ozone layer?&lt;/p&gt;
&lt;p&gt;but, soft!&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Our programming model does  not have to match how our computer works.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;oh! hm. right. &lt;b&gt;the mother of all abstractions.&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;i haven&amp;#8217;t done any functional programming yet, but thanks to brian and scott, i&amp;#8217;m making it a resolution to finally &lt;a href="http://learnyouahaskell.com/" target="_blank"&gt;learn me a haskell&lt;/a&gt; before the year&amp;#8217;s out. or a clojure, or something.&lt;/p&gt;
&lt;h3&gt;update:&lt;/h3&gt;
&lt;p&gt;in the &lt;a href="http://www.reddit.com/r/programming/comments/baqqz/reconciling_functional_programming_with_the/" target="_blank"&gt;comment thread on proggit&lt;/a&gt;, user &lt;a href="http://www.reddit.com/user/radarsat1" target="_blank"&gt;radarsat1&lt;/a&gt; has a really eloquently put take on the situation:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;[one] misconception [here] is that seeing the whole world is &lt;i&gt;bad&lt;/i&gt;.  Think  about &lt;i&gt;why&lt;/i&gt; it&amp;#8217;s considered bad practice in C or C++ to have  singletons and globals, and to pass in large data structures to  functions.&lt;b&gt; It&amp;#8217;s because each and every function has the potential to  modify the world&lt;/b&gt;, and therefore strange interactions can occur that  later on will be difficult to trace and think about.  In purely  functional programming, if a function is passed the whole world, big  deal.. it&amp;#8217;s read-only.  What harm can it do?  We can know apriori that  it&amp;#8217;s not going to upset any major data structures or cause race  conditions, etc.  So passing in the world is not as big a problem in FP.&lt;/p&gt;
&lt;p&gt;Personally I&amp;#8217;m also very young in my understanding of FP, but I&amp;#8217;m slowly  learning to think functionally, and you really need to&lt;b&gt; reconsider many  of the &amp;#8220;golden rules&amp;#8221;&lt;/b&gt; about how to manage your code that you&amp;#8217;ve learned  to abide in order to keep things tractable in the long term.  &lt;b&gt;Many of  them simply cease to apply when you have immutability on your side.&lt;/b&gt;&lt;/p&gt;
&lt;/blockquote&gt;</description><link>http://jrheard.tumblr.com/post/434828204</link><guid>http://jrheard.tumblr.com/post/434828204</guid><pubDate>Mon, 08 Mar 2010 08:00:00 -0800</pubDate></item><item><title>you - yes, you! - can teach yourself how to program.</title><description>&lt;h3&gt;in the beginning was the question&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;do you think it&amp;#8217;s possible to teach yourself programming?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;a friend of mine asked me that a couple of nights ago, to my delight. my answer, of course, was&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;hell yes!&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;as a matter of fact, &lt;b&gt;any self-respecting programmer you&amp;#8217;ve ever met &lt;/b&gt;is mostly self-taught. that&amp;#8217;s because as soon as a neophyte starts coding, they find out that it&amp;#8217;s &lt;b&gt;really fun&lt;/b&gt;, so they want to learn how to do more of it and get better at it, and they find out pretty quick that there are &lt;a href="http://stackoverflow.com" target="_blank"&gt;plenty&lt;/a&gt; of &lt;a href="http://hackernews.com" target="_blank"&gt;ways&lt;/a&gt; to &lt;a href="http://www.reddit.com/r/programming" target="_blank"&gt;do that&lt;/a&gt; on their own, teachers be damned. as another friend of mine put it after spending a week learning how to program for the first time:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;yeah, now i get why you guys code all the time. it&amp;#8217;s like playing a bunch of little games!&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;programming&amp;#8217;s all about solving problems and making things. hell, it&amp;#8217;s about making things that solve problems! how cool is that?&lt;/p&gt;
&lt;h3&gt;the problem&lt;/h3&gt;
&lt;p&gt;the only catch was, i didn&amp;#8217;t have a handy &amp;#8220;learn to program!&amp;#8221; link to direct her to. there are a lot of great resources out there, but i&amp;#8217;ve never found that one single link that i felt really gave the right amount of information to someone starting &lt;b&gt;completely from scratch&lt;/b&gt;.&lt;/p&gt;
&lt;p&gt;the &amp;#8220;completely from scratch&amp;#8221; part is really important. most of the intro-to-programming guides i&amp;#8217;ve seen are written for an audience of born techies who don&amp;#8217;t mind spending a couple hours learning about the lambda calculus. most of the people who&amp;#8217;ve asked me how to teach themselves to program are not in that demographic.&lt;/p&gt;
&lt;h3&gt;the solution&lt;/h3&gt;
&lt;p&gt;so, i sent her an email, which i hope she&amp;#8217;ll find useful. she&amp;#8217;s not the first person to ask me the question that spawned all this, so i figured that i might know some other folks who might find it useful too, which brings us to this post. so, without further ado:&lt;/p&gt;
&lt;h3&gt;the email&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;b&gt;programming is the best.&lt;/b&gt;&lt;br/&gt;&lt;br/&gt;once there was a man known to the world  only as &lt;b&gt;_why the lucky stiff&lt;/b&gt;. his main goal in life was to teach as many  people as possible how much fun coding is. he was a hero of mine, and i can  tell you all about him sometime, but for now all you need to know is  that he produced a bunch of projects related to learning about  programming.&lt;br/&gt;&lt;br/&gt;i&amp;#8217;d recommend you start your career with &lt;a href="http://mislav.uniqpath.com/poignant-guide/" target="_blank"&gt;_why&amp;#8217;s poignant guide to  ruby&lt;/a&gt;. he was a pretty insane person, so it starts off a little weird, but  just trust me on this, it is worth reading and is one of the best intros  to coding i&amp;#8217;ve seen. if you have any questions about anything you read  that you don&amp;#8217;t quite get, ask me! i love to talk about this shit. &lt;br/&gt;&lt;br/&gt;if you&amp;#8217;d like a slightly more interactive learning-thing, you should  check out &lt;a target="_blank" href="http://tryruby.org/"&gt;try ruby&lt;/a&gt; , another of _why&amp;#8217;s projects. just go there and type &amp;#8220;help&amp;#8221; like it  says in the info-box-thing, and it&amp;#8217;ll start a nice little walkthrough  which lets you try out some actual ruby code.&lt;br/&gt;&lt;br/&gt;you&amp;#8217;re gonna be learning how to write &lt;b&gt;ruby&lt;/b&gt; code through those  resources. ruby is a programming language, and is one of many; it&amp;#8217;s  great for learning on because it closely resembles english most of the  time, but it&amp;#8217;s powerful enough that a bunch of really big web sites and  other projects are written in it. &lt;br/&gt;&lt;br/&gt;if you&amp;#8217;d like to&lt;b&gt; try writing some ruby code on your own&lt;/b&gt; after making  it through the first five or ten minutes of either of those links, &lt;b&gt;you  can!&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;you&amp;#8217;re a college student, so i know you&amp;#8217;ve got a laptop running mac os x - bring up spotlight (the magnifying glass in the top-right corner of  your screen) and type &amp;#8220;terminal&amp;#8221;. open the terminal program that shows  up in the search results. now, just type &amp;#8220;irb&amp;#8221; without the quotes, and  hit enter.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;irb&lt;/b&gt; means &amp;#8220;interactive ruby,&amp;#8221; and when you run it, you&amp;#8217;re all  of a sudden in ruby-land! at this point, you can write ruby code to  tell your computer to do anything you want, and it&amp;#8217;ll do it! for  example:  &lt;code&gt;&amp;gt;&amp;gt; 5.times { puts "reba is learning to code!" }&lt;br/&gt;reba is  learning to code!&lt;br/&gt;reba is learning to code!&lt;br/&gt;reba is learning to  code!&lt;br/&gt;reba is learning to code!&lt;br/&gt;reba is learning to code!&lt;br/&gt;=&amp;gt;  5 &lt;br/&gt;&lt;br/&gt;&amp;gt;&amp;gt; "reba!".upcase&lt;br/&gt;=&amp;gt; "REBA!"&lt;/code&gt; mess  around, try out the concepts you learn in those links. try assigning  stuff to variables, try writing functions. for example:&lt;code&gt;&amp;gt;&amp;gt;  def hello(name)&lt;br/&gt; &amp;gt;&amp;gt;      puts "hello " + name + "!"&lt;br/&gt;&amp;gt;&amp;gt; end&lt;br/&gt;=&amp;gt; nil&lt;br/&gt;&lt;br/&gt;&amp;gt;&amp;gt;  hello('reba')&lt;br/&gt;hello reba!&lt;br/&gt;=&amp;gt; nil&lt;/code&gt;coding is all about  taking small building blocks like these and making really cool things  out of them, which you&amp;#8217;ll see if you read the poignant guide. matter of fact, i&amp;#8217;d be willing to bet that we could take the concepts you learn in the first three or four chapters of the poignant guide and immediately apply them to make little ruby scripts that&amp;#8217;ll &lt;b&gt;improve your life by doing chores for you&lt;/b&gt;: calculating reimbursement checks, figuring out the perfect classes to take so you maximize the amount of fun you have while minimizing the amount of work you do, that sort of thing.&lt;/p&gt;
&lt;p&gt;so: check out those places, mess around in irb, let me know when you  run out of things to do or if those links aren&amp;#8217;t making sense to you or  if there&amp;#8217;s anything else you&amp;#8217;re curious about!&lt;/p&gt;
&lt;p&gt;programming is the best.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;the moral&lt;/h3&gt;
&lt;p&gt;that all applies to you, too, dear reader. check out those links, try playing around with irb, and for god&amp;#8217;s sake &lt;a href="http://jrheard.com" target="_blank"&gt;contact me&lt;/a&gt; if you have any trouble. if you&amp;#8217;d like to move past the examples in the poignant guide and start writing handy little programs of your very own, i might even write a follow-up to this post with some more advice. stranger things have happened.&lt;/p&gt;</description><link>http://jrheard.tumblr.com/post/421656059</link><guid>http://jrheard.tumblr.com/post/421656059</guid><pubDate>Tue, 02 Mar 2010 12:07:00 -0800</pubDate><category>programming</category><category>essay</category></item><item><title>"What if the reason you engage in practical activities has nothing to do with your ability to reason,..."</title><description>“What if the reason you engage in practical activities has nothing to do with your ability to reason, and everything to do with being lucky that your particular brand of crazy has some utility?”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;a href="http://dilbert.com/blog/entry/crazy_or_disciplined/" target="_blank"&gt;http://dilbert.com/blog/entry/crazy_or_disciplined/&lt;/a&gt;&lt;/em&gt;</description><link>http://jrheard.tumblr.com/post/422427050</link><guid>http://jrheard.tumblr.com/post/422427050</guid><pubDate>Tue, 02 Mar 2010 11:02:39 -0800</pubDate></item><item><title>http://wvs.topleftpixel.com/10/02/26/</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_kyh8ksrtOj1qb4d1jo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a href="http://wvs.topleftpixel.com/10/02/26/" target="_blank"&gt;http://wvs.topleftpixel.com/10/02/26/&lt;/a&gt;&lt;/p&gt;</description><link>http://jrheard.tumblr.com/post/414336052</link><guid>http://jrheard.tumblr.com/post/414336052</guid><pubDate>Fri, 26 Feb 2010 17:38:00 -0800</pubDate></item><item><title>snippets from the weekly stanford CS job digest</title><description>&lt;p&gt;this is probably gonna be a regular thing. i think i’m gonna be grabbing chunks that make me smile from this weekly email i get and posting them here; i’ll refrain from commentary.&lt;/p&gt;
&lt;p&gt;-&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Job  Requirement # 2010-001&lt;/p&gt;
&lt;p&gt;The ideal  candidate is a current student in an engineering/computer science field, with strong expertise  in C++, Data Structures, Socket and Thread Programming.&lt;/p&gt;
&lt;p&gt;Apart from  the great experience and a chance to contribute and grow with a start-up at its early stage, we  would provide monetary compensation for your efforts (paid on an hourly  basis).&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;-&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;span&gt;You will be compensated with equity, but we  are also willing to consider a negotiable fixed fee / cash compensation.  The position  does not currently offer a salary, so it will be up to us, as a team to  create the revenue needed to pay ourselves.&lt;/span&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;-&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The Applications Developer is responsible for  the development, maintenance, support, secure coding practices and  enhancement of Autonomy Interwoven business applications under the direction of the  Manager of Corporate Applications&lt;/p&gt;
&lt;p&gt;Experience  required:&lt;/p&gt;
&lt;p&gt;* Excellent Verbal and  Written Skills – must be able to demonstrate.&lt;/p&gt;
&lt;/blockquote&gt;</description><link>http://jrheard.tumblr.com/post/413682115</link><guid>http://jrheard.tumblr.com/post/413682115</guid><pubDate>Fri, 26 Feb 2010 10:51:22 -0800</pubDate></item><item><title>How to use rsync to upload big files to HostGator boxes</title><description>&lt;p&gt;tossing a few large .zips up on my HostGator account, and Fetch just isn&amp;#8217;t cutting it, my connection drops every so often and the transfer has to start all over again. scp won&amp;#8217;t do the trick either.&lt;/p&gt;
&lt;p&gt;the secret sauce: rsync &amp;#8212;partial, with &amp;#8212;rsh=&amp;#8217;ssh -p2222&amp;#8217; because HostGator uses port 2222 (rather than the standard port 22) for SSH connections. an example:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;[jrheard@jrheard:~]$rsync --partial --progress --rsh='ssh -p2222' very_large_archive.zip jrheard@jrheard.com:~/www/music/&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;de-licious.&lt;/p&gt;</description><link>http://jrheard.tumblr.com/post/410816799</link><guid>http://jrheard.tumblr.com/post/410816799</guid><pubDate>Thu, 25 Feb 2010 00:18:00 -0800</pubDate></item><item><title>Video</title><description>&lt;iframe width="400" height="299" src="http://www.youtube.com/embed/6VAkOhXIsI0?wmode=transparent&amp;autohide=1&amp;egm=0&amp;hd=1&amp;iv_load_policy=3&amp;modestbranding=1&amp;rel=0&amp;showinfo=0&amp;showsearch=0" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;&lt;br/&gt;&lt;br/&gt;</description><link>http://jrheard.tumblr.com/post/407921481</link><guid>http://jrheard.tumblr.com/post/407921481</guid><pubDate>Tue, 23 Feb 2010 16:35:39 -0800</pubDate></item></channel></rss>
