When Boeing prepared to launch the design of the 727 passenger plain in the 1960s, its managers set a goal that was deliberately concrete: The 727 must seat 181 passengers, fly nonstop from Miami to New York City, and land on Runway 4-22 at La Guardia. (The 4-22 runway was chosen for its length--less than a mile, which was much to short for any of the existing passenger jets.) With a goal this concrete, Boeing effectively coordinated the actions of thousands of experts in various aspects of engineering or manufacturing. Imagine how much harder it would have been to build a 727 whose goal was to be "the best passenger plane in the world."
Code, aimless meanderings and occasional outbursts from an Australian expatriate living in Singapore.
Tuesday, November 24, 2009
Remember Which Goals are Important
Tuesday, November 10, 2009
Factory.create(:factory_girl, :fixtures => false)
Friday, March 20, 2009
Australian Website Blacklist. Would you like lies with that?
So it seems the Australian government lied about how many URL's are on their blacklist.
Fair enough I suppose, we weren't meant to ever know what was on the list anyway.
Of course they lied. Whenever power is wielded in the absence of transparency do we ever hear about how it was secretly used for out benefit? No, we don't.
Senator Conroy says that this isn't the list. Now, because the list is supposed to be a secret there is nothing to weigh this statement against, so it must be taken on faith alone.
Ah, faith...
This is where we get to the other part of the problem. Senator Conroy represents a group of Australians that think it is OK to push their religious views onto others. We all know how great religious zealots are at being open and honest. They've scored a 0 out of 10 for that. These guys are as "open and honest" as they need to be to push their agenda, or to escape prosecution. Don't tell me you need examples.
What about my agenda? I don't have one. I'm also a nobody with no power. I just want information to be out on the open where it wants to be. If you or I want information, we should be able to find it. I do not want my Government telling me what information I should or should not see, as it has proven so often in the past to be way too tempting to Governments to use censorship to help keep themselves in power. Again, you don't need examples, I'm sure you can think of many instances of this being reported... eventually.
"But won't someone think of the children?!", some of you cry. Will someone think of the children years from now when they are denied access to information about about other political parties in Australia, or news about the latest bad things the Government has been doing to Australians.? OK, that may not happen, but once a blacklist exists it can happen. You don't need examples provided for this either.
I'm quite sure if the Labour Party had made it known they were planning on introducing web censorship the balance would not have tipped in their favor at the last election. I suppose thats why they want to get the blacklist implemented in the early part of their term. Voters have short memories generally.
Once we've all been conditioned to accept with censorship of the information we can see, your opinion as an individual is worthless. You lost the power to make your vote mean what you intended it to mean, because without all the information available to you, how can you make an informed decision?
As an Australian I'm incredibly disappointed about this whole mess, although the cynic inside me is not at all surprised.
Sunday, March 8, 2009
scottbarr-number_to_text RubyGem
n = Number.new(119) puts n.to_text # => "one-hundred-and-nineteen"I'm not happy with how the implementation came, but it does the job. I'll clean it up to work a bit nicer sometime :) If you need to convert numbers to text in Ruby, take a look at http://github.com/scottbarr/number_to_text/tree/master
Sunday, February 15, 2009
YahooCurrency Gem
exchange_rate = YahooCurrency.get_rate!("JPY", "USD")
exchange_rate.from #=> "JPY"
exchange_rate.to #=> "USD"
exchange_rate.rate #=> 0.0111
exchange_rate.timestamp #=> Wed Feb 11 22:20:00 +0800 2009
Get the source or the gem from http://github.com/scottbarr/yahoo_currency/tree/master
Hopefully this will be the first of many projects that GITC releases as Open Source.
Thursday, February 12, 2009
Horror Movie Code
Monday, September 22, 2008
Rails with NO Fixtures?
norway: code: NO name: NorwayI added a unit test to make sure I could get Norway by it's country code, which is NO
def test_find_by_code
assert_equal countries(:norway), Country.find_by_code('NO')
end
Agreed, I probably don't need a unit test for this, but this should have worked, but it was failing with the following message. Country id: 318845244, code: "1", name: "Norway" expected but was nilApparently NO in the yaml file is interpreted as a 0 (zero). To prove the theory I changed the code of norway to YES. The unit test failed, and indicated that the model it expected should have had code: "1". Changing countries.yml to be...
norway: code: "NO" name: NorwayI personally really like fixtures and the nice features they bring in, but sometimes they can catch you out. I'm sure it's not a bug, I've just never encountered this before. Ever found anything strange in your fixtures?
Sunday, August 31, 2008
View source code for iPhone RSS feed
I tried to view the Slashdot RSS feed on my iPod Touch, but instead of an RSS feed I was redirected to a specially formatted feed for iPhones. Very nice!
The iPhone specific URL is http://reader.mac.com/mobile/v1/http://rss.slashdot.org/Slashdot/slashdot .
I was curious to about the source code of the page, really just to see if there was any interesting markup. So I tried to view the URL in Firefox... no dice. I was shown a page saying, "This Application Is Viewable Only On iPhone".
Hmm... it was time to cheat a little then. I googled around for the User Agent that the iPhone sends, opened a terminal and entered...
Thursday, August 14, 2008
Ruby on Rails doesn't scale you say?
Thursday, August 7, 2008
Stop and start PostgreSQL on OSX
To manually stop or start a PostgreSQL 8.2 server that was installed via macports, use the following commands.
Stop
# sudo launchctl stop org.macports.postgresql82-server
Start
# sudo launchctl start org.macports.postgresql82-server
Obviously this will also work for PostgreSQL 8.3 or 8.4 if you change the commands slightly.
I prefer the approach Linux distros have generally taken for service management, where all services are listed under the /etc/init.d diretory. To me /etc/init.d/postgresql-8.2 is easier, and you can use command completion to type it.