<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><description>I am a software developer living in Albuquerque, NM. Over the last 25 years I have worked
with computers in one capacity or another. Most of that time was spent writing code.</description><title>Phil Toland</title><generator>Tumblr (3.0; @fiatdev)</generator><link>https://philtoland.com/</link><item><title>"Comcast, Time Warner Cable, and Charter are all among the least liked video providers in the..."</title><description>“Comcast, Time Warner Cable, and Charter are all among the least liked video providers in the country, according to the American Customer Satisfaction Index. Comcast Executive VP David Cohen recently admitted in a Senate hearing on the proposed merger that Comcast is “deeply disappointed” in its own customer service. “It bothers us that we have so much trouble delivering a really high quality service level to customers on a consistent basis. It is not something we’re ignoring,” he said.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;a href="http://arstechnica.com/business/2014/04/comcast-details-plan-to-give-up-customers-and-create-new-cable-company/"&gt;Comcast details plan to give up customers and create new cable company | Ars Technica&lt;/a&gt;&lt;/em&gt;</description><link>https://philtoland.com/post/84130674393</link><guid>https://philtoland.com/post/84130674393</guid><pubDate>Mon, 28 Apr 2014 09:36:51 -0600</pubDate></item><item><title>Erlang Factory 2012 Recap</title><description>&lt;p&gt;I have been back in sunny San Antonio for over a week now, and I have had a chance
to reflect on this year&amp;rsquo;s &lt;a href="http://www.erlang-factory.com/conference/SFBay2012"&gt;Erlang Factory&lt;/a&gt; in San Francisco. The conference
was great in almost every respect, and the folks at &lt;a href="http://www.erlang-solutions.com/"&gt;Erlang Solutions&lt;/a&gt; deserve
a lot of credit for pulling off a great conference. In particular, Francesco
Cesarini went out of his way to make sure all of the delegates felt welcome and
that the conference ran smoothly.&lt;/p&gt;

&lt;p&gt;The hotel where the conference was held was the &lt;a href="http://www.marineclub.com/"&gt;Marines Memorial Club and
Hotel&lt;/a&gt; in downtown San Francisco. As the name suggests, the hotel is
a memorial to U.S. Marines who have died fighting in foreign wars. It is part
hotel and part museum. There is a lot of character and a sense of history that
you don&amp;rsquo;t normally find at a hotel and conference venue.&lt;/p&gt;

&lt;p&gt;Many people that I have talked to suggest that the best part of technology
conferences is the &amp;ldquo;hallway track&amp;rdquo; where you meet new people and discuss
different aspects of the technology. This was certainly true at Erlang Factory,
especially since there were social events scheduled for Thursday, Friday and
Saturday evenings. I often fell into conversations with other delegates over
breakfast or lunch on topics ranging from the talks we just saw to interesting
uses of Erlang. It certainly helps to be able to put faces with names that you
may have only seen on emails or on Twitter.&lt;/p&gt;

&lt;p&gt;My talk covering our Erlang work at Rackspace was well reveived by the attendees.
I had some interesting conversations afterwards with delegates who had faced
similar problems. On Friday evening I sat on a panel discussing running Erlang
on a Platform as a Service (PaaS). There was some interesting back and forth
between the members of the panel and some in the audience. Deploying an Erlang
application to a PaaS is only part of the problem; current PaaS implementations
do not allow doing the sorts of things that make Erlang stand out like
distributed applications and hot code upgrades.&lt;/p&gt;

&lt;p&gt;I think that I got more out of Erlang Factory than any conference I have
attended in recent years. The Erlang community is still small enough that
conferences like Erlang Factory can have a huge impact by getting people
together under one roof. Kenji Rikitake makes a &lt;a href="http://concurrently-chaotic.blogspot.com/2012/04/why-erlang-people-need-erlang-factory.html"&gt;strong argument&lt;/a&gt; for the
value of Erlang Factory to the community and I couldn&amp;rsquo;t agree more. I am looking
forward to next year.&lt;/p&gt;</description><link>https://philtoland.com/post/20973450714</link><guid>https://philtoland.com/post/20973450714</guid><pubDate>Thu, 12 Apr 2012 12:23:50 -0600</pubDate></item><item><title>On Erlang</title><description>&lt;p&gt;&lt;em&gt;[NOTE: This post originally appeared on &lt;a href="http://rackspace.com/blog/overview-of-the-erlang-programming-language"&gt;the Rackspace blog&lt;/a&gt;.]&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;My father used to be an auto mechanic. Every so often the Cornwell or Snap-On
tool truck would come by his garage and he would wander through it like a kid
in a candy store. To this day he has large rolling toolboxes full of the
mysterious implements of car repair. Each tool was useful in some situation
where it made his job easier in some cases, and doable in others.&lt;/p&gt;

