Jan 26 / riney

no-one flies around the sun

IMG_0643

Almost, almost there. Posted some pics of the ongoing apartment organizational project. It’s made easier by the fact that it’s not, for example, raining in my bedroom (many sympathies to @DarthRachel). But it still has far, far to go.

Jan 8 / riney

untrustworthy hashes in ruby

I ran into one of those annoying bugs where a couple different things conspired to have an annoying result. We use GMail at the moment as our SMTP server, and we put all sorts of automated notifications through it. GMail has a well-documented 500 message limit – that’s per-account, per-day. Upgrading to Premier bumps that to 2000, but we really don’t need to upgrade everybody on the domain just to get the extended limits for a system account. Ordinarily, we don’t send anywhere near that much email, but a bug that got our asynchronous mail-sending queue a little clogged up led to a glut of mails that needed to go out. Which put us over the limit. Bleh.

We’ll be switching to a sturdier mail provider soon enough, but for the time being, I decided to rig ActionMailer to load-balance between four accounts. So there’s a few different ways you could pull this off.

  • Monkeypatch ActionMailer. I try to avoid patches like this if at all possible.
  • Randomize ActionMailer’s user_name setting before each use. Well, AM’s settings hash is a class global. Changing it every time, especially when others might be poking at it, seems in poor taste.
  • Something else.

“Something else” turned out to be hacking the settings hash itself. Ordinarily, when you set it up, it looks like this:

ActionMailer::Base.delivery_method = :smtp

ActionMailer::Base.smtp_settings = {
   :address => "smtp.gmail.com",
   :port => 587,
   :domain => "mydomain.com",
   :authentication => :plain,
   :user_name => "somebody@mydomain.com"
   :password => "mypassword"
}

Instead, I did:

ActionMailer::Base.delivery_method = :smtp

smtp_settings = {
   :address => "smtp.gmail.com",
   :port => 587,
   :domain => "mydomain.com",
   :authentication => :plain,
   :password => "mypassword"
}

SYSTEM_ACCOUNTS = %w[system@mydomain.com system2@mydomain.com system3@mydomain.com system4@mydomain.com]
ActionMailer::Base.smtp_settings = Hash.new { |h, k| SYSTEM_ACCOUNTS[rand SYSTEM_ACCOUNTS.size] if k == :user_name }.merge!(smtp_settings)

The useful part is the employment of the version of Hash.new that takes a block. If a key lookup fails, the block is invoked, and is passed the hash and the requested key. It’s basically “method_missing” for hashes. So, when ActionMailer looks for :user_name, the block picks a random entry out of the SYSTEM_ACCOUNTS array. For lack of a better name, I called this approach an “untrustworthy” hash – as one generally expects to get the same key-value mapping from a hash every time.

This wouldn’t work in all cases – for example, has_key?(:user_name) would fail. I’ve got a more generic solution in mind, that being an add-on for Hash that lets you insert key/proc pairs as well as key/value pairs. More on that soon.

Sep 2 / riney

take only what you need from it

Aug 30 / riney

con worklog

friday:
* dropped off blazer for dry cleaning
* started making blueberry-infused vodka
* designed mask/buckle templates in illustrator

saturday:
* got monarch henchmen shorts and a new top to match
* shipped swords to Marriott
* cut mask, lenses, and buckle; painted mask and buckle (awaiting belt shipment)
* cut wings (awaiting paint and mounting)

awaiting: balaclava, tights, belt, boots for henchmen, dry-cleaning for 88

todo tomorrow: assemble wings/mask/buckle, get gloves, get new antennae, look for belt pouch, find backup source for balaclava (henchmen); braid cords, find weapon (wing kong); straighten backup mask, clean ties (88); laundry (everything),

Jul 29 / riney

vlog 7-29 (l0ft)

Jul 10 / riney

vlog 7-10 (tv wtf)

Also, catching up on posting older vlogs:

Jun 7 / riney

time warp. again!

Me and Glitter Pete before the 80s party
Click for the rest…

May 16 / riney

because they know that i’m on time

