<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>I write a lot of code and publish little prose.  But I am writing this blog for me. It will help me better understand what I do by writing about it, and if it helps even one other person, that’s good too.</description><title>(void* dan)</title><generator>Tumblr (3.0; @danspinosa)</generator><link>http://danspinosa.com/</link><item><title>I can’t get enough of Shutterbugg, new track from Big Boi.</title><description>&lt;embed type="application/x-shockwave-flash" src="http://danspinosa.com/swf/audio_player.swf?audio_file=http://www.tumblr.com/audio_file/876589463/tumblr_l6c7a00X2y1qa3g6v&amp;color=FFFFFF" height="27" width="207" quality="best"&gt;&lt;/embed&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;I can’t get enough of Shutterbugg, new track from Big Boi.&lt;/p&gt;</description><link>http://danspinosa.com/post/876589463</link><guid>http://danspinosa.com/post/876589463</guid><pubDate>Thu, 29 Jul 2010 16:51:36 -0400</pubDate></item><item><title>Photo</title><description>&lt;img src="http://29.media.tumblr.com/tumblr_l2d44vzsRi1qz4u07o1_400.png"/&gt;&lt;br/&gt;&lt;br/&gt;</description><link>http://danspinosa.com/post/595420843</link><guid>http://danspinosa.com/post/595420843</guid><pubDate>Thu, 13 May 2010 11:10:41 -0400</pubDate></item><item><title>Rails Finite State Machine: AASM != perfect, but &gt; Workflow</title><description>&lt;p&gt;I recently re-wrote an old model that desperately needed a formalized state machine definition (instead of the fragile logic I originally strung together).  After reviewing both &lt;a href="http://github.com/rubyist/aasm" target="_blank"&gt;AASM&lt;/a&gt; (formerly acts_as_state_machine) and &lt;a href="http://github.com/geekq/workflow" target="_blank"&gt;Workflow&lt;/a&gt;, I went with the former for a couple of reasons.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;AASM seemed to be a bit more mature&lt;/li&gt;
&lt;li&gt;It made more sense to describe an event (i.e. state machine input) once, with all the transitions it could cause and its to/from states, rather than defining it a separate time for each state-transition pair it could affect.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For example, one might define a traffic light in AASM as follows:&lt;/p&gt;
&lt;p&gt;&lt;code&gt; &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt; &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;
&lt;pre&gt;aasm_state :red, :yellow, :green&lt;/pre&gt;
&lt;pre&gt;aasm_event :timer_done do&lt;/pre&gt;
&lt;pre&gt;&lt;span&gt;	&lt;/span&gt;transitions :from =&gt; :red, :to =&gt; :green&lt;/pre&gt;
&lt;pre&gt;&lt;span&gt;	&lt;/span&gt;transitions :from =&gt; :green, :to =&gt; :yellow&lt;/pre&gt;
&lt;pre&gt;&lt;span&gt;	&lt;/span&gt;transitions :from =&gt; :yellow, :to =&gt; :red&lt;/pre&gt;
&lt;pre&gt;end&lt;/pre&gt;
&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Whereas Workflow would have one define it:&lt;/p&gt;
&lt;p&gt;&lt;code&gt; &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt; &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;
&lt;pre&gt;workflow do&lt;/pre&gt;
&lt;pre&gt;&lt;span&gt;	&lt;/span&gt;state :red do&lt;/pre&gt;
&lt;pre&gt;&lt;span&gt;		&lt;/span&gt;event :timer_done, :transitions_to =&gt; :green&lt;/pre&gt;
&lt;pre&gt;&lt;span&gt;	&lt;/span&gt;end&lt;/pre&gt;
&lt;pre&gt;&lt;span&gt;	&lt;/span&gt;state :green do&lt;/pre&gt;
&lt;pre&gt;&lt;span&gt;		&lt;/span&gt;event :timer_done, :transitions_to =&gt; :yellow&lt;/pre&gt;
&lt;pre&gt;&lt;span&gt;	&lt;/span&gt;end&lt;/pre&gt;
&lt;pre&gt;&lt;span&gt;	&lt;/span&gt;state :yellow do&lt;/pre&gt;
&lt;pre&gt;&lt;span&gt;		&lt;/span&gt;event :timer_done, :transitions_to =&gt; :red&lt;/pre&gt;
&lt;pre&gt;&lt;span&gt;	&lt;/span&gt;end&lt;/pre&gt;
&lt;pre&gt;end&lt;/pre&gt;
&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;I suppose it depends on the situation whether it’s clearer to define states - and everything that can cause one to leave that state - or to define events - and all the states on which they operate.&lt;/p&gt;
&lt;p&gt;But beware: AASM is not a perfect finite state machine.  You cannot auto-transition out of the initial state via the :after_enter method.  The initializer code will set your model’s &lt;em&gt;state&lt;/em&gt; variable to whatever is defined by &lt;em&gt;aasm_initial_state&lt;/em&gt; after all callbacks are run, even if the state machine transitions to a new state due to those initial states’ callbacks.&lt;/p&gt;
&lt;p&gt;For example, the following code would result in a :red initial state, not a :green initial state as would be expected:&lt;/p&gt;
&lt;p&gt;&lt;code&gt; &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;
&lt;pre&gt;aasm_initial_state :red&lt;/pre&gt;
&lt;pre&gt;aasm_state :red, :after_enter =&gt; Proc.new { |x| x.go_green! }&lt;/pre&gt;
&lt;pre&gt;aasm_event :go_green do&lt;/pre&gt;
&lt;pre&gt;&lt;span&gt;	&lt;/span&gt;transitions :from =&gt; :red, :to =&gt; :green&lt;/pre&gt;
&lt;pre&gt;end&lt;/pre&gt;
&lt;/code&gt;&lt;/p&gt;</description><link>http://danspinosa.com/post/589746336</link><guid>http://danspinosa.com/post/589746336</guid><pubDate>Tue, 11 May 2010 11:00:49 -0400</pubDate><category>rails</category><category>bug</category><category>gem</category><category>state machine</category></item><item><title>There's a Van de Graaff generator under your hood</title><description>&lt;p&gt;…or at least there could be.&lt;/p&gt;
&lt;p&gt;My brother, a solid mechanical engineer and muscle car devotee, was diagnosing an engine problem and asked me what I though.  A customer at his job was reporting sparks coming from one of the pulleys on the front of an engine.  This had been seen only a few other times, and the theories my brother heard were just entertaining.  The customer had no idea what was going on, how to fix it, or whose fault it was.&lt;/p&gt;
&lt;p&gt;When I learned a little more about the engine, and the pulley in particular, it became quite clear what was going on.  The pulley, normally a solid circle of metal attached to the engine via a metallic shaft, was made of two separate metal pieces; an outer metal ring and and inner metal pulley, separated by a dielectric (rubber, in this case).  If the belt was slipping on the pulley, an electrostatic charge could build up on the outer ring.  The charge would have no way to dissipate like it would on a normal pulley.  This charge could then arc to the engine block when it was strong enough (which isn’t too difficult, as the block and the pulley are fairly close).&lt;/p&gt;
&lt;p&gt;So my brother went on site and sure enough, the belt was loose.  A quick touch with the multimeter confirmed that the pulley was acting electrically as a capacitor, and a new (correctly tightened) belt fixed the issue.  What’s interesting is that at some point, a mechanical engineer added that rubber ring as a damper without realizing the electrical implications under a common failure mode.&lt;/p&gt;</description><link>http://danspinosa.com/post/556396602</link><guid>http://danspinosa.com/post/556396602</guid><pubDate>Wed, 28 Apr 2010 14:37:13 -0400</pubDate><category>engineering</category><category>cars</category><category>fail</category><category>mike</category></item><item><title>Negative content-length in HTTP header</title><description>&lt;p&gt;I recently debugged a fairly interesting problem one of our HomeField users was having with uploads.  The file was &gt; 2GB so the Flash uploader was not an option, and they were using our HTTP uploader.  But every time they tried, after a couple of minutes, the connection would fail due to timing out.  So I got in touch with their IT staff who graciously captured all the traffic on the uplink during a failed upload via &lt;a href="http://www.wireshark.org/" target="_blank"&gt;wireshark&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;After filtering for the ip address of our upload server, I was surprised to see only a handful of packets, most of which were retransmits.  A deep dive showed that the TCP handshake completed, but the first HTTP packet never heard any response back from us.  It was retransmitted by the client, as per TCP specification, and the receiving software on our server never responded.  Closer examination of the HTTP portion of that packet revealed an interesting header field: &lt;strong&gt;&lt;em&gt;content-length: -194931179&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html" target="_blank"&gt;HTTP 1.1 specification&lt;/a&gt; says that “any content-length greater than or equal to zero is a valid value.”  Unfortunately, Windows NT 5.1 (Windows XP) and IE 8 - according to the same header - have an integer overflow issue when dealing with files greater than 2GB.&lt;/p&gt;
&lt;p&gt;This OS level issue was causing the negative content-length, which prevented our server from responding, which caused a confusing (and poor) user experience.  Now I just need to get this user on a *nix OS…&lt;/p&gt;</description><link>http://danspinosa.com/post/552265723</link><guid>http://danspinosa.com/post/552265723</guid><pubDate>Mon, 26 Apr 2010 22:23:11 -0400</pubDate><category>bug</category><category>http</category><category>homefield</category><category>customer support</category></item><item><title>One Leg Chuck</title><description>&lt;p&gt;I love good music, especially when it’s being played live in public.  It’s not often that I hear a public performance I particularly like though.  I’m sick of the pile-o-garbage drummers, wandering mariachi bands and the didgeridoo guy at the Bedford L.  The full drumlines are cool, and sometimes there’s some funky asian musician with an instrument I know nothing about who sounds decent.  But for the most part, these folks only make me turn my iPhone to 11.&lt;/p&gt;
&lt;p&gt;Last night, waiting for the L at my strategic platform location in Union Square, I heard a musician that I really liked.  He was playing an acoustic guitar and covering Blind Melon’s &lt;em&gt;No Rain&lt;/em&gt; with a Johnny Cash meets NIN kind of feel.  I loved it.  So I walked over and payed him a compliment, accompanied by a dollar bill.  Considering that I only heard him for about 5 minutes, he was making $12/hour from just me.&lt;/p&gt;
&lt;p&gt;My only point is that I respect this guy.  Like Bleeding Gums Murphy - my nickname for the saxophonist on Thayer St at Brown University - One Leg Chuck is making the world a better place, and I value that.  I just wish he was on iTunes or Amy Street instead of myspace: http://www.myspace.com/fromcaliforniatonewyork&lt;/p&gt;
&lt;p&gt;Found him on &lt;a href="http://www.youtube.com/watch?v=8FlPp5iz0bw&amp;feature=related" target="_blank"&gt;YouTube&lt;/a&gt;, much better live.&lt;/p&gt;</description><link>http://danspinosa.com/post/545823014</link><guid>http://danspinosa.com/post/545823014</guid><pubDate>Sat, 24 Apr 2010 12:29:45 -0400</pubDate></item><item><title>For a while, my Google Analytics dashboard looked like the above...</title><description>&lt;img src="http://30.media.tumblr.com/tumblr_kzro61qUs81qa3g6vo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;For a while, my Google Analytics dashboard looked like the above image.  I could see trends, but it was like feeling the slope of a hill in the dark: no idea how high it went.  That sucked.  After a little research, it turns out that the Arial font in ~/Library/Fonts was somehow causing this Flash failure.  So I removed the file, and things are back to normal.&lt;/p&gt;</description><link>http://danspinosa.com/post/469371483</link><guid>http://danspinosa.com/post/469371483</guid><pubDate>Tue, 23 Mar 2010 23:25:13 -0400</pubDate><category>fail</category><category>flash</category><category>fix</category></item><item><title>"…driveby culture is both fast and free. When there’s no commitment of money or time in..."</title><description>“…driveby culture is both fast and free. When there’s no commitment of money or time in the interaction, can change or commerce really happen? Just because you can measure eyeballs and pageviews doesn’t mean you should.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;The &lt;a&gt;full article from Seth Godin&lt;/a&gt; was shared with me by &lt;a&gt;Joe Yevoli&lt;/a&gt;. It highlights a significant and great argument for our little app, &lt;a&gt;HomeField&lt;/a&gt;.  You could break down web app audience into two categories as suggested by this article: drive-by users and value-driven users.  We have the later, and a working business model that needs tweaking (vs. a business model that needs creating).  As we read from the beginning, via Guy Kawasaki, we need to set out to change the world in a meaningful way. We are.&lt;/em&gt;</description><link>http://danspinosa.com/post/452612163</link><guid>http://danspinosa.com/post/452612163</guid><pubDate>Tue, 16 Mar 2010 14:15:38 -0400</pubDate></item><item><title>Don't mark my app's email as SPAM</title><description>&lt;p&gt;Judging by the number of &lt;a title="SenderScore" target="_blank" href="http://senderscore.org"&gt;email&lt;/a&gt; &lt;a title="Postmark" target="_blank" href="http://wildbit.com/blog/2009/10/21/announcing-postmark-email-delivery-in-the-cloud/"&gt;outsourcing&lt;/a&gt; &lt;a title="SendGrid" target="_blank" href="http://sendgrid.com"&gt;companies&lt;/a&gt;, there is clearly a large problem to be solved.  I’ve had sporadic issues with email being marked as SPAM with &lt;a title="HomeField" target="_blank" href="http://TeamHomeField.com"&gt;HomeField&lt;/a&gt;, and then regular issues on my latest project, &lt;a title="Founders Card" target="_blank" href="http://founderscard.com"&gt;FoundersCard&lt;/a&gt;.  I’ve finally got them fairly well sorted, as far as I can tell…&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The DNS records on your name sever must be setup correctly (and &lt;a target="_blank" href="http://www.kitterman.com/spf/validate.html"&gt;verified&lt;/a&gt;)&lt;ol&gt;
&lt;li&gt;The A record of the domain you’re actually sending mail from (i.e. teamhomefield.com) must point to the IP of the actual server sending the email (in this case 8.12.42.205)&lt;/li&gt;
&lt;li&gt;You should also configure the SPF record which is being used increasingly by recipient mail servers to further determine if the sending servers IP address is authorized to send email for the given domain.  My DNS has a TXT record with the value “v=spf1 a mx ptr ~all”.     
&lt;ul&gt;
&lt;li&gt;
&lt;a title="record wizard" target="_blank" href="http://old.openspf.org/wizard.html"&gt;This wizard&lt;/a&gt; will help you create the proper record.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;rDNS (reverse DNS) must be setup   
&lt;ul&gt;
&lt;li&gt;On the server sending the mail, the PTR record must correctly specify the hostname pointing to this sever (teamhomefield.com)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Your Rails setup…   
&lt;ul&gt;
&lt;li&gt;You can set from to be any username at the domain configured above, but I’ve found that GMail will mark SPAM unless the following format is used   
&lt;ul&gt;
&lt;li&gt;from	 ”anything@teamhomefield.com (Anything Else)”&lt;/li&gt;
&lt;li&gt;Not sure why “Anything Else &lt;anything@teahomefield.com&gt;” doesn’t work..&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;The reply-to is great for sending on behalf of a user   
&lt;ul&gt;
&lt;li&gt;reply_to “Dan Spinosa &lt;spinosa@gmail.com&gt;”&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;I am using the following ActionMailer configuration   
&lt;ul&gt;
&lt;li&gt;
&lt;pre&gt;config.action_mailer.sendmail_settings = {
  :location       =&gt; '/usr/sbin/sendmail',
  :arguments      =&gt; '-i -t'
}&lt;/pre&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Your emails content…
&lt;ul&gt;
&lt;li&gt;If you’re sending HTML email, be sure to send it as a multipart email including a text part that closely matches the HTML (which, BTW, should include &lt;html&gt; and &lt;body&gt; tags)
&lt;ul&gt;
&lt;li&gt;In Rails, if your mailer action is named “notify_email”, Rails will automatically create a multipart email for you if you have multiple views: notify_email.text.html.erb and notify_email.text.plain.erb&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;It’s free to check your spam score &amp; deliverability at &lt;a target="_blank" href="http://www.contactology.com/check_mqs.php"&gt;contactology&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Your mail servers IP…
&lt;ul&gt;
&lt;li&gt;Make sure it is not listed by Spamhaus, and remove it if it is.  It is common to see your IP in their PBL, which can easily be &lt;a target="_blank" href="http://www.spamhaus.org/pbl/removal/"&gt;remedied&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;HTH, and hope I don’t have to deal with this again.&lt;/p&gt;</description><link>http://danspinosa.com/post/291897620</link><guid>http://danspinosa.com/post/291897620</guid><pubDate>Sun, 20 Dec 2009 11:32:00 -0500</pubDate><category>SPAM</category><category>rails</category><category>GMAil</category><category>fail</category></item><item><title>Web Based S3 File Manager</title><description>&lt;p&gt;I didn’t want a desktop app just to browse my files on S3 and double check that my code was actually doing what it seemed to be doing. I have no regular need to access these files and don’t want another throw-away app cluttering up my MBP.  So I did a little searching, and found this sweet freebie…&lt;/p&gt;
&lt;p&gt;An awesome web based file manager for S3: http://www.s3fm.com/&lt;/p&gt;
&lt;p&gt;You got something better?&lt;/p&gt;</description><link>http://danspinosa.com/post/290416947</link><guid>http://danspinosa.com/post/290416947</guid><pubDate>Sat, 19 Dec 2009 11:31:42 -0500</pubDate><category>s3</category><category>free</category></item><item><title>Rails DB Backup to S3</title><description>&lt;p&gt;If you don’t believe backing up your data is important, come back when (not if) you lose some important information.  Sensible (Rails) developers, read on…&lt;/p&gt;
&lt;p&gt;I’ve seen (and used) decent backup solutions involving mysqldump, sftp and an additional server.  They’re okay, but with a few plugins/gems your DB backup can be elegant (and &lt;a title="S3" target="_blank" href="http://aws.amazon.com/s3/"&gt;Amazon&lt;/a&gt; secure).  I happen to like &lt;a title="DB2S3 on github" target="_blank" href="http://github.com/xaviershay/db2s3"&gt;db2s3&lt;/a&gt;.  Configure the gem like the README says.  Then add a couple of &lt;a title="whenever at github" target="_blank" href="http://github.com/javan/whenever"&gt;whenever&lt;/a&gt; tasks:&lt;/p&gt;
&lt;blockquote&gt;every 1.hour { rake “db2s3:backup:full” }&lt;/blockquote&gt;
&lt;blockquote&gt;every 1.day { rake “db2s3:backup:clean” }&lt;/blockquote&gt;
&lt;p&gt;Holy shit done.  But you will have to pay the S3 bill.  So pick up a penny from the ground every day.  You’ll be $.25 ahead of the game at the end of the month.&lt;/p&gt;
&lt;p&gt;Gotchas?  Of course.  db2s3 relies on &lt;a title="aws-s3" target="_blank" href="http://amazon.rubyforge.org/"&gt;aws-s3&lt;/a&gt;, so you must have that gem installed (this is not explained in the README).  NBD, but if you happen to be using &lt;a title="right-aws" target="_blank" href="http://rubyforge.org/projects/rightaws/"&gt;right_aws&lt;/a&gt; with &lt;a title="paperclip" target="_blank" href="http://github.com/thoughtbot/paperclip"&gt;paperclip&lt;/a&gt;, like me, you may run into issues due to the gem load order.  So, keep your house in order:&lt;/p&gt;
&lt;blockquote&gt;config.gem “aws-s3”, :lib =&gt; “aws/s3”, :version =&gt; ‘&gt;= 0.6.2’&lt;/blockquote&gt;
&lt;blockquote&gt;config.gem “right_aws”&lt;/blockquote&gt;
&lt;p&gt;Thoughts?&lt;/p&gt;</description><link>http://danspinosa.com/post/289055854</link><guid>http://danspinosa.com/post/289055854</guid><pubDate>Fri, 18 Dec 2009 11:23:41 -0500</pubDate><category>rails</category><category>S3</category><category>backup</category><category>ruby</category></item><item><title>"Whatever we are, it’s we who move the world and it’s we who pull it through."</title><description>“Whatever we are, it’s we who move the world and it’s we who pull it through.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;Ayn Rand via Atlas Shrugged&lt;/em&gt;</description><link>http://danspinosa.com/post/240818219</link><guid>http://danspinosa.com/post/240818219</guid><pubDate>Wed, 11 Nov 2009 19:04:09 -0500</pubDate><category>atlas</category></item><item><title>Confusion Over Configuration</title><description>&lt;p&gt;Many Ruby on Rails decisions are guided by the motto “convention over configuration.”  This makes Rails &lt;i&gt;opinionated software&lt;/i&gt; and allows one to get up and running quickly and easily, so long as you follow the crowd.  I love this.  It makes you confident you can try something new, get it up and running fairly easily, then start adding functionality, breaking and tweaking iteratively.  They so to err is human.  It’s also Rails…&lt;/p&gt;
&lt;p&gt;I’m a very organized person; it helps me get things done.  So when I recently started building some Rails billing functionality, I decided I would namespace it.  Shouldn’t be too bad…&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;script/generate model billing/Account ...&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This created the model Billing::Account in the file models/billing/account.rb.  Nice.  Turned out to be less-than-nice when I tried to start working with it.  I’ll spare you the details of how much I hated my life that day and get straight to the caveats:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The migration generated created a table called “billing_accounts” which seemed correct (and great!) to me.  But ActiveRecord doesn’t care about your namespace, so you have to manually add “table_name :billing_account” to the Billing::Account model.&lt;/li&gt;
&lt;li&gt;For testing, a new directory was created: test/fixtures/billing, but it was empty.  The file billing_account.yml was added to the base fixtures directory.  Don’t do what I did and move that file into the billing/ directory: those fixtures don’t get loaded.  So leave it, or move it and update Rails’ load path to look through fixtures/ recursively.&lt;/li&gt;
&lt;li&gt;
&lt;a title="Foxy Fixtures" href="http://ryandaigle.com/articles/2007/10/26/what-s-new-in-edge-rails-fixtures-just-got-a-whole-lot-easier" target="_blank"&gt;Foxy fixtures&lt;/a&gt; do not work with namespaced models.  Not at all.  If there’s a way to get them to play nice, I couldn’t figure it out before deciding to hand out a couple of id’s manually.  Fuck it, that’s why.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;It puzzles me that Rails’ generator seems to handle namespaced models so gracefully, but actually creates these incompatible time-sucking gremlins.  Did I do something completely wrong here?&lt;/p&gt;</description><link>http://danspinosa.com/post/235280513</link><guid>http://danspinosa.com/post/235280513</guid><pubDate>Fri, 06 Nov 2009 16:28:00 -0500</pubDate><category>rails</category><category>fail</category></item><item><title>"It’s a known risk… But the odds against it are pretty good, especially when compared to the rewards..."</title><description>“It’s a known risk… But the odds against it are pretty good, especially when compared to the rewards of being an astronaut, so they’re willing to take the chance. In fact, they FIGHT for it… as would a lot of us. But getting the public to buy this is a lot tougher, especially a public that expects every risk in their lives to be mitigatable to zero. It will be interesting to see if NASA tries to take on this challenge, explaining to the public that doing bold things isn’t about engineering risk to zero. Shit happens, and if we just want to restrict ourselves to things where shit can’t happen… we’re not going to do anything very interesting.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;p&gt;Dan Canin, a Lockheed test pilot on the &lt;i&gt;Columbia&lt;/i&gt; space shuttle accident (via &lt;a href="http://tumblr.com/x0g3uofx7" target="_blank"&gt;reecepacheco&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;I have a significant conscious desire for risk.  Maybe it has to do with the (usually) greater reward I can see, my environment growing up, or what I’ve read and learned along the way.  I’m sure that’s part of it, but I have a feeling it’s more innate.  For me: the adrenaline / dopamine rush; behavior that evolved over millions of years to keep man alive, further his accomplishments and give meaning to his life.&lt;/p&gt;

