The cost of automation

Posted over 7 years back at The Hobo Blog

Very interesting point over on S/N:

Auto-mode vs. shooting manual

Is Hobo guilty of putting up another layer? Of blurring your vision? The answer can’t be a straightforward “yes”, because that road would lead back to hacking assembly-code by hand.

Many photographers like to develop their film by hand too. If Hillman Curtis did that with his movie, for every frame, he’d definitely get a richer result. He’d also never finish.

I think it comes down to a simple trade-off – every time you flick an “auto” switch off, development time goes up, but quality goes up too - people always do things better than machines. Which switches you flick is a judgement call that has to be made for each switch and for each project.

The interesting thing about Hobo is that it lets you, if you so choose, start with all the switches on. You can then switch them off one by one, gradually replacing the automatic with the hand-crafted.

The cost of automation

Posted over 7 years back at The Hobo Blog

Very interesting point over on S/N:

Auto-mode vs. shooting manual

Is Hobo guilty of putting up another layer? Of blurring your vision? The answer can’t be a straightforward “yes”, because that road would lead back to hacking assembly-code by hand.

Many photographers like to develop their film by hand too. If Hillman Curtis did that with his movie, for every frame, he’d definitely get a richer result. He’d also never finish.

I think it comes down to a simple trade-off – every time you flick an “auto” switch off, development time goes up, but quality goes up too - people always do things better than machines. Which switches you flick is a judgement call that has to be made for each switch and for each project.

The interesting thing about Hobo is that it lets you, if you so choose, start with all the switches on. You can then switch them off one by one, gradually replacing the automatic with the hand-crafted.

Random Numbers in UUIDTools

Posted over 7 years back at Sporkmonger

I wrote the random number generator for UUIDTools awhile ago, but strangely, I’m only just now getting around to verifying that the numbers it generates really are decently random. Previously, I’d just been “eyeballing” it.

~/Projects/Ruby/Components/uuidtools/lib $ irb
UUIDTools environment loaded.
>> output = File.new("random.txt", "w")
=> #<File:random.txt>
>> 10000.times do
?>   output.write(UUID.true_random)
>> end
=> 10000
>> output.close
=> nil
>> exit

~/Projects/Ruby/Components/uuidtools/lib $ ent < random.txt
Entropy = 7.998801 bits per byte.

Optimum compression would reduce the size
of this 160000 byte file by 0 percent.

Chi square distribution for 160000 samples is 266.64, and randomly
would exceed this value 50.00 percent of the times.

Arithmetic mean value of data bytes is 127.1241 (127.5 = random).
Monte Carlo value for Pi is 3.146778669 (error 0.17 percent).
Serial correlation coefficient is -0.000714 (totally uncorrelated = 0.0).

I’m reasonably satisfied with that I think.

By comparison, the builtin rand method in ruby gets:

~/Projects/Ruby/Components/uuidtools/lib $ rm random.txt
~/Projects/Ruby/Components/uuidtools/lib $ irb
UUIDTools environment loaded.
>> output = File.new("random.txt", "w")
=> #<File:random.txt>
>> 160000.times do
?>   output.write(rand(256).chr)
>> end
=> 160000
>> output.close
=> nil
>> exit

~/Projects/Ruby/Components/uuidtools/lib $ ent < random.txt 
Entropy = 7.998954 bits per byte.

Optimum compression would reduce the size
of this 160000 byte file by 0 percent.

Chi square distribution for 160000 samples is 231.72, and randomly
would exceed this value 75.00 percent of the times.

Arithmetic mean value of data bytes is 127.6154 (127.5 = random).
Monte Carlo value for Pi is 3.150228756 (error 0.27 percent).
Serial correlation coefficient is -0.000933 (totally uncorrelated = 0.0).

And random.org gets:

Entropy = 7.999805 bits per character.

Optimum compression would reduce the size
of this 1048576 character file by 0 percent.

Chi square distribution for 1048576 samples is 283.61, and randomly
would exceed this value 25.00 percent of the times.

Arithmetic mean value of data bytes is 127.46 (127.5 = random).
Monte Carlo value for PI is 3.138961792 (error 0.08 percent).
Serial correlation coefficient is 0.000417 (totally uncorrelated = 0.0).

Dan Webb - Ruby on Rails Podcast

Posted over 7 years back at Ruby on Rails Podcast

The stylishly sneakered leading proponent of unobtrusive Javascript gives advice about Rails freelancing and standards-based website development.
Also mentioned:

In Praise of Slowness

Posted over 7 years back at The Hobo Blog

I had to create a new category for this post – ‘Off Topic’. Hope you don’t mind but I just had to share this with anyone that’s listening. Everyone in the Western world needs to watch this video. Twice. No, Really.

Once upon a time, a book of “One-Minute Bedtime Stories” provided the wake-up call for Carl Honore, who considered time efficiency to be more important than reading to his son. He realized that he was speeding his way through life to the detriment of his health, productivity and relationships. As in his book, “In Praise of Slowness”, Honore shares examples of how we can make more of life by doing less and getting in touch with our “inner tortoise.” (Recorded July 2005 in Oxford, UK. Duration: 20:00)

