Wednesday, March 12, 2008

I'm not obsessed with urine--I swear...

Humorous Pictures
Enter the ICHC online Poker Cats Contest!

Monday, March 10, 2008

I am a leet rails haxor...

Been playing with Rails a bit, to see how easy it is for me to learn (since I have some nodding familiarity with Ruby). It's generally fun, but I really disliked the new (in v2) style scaffolding. Apparently, the scaffold generator no longer inspects any existing tables in generating the views. You've got to list everything out on the command line. Very disappointing. I whined about it here.

Encouraged by the kind folks on the Rails Talk group, I tried writing my own scaffold generator--generally a complete ripoff of the original, except that if you don't specify any attributes on the command line, it sniffs the db for a table w/the proper name & then packs the arguments with whatever it finds. It's not fully tested, but seems to work for me. Here is the relevant code:


def initialize(runtime_args, runtime_options = {})

# TODO: test this proper (adapt rails' scaffold_test.rb)
# This is hokey, but it's within my powers.
# Rescue the noob who generates scaffold
# on an existing table w/out specifying attributes
# on the command line.
si_uncounted_arguments = %w(--skip-timestamps --skip-migration)
if (runtime_args - si_uncounted_arguments).length == 1 then
# Called in "static introspective" mode--pack
# runtime_args with name:type pairs if we find
# an existing table.
si_table_name = runtime_args[0].pluralize.underscore
puts("Called without any attribute specs on the command
line--looking for a table called '#{si_table_name}'
from which to infer attributes...")
begin
si_cols = ActiveRecord::Base.connection.columns(si_table_name, "#{name} Columns")
rescue ActiveRecord::StatementInvalid => err
# Table not found.
puts("Sorry--table '#{si_table_name}' not found--you're
going to have a lame-ass scaffold. Did you forget
to run 'rake db:migrate' maybe?")
else
si_attributes = []
si_ignorable_fields = %w(id:integer created_at:datetime updated_at:datetime)
si_cols.each do |c|
si_attributes << "#{c.name}:#{c.type}"
end
si_attributes -= si_ignorable_fields
runtime_args += si_attributes
# No need for a migration in this case--we're using the existing table.
runtime_args += %w(--skip-migration) unless
runtime_args.include?('--skip-migration')
end
else
puts("User specified attributes on the command
line--no introspection done.")
end

super

#etc.

end



I think this will work well enough for my purposes. I'll be using it (gotta get back to trying to learn Rails) for my toy app & will see if it serves me. If it does, maybe I'll try to gem it up (or package it up however such things get packaged up) and put it someplace accessible. In the meantime feel free to steal it, suggest improvements, make fun of it, etc.

Saturday, December 01, 2007

Special Guest Dog


For a while now we've been sort of 'fostering' our neighbor's dog, Sadie. Isn't she a cutie?

She was a rescue, but our neighbor says she's a malamute cross. To me she looks more like a combination Collie & English Sheepdog, but who really knows?

Kodos loves having another dog around, even if she doesn't always want to play when he does.

Thursday, August 02, 2007

Urine Nation

I have problems...

The family took a lovely road trip down to Tucson a couple of weeks ago. The house was going to be empty for 5 days or so, so we:
  • boarded the dog
  • up-ended a bag of cat food into a big bowl & scooped their litter boxes for the cats.
Since returning, 1-year-old Kodos has peed in the house four times, in 3 spots. And it seems not to be the regular, only-mildly-offensive pee. This is especially pungent stuff. I can smell it in the room, even after cleaning it with the Get Serious enzyme cleaner, which is supposed to make the smell imperceptible even to the sensitive noses of animals. I've gone over all 3 spots with that several times, and with an upright carpet steamer, and with a hand steamer. The smell is better (at least once the affected spots dry) but I can still smell it if I put my nose down in the affected area. I am definitely in the market for carpet-cleaning tips--please tell me how I can fix these!

Until I can get these things cleaned, I dare not let K into the carpeted areas of the house, so we're back in baby-gate purgatory for a while. This is particularly a drag, b/c my in-laws are visiting, and they are not the most nimble folks.

Have I mentioned that I need carpet cleaning tips?

So what the heck is going on? Why the sudden backslide of house training at this late date? I had trusted Kodos to roam all over the whole house for many months. He hadn't had an accident since I took away the beef bone that seemed to make him, um, incontinent in a different way.

Here are some facts to bolster the conclusion I'm about to lay on you. ;-)
  • At the boarding kennel, Kodos was stationed 2 kennels down from a female in season.
  • While we were gone, the cats took to using one of the bedrooms (the one K first peed) as a litter box & the place stank to high heaven. (Thankfully, they peed on bedding, which was easily removed & laundered--not so much with our carpeting.)
  • Kodos has recently begun lifting his leg to pee, as opposed to squatting.
So I'm thinking that Kodos has had a more or less sudden sexual awakening, and that that is causing him to 'mark' in the house (e.g., pee not to eliminate urine, but to spread his scent around, as a way to mark his territory). More importantly, I'm hoping that getting him neutered (and we did that this past Wednesday) is going to remove this impulse from him completely.

That's right, isn't it? The vet 'fixed' him, didn't she?

Tuesday, July 03, 2007

Tagged!

Consarn it, I've been tagged by Orion Count Drulzelot. Apparently, this means I need to write a new blog post (which I've really had to do anyway) and mention 7 random facts/habits about myself. Since this blog belongs to Roy (the human) rather than Kodos (the majestic, mischievous Newf puppy), I'm going to write about me. So here goes.
  1. I am besotted w/my puppy Kodos, who is now a year old. (Big ups to my Mom, who pointed this out during her recent visit out from NY & used that word 'besotted', which is exactly right.) You're shocked, I know--it's not as though every blog post for the last year or so mentions him prominently...
  2. Just about all of my favorite TV shows have been cancelled by FOX. These would be: Arrested Development; Futurama; Firefly & (just recently!) Family Guy.
  3. I have a law degree that I've never used--never sat for a a bar exam, certainly never practiced, and have pretty much reverted back to a normal person. All that's left are the student loans. Yay.
  4. I am pretty sure this whole 'world wide web' thing is a fad, and will blow over any week now.
  5. I have a very long commute to work--2 hours there, 2.5 hours home. But it's in part a beautiful ferry ride, and I don't drive any bit of it, so I get a lot of work done on my laptop during it.
  6. I am one of those knee-jerk liberal Democrats your parents may have warned you about. Probably the education is to blame for that. I've been in a kind of political fetal position ever since the 2004 presidential election. Got me one of those mp3 music players right then & have been doing a wide eyed la-la-la-la-this-is-not-happening-la-la-la-la ever since. I don't normally talk about this, but this morning's announcement of Scooter Libby's get-out-of-jail-free card has me particularly outraged today. Bloody bastards.
  7. I am a Cancer, which explains why I am not into astrology. Who likes to say they are "a Cancer"? They may as well have named the sign "Pestilence" or something...
Next! ;-)

Sunday, April 22, 2007

We need a ramp for this thing!

Had some down-time yesterday, and so eldest daughter & I loaded Kodos up into the new SUV, and headed over to the dog park. Kodos had a wonderful time of course, and everybody exclaimed at how big he is (and only 10 mos old!). He got kind of mount-y toward the end there, but in general was a gentleman. (So says the very biased daddy--hopefully the other dogs would agree.)

K has climbed himself up into the new car only once so far. The other 4 times he's been in, I've hoisted him in, one end at a time (e.g., I put my arms around his upper chest & hoist his front end up onto the back part of the car, and then I crouch down & lift him in by his rear legs). Not optimal, but it works.

Well, upon returning home from the dog park, K did not want to jump down from the car. He may have hurt a leg while romping w/the other dogs (tho he seems fine now) or he may just have been tired. Either way, he wasn't coming down & so, after 10 minutes or so of waiting for him to recharge, I kind of hugged him sideways around the tops of both sets of legs & brought him out. It worked fine, tho I really didn't think I'd be strong enough to do it (K was 100 lbs. at last weigh-in).

But enough of this foolishness--I ordered a petstep II ramp from Amazon yesterday, and we'll be working on getting K to use it as soon as it comes. Wish us luck!

Saturday, April 14, 2007

Plavalaguna!

We finally got our new RAV4 yesterday--very exciting! Here are some pictures:We went through a freelance broker sort of person, and so they delivered the car right to our house on a trailer.

Here are a couple of pics:





After being bilked into buying unwanted mud flaps, floor mats, and a very lame looking (hopefully it's more functional than it appears) protective rear bumper "appliqué", I was feeling too poor to splurge on the one dealer-installed-option I really wanted--a rear cargo tray/mat to protect the carpeting & foldaway 3rd row seats against the slings and arrows of muddy Newf feet. Fortunately, Costco was selling these lovely $18 industrialish rubber entry mats--the sort of thing you'd encounter upon walking into a supermarket, say. I had to do some (rather inexpert) surgery on it to um, "optimize" it for the space, but I think it's going to work just fine. Check it out:


There are actually 2 "stow-and-go" seats underneath that mat, which means that when we're not hauling Kodos around, we can accommodate 7 people in this beast. Which rocks.

In keeping with family tradition, we have named this vehicle. The name we chose is Plavalaguna, after the blue alien character from Luc Besson's The Fifth Element (scroll down to the Soundtrack section to see a picture of the Diva Plavalaguna herself). We have a bit of an alien streak going I guess--we call our Accord Banichi, after a character in C.J. Cherryh's novel Foreigner.

In the main, I'm pleased with the independent-broker process we went through to get this car. The guy we worked with (Mark Heinemann) had relationships w/dealers in a four-state area, and could sort of reach up the distribution chain to identify and divert the vehicle we wanted. In theory he wasn't a salesman, but in practice he seemed pretty close to one. But no matter--the fact that we were able to do all the wrangling via e-mail was absolutely wonderful. Anybody who's spent 3 hours in an auto dealership trying to hammer out details and/or make credible threats of going elsewhere, while trying to keep their children reasonably entertained knows what I'm saying.

I had ordered the consumer reports invoice report on this vehicle, so I had independent verification of the dealer costs on the various options. I feel like we got a good deal on the vehicle as configured, but the configuration is not exactly as we wanted. The things that were really important to us were the 3rd row seats, the 4wd, and the roof rack. Anything else was pretty much gravy--and not gravy we wanted to pay for. We knew we were going to have to accept the sunroof (which is a plus for me, but L thinks it's just something to leak), the enhanced stereo, and the daytime running lights, just b/c that's the way Toyota manufactures these things. These were all acceptable, but the vehicle Mark found for us also had the aforementioned mudflaps, appliqué, and floor mats, which most certainly were not worth what they charged for them. So I'm 80% happy, but not 100%. But I have yet to be 100% satisfied w/any car purchase, so, c'est la guerre.