What I'm up to (To what I am up?):

    follow me on Twitter

    28 April 2009

    Batch script to open most recent file

    I receive an issues list 2 to 5 times per week from one of my clients.  For a while I was deleting the previous version, saving the new one, and renaming it.  This way, the list was always up to date.  That was a pain.  Then I started dumping the files into one folder, and worrying about which was the correct one whenever I actually had to open it.  That was better when saving the file, but worse when opening it.  Then I sorted the folder by date modified, and it worked, but I never trust Windows explorer to work as anticipated, so I double-checked it every time.

    Today, I decided to take the guess work out of the process.  I created a batch script to scan the 'issues list' directory for Excel (.xls) files, and open the most recent one.  Thanks to Google, and http://www.ericphelps.com/batch/samples/recent.txt, I knocked it out in about 5 minutes.

    Here is the code (almost all of which was taken from erichelps.com):

    @echo off
    for /f "delims=" %%x in ('dir /od /a-d /b *.xls') do set recent=%%x
    start "" "C:\Program Files\Microsoft Office\Office12\excel.exe" "%recent%"

    Essentially what this is doing, is dumping all of the output of a directory listing (sorted by modified date) into an array and assigning as it runs through the array, assigning the variable to the array element over and over again.  This means that when the loop runs out of array elements, the variable is the filename of the most recently modified file.

    The start command prevents the batch window from remaining open the entire time that the spreadsheet is open.

    Now, instead of opening the directory and digging for the most recent copy, I just run the batch file from a shortcut in the quick launch bar, and it opens the most recent .xls file on its own.

    21 April 2009

    I Will Teach You to Be Rich (as a scam artist?)

    I caught wind of I Will Teach You to Be Rich and The 4-Hour Work Week recently, and I started reading the blogs of both of the authors (Ramit Sethi and Tim Ferris, respectively).  They both sound like really interesting concepts, so I downloaded the Kindle samples of both books, and they have something in common: they sound like those scam infomertials you used to see late at night.  The ones where the guy tells you you too can be rich if you follow his simple x-step program.  Then people buy the program, get to step x, and find out step x is starting your own program to scam others out of their money.

    Has any body read either of these books, and found them worth-while reads?  Like it in the comments, will ya?

    ATM skimming and prevention

    I read a post on Lifehacker today regarding ATM skimming. For those
    who don't know what it is, a credit card thief will attach his or her
    own card scanning device to an ATM along with a camera for recording
    PINs. The post links to a pdf of a presentation given to a bank, but
    the information is good to have for card holders as well as the banks
    themselves.

    In addition to taking a good look at an ATM before I swipe my card, I
    usually give the scanner itself a quick tug, to make sure it is a
    securely attached, actual peice of the ATM and not a skimmer's add-on.

    Lifehacker post: http://lifehacker.com/5221255/know-how-to-spot-an-atm-skimmer
    Bank PDF: http://cache.gawker.com/assets/images/consumerist/2009/04/Skimmer_presentation_v1_230109_ppt_1__01.pdf

    19 April 2009

    Stevie Wonder: a Black Man

    So I was just listening to random music, and a track from Songs in the Key of Life came on; Black Man.  Not only is it a great cut, but it has a great message.  While listening to it, I thought the following:

    It is really a shame that the person in charge of Black History Month at my high school is the most racist person I have ever had the displeasure of dealing with.  Were she not, she might have played that song at some point during the month-long morning announcements about black culture, and maybe then I wouldn't have considered Black History Month a joke.  From what I imagine her perspective to be, the only problem with that song, is that it gives too much credit to the inferior, non-black races.

    17 April 2009

    When I became a man, I put away childish things

    Perhaps because I read The Art of Manliness too much today, perhaps because I spent a miserable 36 hours at work where this was a theme, perhaps because I just paid my taxes as a non-dependant for the first time this month, or perhaps because I live in Williamsburg - the capital of people who dress like children playing in their parent's 1983 closet, I have been thinking a great deal about the childishness of American culture recently.
    We have become a people who demand trophies for participation, not accomplishment. A people who want our government to tell us how to live, despite our forefathers having given their lives to prevent just that. A people who are so afraid of failure, we have thrown good money after bad, after worse at our financial system, because we are afraid of failure.
    Who do I blame for this? Everyone, in general. More specifically, and in increasing order, I blame the Democratic party, the news media in general, CNN in specific, lawyers, judges, and, finally, I blame a then-79-year-old woman from Albuquerque, New Mexico - Stella Liebeck.
    In 1994 Stella Liebeck purchased a 49 cent cup of coffee from McDonalds, and then spilled it on herself. Then sued McDonalds for serving the coffee too hot. And WON. Stella Liebeck was awarded six hundred and forty THOUSAND DOLLARS for being to incompentant to hold onto a cup of fucking coffee.
    Since 1994, McDonalds has put labels on their hot drinks warning that they are hot. Ladder companies are all but non-existant due to the liability involved in selling someone a device that can cause them harm. To quote the greatest mind of the 20th century, George Carlin, "Kids need a helmet now for everything but jerking off."
    Jars of peanuts now carry three labels. One stating the ingredients, another for nutritional information, and the third, and allergy warning. The allergy warning states this: "Warning: contains peanuts." I would imagine that you would know that a jar of peanuts contains peanuts by either looking at the contents, reading the label, or reading the ingredients. Companies are so worried about being sued for other people's incompetence so much, that they added another, more specific, label. If you are allergic to peanuts, and you need three lables to tell you not to eat peanuts, you deserve to die.
    Because of Stella Leibeck and the flood-gate she opened for frivilous lawsuits, we have grown to believe that there is no danger in the world. And if there is, someone else will watch out for danger on our behalf. And if they don't, there will be sufficient child-proofing. And if there isn't, we can just take people to court for not child-proofing everything and not keeping a constant watch over us.
    I recommend this book: Consumed by Benjamin Barber. It is a much broader and less passionate look at what the author calls the "infantilization" of culture.

    13 April 2009

    If at first, you don't succeed...


    Found this signature from a forum today, and it made me giggle.

    09 April 2009

    Desire To Dance Vs Alcohol




    http://graphjam.com/2009/04/09/song-chart-memes-desire-dance/

    04 April 2009

    The Future of Warfare

    The presenter lacks subtlty, but it is fascinating, none the less.

    More TED Talks here