Watch video

(I just got a link from a friend recommending the TED Talks and this was the first one I watched – looks like a gold mine!)

In Praise of Slowness

Posted over 7 years back at The Hobo Blog

I had to create a new category for this post – ‘Off Topic’. Hope you don’t mind but I just had to share this with anyone that’s listening. Everyone in the Western world needs to watch this video. Twice. No, Really.

Once upon a time, a book of “One-Minute Bedtime Stories” provided the wake-up call for Carl Honore, who considered time efficiency to be more important than reading to his son. He realized that he was speeding his way through life to the detriment of his health, productivity and relationships. As in his book, “In Praise of Slowness”, Honore shares examples of how we can make more of life by doing less and getting in touch with our “inner tortoise.” (Recorded July 2005 in Oxford, UK. Duration: 20:00)

Watch video

(I just got a link from a friend recommending the TED Talks and this was the first one I watched – looks like a gold mine!)

Hobo 0.5.1 &mdash; hobo command fixed

Posted over 7 years back at The Hobo Blog

I guess that’s what happens when you do a release at 2am. The hobo command was failing, or more specifically, the hobo_user_model generator which is used by the hobo command.

Fixed in Hobo 0.5.1 (download gem)

Hobo 0.5.1 &mdash; hobo command fixed

Posted over 7 years back at The Hobo Blog

I guess that’s what happens when you do a release at 2am. The hobo command was failing, or more specifically, the hobo_user_model generator which is used by the hobo command.

Fixed in Hobo 0.5.1 (download gem)

Episode 6: Shortcut Blocks with Symbol to_proc

Posted over 7 years back at Railscasts

It may have a goofy syntax, but the Symbol#to_proc feature Rails adds allows you to do simple blocks very quickly and easily.

AR Model Initialization Notes

Posted over 7 years back at zerosum dirt(nap) - Home

If you’re new to Rails but not to Ruby, you might be surprised to learn that Rails doesn’t use the standard Ruby initialize() method when Model.new is invoked or when a model instance is returned from a find.

If you need to add some initialization code to an ActiveRecord model, use the after_initialze callback instead:

def after_initialize
  @thing = SomethingElse.new(self)
  @foo = 'bar'
end

Kid

Posted over 7 years back at The Hobo Blog

Any of you Ruby folk taken a look over the fence into Python land and seen Kid templates?

They call it an “attribute language” because unlike DRYML, there are smart attributes rather than smart tags. e.g. from their docs:

<p py:if="system() == 'Linux'">
  Good for you!
</p>

When you’ve stopped sniggering about those empty brackets, you might agree that it’s rather elegant and compact – particularly for this specific example: a conditional.

Over in the forums we’ve been chatting about how all the if_this, if_that tags in DRYML are kinda icky. I’m wondering about supporting this style just for if. Something like

<p if="logged_in?">Logged in as <display_name obj="#current_user"/></p>

Is that just too inconsistent when everything else is done with tags? How about the else? Whadayathink?

p.s. I was going to post this in the forums, but I thought I’d give this way a try. Let me know if you think this is noise in the context of the blog.

So that’s two questions for you. I just put a fresh pad of blank comments in the server so knock yourself out.

Kid

Posted over 7 years back at The Hobo Blog

Any of you Ruby folk taken a look over the fence into Python land and seen Kid templates?

They call it an “attribute language” because unlike DRYML, there are smart attributes rather than smart tags. e.g. from their docs:

<p py:if="system() == 'Linux'">
  Good for you!
</p>

When you’ve stopped sniggering about those empty brackets, you might agree that it’s rather elegant and compact – particularly for this specific example: a conditional.

Over in the forums we’ve been chatting about how all the if_this, if_that tags in DRYML are kinda icky. I’m wondering about supporting this style just for if. Something like

<p if="logged_in?">Logged in as <display_name obj="#current_user"/></p>

Is that just too inconsistent when everything else is done with tags? How about the else? Whadayathink?

p.s. I was going to post this in the forums, but I thought I’d give this way a try. Let me know if you think this is noise in the context of the blog.

So that’s two questions for you. I just put a fresh pad of blank comments in the server so knock yourself out.

Nearly forgot

Posted over 7 years back at The Hobo Blog

If you are updating an existing app that uses Rapid to Hobo 0.5, you will need to add the following at the top of your views/hobolib/application.dryml

<taglib src="plugins/hobo/tags/rapid"/>

<set_theme name="default"/>

Nearly forgot

Posted over 7 years back at The Hobo Blog

If you are updating an existing app that uses Rapid to Hobo 0.5, you will need to add the following at the top of your views/hobolib/application.dryml

<taglib src="plugins/hobo/tags/rapid"/>

<set_theme name="default"/>

Hobo 0.5 and more...

Posted over 7 years back at The Hobo Blog

It was 17 and a half hours in the end but we seem to have made it. Although without a great deal of surplus energy for a riveting blog post!

Hope you enjoy the new site – we’ve tried to have a bit of fun with it :-). Also don’t miss: two new screencasts, the docs, and of course Hobo 0.5 (changelog).

Let me know what breaks!

ZZZZZzzzzzz…