fogbound.net




Wed, 15 Aug 2007

Mysterious Ruby on Rails problem — and solution

— SjG @ 1:51 pm

So, I’m working on an old RoR application, and was having a hard time getting it to work on my newer development machine.

The error dump was not at all clear:

C:\project\foo_bar_baz_quux>rake migrate --trace
(in C:/project/foo_bar_baz_quux)
** Invoke migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute migrate
rake aborted!
wrong number of arguments (1 for 0)
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/vendor/mysq
l.rb:551:in `initialize'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/vendor/mysq
l.rb:551:in `new'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/vendor/mysq
l.rb:551:in `scramble41'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/vendor/mysq
l.rb:141:in `real_connect'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_
adapters/mysql_adapter.rb:316:in `connect'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_
adapters/mysql_adapter.rb:87:in `initialize'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_
adapters/mysql_adapter.rb:37:in `new'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_
adapters/mysql_adapter.rb:37:in `mysql_connection'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_
adapters/abstract/connection_specification.rb:145:in `send'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_
adapters/abstract/connection_specification.rb:145:in `connection_without_query_c
ache='
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/query_cache
.rb:54:in `connection='
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_
adapters/abstract/connection_specification.rb:106:in `retrieve_connection'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_
adapters/abstract/connection_specification.rb:20:in `connection'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/migration.r
b:178:in `migrate'
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/tasks/databases.rake:3
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:in `call'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:in `execute'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:in `each'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:in `execute'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:369:in `invoke'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:362:in `synchronize'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:362:in `invoke'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:1935:in `run'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:1935:in `each'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:1935:in `run'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/bin/rake:7
c:/ruby/bin/rake.bat:20:in `load'
c:/ruby/bin/rake.bat:20

I went through a lot of work to use older versions of Rails, etc, but none of it worked. I didn’t find much out
there that helped, either, until I finally happened across this page.

Turns out it’s one of those pernicious password / old style password hash issues with MySQL. Simplest solution for now: use no database password on the dev box.


Tue, 14 Aug 2007

Macro

— SjG @ 3:35 pm

Ever since I saw a “how to” in Popular Photography back in the early 80s, I always thought it would be cool to make my own super-macro lens by mounting an ordinary lens backwards.

So, on Saturday, using 58mm skylight filter, a dremel tool, hot glue gun, and camera body cap, I created a reverse mount. Into this contraption, I inserted the kit lens (28-70mm) that came with my Nikon N-80, and, tried it out on the Nikon D-70. Obviously, autofocus and automatic exposure are out of the question (although it might be interesting to run wires across from the lens’ connector to the camera. Hm… maybe it’s not out of the question!), so it entails a lot of manual twiddling of focus and looking at histograms.

It’s too much magnification (even at 70mm) to hand-hold, and, even with my old tripod, it’s hard to get a sharp image. Also, with this kind of macro, there’s not a lot of depth of field to play with. I started by taping the aperture lever at full open, and didn’t get dramatically different results when I allowed it to stop down somewhat. I tried to figure out the optics of the situation, but quickly realized that with a variable aperture and a collection of lenses, I would need to go back and hit the books to understand the physics.

Here’s the stinger of a wasp, who was found dead on the driveway:
Sting


Fri, 10 Aug 2007

Monsters!

— SjG @ 2:46 pm

A few years ago, we noticed a BGS (Big Green Spider, aka Peucetia viridans, or Green Lynx Spider) in the back yard, on a dead Echinacea flower. This particular BGS was getting fatter and fatter — and then, one day, it was very skinny, but sitting on what looked like a papier-mâché diatom caught in the web. The BGS guarded the diatom fiercely for a few weeks, until the diatom exploded into an amazing clump of TBSes (Tiny Brown Spiders).
BGS and Kids
The clump gradually dispersed. Whether they ate one another, or just all fled the nest, I can’t really say.

Over the last few years, we’ve noticed an increase in BGSes in the garden. In fact, this year there are several in the front, and a few in the back garden. They all seem to be about the same size when full grown, with perhaps a 1.5 or 2 inch leg-span.

