Archive > July 2007

Checkers Solved

Dave » 21 July 2007 » In Technology » No Comments

Machinist: Tech Blog, Tech News, Technology Articles – Salon

I have to admit, I never thought of checkers as being a game that needed to be solved — never mind that it would take 18 years and several CPUs to do it. Now, it’s time to solve chess, but that might take a while. Checkers has about 5 x 1020 positions, but chess has somewhere in the 1040 – 1050 positions. I suspect that will take awhile longer.

Ths is making me want to dig out the chess program I wrote back when I was getting my masters. Using brute force, the program beat me and a few others all the time. I’m curious how much faster it would run today.

Continue reading...

Tagging

Dave » 20 July 2007 » In Technology » 1 Comment

I came across this excellent post on Philipp Keller’s blog: Tag History and Gartner’s Hype Cycles. I agree with Philipp’s take that we seem to be in the area of disillusionment. The question remains, however, whether tagging really is on the rise in the way that most of us expect. Don’t get me wrong, I’m a big believer and user of tagging, but most non-technical people that I know do not fully appreciate the power of tagging — both personal and global/social.

How do we know?

Tagging History

Gartner’s Hype Cycle

Continue reading...

More Ruby Scaling

Dave » 06 July 2007 » In Technology » 2 Comments

Ruby is an amazingly productive language, and Rails is an awesome framework. However, you need to be aware of what you are getting into. There are lot’s of items that make life difficult for your web server. Some of the biggest culprits are has_one, has_many, etc. They are so powerful, but use them wrong and your database will be in trouble.

For example:

class Company < ActiveRecord::Base
has_many :people
# There is a name column in the db
end

class Person < ActiveRecord:Base
belongs_to :company
end

Now, assume you will be showing 50 people with their company names on a page. The view code is very simple:

<% @people.each do |p| %>
<%= p.first_name + “, ” p.company.name %>
<% end %>

Forget about the formating, but this simple loop will result in 50 database calls to retrieve the company name. If your application does this a lot, you will need some caching, or your database will be in trouble.

It’s a good idea to watch your logs and attack those areas that are performing excessive database queries.

Continue reading...

Automatic CSS: The stylizator

Dave » 06 July 2007 » In Technology » No Comments

Corunet. El blog – Automatic CSS: The stylizator

I came across this the other day. It’s a nice trick to get an idea how others are handling their CSS.

Continue reading...