&lt;p&gt;I am a software developer and I collect programming languages as my father
collected tools. I once went to the local library and checked out old manuals
for COBOL and FORTRAN; not because I wanted to write any code with them (perish
the thought!) but because I wanted to know what makes them tick. I originally
approached the &lt;a href="http://en.wikipedia.org/wiki/Erlang_(programming_language)"&gt;Erlang&lt;/a&gt; programming language with the same sense of curiosity and
detachment. There wasn&amp;rsquo;t a lot of information about Erlang out in the wild at the
time and it wasn&amp;rsquo;t clear to me what Erlang might bring to the table.&lt;/p&gt;

&lt;p&gt;Then in 2007 an interesting thing happened. I was attending RailsConf in Portland,
Ore. and the Pragmatic Programmers had announced that they were publishing &lt;a href="http://pragprog.com/book/jaerlang/programming-erlang"&gt;Programming
Erlang&lt;/a&gt; by Joe Armstrong, the father of Erlang. There was quite a lot of chatter
in the halls and before talks about this weird &amp;ldquo;new&amp;rdquo; programming language. The
attendees of RailsConf 2007 represented early adopters and enthusiasts who would
be comfortable exploring little known languages. It was becoming clear that
Erlang might complement Ruby development nicely being strong in the areas where
Ruby lacked and vice versa. I bought the book when it was released and was very
intrigued.&lt;/p&gt;

&lt;p&gt;Erlang was developed in the 1980s as a programming language to be used in
telephony equipment an environment where reliability is a far greater concern
than raw computational speed. In order to achieve high reliability, Erlang uses
lightweight processes that are completely isolated from each other. These independent
processes communicate by passing messages back and forth. If a process fails,
it does not disrupt the entire system. There is a sophisticated supervision
framework that can detect when a process crashes and react appropriately by,
for example, restarting the process that crashed.  A nice side effect of this
architecture is that Erlang scales very well across multiple cores in a single
server or across multiple servers in a cluster. The lightweight processes in
Erlang do not share anything, so the process you are passing messages to can be
located on the same machine running on a different core or on another machine
in the cluster entirely.&lt;/p&gt;

&lt;p&gt;Perhaps the most famous Erlang project is the AXD301 ATM switch developed at
Ericsson in the late 1990&amp;rsquo;s. The code for the switch consisted of over a million
lines of Erlang code and reportedly reached nine &amp;ldquo;9&amp;quot;s of uptime. While using
Erlang doesn&amp;rsquo;t automatically guarantee that level of reliability, it is a glimpse
of what is possible. Concurrency and reliability are baked into Erlang in a way
that is different than most other languages I have worked with. This leads developers
to think differently about application architecture, especially when it comes
to error handling and failures within a large, distributed system.&lt;/p&gt;

&lt;p&gt;In 2008 I was given the opportunity to put Erlang to the test in an application
I was building for my employer at the time. On that project I worked on a small team
consisting of myself and two other developers and we were able to deliver a solid
system in a relatively short amount of time. Erlang allowed us to focus on the
business problem and not the incidentals. I have chosen to work with Erlang ever
since then because it is both powerful and empowering.&lt;/p&gt;

&lt;p&gt;Many of today&amp;rsquo;s most interesting problems in software development are also the
most challenging. Concurrency in a multicore world and reliability when applications
are growing ever larger and ever more complex must rank up there, along with naming
and cache invalidation as some of the most challenging problems in modern software
development. Erlang is a pragmatic programming language aimed squarely at those
problems. These traits make Erlang an excellent choice for building backend systems
and APIs. For Example, the &lt;a href="http://basho.com/products/riak-overview/"&gt;Riak&lt;/a&gt; and &lt;a href="http://couchdb.apache.org/"&gt;CouchDB&lt;/a&gt; databases are both implemented
in Erlang as well as the &lt;a href="http://www.rabbitmq.com/"&gt;RabbitMQ&lt;/a&gt; message queue. The &lt;a href="http://wiki.basho.com/Webmachine.html"&gt;Webmachine&lt;/a&gt; library
makes writing ReSTful APIs a snap.&lt;/p&gt;

&lt;p&gt;It is cliche these days to suggest that programmers should use the right tool
for the job. However, another saying popular among programmers is that when
all you have is a hammer every problem looks like a nail. Therefore, if
developers are to use the best tool for the job they need to have a full
toolbox. Erlang is a tool that deserves a place in every developer&amp;rsquo;s toolbox.
While Erlang is not a tool that is appropriate for every situation, in the
situations where it is a good fit, Erlang can make a developer&amp;rsquo;s job much easier,
and in some cases doable.&lt;/p&gt;</description><link>https://philtoland.com/post/20973219016</link><guid>https://philtoland.com/post/20973219016</guid><pubDate>Thu, 12 Apr 2012 12:18:21 -0600</pubDate></item><item><title> </title><description>&lt;p&gt;&lt;a href="http://www.erlang-factory.com/conference/SFBay2012"&gt; &lt;img src="http://www.erlang-factory.com//upload/item/83/SF2012ImSpeaking.jpg" alt="I'm speaking at the 2012 San Francisco Erlang Factory!"/&gt;&lt;/a&gt;&lt;/p&gt;</description><link>https://philtoland.com/post/16382553518</link><guid>https://philtoland.com/post/16382553518</guid><pubDate>Mon, 23 Jan 2012 18:46:05 -0700</pubDate></item><item><title>LSRC Talk</title><description>&lt;p&gt;I will be presenting at the Lone Star Ruby Conference this year with my coworker Mike (a.k.a. @lifeinzembla on Twitter). The talk is titled &amp;ldquo;Polyglot Parallelism: A Case Study in Using Erlang and Ruby at Rackspace&amp;rdquo; and will cover our experience rebuilding some older systems in Erlang. We plan to get into when you should use Erlang to augment your existing code as well as what benefits you can expect from Erlang and what pitfalls to avoid. The full abstract is below:&lt;/p&gt;