Okay, new Star Trek. I liked it – bloody shocker, that. Here’s how it is – It’s TOS, to be sure.

  • There is no stately Picard-style diplomacy up in here. There is, however, a fair amount of shooting people in the middle of the face.
  • There are people running through at least two outdoor adventure sets, although there’s no Gorn (but it’s close!) and no battle music (“dun dun DUUUUUN DUUUUN DUUUN DUUUN DUUUUN”).
  • There are jokes.
  • There are lots of things getting blowed up, including redshirts.

It is most definitely Star Trek with some of the corners rounded off to appease non-fans. Also, I am told that the new Spock is hot.
Spock

I can’t really speak to this, as I was a bit distracted by, um…
Uhura

… and, er…uh…
Gaila

… what was I saying?

Oh right. Kirk’s a douchebag in this one.
captain-james-t-kirk-awesome1

The important thing us nerds need to remember, though, is that Captain Kirk was always a douchebag. Kirk is the guy that kicked us in the groin and and took our lunch money in elementary school. He became a nerd icon to be sure, but make no mistake – the guy cheated on his Academy finals, screws around, and punches hoes in the face from time to time. And that’s just in established canon! And the new one is even worse. The way he douches his way into the Captain’s chair is particularly galling. But it works.

Characterizations are generally right-on. Sets are great. Battles are good. Camera work is straight from Serenity/BSG.

Overall, recommended. It’s fun. It’s Star Trek. It’s supposed to be fun dammit!

May 15 / riney

okay, seriously, what’s wrong with Illustrator CS4?

Observe these two buttons.


See how the font on the first one is dim, thin, sort of weedy-looking? And the second one is brighter, fuller?

Let’s have a look how it looks in Illustrator CS4, embiggened:

The first one is the button with the text, unchanged (11pt Arial, bold). The second one is the button with the string converted to an outline. Not that big of a difference, but when you export them, you get the above results. Why is this? What is so weird about Illustrator’s font rendering during export that makes it so different from what’s rendered on screen? It’s like the antialiasing goes into overkill and eats up too much of the text. It wouldn’t be so weird if it didn’t look different on screen before you export it.

It took a while to figure out that outline trick to make things look right again.

May 7 / riney

Things which inspire my rage

  • People using self-checkout lines.

    Maybe I missed my calling as a checkout operator, but I can manage to scan, bag, and pay for my entire order while most people are still irretrievably flummoxed by the indecipherable gibberish emitting from some unknown fount of mystery. What mysterious incantations send them into a whirl of befuddlement? “Please put the item in the bag”.

    Why is this hard? Why do people stand, heads cocked like the RCA Victor dog, as the machine plainitively begs, “please put the item in the bag”? What is the incomprehensible element here? PUT THE ITEM IN THE DAMNED BAG. Some move the items in slow-motion, like they’re bagging priceless crystal; others, thinking the machine must yearn for a closer connection to the products they’re buying, forcefully mash the product into the scanner without actually moving the UPC in relation to it.

    Why. WHY? If I were the poor bastard tasked with the UI focus groups on those things, I would have been committed by now. Almost all the users stab indiscriminately at the screen, not reading, not listening, in a sort of doe-eyed daze, before being rescued by the supervisor who now has to run four lines instead of one.

  • Autism conspiracy nutballs.

    Is the 9/11 “truth” movement too mundane for you? Are you incapable of dealing with mountains of clinical research that says childhood vaccines have precisely dick-all to do with autism? Do you fail to recognize that a chemical compound *made* from a element is *not the same* as that element by itself, demonstrating a lack of even middle-school level science understanding? (God help them when they find out that table salt has chlorine in it.) Do you think Jenny Mccarthy is a deep fountain of scientific knowledge? Then you might be the idiot that left a card in my shopping cart, advertising DVDs that propose to tell me all about how vaccines are evil. Yeah. Good luck with that one. Oh, and good luck dying of measles. Dumbass. I’m not including the link – I’m not sending her stupid, pre-fab MLM site any more ad revenue.