From Hell

How fucking cool would it be to be the Grim Reaper?!

By pure accident is how I stumbled on to Reaper. I don’t remember why, but for some reason, the TV was rockin’ the CW channel. At eight or so, this gem of a show started and I was instantly enthralled in it. Why can’t all TV be this fucking good?! A little synopsis:

Sam (played by Bret Harrison; second from left in photo) has it easy for the first 20 years of his life. His parents allow him to slide through everything with the least possible effort. As a direct result, Sam skipped college, works a dead-end job at the local Work Bench home improvement store, and spends the remainder of his time playing video games. Curious as he was about the reasoning for his parents lack of motivation, he doesn’t find out until his 21st birthday. The ungodly reason his parents let him slide? They sold his soul to the devil before he was even born.

His parents, guilt-ridden, attempt to explain the circumstances that led them to forfeit his soul, Sam can’t quite grasp what is happening to him. When Satan himself (played awesomely by Ray Wise; far right in the photo) drops by to personally explain that Sam must now track down evil souls that have escaped and return them to Hell, Sam refuses his bizarre fate. After getting a small taste of Satan’s temper, however, Sam figures out that breaking a deal with the devil has nasty consequences. Despite this, Sam is fascinated by the devil’s charm and his flattering insistence that Sam is full of untapped potential.

Armed with a constantly changing (and hilarious) series of vessels — starting with a Dirt Devil mini-vacuum — to collect the escapees, Sam finds that his new job is dangerous and frightening, even though he’s assisted by his goofball friends Bert “Sock” Wysocki (Tyler Labine; second from right in photo) and Ben (Rick Gonzalez; not pictured), along with Sock’s ex-girlfriend-turned-paralegal, Josie (Valarie Rae Miller; not pictured). Sock has been Sam’s closest friend and slacker role model for many years and was immediately the first Sam turned to with the news of his new gig with the devil.

Sam knows he’ll have to go to great lengths to hide his new identity from the person who matters most in his world: his smart and pretty co-worker Andi (Missy Peregrym; far left in picture). Trapped by his lack of self-confidence, Sam has loved Andi from afar, despite Sock’s constant urging that he ask her out. Now she’s stuck in a safe job and a safe friendship with Sam.

Though his life has suddenly turned weird and scary, Sam is surprised to find that he somehow feels good about his newfound “mission” — removing evil-doers from the world and sending them back where they belong. Back when nothing was expected of him, Sam never had to push himself to achieve. Now, with his friends and his trusty vessel-of-the-week at his side, Sam is ready to face his destiny as the Reaper.

This show has my kind of comedy: dry but quick-witted and clever humor intermixed with interesting and captivating stories. This might have just become my favorite show, but I’ll need to watch next week to be sure. And I will be tuning in next week. If you haven’t heard of this show, check it out on the CW, Tuesdays 9/8 CST.

I need to unplug…

This looks just like me, 'cept without the cool shades or badassness.

I can’t recall the last time I spent more than a single night away from my laptop. What with the private projects I carry on, websites I maintain, e-mail, Skype, three trillion social networks (I only maintain a Facebook and MySpace account), I feel as though I’m constantly jacked into the Matrix. But without all the cool-as-shit bullet-dodging, ass-kicking, slow-fucking-to-jungle-beats, and flying skills, it just doesn’t hold the element of glamour that it once did. Haha, and let one night pass in which I don’t log onto MySpace or Facebook… it seems as though the whole fucking planet is falling apart according to some people.

But I’m exhausted. Additionally, I’d like to get out to the gym (stop your snickering, fuckers, I know how to do a push-up) and actually get in shape. I’d like to accomplish this soon enough for my drastic cigarette consumption reduction in January. I can’t do that with a trillion damned projects constantly going on, various things needing my ever-constant attention and care. To those who have a stroke if I don’t somehow appear online at least once a night to satisfy whatever oddly, sexual urges you must have, cut the cable. It’s time. You can digitally walk on your own. Now, gimme my dick back. I’m done with side projects for a while. Don’t worry: if I’m working on one of your projects now, I’ll satisfy my obligations and offer technical support… as usual. To others, gimme time. I’m feeling a little burnt up (although money talks, so if we can get past a few language barriers between your wallet and mine I’m sure I might be able to accomodate just one more project).

