<?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></description><title>John Cromartie's Tumblr</title><generator>Tumblr (3.0; @jcromartie)</generator><link>http://jcromartie.tumblr.com/</link><item><title>iTunes 11 creates UI color scheme from album art</title><description>&lt;p&gt;This is a really awesome touch in iTunes 11. The effect was so seamless and well-done that it took me this long to notice.&lt;/p&gt;

&lt;p&gt;&lt;img src="http://i.imgur.com/go9J7h.png" alt="Daft Punk Alive automatically-generated color theme in iTunes 11"/&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src="http://i.imgur.com/Vcb4Ch.png" alt="Buena Vista Social Club automatically-generated color theme in iTunes 11"/&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src="http://i.imgur.com/gLnB3h.png" alt="Brian Eno Ambient 4 automatically-generated color theme in iTunes 11"/&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src="http://i.imgur.com/efeoTh.png" alt="Boards of Canada Music Has the Right to Children automatically-generated color theme in iTunes 11"/&gt;&lt;/p&gt;</description><link>http://jcromartie.tumblr.com/post/37330006626</link><guid>http://jcromartie.tumblr.com/post/37330006626</guid><pubDate>Thu, 06 Dec 2012 08:18:00 -0500</pubDate></item><item><title>Why I'm not Ditching Instapaper for Pocket</title><description>&lt;p&gt;I&amp;#8217;ve been using &lt;a href="http://instapaper.com/"&gt;Instapaper&lt;/a&gt; since 2010. While I really like the service, I&amp;#8217;ve always kept and eye out for worthy replacements.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://getpocket.com/"&gt;Pocket&lt;/a&gt; is &lt;em&gt;Read It Later&lt;/em&gt; after a bit of a rebirth, and is undeniably the sexiest of the boomarklet-based reader apps, with a slick iOS app and a great web interface.&lt;/p&gt;

&lt;p&gt;When you sign up for Pocket you get all of the features it has to offer, presumably forever. That sounds great, right?&lt;/p&gt;

&lt;p&gt;But that&amp;#8217;s actually the biggest thing keeping me from Pocket.&lt;/p&gt;

&lt;p&gt;Instapaper is supported by paid users, while Pocket is VC-backed. This means that, purely by definition, Pocket will &lt;em&gt;only&lt;/em&gt; be around as long as &lt;em&gt;someone other than users&lt;/em&gt; thinks it&amp;#8217;s a good idea.&lt;/p&gt;

&lt;p&gt;Marco could pull the plug on Instapaper for any reason, but at least he has an actual economic incentive to continue the service (for current and subscriber users) and to improve it (to woo future users).&lt;/p&gt;</description><link>http://jcromartie.tumblr.com/post/32888731064</link><guid>http://jcromartie.tumblr.com/post/32888731064</guid><pubDate>Thu, 04 Oct 2012 16:19:49 -0400</pubDate></item><item><title>A Poem for LISPers</title><description>&lt;blockquote&gt;
  &lt;p&gt;MUCH madness is divinest sense &lt;br/&gt;
  To a discerning eye; &lt;br/&gt;
  Much sense the starkest madness.&lt;br/&gt;
  ’T is the majority &lt;br/&gt;
  In this, as all, prevails. &lt;br/&gt;
  Assent, and you are sane; &lt;br/&gt;
  Demur,—you ’re straightway dangerous, &lt;br/&gt;
  And handled with a chain.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;By &lt;a href="http://www.bartleby.com/113/1011.html"&gt;Emily Dickinson&lt;/a&gt;.&lt;/p&gt;</description><link>http://jcromartie.tumblr.com/post/32263770066</link><guid>http://jcromartie.tumblr.com/post/32263770066</guid><pubDate>Tue, 25 Sep 2012 10:52:41 -0400</pubDate></item><item><title>What's so bad about prefix notation?</title><description>&lt;p&gt;One of the common complaints about Lisp is that it forces you to use prefix notation for mathematical expressions. This is a fair complaint, since it&amp;#8217;s a pretty big departure from what we learned in Algebra class.&lt;/p&gt;

&lt;p&gt;But, exactly &lt;em&gt;how bad&lt;/em&gt; is prefix notation, after all? Let&amp;#8217;s start with an example:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;5 + 6 * 7
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;When you read this, in English, as &amp;#8220;five plus six times seven&amp;#8221;, you know exactly what it means assuming you understand the order of operations. It&amp;#8217;s totally clear to anybody familiar with basic math.&lt;/p&gt;