&lt;p&gt;p.s. I’m excited to be getting a copy of Atlas Shrugged back from Reece so I can start reading it again.&lt;/p&gt;&lt;/em&gt;</description><link>http://danspinosa.com/post/232983354</link><guid>http://danspinosa.com/post/232983354</guid><pubDate>Wed, 04 Nov 2009 11:25:09 -0500</pubDate><category>entrepreneur</category></item><item><title>"Why do they always teach us that it’s easy and evil to do what we want and that we need..."</title><description>“Why do they always teach us that it’s easy and evil to do what we want and that we need discipline to restrain ourselves? It’s the hardest thing in the world – to do what we want. And it takes the greatest kind of courage. I mean, what we really want.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;Ayn Rand&lt;/em&gt;</description><link>http://danspinosa.com/post/227981159</link><guid>http://danspinosa.com/post/227981159</guid><pubDate>Fri, 30 Oct 2009 11:04:36 -0400</pubDate><category>aynrand</category></item><item><title>"The question isn’t who is going to let me, it’s who is going to stop me."</title><description>“The question isn’t who is going to let me, it’s who is going to stop me.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;Ayn Rand&lt;/em&gt;</description><link>http://danspinosa.com/post/226984582</link><guid>http://danspinosa.com/post/226984582</guid><pubDate>Thu, 29 Oct 2009 11:01:21 -0400</pubDate><category>aynrand</category><category>politics</category><category>design</category></item><item><title>"Perfection is achieved, not when there is nothing left to add, but when there is nothing left to..."</title><description>“Perfection is achieved, not when there is nothing left to add, but when there is nothing left to take way”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;Antoine de Saint-Exuper&lt;/em&gt;</description><link>http://danspinosa.com/post/225959484</link><guid>http://danspinosa.com/post/225959484</guid><pubDate>Wed, 28 Oct 2009 11:01:07 -0400</pubDate><category>engineering</category><category>philosophy</category></item><item><title>On Over Engineering</title><description>&lt;p&gt;During our meeting with Fred Wilson last week he mentioned something fairly obvious about our company: we have too few engineers  (i.e. just me).  He was making the point that one particular path for our company could see it thrive (netting a few million a year in profits) with a small 10-12 person staff (7 engineers or so).  But it started me thinking about it from the other angle: what if we had too many engineers?&lt;/p&gt;