&lt;p&gt;Two years ago Rackspace had a problem: how do we backup 20K network
devices, in 8 datacenters, across 3 continents, with less than a 1%
failure rate &amp;ndash; every single day? Many solutions were tried and found
wanting: a pure Perl solution, a vendor solution and then one in Ruby,
none worked well enough. They were not fast enough or they were not
reliable enough, or they were not transparent enough when things went
wrong.&lt;/p&gt;

&lt;p&gt;Now we all love Ruby but good Rubyists know that it is not always the
best tool for the job. After re-examining the problem we decided to
rewrite the application in a mixture of Erlang and Ruby. By exploiting
the strengths of both &amp;ndash; Erlang&amp;rsquo;s astonishing support for parallelism
and Ruby&amp;rsquo;s strengths in web development &amp;ndash; the problem was solved.&lt;/p&gt;

&lt;p&gt;In this talk we&amp;rsquo;ll get down and dirty with the details: the problems
we faced and how we solved them. We&amp;rsquo;ll cover the application
architecture, how Ruby and Erlang work together, and the Erlang
approach to asynchronous operations (hint: it does not involve
callbacks). So come on by and find out how you can get these two great
languages to work together.&lt;/p&gt;

&lt;p&gt;Phil Toland does not have an impressive beard, but he has been working
with Erlang since 2008 when he cut his Erlang teeth developing Yet
Another Dynamo Clone. These days he works at Rackspace automating
network devices against their will and often his own better judgement.&lt;/p&gt;

&lt;p&gt;Mike Sassak is Internet famous for his observational skills and his
impressive beard. Also, he works at Rackspace and contributes to
Cucumber.&lt;/p&gt;</description><link>https://philtoland.com/post/6725059088</link><guid>https://philtoland.com/post/6725059088</guid><pubDate>Mon, 20 Jun 2011 10:08:58 -0600</pubDate></item><item><title>Simple Blowfish encryption with Ruby</title><description>&lt;p&gt;I needed to encrypt some text before storing it in the database. Since I needed to get the original back at some point I settled on &lt;a href="http://en.wikipedia.org/wiki/Blowfish_(cipher)"&gt;Blowfish&lt;/a&gt; and &lt;a href="http://en.wikipedia.org/wiki/Advanced_Encryption_Standard"&gt;AES&lt;/a&gt; as good candidates. There are a couple gems with provide this type of encryption, but I could not get either one to work.&lt;/p&gt;

&lt;p&gt;Eventually I came across &lt;a href="http://en.wikipedia.org/wiki/Blowfish_(cipher)"&gt;this snippet&lt;/a&gt; and &lt;a href="http://en.wikipedia.org/wiki/Advanced_Encryption_Standard"&gt;this blog post&lt;/a&gt;. It turns out that it is trivial to use the Ruby OpenSSL library to do encryption. I cleaned up the code from the first snippet a bit:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;require 'openssl'

module Blowfish
   def self.cipher(mode, key, data)
     cipher = OpenSSL::Cipher::Cipher.new('bf-cbc').send(mode)
     cipher.key = Digest::SHA256.digest(key)
     cipher.update(data) &amp;lt;&amp;lt; cipher.final
   end

   def self.encrypt(key, data)
     cipher(:encrypt, key, data)
   end

   def self.decrypt(key, text)
     cipher(:decrypt, key, text)
   end
 end

 if $0 == __FILE__
   p "text" == Blowfish.decrypt("key", Blowfish.encrypt("key", "text"))
 end