I will, of course, continue my blogging. In fact, I’ll probably have a new blog every day this week, what with the final Formula 1 race of the year this weekend in addition to my own escapades on the track. This weekend will be the penultimate event of the year and it’s looking as though the decent weather will hold out. Thank god. My balls weren’t sure how to dress every day.

I digress. Time to unplug for the night. If it’s exceedingly important, I can be reached tomorrow some time. If someone has died, they’ll still be that way in the morning.

Just another excuse…

Linda Blair ain't got shit on my son.

Just another excuse to undertake another phase of modification for my BMW. Interestingly enough, it wasn’t just the spilled coffee, the stale cigarette smell mixed with the aromas of a thousand different automotive fluids, the worn leather, the cracking trim, the outdated electronics. No, no. That might be enough for some people, but what ultimately convinced me that an interior makeover on my car was imminently necessary… was my son.

Indeed, I had already had an interior makeover planned for some time now. But with so many other more important phases immediately more accessible and infinitely more important, I had kept pushing it off and pushing it off, and in case I forgot, pushing it off. Instead, I’m now inclined to make this winter’s car project more than what it already was going to be.

On Thursday of last week Avery was diagnosed with Attention Deficit Hyperactive Disorder (ADHD). He was prescribed Adderall, and the last few days have been absolutely heaven as he’s been a perfect angel. The downside to all of this, and it might be completely unrelated, is that Avery seems to be having a few issues with keeping food down. As I already stated, this could be a simple case of the common flu hitting him at a totally inconvenient time, but I digress.

The entire thing would be totally acceptable, but for the projectile fucking vomiting. Yes, I’m sure everyone claims to know someone with a kid that unceremoniously upchucks the contents of his/her stomachs without a moment’s notice. Yeah, that can be disturbing, but it’s not projectile upchuck. When I say projectile fucking vomiting, what I mean to say is unholy-Linda-Blair-on-fucking-steroids-and-crack-after-a-midnight-binge-of-wings-and-Sprite-projectile-fucking-vomiting. Yes, it’s really that bad.

Last night’s episode occurred as we were making our way home from a cookout we didn’t eat at, and instead decided to hook up America’s favorite nasty fatty treat, McDonalds. After paying for the food at the first drive-thru window, Avery gave me warning that he wasn’t feeling good and that he might need to puke. I kindly told him that we were literally two and a half blocks away from home and that he could hold out. We made it to the second window, and while I can see our food and drinks awaiting us just on the other side of the sliding window, I can see no drive-thru employees to give it to me. As the clock ticks down on Avery’s stomach, I wonder whether or not these people were dropped on their fucking heads as children… or whether or not they’d like to be dropped on their fucking heads again if I don’t receive my quickly-cooling food in a more timely manner. Finally, some bitch who looked as though she had just learned how to dress herself and that she could use her mouth to talk (amongst other things, I’m sure), started to hand me my drinks. And that’s when Avery began to dry heave in the back seat. JesusChristdon’tlethimvomitinthebackseat. As the dumb broad finally started to hand me my food, more dry heaves. And finally, as I feathered the gas for departure and the dumb bitch at the window formed her mouth to say, “Have a good night,” Avery let loose. He let loose. He fucking let loose with a barrage of high-pressured, ultra high volume, no spray, no chunks, just liquid, going-for-the-world-record-length projectile fucking vomiting.

I realized after the fact that Avery must have been looking down when he launched, because the area of impact was kept to a minimum around his car seat. Poor kid was trying to save Daddy’s car like a champ, but as he hasn’t taken physics yet, he didn’t realize that vomit with the consistency of 100% liquid will invariably drip and stream away from the initial ground zero spot. He felt bad for puking in Daddy’s car, but I cheered him up with, “Hey buddy, it could have been worse. At least it smells like fruity gummy rings in Daddy’s car.” And it does, too. I won’t say the smell is unpleasant, but just in case, I left the sunroof and windows open in the garage last night, lest the smell of stomach acids finally break through the overwhelming power of the gummy rings.