&lt;p&gt;The equivalent in Lisp would be:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;(+ 5 (* 6 7))
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If you try to read this like the above infix expression, you get &amp;#8220;plus five times six seven&amp;#8221;, which doesn&amp;#8217;t make much sense. Maybe we can improve on this by changing our reading.&lt;/p&gt;

&lt;p&gt;What if, instead, we read it as &amp;#8220;the sum of five, and the product of six and seven&amp;#8221;. This is more verbose than the simple left-to-right infix reading, but it&amp;#8217;s also unambiguous.&lt;/p&gt;

&lt;p&gt;Now, let&amp;#8217;s say we have a few more symbols in our expression, and we&amp;#8217;re using more operations:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;(x + y + z + 1) / (b * c * 20)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This is a bit of a tangle compared to our simple expression, but looks a lot like the math you might find in graphics or game code. It&amp;#8217;s not bad at all, but I&amp;#8217;ll leave the &amp;#8220;English&amp;#8221; version as an exercise to the reader.&lt;/p&gt;

&lt;p&gt;Now Lisp:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;(/ (+ x y z 1)
   (* b c 20))
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Here, we see that the &amp;#8220;operators&amp;#8221; in Lisp are actually variadic functions, and eliminate a bunch of infix operators. I&amp;#8217;d say this is a win for clarity.&lt;/p&gt;

&lt;h2&gt;Logic&lt;/h2&gt;

&lt;p&gt;And what about logic? Most programmers are used to reading logical expression much like algebraic expressions:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;if (x &amp;lt; 10 || y &amp;gt; 20) ...
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&amp;#8220;If &lt;em&gt;x&lt;/em&gt; less-than ten, or &lt;em&gt;y&lt;/em&gt; greater-than twenty&amp;#8221; is nice and clear. The Lisp version doesn&amp;#8217;t fare so well:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;(or (&amp;lt; x 10) (&amp;gt; y 20))
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&amp;#8220;Or less-than &lt;em&gt;x&lt;/em&gt; ten, greater-than &lt;em&gt;y&lt;/em&gt; twenty&amp;#8221;.&lt;/p&gt;

&lt;p&gt;&lt;img src="http://i.imgur.com/i6Kz9.jpg" alt="a bewildered-looking owl stares at us"/&gt;&lt;/p&gt;

&lt;p&gt;OK. That sucks.&lt;/p&gt;