&lt;/code&gt;&lt;/pre&gt;</description><link>https://philtoland.com/post/807114394</link><guid>https://philtoland.com/post/807114394</guid><pubDate>Tue, 13 Jul 2010 11:07:04 -0600</pubDate><category>ruby</category><category>encryption</category><category>blowfish</category><category>openssl</category></item><item><title>Get ready for more expensive cars</title><description>&lt;p&gt;The Obama administration is announcing &lt;a href="http://arstechnica.com/tech-policy/news/2010/04/epa-finalizes-automotive-fuel-economy-rules.ars"&gt;steep increases in the federal CAFE standards&lt;/a&gt;. Under the new standards average fuel efficiency will increase from 27.5 to 35.5 MPG.  The administration is positioning it as a win for everybody: the government continues to assert its control over the auto industry, environmentalists get thrown a bone and the auto manufacturers get big &amp;ldquo;green&amp;rdquo; subsidies. It is good for everyone but consumers, anyway. The auto manufacturers will of course pass the cost of these changes along to consumers to the tune of $1000 per car. John Stossel makes an &lt;a href="http://stossel.blogs.foxbusiness.com/2010/04/02/more-junk-science/"&gt;insightful observation&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;In a press release, the administration admits that the changes will increase the cost of the typical
  car by $1,000. But they say it will save each driver $3,000 over the life of the car. Are they right?
  I don’t know, but if these savings really exist, why does the government need to FORCE people to take
  them?&lt;/p&gt;
  
  &lt;p&gt;If automakers wanted to make cars like this, they would do it on their own.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The problem is that Americans generally don&amp;rsquo;t want fuel efficient vehicles. They want SUVs, minivans, luxury and sports cars. The CAFE standards contributed to the downfall of the Big 3 automakers last year as they churned out crappy fuel efficient econoboxes that nobody wanted so that they could continue selling the SUVs people did want. I don&amp;rsquo;t see that changing significantly unless gas gets way more expensive.&lt;/p&gt;</description><link>https://philtoland.com/post/491630577</link><guid>https://philtoland.com/post/491630577</guid><pubDate>Fri, 02 Apr 2010 13:06:15 -0600</pubDate></item><item><title>Microsoft doesn't follow its own OOXML standard</title><description>&lt;p&gt;&lt;a href="http://arstechnica.com/microsoft/news/2010/04/iso-ooxml-convener-microsofts-format-heading-for-failure.ars"&gt;ISO OOXML convener: Microsoft&amp;rsquo;s format &amp;ldquo;heading for failure&amp;rdquo;&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Although Microsoft&amp;rsquo;s Office Open XML (OOXML) document format became an ISO standard two years ago,
  the company still hasn&amp;rsquo;t built any software that truly complies with the standard. Microsoft Office
  2010, which is expected to be released later this year, implements the deprecated &amp;ldquo;transitional&amp;rdquo;
  version of the format and is not compatible with the version that was crafted by the standards body.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Everyone who is surprised by this please raise your hand. Yeah, that is what I thought. I was skeptical of the ISO OOXML standardization process from the beginning. Microsoft has never been big on respecting standards, and it appears that is true even when they create the standard themselves.&lt;/p&gt;</description><link>https://philtoland.com/post/491599395</link><guid>https://philtoland.com/post/491599395</guid><pubDate>Fri, 02 Apr 2010 12:46:54 -0600</pubDate></item><item><title>Patron 0.4.6</title><description>&lt;p&gt;I have release version 0.4.6 of Patron, my HTTP client library for Ruby. The big news for this release is a dramatic speedup for uploads. There are still a few bugs outstanding and I hope to have a new release ready soon. You can get Patron via rubygems with &lt;code&gt;gem install patron&lt;/code&gt; or get &lt;a href="http://github.com/toland/patron"&gt;the source&lt;/a&gt; from Github.&lt;/p&gt;</description><link>https://philtoland.com/post/464321368</link><guid>https://philtoland.com/post/464321368</guid><pubDate>Sun, 21 Mar 2010 17:47:19 -0600</pubDate></item><item><title>Importing Wordpress content into Tumblr</title><description>&lt;p&gt;When I decided to move my blog from Wordpress to Tumblr I did a lot of searching to find a tool that would import my content. I found a couple of solutions, but none that worked for me. After taking a look at &lt;a href="http://www.tumblr.com/docs/en/api"&gt;Tumblr&amp;rsquo;s API docs&lt;/a&gt; I decided to throw together a simple script that would parse a Wordpress export file and post the content to Tumblr. It turned out to be pretty easy. Since this is one of those scratch an itch type of solutions it is biased a bit towards the type of content I needed to import (mostly plain posts formatted with Markdown). I am posting it in the hopes that it will be useful, but as always, caveat programmor.&lt;/p&gt;

&lt;script src="http://gist.github.com/332449.js?file=tumblr-import.rb"&gt;&lt;/script&gt;</description><link>https://philtoland.com/post/464265345</link><guid>https://philtoland.com/post/464265345</guid><pubDate>Sun, 21 Mar 2010 17:18:11 -0600</pubDate></item><item><title>Tumblr is blog lube</title><description>&lt;p&gt;This is going to be one of those embarrassingly meta posts where I talk about the technology behind this site. Rather than drag this out needlessly I will get right to the point and say that I have fully moved my blog over from a self-hosted Wordpress install to &lt;a href="http://tumblr.com"&gt;Tumblr&lt;/a&gt;. Actually, it is a little more complicated than that. I had three sites where I theoretically posted content: my main blog at fiatdev.com, my personal site at philtoland.com and my Tumblr blog at tumbl.fiatdev.com. While I have not posted regularly for a couple of years, it became clear to me that I simply had too many buckets for online content. It was time to simplify and so I moved the content from all three sites into my Tumblr blog.&lt;/p&gt;

