Tuesday, November 10, 2009
Factory.create(:factory_girl, :fixtures => false)
Tuesday, May 26, 2009
Twitter really satisfies?
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
To convert a number to text:
n = Number.new(119)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 :)
puts n.to_text # => "one-hundred-and-nineteen"
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
Shiny new Apple Airport Extreme
As I've had an excellent run with Apple products I decided to give the Airport Extreme a shot.
It was a breeze to setup, and my wife and I can both notice the speed difference when accessing the net.
So far, so good!
Quality costs more but it seems you get what you pay for. We'll see if I'm singing the same tune about the Airport Extreme in 12months time.
YahooCurrency Gem
Originally the code was part of a working Ruby on Rails demo I created about 12 months ago. A project we are currently working on needed exchange rates, so i created a Gem from the original code so we could easily reuse it across any of our future Ruby projects.
We discussed making the project open source, and agreed that it would probably be useful for others, and also great for Global IT Creations to contribute something back to the open source. It is only a small contribution, but you have to start somewhere.
Here is some example code...
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/masterHopefully this will be the first of many projects that GITC releases as Open Source.
Thursday, February 12, 2009
Horror Movie Code
One section of code I'm looking at has a 300+ line if/elseif block, up to 9 levels deep! And if you want to see some real crap, you can look anywhere else in the remaining 700+ lines of code.
As for the project in general there are no meaningful unit tests, all the code is crammed into the Controllers, and it is so un-DRY you need a raincoat to get through it.
Code like this makes me want to cry.
This code is concrete evidence that if your parents are blood relatives you should not write software. (No offence intended to non-code writing inbreeds.)