Oh well, at least I have an excuse to get at that interior makeover now.

ASP.NET: Export to Excel

About as useful as a monkey fucking a football.

I’ve taken over a previous employee’s ASP.NET project at work, and in this process I have found that this person did absolute shit work. No joke, this code sucks in the dirtiest and most degrading sense of the word (use your imagination here, folks). I’m basically at a crossroads of either re-writing the entire fucking application, which would take months and months of eight-hour-a-day work, or washing my hands of the whole business and moving on to my next project. Unfortunately, before I can do either of those I have to put out a few immediate fires. One of those fires, and today’s topic, is how to efficiently grab a large chunk of data from Microsoft SQL 2005 and spit out a Microsoft Excel document. I’m only calling it an Excel doc because it applies to my specific scenario, but the file that it kicks out is a simple comma-delimited file arranged in such a fashion as is acceptable for most spreadsheet software packages.

This first piece of code will handle the data retrieval and document dialog prompting, while simultaneously jumping over to the second piece of code to actually create the Excel doc. In my case, since this was merely a quick, down-and-dirty fix to an existing problem, I didn’t even bother with dinner and foreplay and tied this straight to a button event handler. If this was meant to be a work of art, I’d have shoved all this shit into the business logic layer, as is proper for an application of the size I’m working on. Now, on to the data retrieval and document prompting…