&lt;p&gt;Quite frankly, I am tired of having to maintain a blog engine. That is something that was kinda fun when I started but has become a chore for me. I began to obsess over the Wordpress engine itself while not writing any actual content. I like Tumblr because it is hosted and simple. Oh, and the &lt;a href="http://www.kungfugrippe.com/post/338855/tumblrs-smartypants-bookmarklet-tumblrs"&gt;bookmarklet&lt;/a&gt; is &amp;ldquo;teh awesome&amp;rdquo; as the kids say these days. Tumblr&amp;rsquo;s bookmarklet and simplicity remove the friction from posting content (hence the title of this post).&lt;/p&gt;

&lt;p&gt;Now, with all of that having been said, we will see if any of this results in more content being posted here or not.&lt;/p&gt;</description><link>https://philtoland.com/post/464245622</link><guid>https://philtoland.com/post/464245622</guid><pubDate>Sun, 21 Mar 2010 17:07:46 -0600</pubDate></item><item><title>"The logic seems unassailable: The District of Columbia is the hub of the political class. Higher..."</title><description>“The logic seems unassailable: The District of Columbia is the hub of the political class. Higher unemployment in Washington and vicinity thus means fewer parasites feeding off the productive economy, which augurs well for recovery.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;a href="http://online.wsj.com/article/best_of_the_web_today.html#printMode"&gt;Good News, D.C. Unemployment’s Up - WSJ.com&lt;/a&gt;&lt;/em&gt;</description><link>https://philtoland.com/post/445843256</link><guid>https://philtoland.com/post/445843256</guid><pubDate>Sat, 13 Mar 2010 11:49:01 -0700</pubDate></item><item><title>"Adobe CTO Kevin Lynch claims that the company’s ubiquitous Flash plug-in doesn’t ship..."</title><description>“Adobe CTO Kevin Lynch claims that the company’s ubiquitous Flash plug-in doesn’t ship with any known crash bugs. One can only assume that he has never used the software.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;a href="http://arstechnica.com/open-source/news/2010/03/mozilla-previews-new-feature-to-guard-against-flash-crashes.ars"&gt;Mozilla previews new feature to guard against Flash crashes&lt;/a&gt;&lt;/em&gt;</description><link>https://philtoland.com/post/436981437</link><guid>https://philtoland.com/post/436981437</guid><pubDate>Tue, 09 Mar 2010 08:40:05 -0700</pubDate></item><item><title>Extracting data from iPhone backups</title><description>&lt;p&gt;I recently reset my iPhone in an attempt to clear up some weird issues I was having. It wasn&amp;rsquo;t until afterwards that I realized that I had forgotten to pull my photos off of the phone first. After doing some searching I discovered that the iPhone backup files are located at:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;/Users/&amp;lt;user&amp;gt;/Library/Application Support/MobileSync/Backup
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I then found the &lt;a href="http://iphonewebdev.googlegroups.com/web/bkupextract.pl"&gt;bkupextract.pl script&lt;/a&gt; that attempts to extract all of the sqlite3 databases from the backup files. I modified the script to also extract the plist, JPEG and PNG files and posted it to &lt;a href="http://gist.github.com/194530"&gt;a gist&lt;/a&gt;. My Perl-Fu is weak, so no complaining about the quality of the code, but it found my photos.&lt;/p&gt;</description><link>https://philtoland.com/post/448933945</link><guid>https://philtoland.com/post/448933945</guid><pubDate>Sat, 26 Sep 2009 18:03:25 -0600</pubDate><category>Tools</category><category>.mac</category><category>iphone</category></item><item><title>Patron 0.4</title><description>&lt;p&gt;The 0.4 version of Patron has been released. This version addresses feedback from the initial public release and fixes a few minor bugs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fixed a bug in the Patron.version method&lt;/li&gt;
&lt;li&gt;Added HTTP proxy support&lt;/li&gt;
&lt;li&gt;Enabled SSL and Win32 support&lt;/li&gt;
&lt;li&gt;Added ability to download data to a file with GET&lt;/li&gt;
&lt;li&gt;Fixed a bug where header values were prefixed with a space&lt;/li&gt;
&lt;li&gt;Made the Session#request method public&lt;/li&gt;
&lt;li&gt;Added support for the WebDAV COPY method&lt;/li&gt;
&lt;li&gt;Added support for uploading files with POST and PUT&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In addition to all of this, Patron has a new home page at &lt;a href="http://toland.github.com/patron/"&gt;http://toland.github.com/patron/&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;So, what&amp;rsquo;s next for Patron? Well, I would like to put out a 0.5 release in the next few weeks with some refactoring and API tuning. Also, I would like to implement the rest of the WebDAV methods. I am toying with the idea of creating a net/http compatible interface so that Patron can be used as a drop-in replacement. Not sure if that is going to go anywhere, though.&lt;/p&gt;

&lt;p&gt;Once I am happy with the API and documentation I will release 1.0. Other than that, I try to respond to bug reports and feature requests in a timely manner. I originally wrote Patron to scratch my own itch, and that itch has been scratched. At this point I am looking to make Patron as broadly useful as I can, and your feedback helps with that.&lt;/p&gt;

