http://nathanherald.com nathanherald.com nathanherald.com en-us 2009-07-02T12:46:10-07:00 http://nathanherald.com/2009/07/mstrkrft http://nathanherald.com/2009/07/mstrkrft http://www.vimeo.com/5284239

http://www.vimeo.com/5284239

]]>
2009-07-02T12:17:54-07:00 http://nathanherald.com/2009/07/onedreamrush http://nathanherald.com/2009/07/onedreamrush http://www.vimeo.com/5405849

http://www.vimeo.com/5405849

]]>
2009-07-02T08:46:07-07:00 http://nathanherald.com/2009/07/design-management http://nathanherald.com/2009/07/design-management Design Management Design Management

A fantastic article by Zeldman about project management for design/web projects.

]]>
2009-06-27T21:46:40-07:00 http://nathanherald.com/2009/06/http-balldroppings-com-js http://nathanherald.com/2009/06/http-balldroppings-com-js http://balldroppings.com/js/ http://balldroppings.com/js/ ]]> 2009-06-25T18:23:59-07:00 http://nathanherald.com/2009/06/stoned-wallabies-make-crop-circles http://nathanherald.com/2009/06/stoned-wallabies-make-crop-circles Stoned wallabies make crop circles Stoned wallabies make crop circles ]]> 2009-06-24T08:32:07-07:00 http://nathanherald.com/2009/06/vegan-flyer http://nathanherald.com/2009/06/vegan-flyer Vegan Flyer Vegan Flyer ]]> 2009-06-24T07:54:39-07:00 http://nathanherald.com/2009/06/_why http://nathanherald.com/2009/06/_why http://project.ioni.st/post/2738#video_2738

http://project.ioni.st/post/2738#video_2738

]]>
2009-06-23T06:52:30-07:00 http://nathanherald.com/2009/06/fios http://nathanherald.com/2009/06/fios <p>The Fios man just repaired the internets here at home. A power brick freaked out and had to be replaced - which is actually what I had deduced myself since the LED on the thing was blinking like crazy.</p> <p>I should blame my lack of blog posts on the lack of internet access, but tethering was setup on my iPhone so it's really just me being lazy.</p> <p>Good news though, the Fios man offered to change my router access from Coax to Ethernet! This may not seem exciting, but it allows me to use any router I want without having to hack the Verizon router's firmware to make it pass through.</p> <p>Now I am using my Airport Express and the Verizon router is neatly boxed up in the corner. As it should be.</p> <p>Best Fios tech ever.</p> The Fios man just repaired the internets here at home. A power brick freaked out and had to be replaced - which is actually what I had deduced myself since the LED on the thing was blinking like crazy.

I should blame my lack of blog posts on the lack of internet access, but tethering was setup on my iPhone so it's really just me being lazy.

Good news though, the Fios man offered to change my router access from Coax to Ethernet! This may not seem exciting, but it allows me to use any router I want without having to hack the Verizon router's firmware to make it pass through.

Now I am using my Airport Express and the Verizon router is neatly boxed up in the corner. As it should be.

Best Fios tech ever.

]]>
2009-06-16T19:43:01-07:00 http://nathanherald.com/2009/06/5-ways-to-know-you-were-driving-an-rv-too-long http://nathanherald.com/2009/06/5-ways-to-know-you-were-driving-an-rv-too-long 5 Ways To Know You Were Driving An RV Too Long 5 Ways To Know You Were Driving An RV Too Long
  1. You are impressed with the acceleration of a 2003 Honda Civic Hybrid
  2. You keep taking turns way too wide
  3. You expect the tank to hold over $100
  4. You worry about height going to a drive through
  5. You finally, truly realize you were driving a freaking huge RV
]]>
2009-06-16T15:02:19-07:00 http://nathanherald.com/2009/06/couch-db-snippet http://nathanherald.com/2009/06/couch-db-snippet How to fetch a non-continuous set of couchdb ID's (when start and end keys won't work) How to fetch a non-continuous set of couchdb ID's (when start and end keys won't work)

Using curl:

$ curl -X POST http://localhost:5984/tickets/_all_docs \
  -d '{ \
    "keys":[ \
      "06a1b6e367cd059362bc3a7921b64b45", \
      "b6e6ee95a42e10f4b884b024e10fec2b"] \
    }'