&lt;p&gt;I firmly believe one of the reasons startups create some of the most beautiful and expertly crafted products is that they have limited resources with which to produce them.  Startups therefore, by necessity, build only to create value and build the smallest solution possible.  This viewpoint is bolstered by 37signals’ &lt;a title="Getting Real" href="http://gettingreal.37signals.com/" target="_blank"&gt;Getting Real&lt;/a&gt;, Paul Graham in many of his &lt;a title="Paul Graham essays" href="http://www.paulgraham.com/articles.html" target="_blank"&gt;excellent essays&lt;/a&gt;, and the principle of least effort (or path of least resistance, if you will).  It’s why Rob Pacheco says, “to find the most efficient way to accomplish a task, give it to the laziest guy in the kitchen.”&lt;/p&gt;

&lt;p&gt;Conversely, when a startup grows (or starts) too big, it produces decreasingly beautiful products.  Engineers, by definition, like to engineer.  An average engineer - which most of them are, by definition of the word average - will not achieve perfection.  Since these engineers have to do &lt;i&gt;something&lt;/i&gt; with their time, the company they work for ends up with an over-engineered product (by definition!).  It is the rare exception (i.e. Apple) that can produce many beautiful products by the labor of many engineers.&lt;/p&gt;

&lt;p&gt;-A Lazy Engineer&lt;/p&gt;</description><link>http://danspinosa.com/post/224391656</link><guid>http://danspinosa.com/post/224391656</guid><pubDate>Mon, 26 Oct 2009 21:36:41 -0400</pubDate><category>engineering</category><category>fail</category></item><item><title>Flash Now!</title><description>&lt;p&gt;In development of a new, greenfield application I had flash messages popping up twice: once for the current page, and then again on the next page.  It turns out I was using flash[]= and then rendering within the same action.  As flash[]= is designed to carry over to the next action (i.e. after you redirect, a new action is performed) it was showing up again.  The solution: flash.now[]=.  This hash is cleared after the current action.  The following code illustrates when to use each:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;def create_application
  #do work
  if it_worked?
    flash[:notice] = "Great success!"
    redirect_to @cash
  else
    flash.now[:error] = "Let's try that again"
    render :action =&gt; "new"
  end
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The flash[:notice] must be carried over to the action that handles the @cash path (following to the redirect), whereas the flash.now[:error] will be shown for the current action (even though it renders a different view) and should not be carried over to the next action.&lt;/p&gt;
&lt;p&gt;It seems somewhat strange to me that I’m just discovering this now.  I suppose that as I learn more about Rails and web applications in general, I adjust my techniques and start experimenting with new ones (that aren’t always better).  The fact that flash[]= carries over to the next action and flash.now[]= doesn’t has only come into play now that I’m using flash as more of a central messaging system than just the standard notices from scaffolds.&lt;/p&gt;</description><link>http://danspinosa.com/post/218262904</link><guid>http://danspinosa.com/post/218262904</guid><pubDate>Tue, 20 Oct 2009 13:53:55 -0400</pubDate><category>ruby</category><category>rails</category><category>fail</category></item><item><title>"My research revealed that lucky people generate good fortune via four basic principles. They are..."</title><description>“My research revealed that lucky people generate good fortune via four basic principles. They are skilled at creating and noticing chance opportunities, make lucky decisions by listening to their intuition, create self-fulfilling prophesies via positive expectations, and adopt a resilient attitude that transforms bad luck into good.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;p&gt;&lt;a href="http://www.telegraph.co.uk/technology/3304496/Be-lucky---its-an-easy-skill-to-learn.html" target="_blank"&gt;Be lucky - it’s an easy skill to learn - Telegraph&lt;/a&gt; (via &lt;a href="http://bijansabet.com/" target="_blank"&gt;bijan&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;Absolutely true.&lt;/p&gt; (via &lt;a href="http://reecepacheco.com/" target="_blank"&gt;reecepacheco&lt;/a&gt;)&lt;/em&gt;</description><link>http://danspinosa.com/post/217429237</link><guid>http://danspinosa.com/post/217429237</guid><pubDate>Mon, 19 Oct 2009 16:35:36 -0400</pubDate></item></channel></rss>