&lt;p&gt;Patches and contributed documentation are always welcome. In particular, if anyone feels like trying to get this working on Windows, I will be happy to integrate the resulting patches and publish a binary gem.&lt;/p&gt;</description><link>https://philtoland.com/post/448933881</link><guid>https://philtoland.com/post/448933881</guid><pubDate>Wed, 22 Jul 2009 10:35:32 -0600</pubDate><category>Code</category><category>client</category><category>http</category><category>library</category><category>ruby</category></item><item><title>Using DTL templates with Nitrogen</title><description>&lt;p&gt;One thing that I did not like about working with the &lt;a href="http://nitrogenproject.com/"&gt;Nitrogen&lt;/a&gt; web framework is the way that view rendering is handled. Nitrogen calls the function &lt;code&gt;main/0&lt;/code&gt; in your web modules which, by convention, returns an instance of the &lt;code&gt;template&lt;/code&gt; record. This record points to a template file that has HTML code with a little Erlang mixed in. Essentially, you can call functions in your web module and whatever content those functions return is interpolated into your template.&lt;/p&gt;

&lt;p&gt;This all makes it sound a little more complicated than it really is. Here is a little &amp;ldquo;hello world&amp;rdquo; sample to illustrate how it works. First, the &lt;code&gt;web_page&lt;/code&gt; Erlang module defines the &lt;code&gt;main/0&lt;/code&gt; function and a couple of callouts:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;-module(web_page).
-include("wf.inc").
-compile(export_all).

main() -&amp;gt; #template { file="./wwwroot/template.html" }.
title() -&amp;gt; "Hello, World!".
content() -&amp;gt; #h1 { text="Hello, World!" }.
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This will cause Nitrogen to render the template.html file.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;title&amp;gt;[[[page:title()]]]&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
[[[page:content()]]]
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The callouts in the template will call the respective functions in the &lt;code&gt;web_page&lt;/code&gt; module and we end up with a page that displays a bold &amp;ldquo;Hello, World!&amp;rdquo;. The template file is really analogous to a Rails layout and the content that Rails puts into a view template is returned from the callouts using a markup DSL based on the Erlang record syntax.&lt;/p&gt;

&lt;p&gt;This template mechanism is simple, but it becomes very limiting when working on a non-trivial application. Nitrogen mixes controller functionality with presentation in a way that is reminiscent of PHP or JSP. Also, you cannot compose templates and the markup DSL doesn&amp;rsquo;t cover all of the HTML elements and attributes.&lt;/p&gt;

&lt;p&gt;I ran into this problem while working on a Nitrogen powered site and decided that I just couldn&amp;rsquo;t live with the default template system. After a little digging around I discovered &lt;a href="http://code.google.com/p/erlydtl/"&gt;ErlyDTL&lt;/a&gt; which implements a substantial subset of the &lt;a href="http://www.djangoproject.com/documentation/templates/"&gt;Django Template Language&lt;/a&gt; in Erlang. It turns out that using ErlyDTL in a Nitrogen site is quite simple.&lt;/p&gt;

&lt;p&gt;The first thing I needed was a utility function to render ErlyDTL templates. Nitrogen includes implicit elements for the notification flash and Javascript code for all of that AJAX goodnes which I needed to replicate in my render function.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;-module(my_util).
-compile(export_all).

template_path(Template) -&amp;gt;
    filename:join([code:priv_dir(my_app), templates, Template]).

render_template(Name, Variables) -&amp;gt;
    Template = template_path(Name ++ ".html"),
    Mod = list_to_atom(Name ++ "_template"),
    ok = erlydtl:compile(Template, Mod),
    {ok, Body} = Mod:render([{flash, element_flash:render()},
                             {script, wf_script:get_script()}
                             | Variables]),
    Body.
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now, I can replace the simple module from earlier with this new one:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;-module(web_page).
-include("wf.inc").
-compile(export_all).

main() -&amp;gt;
    my_util:render_template("template", [
          {title, "Hello, World!"},
          {content, content()}]).

content() -&amp;gt; "Hello, World!".       
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;My template file is now equally simple:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;title&amp;gt;{{ title }}&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;h1&amp;gt;{{ content }}&amp;lt;/h1&amp;gt;    
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;All of the markup is now in the template file, and the module is concerned only with getting the content from somewhere and making it available to the view. This also allows us to use the full power of ErlyDTL: we can compose templates and perform simple operations on the content to be displayed. Here is an example from the ErlyDTL home page:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Welcome back, {{ name }}!

You have {{ friends|length }} friends: {{ friends|join:", " }}

