jump to navigation

What have you done for your country? November 5, 2008

Posted by Brent in computers, entertainment, games, politics, quotations, technology, what "you do here".
Tags: , , ,
add a comment

I came across this here:

Originally posted by M4EOzzy:
I look forward to many years from now, when people ask me,

“Where were you when Barack Obama was elected president?” and I can answer,

“I was in our nation’s capitol, fighting against slavery…….and supermutants……and molerats…..in the year 2252.”

I, too, was on the National Mall saving the world from supermutans, molerats, radscorpions, etc.

Request for Nom-Nom August 13, 2008

Posted by Derek in technology, what "you do here".
Tags: ,
2 comments

We’re still using shell scripts in a Fortune 200 company. Pure hackery. (This wordpress theme is not wide enough, but you get the idea…)

#!/bin/ksh
#
#  Shell script to make a backup of the previously compressed file if it exists,
#  execute the YUI-Compressor on the specified source file, and clean up the
#  backup directory so that it doesn't grow too large
#

trap huphandler  HUP
trap ''          QUIT
trap exithandler TERM INT

huphandler()
{
   print 'Received SIGHUP'
}

exithandler()
{
   print 'Received SIGTERM or SIGINT'
   exit 1
}

if [ $# -ne 3 ]; then
  echo 1>&2 "Usage: yuicompressor <source file-name> <source file-type> <output file-name>"
  echo "e.g. home.src.js js home.cmp.js"
  exit 1
fi

if [ $1 == $3 ]; then
        echo "Error: Source filename and output filename cannot be the same."
        exit 1
fi

#echo "Enter the source filename to compress and the type of file; e.g. newNWA.src.css css:"
if [[ -z $2 ]]; then
        echo "Please enter a file type, usually it's \"js\" or \"css\":"
        read file_type
fi
#echo "Enter the output filename: e.g. newNWA.cmp.css"

if [[ -z $3 ]] ; then
        echo "output_file is null, I cannot compress"
                exit
else
# make a backup copy first
if [ -f $3 ]; then
        echo "Output file already exists, making a backup..."
        NOW=$(date +"%Y%m%d.%H-%M-%S")
        FILENAME=$3.$USER.$NOW
        cp $3 /weblogs/backup/yuicompressor/$FILENAME
                chmod 775 /weblogs/backup/yuicompressor/$FILENAME
        echo "Output file backed up, now compressing $source_file..."
else
        echo "No existing output file found to backup. Starting compression of $source_file..."
fi

#perform the compression
/usr/java14/bin/java -jar /opt/www/scripts/yuicompressor-2.3.6/build/yuicompressor-2.3.6.jar --type $2 $PWD/$1 -o $PW
D/$3

#cleanup backup directory
echo "Checking to see if backup directory cleanup is needed..."
cd /weblogs/backup/yuicompressor/
files_in_dir=`ls $3.$USER.* | wc -l`
files_to_delete=`expr $files_in_dir - 3`
        if [ $files_to_delete -gt 0 ]; then
          echo "Cleaning up backup directory..."
          ls -t | tail -n $files_to_delete | xargs rm
          if [ $? -ne 0 ]; then
            echo .An error ocurred deleting the files.
            exit 1
          else
            echo "$files_to_delete file(s) deleted."
          fi
        else
          echo "No cleaning of backup directory needed."
        fi
fi

A New Hobby: Tufte Trolling July 21, 2008

Posted by Brent in knowledge, websites, what "you do here".
Tags: , , ,
1 comment so far

I attended a one-day course by Edward Tufte a few weeks ago.  I’ve since read 2.75 of his 4 books given out as part of the course.

My brain is now alert to all the chartjunk and PowerPoint fluff running rampant in the world.

So, I’ve taken up the crusade to troll blogs that post wasteful data graphics.  Please see my comment at a popular programming blog.

Request For Comment: NomNom May 15, 2008

Posted by Brent in technology, what "you do here".
Tags: , , , , ,
add a comment

using System;

namespace Silly
{
/// <summary>
/// Wrapper to facilitate the nom-nom-nom anti-pattern
/// </summary>
/// <typeparam name=”T”></typeparam>
public static class NomNom<T>
{
public static void Nom<WTF>(Func<WTF> action)
{
try { action(); }
catch { } // this is the om nom nom nom pattern
}

public static void Nom<WTF>(Action<WTF> action, WTF input)
{
try { action(input); }
catch { }
}
}
}

private static void TestSilly()
{
NomNom<int>.Nom<int>(OMGBOOMZ(), -1);
}

private static Action<int> OMGBOOMZ()
{
return x => { –x; List<int> xx = new List<int>(); xx[x]++; };
}

So, you’re being laid off, hm? April 24, 2008

Posted by Derek in finance, knowledge, what "you do here".
Tags: , , ,
2 comments

No, I’m not being laid off. Yet. But I could be, and that possibility grows ever more likely each day that passes. And it’s caused me to start to think about some of those Bigger Picture items in life.

One blog I read fairly regularly is The Simple Dollar. The author, Trent, has written a 31-part series on fixing your finances. I don’t necessarily need my finances to be “fixed”, but I think the idea of this series is a great and important one: a little work each day over a short period of time (one month) can set you up for long-term growth, not only in personal finance, but in life: your work, your personal life, your dreams and goals, pretty much all the Big Picture items alluded to earlier.

So, tonight, I will begin this exploration with my five main values. This should be an interesting and enlightening experience, and perhaps I’ll share some of it as I progress through the steps.

The 25 Hour Day April 9, 2008

Posted by Derek in what "you do here".
1 comment so far

I worked my tail off today cleaning my slate of obligations to others so that I could get back to doing my job. “Getting ahead” is great in concept, but once you start to be recognized as a resource in certain areas, your time now belongs to others.

This is all fine by me as I buy into the team concept fully, but that’s all meaningless if the launch date isn’t met. I need about a week’s worth of 25 hour days.