ruby! rails! kids! oh my! … and other fun from terry heath
RSS icon Email icon Home icon
  • Whoah there Kostards

    Posted on October 27th, 2008 No comments

    Your election isn’t being stolen. Calm down. See the burning stupidity here.

    This is what happens when you (a) want to subscribe to conspiracy theories, (b) think the GOP is smarter than they are, and (c) are gullible and will read whatever someone writes on the internets.

    Let’s take a look at what’s being argued here.

    ES&S iVotronics touch screens have already been observed now in four completely separate States, flipping the votes, in the early voting that has taken place to date. Eye-witness reports of repeated, consistent flipping of votes (from Obama to McCain naturally) has already occurred in the States of: West Virginia, Tennessee, Missouri, and Texas that have had early voting.  Missouri, of course, is a key background State in McCain’s electoral vote math.

    Ok, I want to hear how it was observed “flipping the votes.” Further, I’d question your run of the mill eye-witness voter, largely because they’re unreliable. If you press the Y and H key at the same time (and I’d bet people would press close to one button over the other), then can you tell me which one is going to get clicked? Even if you thought really hard, “I want the Y key to come up,” you couldn’t guarantee it.

    As a developer, I come across people who all the time don’t quite understand how to use software. This doesn’t mean the software is corrupted, just that people don’t get things right all the time.

    These are not “glitches“.
    This is also not the result of just “one faulty machine”.
    How about some straight-talk:

    Fact: This is not a “glitch“.
    Fact: This is not a one machine problem.
    Fact: This is not a one State problem.
    Fact: This is not a one Election problem.
    Fact: This is neither a “theory”, nor speculation. It’s real.
    Fact: The Democratic candidate is getting their (would be) votes systematically stolen.

    For some reason, if you write for Daily Kos, you just have to say something and it’s true.

    Anyone who says “that’s not a glitch, it’s intentional,” clearly doesn’t understand how subversive glitches can be. Further, they haven’t even shown reasonably (anyone have a YouTube video of a guy clearly pressing one button and the other candidate being selected? No? Thought not.) that it is a problem with the machine.

    That the “glitch” has been observed across different machines only speaks to people using the different machines. As many people who write software can attest, it’s often not the system that’s broken, it’s that the functionality hasn’t been well conveyed to the user.

    Multiple states have multiple people, thousands (millions now?) voting, and a handful have “issues.” Predictable. Even with paper ballots.

    That it hasn’t been actually shown in a test case, and only by anecdote should make anyone skeptical. This is solely conspiracy bullshit, not meant for human consumption, but only Rtards who think that the government is *really* out to steal an election, that anyone who doesn’t support Obama or Paul is evil, and that [redacted to keep this on my RSS feeds].

    Keep in mind, everybody, that two people saying they can repeat results in a hidden closet in a basement isn’t evidence. Much larger groups of people have testified to seeing Bigfoot, to seeing UFOs, to causing cold fusion, and to turning iron straight to gold. None of that happened, and people like to lie.

    I find it best in these cases to ask yourself a question: “What’s more likely: two or three people from Texas trying to vote correctly and the machines failing, and everybody else not reporting their issues, and the GOP teaming up with voting machine creators to systematically sabatoge the election and being dumb enough to show evidence of this in *TEXAS*, a state that has no chance of going blue, or two or three country bumpkins not knowing how to correctly use a computerized voting machine?”

    Uncategorized
  • Ant and the GrassHopper

    Posted on October 21st, 2008 2 comments

    Meezy forwarded this to me (not in support, probably more in a “oh-holy-crap-people-are-stupid” sort of note):

    The ant and the grasshopper
    This one is a little different…Two Different Versions!  Two Different Morals!

    OLD VERSION: The ant works hard in the withering heat all summer long, building his house and laying up supplies for the winter.
    The grasshopper thinks the ant is a fool and laughs and dances and plays the summer away. Come winter, the ant is warm and well fed.
    The grasshopper has no food or shelter, so he dies out in the cold.
    MORAL OF THE STORY: Be responsible for yourself!
    ———————- ———————
    MODERN VERSION:
    The ant works hard in the withering heat all summer long, building his house and laying up supplies for the winter.
    The grasshopper thinks the ant is a fool and laughs and dances and plays the summer away.
    Come winter, the shivering grasshopper calls a press conference and demands to know why the ant should be allowed to be warm and well fed while others are  cold and starving.
    CBS, NBC, PBS, CNN, and ABC show up to provide pictures of the shivering grasshopper next to a video o f the ant in his comfortable home with a table filled with food. America ‘s stunned by the sharp contrast.
    How can this be, that in a country of such wealth, this poor grasshopper is allowed to suffer so?
    Kermit the Frog appears on Oprah with the grasshopper, and everybody cries when they sing, ‘It’s Not Easy Being Green.’
    Jesse Jackson stages a demonstration in front of the ant’s house where the news stations film the group singing, ‘We shall overcome.’ Jesse then has the group kneel down to pray to God for the grasshopper’s sake.
    Nancy Pelosi & John Kerry exclaim in an interview with Larry King that the ant has gotten rich off the back of the grasshopper, and both call for an immediate tax hike on the ant to make him pay his fair share.
    Finally, the EEOC drafts the Economic Equity & Anti-Grasshopper Act retroactive to the beginning of the summer.
    The ant is fined for failing to hire a proportionate number of green bugs and, having nothing left to pay his retroactive taxes, his home is confiscated by the government.
    Hillary gets her old law firm to represent the grasshopper in a defamation suit against the ant, and the case is tried before a panel of federal judges that Bill Clinton appointed from a list of single-parent welfare recipients.
    The ant loses the case.
    The story ends as we see the grasshopper finishing up the last bits of the ant’s food while the government house he is in, which just happ ens to be the ant’s old house, crumbles around him because he doesn’t maintain it.
    The ant has disappeared in the snow.
    The grasshopper is found dead in a drug related incident and the house, now abandoned, is taken over by a gang of spiders who terrorize the once peaceful neighborhood.
    MORAL OF THE STORY: Be careful how you vote in 2008, McCain and Jesus Rule!
    ——-
    It’s hilarious how short-sighted people can be, and sadly the effect is only magnified in an election. This is obviously a bunk email, but why? Doesn’t it describe what happened? Clearly the ants (hard working, white Americans) have done all the heavy lifting and now those damn non-white, “different,” lazy people who didn’t prepare for an economic downturn are begging the ants for money and food.
    It’s entirely their fault that they didn’t prepare. And their poor work ethic is just proof that god didn’t want them to come to heaven, and wants them to starve. Seriously grasshoppers, where’s your damn Puritan work ethic? Oh, you’re Catholic? That’s clearly the problem.
    Lost in all of this contrast that really isn’t that impactful (Catholic? Puritan? you’re worshipping something that isn’t there; green? red? poor? rich? you’re both people) and all of this name dropping that surely will polarize people (because Bill and Hillary Clinton and John Kerry had so much to do with our current economy) is how the story really went.
    Several big ants, who show up to church every Sunday and sing the same songs the author of this email does, went and found a whole bunch of grasshoppers, who generally don’t have homes or food stores. They told the grasshoppers, “check this out, rates are really good right now, you should buy into our homes and food stores.” Seeing something that looked good for their entire grasshopper family, the bugs obliged, and boom, looked like they were set for the winter. Not explained in the sale was how the rates would likely go up, or how there was a housing bubble that would likely pop and would significantly devalue their food stores. Emphasis on: “you’re good. This will help your family!”
    As this looked to be incredibly profitable, and big ants could go and sell the liens on the homes and food stores to even bigger, more church-going ants, things looked to be going really well. Clearly, The Jesus was rewarding them for their beliefs. Yay Jesus!!!
    But then interest rates went up, and grasshoppers (who were being conned the whole time) realized they couldn’t pay, and stopped. And then the ants realized they were a little bit fucked, and asked for money.
    And then, since the ants were all good church people, it *clearly* couldn’t have anything to do with them that the economy was going in the toilet. Why should grasshoppers get any help (hint: they aren’t)? This is all their fault. McCain and Jesus 2008!
    What’s lost in all of this story telling is we’re all people (or, in this case, bugs). Why is it necessary to highlight the differences and justify punishment through those? Why can’t we just say, “wow – this is a little bit everyone’s fault, let’s work together, get it fixed, and get on our merry way?”
    Was there some greed that caused a problem? Yes. People in high positions make mistakes, and we feel them more than when a guy down the street makes a mistake. See: current economy, Iraq war, Clinton cheating on his wife.
    Somehow, by blaming *only* the grasshoppers in this case, people can weave a tale and then nonchalantly drop the non sequitur: “McCain and Jesus rule!” This doesn’t have anything to do with Jesus. Even if he were a deity, it wouldn’t matter. This has to do with failed economic policies and a lack of oversight, and lots of stuff that I don’t fully understand, and you don’t either.
    However, I’ll say that I think the football coach who blames his players needs to be fired just as badly as the president who blames his people. And I’d argue that firing someone means you don’t want to hire an almost-identical replacement. And Sarah Palin thinks people rode dinosaurs to work, which automatically means she’s not fit to have ANYTHING to do with science education. And Ralph Nader is a joke. Therefore, vote Obama in ’08.

    Uncategorized
  • Open Source FTW / Rails plugin updates

    Posted on October 20th, 2008 No comments

    So I’ve been using open source for a long time. I’m a huge fan of Linux, Ruby, Rails, Audacity, Firefox, Adium, Pidgin, OpenOffice, etc. That said, I haven’t really given much back to any of those projects. I just kinda mooch. Which is cool, it’s what almost all of us do.

    Recently, however, I’ve started playing more on GitHub and have started writing a lot more code for public consumption. While right now it’s just been Rails plugins, it’s been a lot of fun starting to work through the Rails codebase and start seeing how other people think.

    Anyways, I figured I’d use this to plug a few projects I’ve contributed to in the past few weeks:

    1. immutable_attributes - This is a Rails plugin that lets you specify attributes that shouldn’t be overwritten. The mechanism can be either an overridden setter (the original plugin) or a validation (my contribution). They serve different purposes, but it’s pretty cool to just say validates_immutable and be done with it.
    2. tiny_mce – This is a plugin that I’ve got some mixed feelings about. It ties tiny_mce information into your controller, which I find tighter coupled than I like. That said, it makes upgrading tiny_mce (which can be a HUGE pain in the ass) trivial, so it’s an interesting tradeoff. We’ve ended up at work putting the TinyMCE config stuff in an initializer, which has worked pretty well so far. My contribution here has been trivial, but I thought I’d plug it anyways since it’s a good idea for a plugin.
    3. uses_guid – So this is a fork of a plugin that was originally here. One of the most obvious changes? usesguid -> uses_guid. There were also some weird things that happened with the way keys were established, and the plugin wasn’t the most flexible. It still needs some work (like smarter intercepting of primary keys for guids and working accordingly), but it’s up there for people to play with.

    So, if you’re bored, go add stuff to those plugins. Or to some of my other projects. They’re all up there on GitHub. Color me a fan.

    Uncategorized
  • SEO: like global warming, but ends in annoyance instead of starvation

    Posted on October 19th, 2008 No comments

    I was working on GitHub and finally figured out how to make my commits just show as [terry] instead of [Terry Heath]. It’s my damn Apple user name, so I’m guessing that comes from your actual machine’s username, and not your profile. Which is a little dumb, GitHub.

    But anyways, I was curious what that would do to googling my name. I hadn’t googled my name in a while, and the first hit is now some eponymous SEO douche.

    SEO contributes largely to the smog of the internets. I realize it’s a natural progression once a medium gets popular to try to get *your* content on top, but the nice thing about the internets back in the day was that good content rose to the top and bad content stayed put.

    SEO “consultants” screw that up, and instead you don’t always find what you’re looking for. Oh well, I’m sure the people at Google are smart enough to find a better way to defeat them.

    A good way to do it? Don’t add comment backlinks to a site’s score. A nice side effect would be that I wouldn’t have to filter out a bunch of spam saying “nice site!”

    Anyways, I’m not concerned with not being first for “terry heath,” (I’d rather be on the 2nd or 3rd page, to be honest), but figured I’d drop a little SEO rant.

    Uncategorized
  • Reaching for the paddle…

    Posted on October 16th, 2008 5 comments

    Our son, Nate, is 16 months old. He’s adorable, hilarious, walking, running, loud, and incredibly energetic. He also has started doing things that we don’t want him to. Like hitting a glass table with a spoon (which scares both the cats and his parents) and hitting people.

    He’s started to understand that when I say, “if you do that again, I’m going to take it away,” that it means something. The other day when he hit the table after I told him not to and I stood up, he ran across the house whining, because he knew I was going to take his spoons. I don’t care about having the power in the relationship, but I thought it was great that he realized his actions could have consequences, and there were some consequences that he didn’t like.

    Unfortunately, I can’t tell him I’m going to take his hand away if he slaps me in the face. Believe it or not, I’m against amputation (except that one time, with his foreskin, which I’m still not sure I made the right decision). So we’re trying to figure out the best way to handle the situation, and are pretty confused.

    Before anyone suggests it, and I doubt many who read this blog would, we’re not spanking. It’s not an option for us. I don’t want to send a message that, when you’re in total control of someone, you can do whatever you want with them, and that’s the message I think spanking sends.

    So we’ve started reading around the internets, and still haven’t found a great answer. Do we redirect his attention? Do we just ignore it? Do we put him in timeout? Do we ship him to Russia where the kids behave better?

    Lots of parents on these sites will offer their own children as evidence, but I don’t want anecdotes. I’d like actual evidence saying, “kids subjected to this disciplinary measure improved behavior and didn’t grow up to be terrorists.” Unfortunately, I haven’t found any of those yet.

    Further, all of the so-called “experts” on child rearing seem fake. They’ll tell me about the inner psyche of a toddler, and I can’t help but equate them to animal talkers or astrologists. Nate can say 10 words. How, exactly, are you going to tell me what he’s thinking? I question anyone who says “your baby is thinking this,” because it seems they’re right about as often as they are wrong. Which isn’t helpful.

    We’re not even sure how to administer timeout. I don’t want to hold him in place, so the options would be either just standing in front of him (apparently with our backs turned) and not letting him escape, or putting him in a pack and play.

    Anyways, this is part of the problem with not believing everything you read, and questioning things other parents have done. It makes you indecisive. If anyone has any great suggestions for how to deal with a kid who is great 95% of the time, and 1% of the time provides no easy recourse for his behavior, I’d love to hear them.

    Uncategorized
  • (Social) Security: Censorship or Obscurity?

    Posted on October 15th, 2008 No comments

    This might be my most confusing post title to date. My apologies.

    The subject of transparency and social networking in the workplace has come up a few times in different blogs. In a related topic, I read a post by another twitter-er about self censorship a few weeks ago that has closely reflected my sentiment from time to time.

    I tend to swing (to an extent) back and forth between a conservative and liberal posting policy, and this seems to tie closely with my job security and job searching. If I’m looking for a job, you can bet that my facebook has been locked down for weeks, I’ve locked down my tweets, have taken down my blog, and tried as hard as possible to break all ties with pseudonyms. If I’m comfortable with my job situation, and with the coworkers, I tend to let more out.

    There’s a couple of things that sprout from this. Some are amazing, and I realize would never have happened 15 years ago. Others are annoying to terrifying.

    First up, I’ve burned a few bridges. Not many, but I’ve gotten in trouble for my blogging a few times. Well, once. At Company ST, where I posted about how I was unhappy with how some features came out, that came to backfire. I was already considering working my way out of the company, though, so it wasn’t too disastrous. As a learning experience, though, I’ll only write company initials most of the time.

    I’ve also learned things about coworkers in a much more vented atmosphere. While some tweeps keep their politics and opinions and religion to themselves, others pepper their stream with it. I do as well. This has led to some discussions, though rarely deep ones, that if anything let me know some of my coworkers better. I think this is fantastic.

    What I think is incredibly important in this transparency process is that we provide ideas and reasoning behind them. This does two things. First, it provides a much better understanding for readers where we’re coming from, so we don’t just come off as crazy. And second, it gives opponents an arena for discussion, instead of having to go after the person or bring up some other unrelated garbage.

    Anyways, back to the title. I think there’s two ways we can keep ourselves employed and be opinionated.

    The first is to not share those opinions. It’s how things worked in the mid ’90s down to the dark ages, and if it was good enough for them, then it’s good enough for you.

    The second is to share those opinions in a reasoned fashion, with enough volume that you’re not likely to be tagged by a single post. For those unfamiliar with Zed Shaw, the guy wrote a post “Rails is a Ghetto” that torched the Rails platform and community. It made it onto Slashdot, and even people who didn’t care about Rails or Zed thought, “holy crap, that guy just ended his career.”

    Of course, if you read the rest of Zed’s site, you see that the post isn’t anything spectacular. He flames tons of different subjects on his site. What you also get from reading his posts? The guy’s incredibly smart.

    Now, I don’t think Zed’s a shining example for flooding your opinions out there to provide a quick look at your character, I think as long as you’re not flaming people you work(ed) with and keep things reasonable without too much hyperbole, you’re not going to put too much of a bad taste in someone’s mouth.

    Essentially, I think exposure is good. It helps you vet ideas. It lets people know you before they meet you. If you spout racist nonsense on your site, then I probably won’t let you through a phone screen. If you say you want to go to a burning man festival, which sounds weird to me, I’ll listen to what you have to say and think about both the technical merits of your answers and how you’d fit in with our culture.

    I’m not sure how older generations feel about this, but it seems that people I went to school with subscribe to the same mindset. We disagree about issues, and try to write up compelling arguments justifying our points. I might disagree with you fundamentally on politics and religion, but I don’t think that should keep you from working with me.

    *I generally don’t link to blogs of people I work with, because I don’t want to take responsibility for putting a link to my blog on your site, since I do let almost everything air out.

    Uncategorized
  • Tried out Shoes

    Posted on October 14th, 2008 No comments

    I got bored tonight and wanted to write a little script to calculate the amount of time left in my propane tank. Instead of just doing it in Ruby (or Numbers, for that matter), I figured I’d play with Shoes a little. Then I got bored, and really just spat it out and am done with it.

    Anyways, for those curious or who want to calculate the time left in their propane tank, here’s the code:

    PROPANE_GALLON_WEIGHT = 4.23
    BTUS_PER_GALLON = 91_690
    
    Shoes.app do
      stack do
        para "Let's figure out how much time you have left in your tank."
        para "Tare weight?"
        @tare_weight = edit_line
        para "Weight?"
        @weight = edit_line
        para "BTUs per hour?"
        @btus_per_hour = edit_line
        button "Calculate!" do
          propane_weight = @weight.text.to_i - @tare_weight.text.to_i
          gallons_of_propane = propane_weight / PROPANE_GALLON_WEIGHT
          btus = gallons_of_propane * BTUS_PER_GALLON
          hours_remaining = btus / @btus_per_hour.text.to_i
          alert("Hours remaining: #{hours_remaining}")
        end
      end
    end
    

    Uncategorized
  • New Charity Up

    Posted on October 8th, 2008 2 comments

    Head over to HalfAHundred and donate. This is important, people. We’re better than this. Even if you’re in college, if you give up 2 Chili’s dinners a month, you can make a huge difference. 

    Uncategorized
  • I kinda read books: People’s History of the United States

    Posted on October 8th, 2008 2 comments

    I tried to read Zinn’s book. I really did. I tried extra hard, seeing how it’s referenced in Good Will Hunting.

    But I couldn’t. I don’t think it’s anything wrong with the book. A lot of people have said they liked it a lot, or at least found it compelling. 

    I’m pretty sure I know why: history is boring. I know, I know, some of the 7 readers I have will say it’s not. But you’re wrong. That’s right, you’re wrong in your opinion.

    It’s nothing we can change. We can’t affect it. We can’t manipulate it. 

    I think this is why I’m so drawn to science subjects. I want to learn more about how our actual world works, now how it did work. I realize that they’re sometimes related, but I figure I’ll gain that understanding as I read more about the current world.

    So, about 100 pages in, I dropped it. Maybe I’ll pick it up when I get a lot older and can’t sleep at night, but for now, I’m going to stick to (as far as nonfiction goes) those crazy science/religion/morality books. They’re more interesting, because they seem to more aptly describe our current situation. 

    Uncategorized
  • Ruby: drop the superiority complex, give us a damn final keyword

    Posted on October 8th, 2008 3 comments

    Sorry. I know that headline is a little inflammatory, but after reading comments about legitimate complaints against Ruby, it’s needed. Don’t get me wrong – I love Ruby. It’s a huge step up compared to Java, C++, or VB/C#.NET when it comes to expressions. What’s 20 painful lines in J++# is 2 in Ruby, and much easier to read. But it’s time to realize that it’s a language – not a religion. It has bad things about it. 

    If you’re coming in for an interview, and somehow come across my name (I don’t name companies on my blog), then here’s a heads up. I’m going to ask you what you don’t like about Ruby. Here’s a fantastic answer: their handling of constants, and the built in clone function, both suck and are misleading.

    You should not be able to modify a constant value. If you want other developers, or you, to modify it, don’t make it a constant. This is a fundamental dearth in Ruby: the inability to lock down constants. Sure, you get a warning. Sometimes.

    One of the comments on Steve Yegge’s blog about this issue? “Ruby is for good programmers who know what they’re doing.” This is ridiculous red herring if I’ve ever seen one, and I’ve seen some huge ones. The problem is, you don’t always know what you’re dealing with, and it can be a reference to a constant, and you shouldn’t have to do any sort of check to modify that. You should get an immediate error.

    I’m ranting about this because it cost 2 developers and entire afternoon hunting down yesterday. 

    Anyways. Sure, nobody’s going to see “oh, they defined PI to 3.14159″ (that’s all I know from memory of Pi) and think “let’s redefine it to 4″ (unless you live in Missouri.) But people could think that changing @var is ok, when they’re in a view and the variable came from a controller. Why would they know that @var is actually a reference to PI, and by adding 1 to it, they’re fucking up the math for ALL 10TH GRADERS, WORLDWIDE?

    “Oh, but Terry, you idiot! You can freeze an object!”

    Uhuh. Except, say, Hash#merge doesn’t respect freeze. It doesn’t even provoke a warning.

    This is retarded. It comes off as an afterthought of the language developers, and as a consequence leaves us multi-developer teams slightly screwed. Constants have meaning, and if they don’t, drop the charade and just treat ALL_CAPS variables as normal. A mindless warning showing up in who-knows-what logs isn’t going to help anybody. 

    Bottom line, languages need a way to define a const. A great way to write code is to do it in such a manner that people can’t misunderstand or violate your class’s internals. Constants provide a fantastic way to do that. In fact, in Java, atomic consts are even replaced on the first pass of the compiler, meaning there’s NO WAY WHATSOEVER that they get affected. Ruby needs this, and to say otherwise is to admit either a super small (read: “1″) team bias or intellectual dishonesty. 

    Uncategorized