Have some primes:
{# this is exciting #}
{% for i in primes %}
    {{ i }}
{% endfor %}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;There is one drawback to this approach. The Nitrogen DSL includes helpers for generating links that work with its event system. When using ErlyDTL we have to create those links manually, but it isn&amp;rsquo;t hard. The key thing to remember is that the link id is the event name that will be passed to your module. Here are a couple of examples:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;a id="do_it" href="javascript:"&amp;gt;Do It!&amp;lt;/a&amp;gt;
&amp;lt;button id="do_it" class="button submit"&amp;gt;Do It!&amp;lt;/button&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The extra flexibility of DTL is certainly worth the small amount of extra work.&lt;/p&gt;</description><link>https://philtoland.com/post/448933855</link><guid>https://philtoland.com/post/448933855</guid><pubDate>Mon, 13 Jul 2009 13:24:35 -0600</pubDate><category>Code</category><category>dtl</category><category>erlang</category><category>erlydtl</category><category>nitrogen</category></item><item><title>Announcing Patron: a Ruby HTTP client library</title><description>&lt;p&gt;I was recently given the opportunity to release several of the projects I was working on at The Hive as open source. These projects are libraries that we built to address specific problems we ran into but were not core to our business. Most of these were always destined to be released, it just took a while before we got around to it. Everything is currently on my &lt;a href="http://github.com/toland"&gt;GitHub page&lt;/a&gt;, but I wanted to do a little cleanup on each project and announce them individually.&lt;/p&gt;

&lt;p&gt;Today I am announcing the first of these projects: Patron. Patron is an HTTP client library for Ruby that features a usable API and good performance. As for the name Patron, I searched through the thesaurus looking for synonyms for the word &amp;ldquo;client&amp;rdquo;.&lt;/p&gt;

&lt;p&gt;The performance problems with the built-in Ruby HTTP client are well documented &lt;a href="http://apocryph.org/2008/10/04/analysis_ruby_18x_http_client_performance/"&gt;elsewhere&lt;/a&gt;, so I won&amp;rsquo;t go into that here. The other alternative is the Curb gem which is based on &lt;a href="http://curl.haxx.se/libcurl/"&gt;libcurl&lt;/a&gt; and offers great performance. Unfortunately, curb is unfinished and doesn&amp;rsquo;t appear to have an official maintainer. Also, the API leaves much to be desired. These issues are compounded by the fact that curb is primarily implemented in C and is difficult to modify.&lt;/p&gt;

&lt;p&gt;I tried to patch curb to get all of the features we wanted, but subtle bugs kept creeping in. Eventually I gave in and wrote Patron. The goal was to have a Ruby HTTP client built on libcurl with a reasonable API. By implementing as much as possible in Ruby I think that Patron is much more maintainable than curb.&lt;/p&gt;

&lt;p&gt;I have not made an attempt to support every feature of libcurl. Libcurl is huge and trying to support every feature would lead to bloat and make it harder to maintain. Instead, I built a small API that did what we needed it to do. It has been in use at The Hive for some time now and seems pretty stable.&lt;/p&gt;

&lt;p&gt;The documentation for Patron is &lt;a href="http://patron.rubyforge.org/"&gt;on Rubyforge&lt;/a&gt; and the source code is available &lt;a href="http://github.com/toland/patron/tree/master"&gt;on GitHub&lt;/a&gt;.&lt;/p&gt;</description><link>https://philtoland.com/post/448933804</link><guid>https://philtoland.com/post/448933804</guid><pubDate>Fri, 03 Jul 2009 13:02:50 -0600</pubDate><category>Code</category><category>client</category><category>http</category><category>library</category><category>ruby</category></item><item><title>Thoughts on NetBeans 6.7</title><description>&lt;p&gt;I used NetBeans back when it was called Forte for Java and have kept an eye on it ever since. Every few releases I would download it and try it out again. Since Eclipse came onto the scene, NetBeans was just &amp;ldquo;that other Java IDE.&amp;rdquo; I no longer work with Java, nor do I use an IDE, but I still download NetBeans every once in a while to see how far it has come. When Rails began to gain traction, the NetBeans team began to work in Ruby support. The Ruby support in NetBeans has always demoed well, but always seemed a bit too clunky for me. And it looked like crap on OS X.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.netbeans.org/servlets/NewsItemView?newsItemID=1399"&gt;NetBeans 6.7&lt;/a&gt; was released on Monday and I dutifully downloaded it and played with it for a couple of days. The first thing that stuck me is that it looks good on OS X.&lt;/p&gt;

&lt;p&gt;&lt;img src="https://64.media.tumblr.com/tumblr_kzazhcClVu1qz4fz1.png" alt=""/&gt;&lt;/p&gt;

&lt;p&gt;This is the best looking Swing application I have ever seen, and yet there are little inconsistencies that can become annoying. For example, you can drag a Cocoa window by clicking anywhere on the integrated toolbar, but in NetBeans you have to click on the title bar. This is a big issue since the toolbar in NetBeans looks like an integrated Cocoa toolbar, but it isn&amp;rsquo;t. Also, clicking on a file in the explorer on the left shows the file&amp;rsquo;s members in the Navigator, but does not open the file. You have to double click to actually open a file.&lt;/p&gt;

&lt;p&gt;All of this would be forgivable if NetBeans offered better functionality than my current toolset. The whole idea behind IDEs is that it is more convenient to have all of the functionality you need bundled into one application than to use several separate apps. However, getting to some of the functionality in NetBeans requires digging around in the UI, and some stuff is just broken compared to the non-IDE equivalent. For example, when running Ruby tests or the Rails server via script/server from within NetBeans, the ASCII color codes are not properly interpreted making the output unreadable.&lt;/p&gt;

&lt;p&gt;So far, I have found NetBeans less convenient than the combination of &lt;a href="http://macromates.com/"&gt;TextMate&lt;/a&gt;, &lt;a href="http://gitx.frim.nl/"&gt;GitX&lt;/a&gt;, Terminal and &lt;a href="http://www.sequelpro.com/"&gt;Sequel Pro&lt;/a&gt;. Part of this is due to the fact that I have a lot of time invested in my current development stack. The latest version of NetBeans shows enough promise, and I am enough of a tools geek, that I am going to tough it out a few more days. That having been said, I am having a hard time seeing the value in an IDE when the components of a non-integrated development tool stack are of such high quality.&lt;/p&gt;</description><link>https://philtoland.com/post/448932748</link><guid>https://philtoland.com/post/448932748</guid><pubDate>Thu, 02 Jul 2009 12:56:00 -0600</pubDate><category>Tools</category><category>ide</category><category>netbeans</category><category>osx</category><category>rails</category><category>ruby</category></item><item><title>Master's degree preferred</title><description>&lt;p&gt;I recently found this in a job ad:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;This position will be responsible for customizing xml front-end templates&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Sounds like fun. After lines of &amp;ldquo;must have X plus years in Y technology&amp;rdquo; the employer states:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Candidates will possess a Bachelor’s Degree in a related field, with a Master’s Degree preferred.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;Seriously?&lt;/em&gt; I am curious what field is &amp;ldquo;related&amp;rdquo; to editing XML templates.&lt;/p&gt;</description><link>https://philtoland.com/post/134249930</link><guid>https://philtoland.com/post/134249930</guid><pubDate>Thu, 02 Jul 2009 11:13:00 -0600</pubDate></item><item><title>My Erlang setup</title><description>&lt;p&gt;When setting up Erlang under OS X I have run into two issues. First, how do I keep multiple versions installed at once? I sometimes have a need to evaluate a new version of the Erlang VM while keeping the old version around &amp;ldquo;just in case.&amp;rdquo; In a  few instances I had two applications which needed different versions of the VM. Second, where do I install all of the 3rd party Erlang libraries? Unlike with Ruby or Python there is no blessed &amp;ldquo;site&amp;rdquo; directory for 3rd party Erlang libraries.&lt;/p&gt;

&lt;p&gt;After a little experimentation I was able to set things up in a way that solves both of these issues. Some of the details are a bit specific to Mac OS X, but this method could easily be adapted to any UNIX-like environment. The method involves symlinks so Windows users are probably out of luck.&lt;/p&gt;

&lt;p&gt;I decided to install all Erlang related stuff under &lt;code&gt;~/Library/Erlang&lt;/code&gt; to generally conform to OS X conventions. While I chose to install under my home directory, you could also put it in &lt;code&gt;/Library&lt;/code&gt; with minimal changes to the process. In the &lt;code&gt;Erlang&lt;/code&gt; directory I have two subdirectories: &lt;code&gt;Releases&lt;/code&gt; and &lt;code&gt;Site&lt;/code&gt;. The general idea is that each Erlang release will live in a subdirectory of &lt;code&gt;Releases&lt;/code&gt; named after the Erlang release (i.e., &amp;ldquo;R13B01&amp;rdquo;) while 3rd party code goes in &lt;code&gt;Site&lt;/code&gt;. Finally, I create a symlink named &lt;code&gt;Current&lt;/code&gt; in the Erlang directory and link it to the release that I am currently using.&lt;/p&gt;

&lt;p&gt;The final setup looks like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Erlang
  |-- Current -&amp;gt; Releases/R13B01
  |-- Releases
  |     |-- R12B5
  |     `-- R13B01
  |-- Site
  |     |-- erlydtl-0.5.2.2
  |     |-- mochiweb-0.97.1
  |     |-- nitrogen-0.2.0
  |     `-- webmachine-1.3
  `-- setup.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The &lt;code&gt;setup.sh&lt;/code&gt; file is sourced in my &lt;code&gt;.bash_profile&lt;/code&gt; and it sets up the shell environment:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;export ERL_ROOT=$HOME/Library/Erlang/Current
export ERL_LIBS=$HOME/Library/Erlang/Site
export MANPATH=$ERL_ROOT/man:$MANPATH
export PATH=$ERL_ROOT/bin:$PATH
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;With this setup, all of the libraries in &lt;code&gt;Site&lt;/code&gt; are in the Erlang code path and the current Erlang VM is in the shell&amp;rsquo;s path. I can switch Erlang VMs by changing the symlink to point to a different distribution, but everything else remains the same.&lt;/p&gt;

&lt;p&gt;Building Erlang from source is simple. After extracting the source distribution:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ ./configure --prefix=$HOME/Library/Erlang/Releases/R13B01
$ make
$ make install
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You will want to replace the &amp;lsquo;R13B01&amp;rsquo; with the name of the distribution you are building.&lt;/p&gt;</description><link>https://philtoland.com/post/448932672</link><guid>https://philtoland.com/post/448932672</guid><pubDate>Wed, 01 Jul 2009 16:45:33 -0600</pubDate><category>Tools</category><category>erlang</category><category>osx</category></item></channel></rss>
