A View Inside My Head

Jason's Random Thoughts of Interest

NAVIGATION - SEARCH

Truck

Last week, I travelled to Philadelphia to work out of my company's office in Exton for a week. Before leaving, I took my youngest daughter for a hike in the park, which was a two-fold treat for her: she got to spend time with Daddy, and as an extra bonus, she got to ride in Daddy's truck. Being a two-seater, it is not often used unless I'm spending some 1-on-1 time with one of the kids.

After returning from out hike, I parked it on the street in front of the house. It looked something like this picture that I took in 2003 right before buying it:

[Sorry, photo no longer available... But it was pretty sweet looking!]

Well, fast forward to very early Friday Morning. I was sleeping in my hotel room, when my cellphone began to ring. I think the alarm clock took quite a few swipes of my fist before I realized that it was not the loud noise that was bothering me. I stumbled out of bed and picked up the phone, only to hear my wife tell a tale of firetrucks and flames and the entire neighborhood observing some bonfire that was taking place on the street in front of my house.

I had actually had a bad dream just a bit earlier, and was relieved to find out that it was only a dream. I think part of me expected the same to happen in this case, but no such luck. My truck - the one that I had just paid off a few months ago - was ablaze.

Now, the truck looks a little more like this:

Notice if you will that there is no hood on the truck. It was a steel hood, and is nowhere to be found. So, it was either removed by the firefighters and they took it with them, or it simply melted away.

The worst part now is that we have to wait until Monday (2 more days as I write this) for the insurance company to tow the shell away to their evaluation center... once there, the lady told me, they would then make the determination as to whether it could be repaired or not. I just giggled to myself.

But, until then, there's a tarp-wrapped burned-out truck serving as a landmark for those trying to locate my house. It's the one with the nose sitting on the asphalt.

UPDATE: The truck was hauled away shortly ago. While speaking with the neighbors who came out to watch, I learned that another neighbor filmed it AND UPLOADED TO YOUTUBE! Thanks, Andy!

A View Inside My Head | All posts tagged 'Euler'

A View Inside My Head

Jason's Random Thoughts of Interest

NAVIGATION - SEARCH

Project Euler Comes to Azeroth

It seems that a lot of my friends are doing Project Euler (according to my High School math teacher, this is pronounced "Oiler").  For example, Bill Wagner has been posting C# solutions, Darrell Hawley has ventured into the Python realm, and Dustin Campbell has been working on F# versions.

I love numbers, and spent a good portion of one summer playing with primes and number fields just for fun (since then, I've discovered WoW, and that takes up all of my time that would otherwise be spent exercising my brain).  Project Euler is actually right up my alley, and while in Seattle, I joked with Dustin that I should post solutions using LUA, and use World of Warcraft as my testbed... 

Problem 1 is finished.  :-D

WoWScrnShot_042408_205532

My no-frills WoW add-on is a simple ACE2 mod that includes AceConsole (for printing to the chat window in the lower left of the screenshot).  I won't bore you with the framework code, but will list my solutions as individual functions on my wiki (where it can grow without polluting my blog's RSS feed). 

As a taste, here's the Problem 1 solution written in LUA.  OnEnable() is my add-on's entry point, and it simply calls into the function Problem001(limit).

function ProjectEuler:OnEnable()
ProjectEuler:Problem001(1000)
end

function ProjectEuler:Problem001(upperLimit)
self:Print("Sum of all numbers less than " .. upperLimit .. " that are divisible by 3 or 5")

local f = function(factor)
local n = math.ceil(upperLimit / factor)
return n * (n-1) * factor / 2
end

local result = f(3) + f(5) - f(15)

self:Print(result)

end