1. Argh!

    caladan:~ mph$ man bash
    
     [...]
    
    Constants with a leading 0 are interpreted as octal numbers.  A leading 
    
    0x  or  0X  denotes  hexadecimal. 
    

    That’s been messing with me all week in re: a shell script I wrote to generate the date as a quarter. The output from:

     let dat="((`date +%m`-1)/3)+1" 
    

    Means that “dat” comes out as “0something,” because strftime doesn’t seem to allow for “month with no leading 0,” just %m’s “month with leading 0.” So bash reads dat as an octal value and ralfs when I try to do something more with the number because there’s no such thing as “08” in octal. It took, for those of you who like to read about this sort of thing, three months for this to manifest in the script generating the quarter, because, you know, 01 through 07 do exist.

    Anyhow, looks like DateTime has pretty much what I need to do this with a simple $qtr = $dt->quarter.

    I wouldn’t have to be embarrassed by this sort of kludgery if I kept it to myself, I guess.

    Keep reading →
  2. Spam Doth Never Prosper …

    … ‘how’s that’ you ask, man? For if it prosper, none dare call it spam.

    In my inbox:

    You may have seen the study released today by outplacement consultants xxxxxxxx stating that a growing number of fantasy football leagues are costing employers as much as $1.1 billion a week in lost productivity.

    The study also found that during the regular season, nearly 37 million people spend an average of 50 minutes a week at work managing their fantasy football teams.

    I should start keeping a running tally of how many minutes a week are lost to the many activities software security companies have a product to block. My guess is that the average American worker spends about 8,000 hours a week doing something he or she shouldn’t, for a grand total of $98 gajillion in lost productivity.

    American tech journalists lose an average of 3 million minutes a week wading through this crap, but since we usually just sigh and write it up anyhow, even though it’s lame, boneheaded and springs from the stupid assumption that if you can just seal off all forms of entertainment people will work ninety times harder, it’s kind of a wash in terms of claiming lost productivity.

    Keep reading →
  3. When the Only Tool You Have Is a Reckless Disregard for Security …

    Create quick-access ssh shortcuts:

    Long and short? Avoid pesky passwords and script your access to remote hosts with ssh & expect.

    Sweet. Jesus.

  4. So the bar is now set at "evil?"

    Whore No More | MetaFilter:

    “I actually felt sick, just sick, about wasting so much studio money and being such a stinky, stinky junket whore.” Freelance writer Eric D. Snider took up an offer to attend Paramount Studios’ World Trade Center press junket, “being a whore just once to see what it was like.” After he spoke unkindly of the practice—taking issue with how studios trade luxurious treatment for positive media coverage—the studio had him blacklisted from all further Paramount screenings, and those of a few other studios.

    It kind of bothers me that Snider can tell the story he tells and the response it elicits from a few commenters is “It’s not like the studio’s being evil or anything.”

    Keep reading →