> {
    "total_rows":3,
    "offset":0,
    "rows":[
      {
        "id":"06a1b6e367cd059362bc3a7921b64b45",
        "key":"06a1b6e367cd059362bc3a7921b64b45",
        "value":{"rev":"5-2613703449"}
       },
       {
         "id":"b6e6ee95a42e10f4b884b024e10fec2b",
         "key":"b6e6ee95a42e10f4b884b024e10fec2b",
         "value":{"rev":"4-3074023027"}
       }
     ]
   }
]]>
2009-06-15T13:59:53-07:00 http://nathanherald.com/2009/06/resuce-instead-of-if http://nathanherald.com/2009/06/resuce-instead-of-if <p>Just a random thought.</p> <p>A lot of people who use rails do a object.save, then check if it's true or not to determine what to do next in a controller. I find that to be verbose and hides the actual save command inside an if statement.</p> <pre><code>def update if @page.update_attributes params[:page] redirect_to admin_pages_path else render :edit end end </code></pre> <p>I prefer stuff like this:</p> <pre><code>def update @page.update_attributes! params[:page] redirect_to admin_pages_path rescue ActiveRecord::RecordInvalid render :edit end </code></pre> <p>I think it's more clear that to render :edit is an exception and should not be the norm.</p> Just a random thought.

A lot of people who use rails do a object.save, then check if it's true or not to determine what to do next in a controller. I find that to be verbose and hides the actual save command inside an if statement.

def update
  if @page.update_attributes params[:page]
    redirect_to admin_pages_path
  else
    render :edit
  end
end

I prefer stuff like this:

def update
  @page.update_attributes! params[:page]
  redirect_to admin_pages_path
rescue ActiveRecord::RecordInvalid
  render :edit
end

I think it's more clear that to render :edit is an exception and should not be the norm.

]]>
2009-06-15T09:53:02-07:00 http://nathanherald.com/2009/06/louisiana http://nathanherald.com/2009/06/louisiana <p>I have been in Louisiana for the past week helping out with Habitat for Humanity in New Orleans and HPC in Baton Rouge. Worked on some houses, mowed some lawns, painted some doors, and sweated a lot. It's hot there. Like really really hot.</p> <p>Had a great time helping, what little I could, and glad to be home and back to normal.</p> I have been in Louisiana for the past week helping out with Habitat for Humanity in New Orleans and HPC in Baton Rouge. Worked on some houses, mowed some lawns, painted some doors, and sweated a lot. It's hot there. Like really really hot.

Had a great time helping, what little I could, and glad to be home and back to normal.

]]>
2009-06-05T12:15:42-07:00 http://nathanherald.com/2009/06/give-away-everything http://nathanherald.com/2009/06/give-away-everything <p><em>Paul Arden</em></p> <blockquote><p>Do not covet your ideas. Give away everything you know, and more will come back to you.</p></blockquote> <p>Found via <a href="http://joshuablankenship.com/blog/2009/06/03/paul-arden-on-idea-hoarding/">Joshua Blankenship</a></p> Paul Arden

Do not covet your ideas. Give away everything you know, and more will come back to you.

Found via Joshua Blankenship

]]>
2009-06-04T15:51:21-07:00 http://nathanherald.com/2009/06/ruby-god http://nathanherald.com/2009/06/ruby-god <p>I just setup <a href="http://god.rubyforge.org/">God</a> to monitor 4 mongrels and <a href="http://github.com/adzap/ar_mailer/tree/master">ar_sendmail</a> and post to twitter about it. Need to tweek God's settings a bit, but really cool thus far.</p> I just setup God to monitor 4 mongrels and ar_sendmail and post to twitter about it. Need to tweek God's settings a bit, but really cool thus far.

]]>
2009-06-04T06:35:14-07:00 http://nathanherald.com/2009/06/google-chrome-on-mac http://nathanherald.com/2009/06/google-chrome-on-mac http://farm3.static.flickr.com/2416/3594570909_ddb91e3b2f_m.jpg

Google chrome on mac is pretty cool. Doesn't work with Flash and can't do http authentication yet, but it's already a really really good browser.

You can find builds for every revision.

]]>
2009-06-02T11:08:28-07:00 http://nathanherald.com/2009/06/css-animations-on-iphone http://nathanherald.com/2009/06/css-animations-on-iphone <p>I don't know if anyone has noticed, but Safari on the iPhone is capable of 3D transforms and smooth animation thanks to CSS Animations. Checkout <a href="http://developer.apple.com/safari/library/samplecode/SimpleBrowser/index.html">this example</a> (free account required).</p> <p>It's hard to tell that it's a webpage. I have got to do something with this.</p> I don't know if anyone has noticed, but Safari on the iPhone is capable of 3D transforms and smooth animation thanks to CSS Animations. Checkout this example (free account required).

