Showing posts with label thank god that's over. Show all posts
Showing posts with label thank god that's over. Show all posts

Friday, January 2, 2009

Who Knew?!?!

...that it would be more than two months since my last post.

...that Rails and Merb would get into bed with each other. (And may or may not come out producing something useful).

...that we would be on the verge of collapsing economically (ok, some did, but I didn't).

...that the Boston Bruins would lead the NHL in points almost half way through the year by winning 10 games straight! (they better knock this off, my Red Wings need some love)

...that the Tennessee Titans would be the 1st seed in the NFL playoffs.

...that I would grasp enough Erlang to seriously consider using it for an application.

...that I could come up with a post as "clever" as this with a horrid head cold.

Ok, well now that the busyness of Nov/Dec is over I can hopefully return to more sharing...Stay tuned.

Monday, September 8, 2008

Is your DataMapper CouchDB adapter PUT'ing where it shouldn't?

It sounds gross, sure...but this was actually a simple problem I foresee someone running into and potentially running around mad about for an hour if they're not too keen on how DataMapper/CouchDB work together. Even if you DO know how they work together, this was still a fun problem to track down.

So let's take an example model that's extremely simple:

class Person
include DataMapper::Resource
# CouchDB Specific
property :id, String, :key => true, :serial => true, :field => :_id
property :rev, String, :field => :_rev
#App Specific
property :name, String, :nullable => false, :length => 75, :key => true
end


Looks harmless, right? That's what I thought too! Well, if you begin your application and get to the point of actually creating a Person you'll be greeted with an error that kicks off with "EOFError: end of file reached ".

So what's happening here?

Basically in the adapter, there is a LOC in the create method where it checks to see if there is a key or not (Yea, the one we've specified above as :name).

This creates an assumption of using PUT instead of POST and that is where the issue stems from. So, to fix this problem, all you need to do is DROP the :key => true and things will run as they should.

Now you're probably asking "But, what if I NEED to have that key there, I NEED to relate my models with a foreign key". Not to sound harsh, but just to be clear, you may want to revisit why you're using CouchDB in the first place.

Wednesday, August 6, 2008

Timezones in Gentoo

I'm on Central time...and there wasn't a clear way (within the gentoo docs) for getting myself on the correct timezone. SO, for anyone in my timezone that needs it...this is the way to do it:

rm /etc/localtime && ln -s /usr/share/zoneinfo/US/Central /etc/localtime

For anyone else, after zoneinfo// - make sense?

40 minutes...and sometimes I wonder about myself.

Monday, August 4, 2008

SFTP and blogger

Just a hint for anyone setting up a hosted blog via the blogger platform.

You will likely need to modify your /etc/ssh/sshd_config file...or else you will be unable to publish to your sftp site.

The change you need to make is:

PasswordAuthentication yes


It's likely already set to "no".

I was getting this error while trying to publish to a hosted blog to my domain and was seeing an error in my ssh log that read:
Did not receive identification string from [google ip addr]


So yea, I hope that helps anyone who needs it.

Friday, January 18, 2008

'Wings finally break 3 game skid.

Just to give anyone reading a heads-up, I'll post my hockey blurbs here and there, because I need to give my team a "shout out". Maybe I'll even convert you into a hockey fan along the way...

The Detroit Red Wings ended a three game losing streak Thursday night in a 3-2 shootout victory over the Vancouver Canucks. Dan Cleary posted the only 2 regulation goals for Detroit, with Henrik Zetterberg putting away the only shootout goal.

Dominik Hasek certainly shined on in this game stopping 26 of 28 shots and shutting the Canuck shooters down in the shootout.

In years past, I could probably (and given the time, I most likely will because I'm a nerd like that) graph two "slips" in the Red Wings seasonal performance. One in November and one in late January/early February, almost like clockwork. I'll hopefully put something together in the coming weeks with all the madness going on.

Cheers for the Red Wings!