private void btnGenerateExcel_Click(object sender, System.EventArgs e)
{
// Go get the SQL connection string from the web.config file.
string ConfigSQL = ConfigurationSettings.AppSettings[”SiteSqlServer”];

// Instantiate a new connection based on our newly acquired connection string.
SqlConnection conn = new SqlConnection(ConfigSQL);

// Let’s define the SQL stored procedure we’ll be executing to get our data.
SqlCommand cmd = new SqlCommand(”RetrieveAllRecords”, conn);

// Set the command object so it knows it’s a stored procedure.
cmd.CommandType = CommandType.StoredProcedure;

// The stored procedure is expecting a variable parameter.
cmd.Parameters.Add(new SqlParameter(”@ID”, variableID);

// Declare the adapter and let’s go get our data!
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = cmd;

// We need a “bucket” to put this data in so we can access it.
DataSet ds = new DataSet();
da.Fill(ds);

// Time to turn this into an Excel doc.
ExcelController ctrl = new ExcelController();
string strData = csv.Export(ds, true);
byte[] data = ASCIIEncoding.ASCII.GetBytes(strData);
Response.Clear();

// We’re back! Make the user download the file!
Response.AddHeader(”Content-Type”, “application/Excel”);
Response.AddHeader(”Content-Disposition”, “inline;filename=ExcelDocTest.csv”);
Response.BinaryWrite(data);
Response.End();
}

That wasn’t so bad, was it? Shit, I forgot to mention: I usually write everything in C#.NET these days, so if you’re still chugging along on VB.NET, I’d suggest making the move over. Microsoft won’t support VB forever. Might as well get ahead of the curve now. I digress.

The second part of this, and arguably the biggest bitch, is the actual processing of our dataset into csv format. I’ve put this into a business logic layer class or else I would have ended up leaving a huge fucking eyesore of endless code inside my only code-behind file. Dirty code? Fuck that. Do it right.


public class ExcelController
{
public string Export(Dataset ds, bool exportColumnHeadings)
{
// First thing’s first: create our variables
string header = string.Empty;
string body = string.Empty;
string record = string.Empty;

// We’re automatically doing this from Part 1, but…
// If you want column headings included in the file…
if (exportColumnHeadings)
{

foreach (DataColumn col in ds.Tables[0].Columns)
{
header = header + (char)34 + col.ColumnName + (char)34 + “,”;
}

header = header.Substring (0, header.Length - 1);
}

// Time to iterate through the rows to retrieve what we need.
foreach (DataRow row in ds.Tables[0].Rows)
{
Object[] arr = row.ItemArray;
for (int i = 0; i < arr.Length - 1; i++)
{
if (arr[i].ToString().IndexOf(”,”) > 0)
{
record = record + (char)34 + arr[i].ToString() + (char)34 + “,”;
}
else
{
record = record + arr[i].ToString() + “,”;
{
}
body = body + record.Substring(0, record.Length - 1) + Environment.NewLine; record = “”;
}
if (exportColumnHeadings)
{
return (header + Environment.NewLine + body);
}
else
{
return body;
}
}
}


So there you have it. Ten pounds of shit in a five pound bag… or something. There’s nothing pretty about it. It’s nothing to write home to mom about, but when you absolutely need a quick fix for something like this, it can’t be beat.

Lewis Hamilt0wned!

Race winner Kimi Raikkonen (FIN) Ferrari in parc ferme. Formula One World Championship, Rd16, Chinese Grand Prix, Race Day, Shanghai International Circuit, Shanghai, China, Sunday, 7 October 2007

Lewis Hamilton started the Chinese Grand Prix with a fantastic pace from pole. As the rain started to fall in Shanghai, all drivers were equipped with Bridgestone “intermediate” wet tires. The rain fell for about ten minutes while the drivers and engineers debated on which tires should be put on for the first round of pit stops. With time running out, Lewis pitted first on lap 10. Even though his tires were absolutely ripped up from the combination of wet and dry track surfaces, he forewent the change of tires and stayed on the worn ones. He received about five laps worth of fuel and left pit lane. Weather updates every 30 seconds continued to promise of more rain, so that when Ferrari’s Felipe Massa came in, he too forewent a new set of tires in exchange for a quick fuel fill-up. But the rain never came. At lap 20, cars began to come in for soft-dry tires. At this point, Kimi’s pace coupled with Lewis’s lack of grip came down to an epic battle between the two for the race lead. In a brilliant move, Kimi overtook Lewis in corner 12 and immediately poured on the speed. The gap between Kimi and Lewis widened, until Lewis’s tires forced him into the pits for fresh ones. Unfortunately, pit lane itself was still wet, and Lewis’s lack of traction put him into the gravel at the mouth of pit lane. In dramatic fashion, Lewis stayed on the throttle, digging the back end of his McLaren Mercedes so deep that he beached the car. The entire chassis was immovable, resting entirely on its carbon-fibre underpanel, all four wheels spinning helplessly inches above the gravel. As crews came out to attempt to push the craft back onto the tarmac, Kimi began cranking out hot laps, cushioning his lead by ten seconds. In the end, Lewis ended his race early, and Kimi drove brilliantly to win the race.

Elsewhere, Fernando Alonso drove with a purpose to second place, making the fight for the World Drivers Championship a three-way showdown at the final grand prix at Brazil’s Interlagos. Interestingly, had Lewis won at Shanghai, Fernando would not have competed in the Brazilian Grand Prix after throwing a temper tantrum following Saturday’s qualifying. McLaren Mercedes team principal Ron Dennis told reporters that Fernando’s attitude would cost him his seat. Now, it appears, McLaren Mercedes is trying to salvage what they can from the season, since they won’t be winning the Constructors Championship. It looks as though they’re just going to throw as many drivers as possible at it and hope one of them takes it. So the stage is set two weeks from now for a showdown the likes of which Formula 1 hasn’t seen since the mid-eighties.

As it stands, rookie Lewis Hamilton (Vodafone McLaren Mercedes) continues to lead the fight with 107 points. Two-time reigning world champion Fernando Alonso (Vodafone McLaren Mercedes) trails closely with 103 points, while the Susan Lucci of F1, Kimi Raikkonen (Scuderia Ferrari Marlboro), brings up the rear with 100 points. That’s seven points spread between three drivers, meaning that Interlagos, and the championship as a whole, is anyone’s for the taking. If Lewis wins, it’s all over for everyone. In order for Fernando to take the championship, he needs Lewis to finish at least four points beneath him. Kimi has it the roughest of all, and not only needs Lewis to finish sixth or worse, but also needs Fernando to finish third or worse.

But as difficult as Kimi’s situation sounds, Shanghai proved that in Formula 1, anything can happen.

Who then now?! My name is Rob Morrow. I am a Central Illinois native, a proud omnivore, a software developer by day and when the sun goes down I morph into a musical ninja. I am... [Read more]