It's hard to tell that it's a webpage. I have got to do something with this.

]]>
2009-06-01T18:29:08-07:00 http://nathanherald.com/2009/06/flash http://nathanherald.com/2009/06/flash Flash Flash

Rating: 1.1

Much time has been wasted recently getting Flash to do anything well.

]]>
2009-05-24T08:32:46-07:00 http://nathanherald.com/2009/05/scotland-on-rails-videos http://nathanherald.com/2009/05/scotland-on-rails-videos Scotland On Rails Videos Scotland On Rails Videos ]]> 2009-05-21T11:12:05-07:00 http://nathanherald.com/2009/05/this-is-why-wolfram-alpha-is-cool http://nathanherald.com/2009/05/this-is-why-wolfram-alpha-is-cool This is why Wolfram Alpha is cool This is why Wolfram Alpha is cool ]]> 2009-05-21T11:08:52-07:00 http://nathanherald.com/2009/05/my-name http://nathanherald.com/2009/05/my-name My Name My Name ]]> 2009-05-20T06:39:23-07:00 http://nathanherald.com/2009/05/tank-icons http://nathanherald.com/2009/05/tank-icons Tank Icons Tank Icons

This might be some of the coolest animated gifs I have come across in a very long time.

]]>
2009-05-19T08:27:16-07:00 http://nathanherald.com/2009/05/html5 http://nathanherald.com/2009/05/html5 HTML5 HTML5

Used to be, I would only use a strict XHTML doctype on any webpage I authored. I looked down on people using html4 or transitional even, thinking it was pretty worthless (which it is ;).

Why is XHTML better?

  1. XML can be validated, extended, and written by machines easier since it's parsing rules are standardized.
  2. XSLT
  3. Strictness (if it isn't valid xml, it doesn't work)

Any cons?

  1. Strictness. The idea of a comment from someone on my blog being able to derail the entire page because of invalid xml is pretty stupid.
  2. application/xml support sucks. Violating the spec just to please IE seems ok at first, but it really is just another thing to worry about. What if the mechanism that does this switch freaks out or doesn't work with IE9 or something?

But I don't care now, because HTML5 is the future

HTML 5 actually provides all the positives of XHTML without any of the cons. It's parsing rules are declared fully, anyone can make a parser and validation will be much more useful. HTML 5 will also define XHTML 5, which will be essentially the same but with XML compatibility, so XSLT is still an option. And strictness is still possible, but doesn't derail the entire thing.

You also get new form inputs, section, nav, header, footer, and other cool tags. You get data- attributes on elements, you get DOM parity with the parsing model, you get SQL storage in the browser, the ability to run apps offline, etc. You really get all the ideas we all already agree on.

Any really, why should HTML have it's own spec and be it's own language? Why do we have to use XML for everything? I already use JSON for almost all of my inter-application communication when I write webapps. Not because it works natively in javascript (I'm not even using it there much), because it works everywhere. There are not attributes or namespaces or anything, just data. It beats the pants off XML for most everything I do. And parsing JSON is dead simple, anyone can write a parser (sound familiar).

And really, the main reason HTML5 is the best to me is because the author of and contributors to the spec care about what works now. They are not hesitating to push things forward, but they are not blindly blazing a trail that no one is going to follow.

Is there anything that is in XHTML 2 that (X)HTML 5 will not have that matters? Contact me and I will amend any comments if valuable.

Also, here is a google search in case you care.

Update: Probly the best overview at immike.net. A quote:

Both working groups have embraced the coming Semantic Web by allowing developers to embed richer metadata in their documents. As with forms, the XHTML2 working group has embraced a more sophisticated technology, while the HTML working group has kept things simple.

The complex looks nice sometimes, but usually the simple wins in the end.

Update 2: An article disagreeing with me.

Update 3: Some more links:

]]>
2009-05-16T20:54:47-07:00 http://nathanherald.com/2009/05/mon-ami-gabi http://nathanherald.com/2009/05/mon-ami-gabi Mon Ami Gabi Mon Ami Gabi

Rating: 4.0

Website. A french bistro and steak house. Good steak, good wine, and good desert. Profiteroles are the bomb.

]]>
2009-05-16T15:26:58-07:00 http://nathanherald.com/2009/05/we-went-on-a-hike-amazing-forest-right-behind-our-house http://nathanherald.com/2009/05/we-went-on-a-hike-amazing-forest-right-behind-our-house http://farm4.static.flickr.com/3639/3537221832_1fd69db359.jpg?v=0