&lt;p&gt;But what if we alias some of these functions, and rewrite it as:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;(either? (ascending? x 10) (descending? y 20))
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;By phrasing it in the form of predicates, it becomes a bit clearer (I am not suggesting anybody start writing things with aliases like this&amp;#8230; it&amp;#8217;s just for our example). And, in fact, it might give a hint as the variadic nature of &amp;lt; and &amp;gt; in Lisp. Let&amp;#8217;s look at a larger Boolean expression from a curly-brace language:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;if (0 &amp;lt; x &amp;amp;&amp;amp; x &amp;lt; 10 &amp;amp;&amp;amp; 10 &amp;lt; y &amp;amp;&amp;amp; y &amp;lt; 20) ...
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This expression is already as nicely arranged as it can be, in number-line order. But I wouldn&amp;#8217;t recommend trying to read this out (&amp;#8220;if zero is less than &lt;em&gt;x&lt;/em&gt;, and &lt;em&gt;x&lt;/em&gt; is less than ten, and &amp;#8230;&amp;#8221;). However, in Lisp we can just say:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;(&amp;lt; 0 x 10 y 20)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Or, &amp;#8220;are zero, &lt;em&gt;x&lt;/em&gt;, ten, &lt;em&gt;y&lt;/em&gt;, and twenty in ascending order?&amp;#8221;. That is much better, and suddenly our code is that much closer to the number line style that infix Boolean expressions strive for.&lt;/p&gt;

&lt;h2&gt;Is This Just For Lisp?&lt;/h2&gt;

&lt;p&gt;Of course not! If you are in a language with varargs you can create static methods/functions to implement all of these things. And perhaps you will go ahead and do that now, if these examples have piqued your interest.&lt;/p&gt;

&lt;h2&gt;But What if We Could Keep Infix After All?&lt;/h2&gt;

&lt;p&gt;Now, of course, Lisp is nothing if not putty in the hands of programmers. If you find that something fundamental is missing, or you&amp;#8217;re inventing something for the first time, then you can just extend the language to do whatever you want.&lt;/p&gt;

&lt;p&gt;It turns out that &lt;a href="https://github.com/jbester/cljext/blob/master/cljext/math.clj"&gt;infix notation is just a library&lt;/a&gt; in Lisp. Compare this to adding prefix notation to C#, or adding postfix notation to Java.&lt;/p&gt;</description><link>http://jcromartie.tumblr.com/post/31308575450</link><guid>http://jcromartie.tumblr.com/post/31308575450</guid><pubDate>Mon, 10 Sep 2012 21:33:00 -0400</pubDate></item><item><title>bcrypt is Not the Answer</title><description>&lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/Bcrypt"&gt;bcrypt&lt;/a&gt; and other adaptive hash algoritms are a good idea. It&amp;#8217;s comforting to know that your password hash time can be scaled up as computing power available for brute force cracking increases.&lt;/p&gt;

&lt;p&gt;However, this is an arms race. It&amp;#8217;s reasonable to assume that the power available to crack passwords will increase faster than the power available to initially hash passwords. It&amp;#8217;s better to just avoid this race if possible.&lt;/p&gt;

&lt;p&gt;If bcrypt is widely adopted, and services fail to update bcrypt parameters, then in 10 years those who are still using 2012-CPU-speed-based recommendations will be in exactly the same place as those who use plain SHA1 today: subject to brute force cracking relatively quickly.&lt;/p&gt;

&lt;p&gt;What we need is a hashing algorithm that takes 1 second to compute on 2012 hardware, and 1 second &lt;em&gt;on 2022 hardware&lt;/em&gt;. The algorithm should be dependent on &lt;em&gt;time passing&lt;/em&gt;, rather than &lt;em&gt;time spent computing&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;If we could decouple password hash strength from computing power, and instead make it &lt;em&gt;temporally bound&lt;/em&gt;, then we&amp;#8217;d achieve real password hash security.&lt;/p&gt;

&lt;p&gt;There are probably not a lot of good ways to do this, and I&amp;#8217;ll leave the details up to people who are way smarter than me. But it seems to me that this is a way to avoid a brute-force-cracking arms race and a colossal waste of computing power in the future.&lt;/p&gt;</description><link>http://jcromartie.tumblr.com/post/24677917522</link><guid>http://jcromartie.tumblr.com/post/24677917522</guid><pubDate>Fri, 08 Jun 2012 09:58:00 -0400</pubDate></item><item><title>jQuery plugin for XML namespaces</title><description>&lt;p&gt;If you&amp;#8217;ve ever tried parsing RSS or other XML content using jQuery, you know that it&amp;#8217;s impossible to select elements with a specific namespace. On top of jQuery&amp;#8217;s own selector engine, the browser&amp;#8217;s own selector engine is broken in certain cases, too! So, I rolled a quick solution for this in the form of a plugin: &lt;code&gt;$.fn.findNS&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This lets you find, for instance, a &lt;code&gt;&amp;lt;media:description&amp;gt;&lt;/code&gt; element, like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$(item).findNS("media", "description")
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You can find the code in &lt;a href="https://gist.github.com/2845902"&gt;this gist&lt;/a&gt;.&lt;/p&gt;</description><link>http://jcromartie.tumblr.com/post/24145321902</link><guid>http://jcromartie.tumblr.com/post/24145321902</guid><pubDate>Thu, 31 May 2012 16:19:32 -0400</pubDate></item><item><title>Memoized Blocks in Smalltalk</title><description>&lt;p&gt;I came across &lt;a href="http://objology.blogspot.com/2012/05/tag-memoizedfunctions.html"&gt;this post on memoization in Smalltalk&lt;/a&gt; by way of &lt;a href="http://www.jarober.com/blog/blogView?entry=3514542450"&gt;James Rober&amp;#8217;s blog&lt;/a&gt;, but it was lacking in actual code!&lt;/p&gt;

&lt;p&gt;So, without delay, I fired up &lt;a href="http://www.pharo-project.org/home"&gt;Pharo&lt;/a&gt; and whipped up &lt;a href="https://gist.github.com/2705526"&gt;an implementation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It&amp;#8217;s very simple, in typical Smalltalk fashion. It&amp;#8217;s just a method of BlockClosure:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;memoized
    "returns memoized version of an unary function"
    | cache |
    cache := Dictionary new.
    ^ [ :x | cache at: x ifAbsentPut: [ self value: x ] ]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And it&amp;#8217;s used like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;#(1 2 3 1 2 3) collect: [:x | Transcript show: x asString; cr. x + 1] memoized.
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;That will only display &amp;#8220;1&amp;#160;2 3&amp;#8221; &lt;em&gt;once&lt;/em&gt; in the Transcript, thanks to memoization, and returns the correct result.&lt;/p&gt;</description><link>http://jcromartie.tumblr.com/post/23143262205</link><guid>http://jcromartie.tumblr.com/post/23143262205</guid><pubDate>Tue, 15 May 2012 22:17:00 -0400</pubDate></item><item><title>What kind of idiot...</title><description>&lt;p&gt;&amp;#8230;accidentally buys DDR3-1066 (PC3-8500) when he meant to buy PC3-10600 (DDR3-1333)!?&lt;/p&gt;

&lt;p&gt;This is why I am not a &amp;#8220;hardware guy&amp;#8221;. I have no patience for figuring out some rather obtuse and arcane combinations of numbers and letters that mean the difference between a computer working correctly or not working at all. Oh wait. That sounds like code.&lt;/p&gt;</description><link>http://jcromartie.tumblr.com/post/21410399781</link><guid>http://jcromartie.tumblr.com/post/21410399781</guid><pubDate>Thu, 19 Apr 2012 20:56:00 -0400</pubDate></item><item><title>Yahoo! Goes Nuclear</title><description>&lt;p&gt;Well, we can say without a doubt that Yahoo! is done now. They are resorting to leveraging patents &lt;a href="http://www.google.com/patents?id=JsJ6AAAAEBAJ&amp;amp;printsec=abstract#v=onepage&amp;amp;q&amp;amp;f=false"&gt;like this&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;&lt;img src="http://www.google.com/patents?id=JsJ6AAAAEBAJ&amp;amp;pg=PA6&amp;amp;img=1&amp;amp;zoom=4&amp;amp;hl=en&amp;amp;sig=ACfU3U3sfbU9_218WSLJRiMnbMkdj2L1wQ&amp;amp;ci=161%2C270%2C681%2C885&amp;amp;edge=0" alt="wireframe of every website ever"/&gt;&lt;/p&gt;

&lt;p&gt;This is what anybody developing an ad display system would do. How could any moderately serious site &lt;em&gt;not&lt;/em&gt; order ads by their click-through rate or price-per-click? That would be silly to omit, and it&amp;#8217;s completely obvious to anybody who has spent any time on the Internet.&lt;/p&gt;</description><link>http://jcromartie.tumblr.com/post/19240331302</link><guid>http://jcromartie.tumblr.com/post/19240331302</guid><pubDate>Tue, 13 Mar 2012 13:08:00 -0400</pubDate></item><item><title>What Happened to TileStack?</title><description>&lt;p&gt;Every once in a while, a blog post or some article will ignite a HyperCard nostalgia trip among the programming community. Everybody remembers how awesome it was, what was possible with it, and how Apple pulled the plug. Then people start prognosticating on how to build a new and more modern HyperCard, that would be like the original but &lt;em&gt;even more awesome&lt;/em&gt;, with features &lt;em&gt;X&lt;/em&gt;, &lt;em&gt;Y&lt;/em&gt;, and &lt;em&gt;Z&lt;/em&gt;, and everybody would love it and be transported back to that magical time again.&lt;/p&gt;

&lt;p&gt;Well, I never used &lt;a href="http://www.tilestack.com/"&gt;TileStack&lt;/a&gt;, but it&amp;#8217;s gone now. It looks like they tried earnestly to pull it off. Only an insider could offer the real story on why they shut down.&lt;/p&gt;

&lt;p&gt;Based on YouTube videos, it looks like TileStack tried to implement HyperCard&amp;#8217;s vocabulary of stacks, cards, buttons, fields, scripts, handlers, and functions. They even implemented the HyperTalk programming language, and could even import actual HyperCard stacks.&lt;/p&gt;

&lt;p&gt;At the same time, the UI lacks the stripped-down elegance of the original HyperCard, where viewing a card is a no-frills affair, and the card is presented by itself with no fanfare. Editing the card means opening a menu (optionally tearing off a tool palette) and descending, hierarchically, into different levels of detail for the selected element. You go from the card itself, to a button or field&amp;#8217;s properties, to the script&lt;/p&gt;

&lt;p&gt;TileStack appears to have taken the smartly modal/hierarchical interface of HyperCard and &amp;#8220;flattened&amp;#8221; it, enshrining modelessness. In HyperCard you open an object&amp;#8217;s Info dialog to edit it. In TileStack you simply focus it and use the large dynamic toolbar area above the stack. It is a staggering array of options, where everything is visible all the time, but only a few options are actually available.&lt;/p&gt;

&lt;p&gt;Just some thoughts.&lt;/p&gt;</description><link>http://jcromartie.tumblr.com/post/18401054162</link><guid>http://jcromartie.tumblr.com/post/18401054162</guid><pubDate>Mon, 27 Feb 2012 18:00:05 -0500</pubDate></item><item><title>This is happening.</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_m02lxc2cKG1qahl2yo1_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;This is happening.&lt;/p&gt;</description><link>http://jcromartie.tumblr.com/post/18394884294</link><guid>http://jcromartie.tumblr.com/post/18394884294</guid><pubDate>Mon, 27 Feb 2012 16:20:00 -0500</pubDate></item><item><title>Oops! I don't care!</title><description>&lt;p&gt;I&amp;#8217;ve left a half-finished pre-alpha thingamajig running at &lt;a href="http://smarterseating.com"&gt;http://smarterseating.com&lt;/a&gt; for about 6 months now. It&amp;#8217;s actually been running in a Clojure REPL in a SSH session since I first started it. That&amp;#8217;s a nice testament to how long a Clojure web app can run, but it&amp;#8217;s not the point.&lt;/p&gt;

&lt;p&gt;It started when a friend wanted to solve this problem for his wife (a school teacher) and I came up with a solution. I thought I&amp;#8217;d throw something out there that just worked, and that this would be some kind of magic kick in the entrepreneurial pants, and I would turn it into something that made money. I thought it would be useful for people who need to seat classrooms, wedding receptions, and other things.&lt;/p&gt;

&lt;p&gt;But the thing is, I just don&amp;#8217;t care. I don&amp;#8217;t have any need for it. I don&amp;#8217;t think it&amp;#8217;s going to make the world a better place. I don&amp;#8217;t have intimate domain knowledge here. The market is probably small.&lt;/p&gt;

&lt;p&gt;So, yeah. Don&amp;#8217;t do that.&lt;/p&gt;

&lt;p&gt;I can see two reasons why I would build something I don&amp;#8217;t care about:&lt;/p&gt;

&lt;ol&gt;&lt;li&gt;Someone is paying me lots of money for it.&lt;/li&gt;
&lt;li&gt;Someone will pay me lots of money for it.&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;So I&amp;#8217;ll be recycling this Linode box for some other projects.&lt;/p&gt;</description><link>http://jcromartie.tumblr.com/post/18277086496</link><guid>http://jcromartie.tumblr.com/post/18277086496</guid><pubDate>Sat, 25 Feb 2012 18:09:00 -0500</pubDate></item><item><title>Why do remote controls still exist?</title><description>&lt;p&gt;The post &lt;a href="http://minimalmac.com/post/18189678921/tv-is-broken"&gt;TV Is Broken&lt;/a&gt; reminded me of something that I&amp;#8217;ve been thinking about for a while. It&amp;#8217;s only tangential to the problem of content on TV.&lt;/p&gt;

&lt;p&gt;I don&amp;#8217;t buy a lot of consumer electronics, but it so happens that I have &lt;em&gt;six&lt;/em&gt; devices that can comfortably browse the web from my couch. They are usually within reach when I&amp;#8217;m operating the TV or its cohorts (a receiver/amplifier and a PlayStation 3). Many of the things connected to my TV, including the TV itself, are connected to my home network.&lt;/p&gt;

&lt;p&gt;So, why do we still have remote controls? Why can&amp;#8217;t I control my interconnected devices with a web interface which advertises itself on my WiFi network (via &lt;em&gt;Bonjour&lt;/em&gt;, for example), which my iPad can pick up and browse?&lt;/p&gt;

&lt;p&gt;Why can&amp;#8217;t I coordinate my media sources and my output options from one device without insane ugly hacks (I&amp;#8217;m looking at you, Logitech Harmony)?&lt;/p&gt;

&lt;p&gt;There&amp;#8217;s probably a big opportunity licensing and implementing something like this for TV and set-top/DVR/game devices.&lt;/p&gt;</description><link>http://jcromartie.tumblr.com/post/18208174222</link><guid>http://jcromartie.tumblr.com/post/18208174222</guid><pubDate>Fri, 24 Feb 2012 17:00:35 -0500</pubDate></item><item><title>On to level 4!</title><description>&lt;p&gt;&lt;img src="http://i.imgur.com/hPkBx.png" alt="level 4 welcome screen"/&gt;&lt;/p&gt;

&lt;p&gt;I have to say I&amp;#8217;m a little bit proud of myself for figuring out level 3 on &lt;a href="https://stripe.com/blog/capture-the-flag"&gt;Stripe&amp;#8217;s Capture the Flag challenge&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Good luck to everybody out there trying this, too.&lt;/p&gt;</description><link>http://jcromartie.tumblr.com/post/18190893010</link><guid>http://jcromartie.tumblr.com/post/18190893010</guid><pubDate>Fri, 24 Feb 2012 10:56:04 -0500</pubDate></item><item><title>Struggles and Success With Cygwin</title><description>&lt;p&gt;While PowerShell is a great thing for Windows management, it still has a long way to go to catch up with the sheer flexibility of Bash and the staggering array of tools centered around manipulating simple streams of text.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://stackoverflow.com/questions/573623/powershell-vs-unix-shells"&gt;This post on StackOverflow&lt;/a&gt; contains a few great bits from different perspectives: even from the creator of PowerShell itself.&lt;/p&gt;

&lt;p&gt;I just wanted to share some of the problems that came up with my attempts to integrate various open-source tools into our Windows-based development environment. Finally I&amp;#8217;ll share some tips/observations that led to an enjoyable environment.&lt;/p&gt;

&lt;h1&gt;Problems&lt;/h1&gt;

&lt;h2&gt;Permissions&lt;/h2&gt;

&lt;p&gt;Easily the most frustrating part of Cygwin is when it attempts to imitate POSIX permissions on NTFS volumes by manipulating the ACLs. Frankly, Cygwin does a terrible job at this. It only serves to cause massive headaches.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TURN THIS OFF&lt;/strong&gt; before you do anything else in Cygwin.&lt;/p&gt;

&lt;p&gt;You can avoid permissions issues by setting up your NTFS mount points with the &amp;#8220;noacl&amp;#8221; option. This is easily accomplished by configuring them in &lt;a href="http://en.wikipedia.org/wiki/Fstab"&gt;fstab&lt;/a&gt; with the &amp;#8220;noacl&amp;#8221; option, like so:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;none            /cygdrive       cygdrive        binary,posix=0,user,noacl       0       0
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This line will cause Cygwin to simply leave the default Windows permissions alone. They are good enough in 99% of cases, and I&amp;#8217;ve found that they are better than what Cygwin does to permissions (it&amp;#8217;s not pretty) in nearly 100% of cases.&lt;/p&gt;

&lt;h2&gt;Forking&lt;/h2&gt;

&lt;p&gt;This is a problem that can be harder to work around, due to the fact that Windows doesn&amp;#8217;t allow easy forking of processes. Cygwin&amp;#8217;s version is very slow (by necessity). The maximum forking performance of Cygwin is about 2% of my comparable Mac OS X machine&amp;#8217;s speed when executing Bash commands in a loop. Here&amp;#8217;s a useful mini-benchmark to see for yourself:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;while true; do date; done | uniq -c
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;One way around this limitation is to use a programming language like Perl or Ruby for scripts that need to iterate over large numbers of files, etc.. Ruby has a very handy standard library with good file handling utilities.&lt;/p&gt;

&lt;h2&gt;Rebasing&lt;/h2&gt;

&lt;p&gt;Sometimes, after an update, Cygwin programs are not linked correctly anymore. This is solved with a &lt;a href="http://cygwin.wikia.com/wiki/Rebaseall"&gt;rebase&lt;/a&gt;. This operation will update your Cygwin binaries/libraries to be able to find the right functions in linked libraries (like the all-important &lt;code&gt;cygwin.dll&lt;/code&gt;).&lt;/p&gt;

&lt;h1&gt;Background Tasks&lt;/h1&gt;

&lt;p&gt;The &lt;code&gt;cygrunsrv&lt;/code&gt; tool lets you install any cygwin program (script or .exe) as a Windows service. This is a godsend, as you can easily get useful servers like &lt;code&gt;rsyncd&lt;/code&gt;, &lt;code&gt;git --daemon&lt;/code&gt;, simple Ruby web servers, or any other background task up and running with little trouble.&lt;/p&gt;

&lt;h1&gt;Ruby&lt;/h1&gt;

&lt;p&gt;Arguably the best part of Ruby is the RubyGems packaging system. Many of the best gems, however, require native extensions to be built. While some gems have pre-built Windows binaries, many do not. Cygwin makes this easy by making GCC and many of the dependent libraries available. I&amp;#8217;ve never run into a gem that couldn&amp;#8217;t be built under Cygwin with anything more than grabbing the right libraries through the package manager.&lt;/p&gt;</description><link>http://jcromartie.tumblr.com/post/16672716406</link><guid>http://jcromartie.tumblr.com/post/16672716406</guid><pubDate>Sat, 28 Jan 2012 21:50:04 -0500</pubDate></item><item><title>Jenkins, Cygwin, Windows 7, and permissions</title><description>&lt;p&gt;&lt;a href="http://www.cygwin.com/"&gt;Cygwin&lt;/a&gt; is a godsend for controlling your workflow and putting together the sort of tools that keep devops humming along. And &lt;a href="http://jenkins-ci.org/"&gt;Jenkins&lt;/a&gt; is a great freeform build tool for managing pretty much any software CI/build process.&lt;/p&gt;

&lt;p&gt;But Cygwin and Windows permissions don&amp;#8217;t always play nicely, especially when you add intermediary processes like Jenkins to the mix. My build scripts were copying various folders into the Jenkins workspace, among other things. However, the files and directories ended up having all sorts of nasty permissions issues. Certain users (like the ASP.NET app pool identity) could not read files, and overall things looked pretty weird.&lt;/p&gt;

&lt;p&gt;So, &lt;a href="http://technet.microsoft.com/en-us/library/cc753525(WS.10).aspx"&gt;Icacls&lt;/a&gt; to the rescue! Right?&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;icacls the-dir /reset /T /C /Q
... &amp;lt;snip 5000 lines of Access Denied errors&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I was getting &amp;#8220;Access Denied&amp;#8221; errors on every file in the directory, even when I made sure to run cmd.exe as Administrator. Icacls was not working to take ownership either, so I tried &lt;a href="http://technet.microsoft.com/en-us/library/cc753024(WS.10).aspx"&gt;Takeown&lt;/a&gt;. It worked to take ownership where Icacls did not.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;takeown /F the-dir /R
icacls the-dir /reset /T /C /Q
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;All is well now. I hope this might help someone with the same issues.&lt;/p&gt;</description><link>http://jcromartie.tumblr.com/post/14566581834</link><guid>http://jcromartie.tumblr.com/post/14566581834</guid><pubDate>Wed, 21 Dec 2011 11:26:00 -0500</pubDate></item><item><title>Things you can't do in Visual Studio</title><description>&lt;p&gt;Here&amp;#8217;s something you can&amp;#8217;t do in Visual Studio: be editing code in one half of a split window, and be having a conversation with the language/framework author in another, with only a few keystrokes, and with the full facilities of the editor at your disposal. Thanks, Emacs. You made my day.&lt;/p&gt;</description><link>http://jcromartie.tumblr.com/post/14517955960</link><guid>http://jcromartie.tumblr.com/post/14517955960</guid><pubDate>Tue, 20 Dec 2011 13:30:00 -0500</pubDate></item><item><title>Is Zach Holman trolling us?</title><description>&lt;p&gt;&lt;a href="https://github.com/holman/spark/"&gt;spark&lt;/a&gt; is over 400 points on HN right now.&lt;/p&gt;

&lt;p&gt;Initially, the script didn&amp;#8217;t work on OS X. Now I&amp;#8217;m not sure what it does work on, but it barely works on my OS X terminal, and it definitely doesn&amp;#8217;t work in Cygwin.&lt;/p&gt;

&lt;p&gt;It takes a comma-separated list, instead of a standard argument list. So you have to use &lt;code&gt;tr "\n" ","&lt;/code&gt; instead of just simple substitution or &lt;code&gt;xargs&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;It doesn&amp;#8217;t even handle the examples in the README. The earthquake data is made up of floating point numbers, and so you not only lose a good deal of information, but the latest script flat-out chokes on it.&lt;/p&gt;

&lt;p&gt;And then there&amp;#8217;s the speed. Somehow it&amp;#8217;s taking over 2 minutes to run the (incorrect) earthquake sparkline.&lt;/p&gt;

&lt;p&gt;Now compare that to a &lt;a href="https://gist.github.com/1367091"&gt;4-line Ruby version&lt;/a&gt; that works correctly, handles positive and negative decimal numbers, works the same anywhere that Ruby runs, and runs &lt;em&gt;hundreds of times faster&lt;/em&gt; (and this is &lt;em&gt;Ruby&lt;/em&gt; here), and holman tells me &amp;#8220;Ruby is for chumps&amp;#8221;?&lt;/p&gt;

&lt;p&gt;Is he trolling?&lt;/p&gt;</description><link>http://jcromartie.tumblr.com/post/12852093593</link><guid>http://jcromartie.tumblr.com/post/12852093593</guid><pubDate>Tue, 15 Nov 2011 17:31:00 -0500</pubDate></item><item><title>R.I.P. John McCarthy</title><description>&lt;p&gt;The third major computing figure to die in a month! They say famous people die in threes.&lt;/p&gt;

&lt;p&gt;Anyway, I owe my career in software to John McCarthy. My first introduction to programming was through the Apple Logo programming environment in elementary school.&lt;/p&gt;

&lt;p&gt;Fast forward many years later, after stumbling along in BASIC, PHP, Java, C#, Ruby, and others. I rediscovered Lisp through Scheme (and &lt;em&gt;The Little Schemer&lt;/em&gt;) and Clojure. Little did I realize that Logo was actually a Lisp dialect all along, and while it was the first Lisp REPL I would use, it would certainly not be the last! This return to &amp;#8220;the programmable programming language&amp;#8221; would dramatically reshape the way I think about programming.&lt;/p&gt;

&lt;p&gt;Thanks to John McCarthy for his tremendous contributions to the programming world.&lt;/p&gt;</description><link>http://jcromartie.tumblr.com/post/11886345368</link><guid>http://jcromartie.tumblr.com/post/11886345368</guid><pubDate>Mon, 24 Oct 2011 20:23:00 -0400</pubDate></item><item><title>Poor Man's Tuples in Clojure</title><description>&lt;p&gt;Hiredman is working on a &lt;a href="https://github.com/hiredman/tuples"&gt;nice implementation of tuples&lt;/a&gt; in Clojure. But, just for fun, I wanted to whip up the absolute minimum viable O(1) tuple possible.&lt;/p&gt;

&lt;p&gt;The result is this macro:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;(defmacro tuple
  [&amp;amp; xs]
  `(fn [idx#] (case idx# ~@(mapcat list (range (count xs)) xs))))
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Try that in Ruby or C# ;)&lt;/p&gt;

&lt;p&gt;So, &lt;code&gt;(tuple "foo" 5 :bar)&lt;/code&gt; returns a function that takes an index and returns the value at that index in the arguments to &lt;code&gt;tuple&lt;/code&gt;, i.e. &lt;code&gt;((tuple "foo" 5 :bar) 1)&lt;/code&gt; returns &lt;code&gt;5&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The macro compiles to a &lt;code&gt;case&lt;/code&gt; form which dispatches in constant time, although it&amp;#8217;s not as fast as Hiredman&amp;#8217;s implementation, or even Clojure&amp;#8217;s native vector.&lt;/p&gt;</description><link>http://jcromartie.tumblr.com/post/11723687161</link><guid>http://jcromartie.tumblr.com/post/11723687161</guid><pubDate>Fri, 21 Oct 2011 01:10:00 -0400</pubDate></item></channel></rss>