Maybe I need to check on our Reactor Core to make sure it’s not leaking, because two weeks ago, I discovered a BGS in the front yard with a leg-span of easily 3 inches — maybe even bigger. I’ll have to take some pictures, although I’m a bit chary of getting close enough, especially close enough to put something in the scene to give a sense of scale.

In any case, I hereby formally initiate the acronym RFBGS, for a Really Flippin’ Big Green Spider, aka Peucetia viridans maximus.

Filed in:

Thu, 9 Aug 2007

Harry Potter and the Deathly Hallows

— SjG @ 9:26 pm

J.K. Rowling, Scholastic, 2007.

So, based upon
my predictions
, I probably only got a C+ in Divination. Which is just as well.

Rowling managed to pull off a mostly satisfactory ending to the series. This last book abandons the leisurely pace of the previous two, and kicks into high gear right off. It accelerates from there.

I enjoyed the resolution to the Snape Question, which I thought was at least plausible within the framework that was set up. The tying up of the loose ends with regards to Horicruxes was satisfying. The body count was about what I expected, although Rowling toyed with us in a few cases. The disposition of Dobby and Kreacher and the house elves worked well, and felt like the groundwork had been well laid over the course of the previous books. The whole kerfuffle with the Elder Wand and how it plays out, on the other hand, is a little out of left field. We didn’t have much background from previous books to help with that.

I find that I have some dissatisfaction in retrospect; things that didn’t bother me while I was reading the book feel unsettled later. Some of the deaths were kept emotionally distant, or even rushed over — Harry sees bodies laid out on tables, and that’s pretty much it. Obviously, he’s got other issues at hand, but we don’t ever come back to experience any of the feelings. I would have liked the story to come closer to full circle with the Durstleys. But my strongest objections both involve scenes in train stations: the expository segment in the latter part of the Battle of Hogwarts didn’t feel right to me. We needed the information, but the circumstances felt forced. Again, I understand why the other train station scene was necessary, but the thought it generated more than any was “damn, what a bunch of breeders!”

Perhaps I’ll do what Karl’s doing, and re-read the whole series. If I do, I’ll write more, and probably with much less vague avoidance of spoilers.

Filed in:

Tue, 7 Aug 2007

What Makes Sammy Run?

— SjG @ 9:28 pm

Budd Schulberg, Vintage Books, 1990 (originally published 1941)

The story of obnoxious, hyper-competitive, and ambitious Sammy Glick(stein)’s rise from child of the tenements to the head of a major Hollywood studio is a familiar one. Glick embodies the entitled, egotism that we see everywhere, the ends-justify-the-means machinations, and the casual disregard for everyone unless they can be used for advancement.

The tale of Glick’s rise is interwoven the explosive growth of the studio system, along with the early development of the Screenwriter’s Guild. It’s a quick, engaging novel, filled with betrayals, triumphs, and backstabbery. The characters are familiar too, we’ve all dealt with Glicks and their victims, whether on campus or in a corporation.

The copy I read (thanks Karl!) contains not only the novel of What Makes Sammy Run?, but the two short stories from which the novel evolved, as well as an afterword written by Schulberg in 1989. The short stories are interesting views into how the novel was developed, but the afterword is even more revealing. Schulberg writes of the surprise of the book’s success, how it was simultaneously attacked as being Communist and being counter-revolutionary, and how it led him to a fist-fight with John Wayne on the beaches of Puerto Vallerta. He talks about his alienation from the Communist party, and offers a defense for his role as a friendly witness for the House Committee on Unamerican Activity.

Most poignantly, he writes of Sammy Glick’s evolution from a repugnant character to a role model in the forty some odd years since publication (or rather, how our American attitudes have shifted). He cites various late Reagan-era examples of how America has become a nation of entitled, self-important Glicks and Glickettes. He ends with the dire warning that the Sammy of the 21st century may end up making the Sammy of the 20th look like an eagle scout.

Filed in: