This blog has been offline for several months; I rebuilt my server, and have been spending more time coding than writing.
I know I’ve said it before, but I hope to post more frequently again – we’ll see how long it lasts this time.
It’s been 40 years since my Dad started sending out Christmas cards with “obscure” messages! I’ve been posting them *almost every December for the last several years, so here’s the sixth one, from 1978:
Yup, that’s me in the back. Nice hat.
My good friend b1-66er wrote this post about how he’s decided to vote. Please go read it, then compare your thinking to his, and mine – I started this as an email to him, but I’ve decided to post it here in case any of the other four of you who read this are thinking along the same lines.
I read your post about why Obama has lost your vote, and I wholeheartedly agree with all of your complaints. However, you do live in a swing state, and your vote does count for something, so I’m asking you to this about this differently.
The question you’re answering with your vote isn’t “does Obama deserve another term?” but “Who would be better to run things for the next four years?,” and Obama and Romney are the only two available choices at this point.
Please set aside your (valid! correct!) feelings about Obama’s sickening and shameful performance on this issue and vote for him anyway, because the alternative is so much worse: I truly believe that Romney would take us further back to darker ages on many issues, *including* this one, but also women’s rights, gay rights, poverty and the social safety net, strategies for the economy and job creation, taxation, foreign policy, … nearly all the issues I can think of. There’s also the matter of the two Supremes likely to be appointed next term.
Then, after the election, maybe take a stronger role with one of the groups fighting the administration over Obama’s failures: possibly even less meaningful than your specific vote, I know.
But don’t think that voting for the wrong guy (or not voting at all) out of spite would have the effect you want – that seems like a great way to have your vote mean even less.
I use RubyMine and Firefox for most of my day-to-day Ruby on Rails development, and in spite of my best efforts, I sometimes get exceptions that result in the display of Ruby backtraces instead of the web page I asked for.
While the backtrace helpfully lists the places in my code (or Rails, or the Ruby libraries, etc) that we traversed on the way to the crash site, opening the file in RubyMine to see more context requires copying the path, invoking a RubyMine keyboard shortcut for open-file, and pasting. Work.
After a lot of this copy and pasting, it occurred to me to join Firefox’s ability to invoke a program for a particular URL scheme, and the command-line wrapper that RubyMine can produce to open files in a running RubyMine instance.
This gist is the result: it’s a Rails initializer that produces “mine:” links in backtraces. It starts with instructions on setting up Firefox and the RubyMine wrapper; once you’ve followed them, you’ll get links in the backtrace that’ll take you directly to the source where an exception occurred.
(Note: I’m using this while working on a Ruby 1.8.7 / Rails 2.3.4 application, and as you can see, it monkey-patches the backtrace functions in Exception; I fully expect to have to update it for newer Ruby and Rails versions – if you find that changes are needed, or have other suggestions, please let me know in a comment. Thanks!)
(The small image is a little blurry – click on it for the full-size image.)
Despite its popularity WEBrick has gained some notoriety since the code is completely undocumented.
— Wikipedia’s WEBrick page
WEBrick is the little web server in the Ruby standard library, and I’ve used it several times when I’ve needed to embed a little server in a project. I noticed a couple of problems in my latest little program: it took a few seconds to start up, and always included a “TCPServer Error: Address already in use – bind(2)” warning in its startup messages.
After watching this happen a few dozen times, I found solutions to both these annoyances, and they’re here in the hope that someone else will Google their way here: just create your server object like this:
# This fixes the slow startup
Socket.do_not_reverse_lookup = true
# Using :BindAddress to say "bind to all interfaces" fixes the address-in-use warning
server = HTTPServer.new(:Port => my_port_number, :BindAddress => "0.0.0.0")