We went on a hike. Amazing forest right behind our house.

]]>
2009-05-13T19:28:39-07:00 http://nathanherald.com/2009/05/twitter-changed-at-replies http://nathanherald.com/2009/05/twitter-changed-at-replies Twitter changed @replies, then some people freak out, then twitter try to calm them by talking, then they try to calm them by changing Twitter changed @replies, then some people freak out, then twitter try to calm them by talking, then they try to calm them by changing ]]> 2009-05-12T14:55:43-07:00 http://nathanherald.com/2009/05/standford-iphone-programming-classes-free-on-itunes http://nathanherald.com/2009/05/standford-iphone-programming-classes-free-on-itunes Standford iPhone programming classes, free on iTunes (link will open iTunes) Standford iPhone programming classes, free on iTunes (link will open iTunes) ]]> 2009-05-12T14:00:53-07:00 http://nathanherald.com/2009/05/snakes-on-a-plane http://nathanherald.com/2009/05/snakes-on-a-plane Snakes on a plane Snakes on a plane ]]> 2009-05-12T09:45:59-07:00 http://nathanherald.com/2009/05/http-bigthink-com-topics-architecture-and-design-ideas-jeff-zeldman-drives-home-the-importance-of-web-standards http://nathanherald.com/2009/05/http-bigthink-com-topics-architecture-and-design-ideas-jeff-zeldman-drives-home-the-importance-of-web-standards http://bigthink.com/topics/architecture-and-design/ideas/jeff-zeldman-drives-home-the-importance-of-web-standards

http://bigthink.com/topics/architecture-and-design/ideas/jeff-zeldman-drives-home-the-importance-of-web-standards

]]>
2009-05-11T21:31:07-07:00 http://nathanherald.com/2009/05/example-rating-with-weird-amount http://nathanherald.com/2009/05/example-rating-with-weird-amount Example Rating with Weird Amount Example Rating with Weird Amount

Rating: 3.2333

This post's rating is 3.2333. Just testing to make sure the star images work ok even with weird numbers like that.

]]>
2009-05-11T21:28:52-07:00 http://nathanherald.com/2009/05/reviews-now-show-stars http://nathanherald.com/2009/05/reviews-now-show-stars <p>Review posts now show their ratings as stars.</p> <p>Ratings are stored as floats, so they can have very strange precision like 4.5 or 4.3567. Since I wanted to show the amount of stars as accurately as possible, I decided to make something that can reflect any float value (basically).</p> <p>Essentially, I laid 5 stars out (15px wide each) with 4px between them. I saved out two versions, one with all stars in the off/disabled state and one with all stars in the on/enabled state. I use these as backgrounds of div's, with the "on stars" on top of the "off stars." I show the current rating with the "on stars" by clipping the image's width. See below:</p> <p><img src="http://farm4.static.flickr.com/3644/3524672372_8fd356de01.jpg?v=0" alt="Star Layout Illustration" /></p> <p>So, I essentially clip the "on stars" to whatever width they need to be to represent the rating.</p> <p>How does one calculate the width? Well, it's simply <code>(star_width * rating_amount) + (space_width * floor(rating))</code>. <code>floor()</code> means to always round down, even when the decimal is .5 or more. Example math:</p> <p>Rating: 1<br/> Width: (15px <em> 1) + (4px </em> 1) = 19px (only shows the first star)</p> <p>Rating: 4.5<br/> Width: (15px <em> 4.5) + (4px </em> 4) = 83.5px</p> <p>Since we can't have 0.5 pixels technically, I just round the amount off to the nearest integer.</p> <p>So, not very hard. Actually, it took me longer to write this post than to make the stars.</p> Review posts now show their ratings as stars.

Ratings are stored as floats, so they can have very strange precision like 4.5 or 4.3567. Since I wanted to show the amount of stars as accurately as possible, I decided to make something that can reflect any float value (basically).

Essentially, I laid 5 stars out (15px wide each) with 4px between them. I saved out two versions, one with all stars in the off/disabled state and one with all stars in the on/enabled state. I use these as backgrounds of div's, with the "on stars" on top of the "off stars." I show the current rating with the "on stars" by clipping the image's width. See below:

Star Layout Illustration

So, I essentially clip the "on stars" to whatever width they need to be to represent the rating.

How does one calculate the width? Well, it's simply (star_width * rating_amount) + (space_width * floor(rating)). floor() means to always round down, even when the decimal is .5 or more. Example math:

Rating: 1
Width: (15px 1) + (4px 1) = 19px (only shows the first star)

Rating: 4.5
Width: (15px 4.5) + (4px 4) = 83.5px

Since we can't have 0.5 pixels technically, I just round the amount off to the nearest integer.

So, not very hard. Actually, it took me longer to write this post than to make the stars.

]]>