Sunday, June 28, 2009

Ticket Manager

Just made a little rails ticket manager which is now hosted at heroku.com.
Gonna keep the heroku given name of blooming-rain-76 for now.

You can sign up, create a project, create tickets for projects, create comments for tickets, set ticket priority and status. can also request to join another users project but user stuff is not all there yet.

Monday, April 13, 2009

.lang files in Ubuntu 8.10

Where oh where do the language spec files go in ubuntu 8.10 (intrepid ibex). According to this blog they are in ~/.gnome2/gtksourceview-1.0/language-specs/.
This was not the case on this install i've eventually located them in /usr/share/gtksourceview-2.0/language-specs

Tuesday, April 7, 2009

Rails and Dates

Stick this in environment.rb after the initialize block and have dates in the format you want.

ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.merge!(:default => '%d/%m/%Y')

Model.date.to_s will use the default in the DATE_FORMATS hash if present.

ruby makes you smile

def self.randy n
(1 + (rand * n-1).round)
end

Thing.create!(:bob => randy(730).days.ago.to_date)

I know its nothing that complex, but it just highlights how friendly Ruby is.

Sunday, April 5, 2009

Problems of Religion (geography)

Why is it that some people believe one religion while others believe a different one? Is it because people look at the different ones and think which one is right and then choose to follow it? Is it that they are all the same so it doesn't matter which one you follow? Not according to those who slaughter others for believing something different. Is it that people just follow what everyone else around them is following?

On the whole and certainly before large scale travel a person believed the religion of the region in which they where born? In historical times it was often socially impossible to not follow the same faith as your peers (they'd either shun or kill you!). However without social pressures, even today, it seems most people will just take the faith of their birth place especially if they stay put. I posit if the same religious person was born and raised somewhere else with a different religion they would believe that instead, especially in the times where other religions where unknown.

If all religions feel that they are mirrors of the other faiths and all stemming from the same source then there should be no question of which is the right one. As there is this question, as religions do feel that they are unique and each one views itself to be then one then why does geographical location represent the strongest factor determining which faith will be followed?

If it does turn out that it is the location that determines religious belief then that debases any one's claim of being the right one. Moreover it calls further into question the validity of each one.

Monday, March 30, 2009

ruby is so cool

result = things.select do |thing|
//some code
end if some_criteria

Sunday, March 29, 2009

Man; Dogs' Bitch

This came from a discussion I was having this morning about what Aliens would perceive to be the superior life, would it be humans or something else?
They would have some criteria to make their judgment of superiority. They may look at intelligence or size or how things have changed over history and ask if they are in a better state now than its predecessors. Intelligence and size are very human perceptions of superiority. Perhaps a good unbiased metric of which species has advanced the most might be the amount of energy it must output in order to survive and a comparison of how this has changed over the spices development. So the superior species would be the one which has optimized its energy outputs most effectively in order to achieve the same or better than its predecessors.

Humans would like to feel that we hold the leash over our development and the development of many other species but this is our view of things. At some point man found that it was good to have a dog by his side, and we like to feel that we have now domesticated dogs. How about looking at it the other way round.

Some humans where better suited to dogs and the dogs could scavenge from these types of people. These dog friendly people then had an edge over other dogless folk and so began the process of the dog selecting for more and more dog friendly people. This is not where it ends. The dog has now effectively out sourced nearly all of its major energy expending activities to mankind. We provide food, heating and couch.

An alien may judge what we see as our pets to be the masters of us as we still have to do the actual energy outlay.