Saturday, August 30, 2008

Battening down the hatches...

Hurricane Gustav, 5-day forecast: Saturday Aug 30 @ 9:00 PMSo it's been a while since we've really had a bad hurricane barrel right down on us. The last one that affected me was Katrina, although I was lucky; Rita did a good bit of damage that same year.

Now, it looks like Mother Nature may just be making up for lost time. Hurricane Gustav is headed straight for us with all of the computer models in general consensus that it's not turning until after it's made landfall. And, it's not a small, wimpy storm; it's currently a Category 4 storm, and it's waltzing through the Gulf, which gives it the opportunity to gain strength before its arrival, which, according to the forecasts, is due to mess my life up this Monday. Happy Labor day! I brought you some rain and wind! Ug.

As if that wasn't bad enough, it looks like Gustav has a girlfriend that may be showing up to the party, albeit a few days later. Hanna is currently a tropical storm, but it appears that she is making a bee-line towards the Gulf of Mexico. I am personally hoping that either she changes course or Florida knocks the wind (and rain) out of her. We really don't need a couple of hurricanes within a week of each other. That's just poor scheduling.

For anyone who was afraid that I might climb up a tree and cut my limbs off, I wasn't able to go into Harahan, due to traffic from people evacuating. Hopefully the tree won't fall into my Mother-in-Law's house before I can get down there and remove it. I did, however, spend all day today and yesterday preparing my house and my neighbor J.R. Nip's house for the coming hurricane. I had to round up all of the small things that were outside and put them in storage, and take all of the larger things, such as outside furniture, and put them all close together in my carport and cable them all together so they won't go flying out of my yard. Will that work? I dunno... it worked last time, but time will tell. I have about one more day of preparation and about one more day before it hits, so it should work out. I'm also trying to get as much of my reviews and other site work done while I still have power and Internet access, as these become scarce commodities when a hurricane hits.

Until later, this is the Geck0, signing off.

Thursday, August 28, 2008

Appending to event functions in javascript

So, Google Answers is a Google Product (feature?) that has come and gone, evidently. I was looking up some information on how to do something specific with JavaScript and Googled into a JavaScript question that someone had posted, asking how to go about "Appending to event functions in javascript".

Well, this was not what I was doing, specifically, but along the same vein of what I was looking into. Anyway, I was sad to see that I knew the answer and yet, with Google Answers closed down, I wasn't able to post a response, even though no one had answered the question.

Anyway, I am posting a code snippet below for anyone who is interested in adding javascript function calls (or, for that matter, other javascript executable statements) to the document.body.onload after the page has started loading.

This comes with no guarantee or warranty, but may be fun to play around with. Please note that the alert that says "This fires first" fires ON LOAD, as do the others, but it fires before the "page has loaded" alert, because it is being PREpended to the top of the list of things to do on load. This allows you to include something later in the file that needs to be done before other things. Using this same concept, one could build a more elaborate set of functions that allow you to insert statements into the list of statements to be executed in a specific, desired order, sort the statements in some fashion or specifically delete or modify a single statement, but I don't know if that would really serve any true purpose. This is more of an academic exercise.

The code:
<html>
<head>
<title>Changing Onload via JavaScript</title>
<script>
function onload1()
{
alert("page has loaded");
}
function addedFunction()
{
alert("Added Function successfully");
}

function prependOnload(statement)
{
insertOnload(statement, true);
}
function appendOnload(statement)
{
insertOnload(statement, false);
}
function insertOnload(statement, isPrepend)
{
var oldOnload = document.body.onload+"";
var startOfOldStatements = oldOnload.indexOf("{")+1;
var endOfOldStatements = oldOnload.lastIndexOf("}")-1;
var instructions = oldOnload.substring(
startOfOldStatements, endOfOldStatements);
var newOnload = (isPrepend)?
(statement+instructions):(instructions+statement);

newOnload = new Function(newOnload);
document.body.onload = newOnload;

}

</script>

</head>
<body onload="onload1();">
<script>
appendOnload("addedFunction();");
prependOnload("alert('This fires first');");
</script>
</body>
</html>


Notes on the code:
The main work-horse here is insertOnload(). The first thing it does is gets the current value of onload as it stands. This is a function, not a string, so in order to manipulate it, we have to force a cast to string, hence the +""... add a string to something and it becomes a string. Sneaky, no?

With the contents in a string form, we then peel off the function definition, leaving us with a list of instructions (again, as a big ole chunk of text). We can easily either add our new statement to the beginning (statement+instructions) or to the end (instructions+statement).

Now that we have the statements that we want executed, we have to create a new Function containing this new list and then assign it to document.body.onload and we're done.

Wednesday, August 27, 2008

Gustav, the unwelcomed caller...

Tropical Storm Gustav: Tracking Map
...Then I'll huff and I'll puff and...


Well, we've managed to dodge the bullets pretty well since Katrina ripped New Orleans so badly. Unfortunately, Tropical Storm Gustav is looking like he wants to go to Louisiana when he grows up...

...and they grow up so fast, these days.

Where does that leave me? Well, hoping that the storm is small, waving my hands in the hopes of shooing it to one of our neighboring states, stocking up on batteries and canned goods that taste good cold (yum... green bean salad) and planning a trip to scale and cut down (from the top-down) a tree in my Mother-in-law's back yard.

Yup, these sort of things end up my responsibility, as they are no one else's, yet must be done. So, I have a brand-new Ryobi rechargeable chainsaw, a protective hat with a visor, some rope to help pull limbs and tree parts away from me and I'll be renting an extension ladder to do the job. It's looking like it's going to be Friday or Saturday, weather permitting.

If you never hear from me again... well, it might be that I'm bad about updating blogs.

Until later, this geck0 has to prepare to climb a tree.

Sunday, August 17, 2008

I want your vote...

...to count. I really do.

I know that people say that the kids today are just too darn apathetic to get out and vote. I think the problem is that people thing that their votes don't count. Or, more specifically, I feel that people would vote if they could vote their mind when they actually make the effort to head to the polls.

The problem with the voting system, as I see it, is that you can only vote FOR someone. That's great if there is a candidate who sees the world the way you see it. However, more often than not, it's not a matter of strolling to the polls to vote FOR the candidate you want to see in office; it's trying desperately to choose between two people you wouldn't let babysit for you and wouldn't trust to balance your checkbook.

When it comes right down to it, I think a lot more people would actually get out and vote if they could say, "I DON'T want this person in office," even if that was all they put on their ballot. In essence, a vote against one candidate is a vote for all of the other candidates, but not with the full weight of a vote.

If there is a candidate or candidates you would like to see in office, you should be able to vote for them. If there are others you don't want to see in office, you should be able to vote against them. If there are candidates you don't feel strongly about either way, simply don't vote either way for them.

Our technology has come a long way since this country was founded, and it seems to be that we should be able to count the ballots just as easily using this method of voting as the current way. It's more data, but it better captures the will of the people. If anyone else out there is concerned with the fact that we are electing presidents into office and they are subsequently having unbelievably low approval ratings, then let's change the voting system so that negative opinions are taken into considerations before the candidates are elected.

I honestly don't understand why this is not the way we vote for candidates already.

Saturday, August 16, 2008

Blogger me this...

So, today's task is to make a "Label Cloud" for use on this blog and on the "Backstage at GameVortex" blog. I am rather surprised that there's not already one out there. I'm basically trying to reproduce the old familiar "Tag Cloud" look, but using the blog's labels instead of reader-assigned tags.

I suppose the work will come in handy, as I am considering adding a "Tag" system and a "Tag Cloud" to GameVortex and, perhaps, PSillustrated and I'll need to know how to create these from scratch, I would assume. Unless there's a really generic "tagging" system out there. Hmm... that might be worth looking into, actually.

Anyway, I am finding the gadgets (or widgets) for Blogger to be rather limited and stubborn to deal with. The problem seems to come with wanting to have access to the blog page's data and wanting to be able to work with the data in any real way. What I need to be able to do is determine the minimum and maximum values for data:label.count, but my attempts to pass them into a javascript function or set up a variable and set it while looping through the items seems thwarted at every turn.

So, in the mean time, I've basically hard-coded a version. I'm certainly not happy with it, but at least it's something that proves the idea for now.

GameVortex: Collector's Edition ?!?

So, I've decided to "compartmentalize" a little bit.

Originally, I had planned to blog pretty much whatever here, including the extra stuff that doesn't make it into my reviews or other content on GameVortex and PSillustrated. While that's still pretty much the plan, I just made a separate blog, "Backstage at GameVortex," that's specifically for offering a "behind the scenes" look at GameVortex.

To this end, I have just finished moving three posts that were labelled 'Content "Making of"' to the other blog and, in the future, will be posting those there. Hopefully, other reviewers will also make use of this ne blog. I think it could be a cool way for our readers to get to know us better.

Friday, August 15, 2008

Aquatic Calamity

I like fish. I like to watch fish go about there activities, interacting with each other and exploring their environment and so forth. I find it peaceful and relaxing.

My wife and I maintain two 55 gallon marine aquariums in our home, as well as a 90 gallon pond in the back yard. Additionally, we have a 10 gallon freshwater tank on the bar area to rehabilitate one of the pond fish who had a falling out with the others. Finally, I have a small "executive" aquarium for a blue Betta fish named "Dudey," who recently came down with velvet and I've moved him home so that I can better control his environment and properly treat him.

Which leads me to my topic. We have had the worst time with disastrous "events" with our pets this year, especially our fish, but it actually goes beyond that; one of our outside cats was attacked in our yard by a dog from down the street... and that neighbor is beyond negotiation and animal control can't do anything unless we basically gift-wrap the dog for them.

Anyway, when we came back from our Gatlinburg trip, one of our pond fish, "Lucky," who, to that point, I was sure was the luckiest fish in the world, was dead, without any obvious cause of death. I got this fish from a coworker who couldn't keep it. He had been experiencing fish loss in his small pond in his back yard. They weren't turning up dead, they were simply not there anymore. Then, one day, he sees a snake slithering away from his pond with a lump in it. He kills the snake, slits it open and out comes Lucky, none the worse for wear. That's where the legend began, but since that time he outlived his pond mates in two locations and survived a mishap in our pond where all of the water got pumped out and the bottom floated up, causing the pond to become wrinkled and malformed. One of the smaller fish that my wife loved died in that event, but Lucky lived through it, swimming in place in an area that had less than an inch of clearance around him. And he was nearly a foot, nose to tail-tip. He was an amazing fish. And I don't even know what happened to him. JRNip was watching our house for us and said he had seen him the afternoon before we got home and he was fine.

We have one porcupine puffer in each of our two 55 gallon marine tanks, and a lawnmower blenny in each to help clean the tank. Well, as far as we can determine, one of those blennies apparently went after a piece of food that the puffer was going after and got the business end of a poisoned spine. We assume that, since his mouth swelled up and wouldn't close and his head turned dark in coloration. He was unable to eat for a few days, but we took care of him to the best of our ability in a hospital tank and after about a week, he was good enough to return to the marine tank.

This same hospital tank is now occupied by my fish-away-from-home, Dudey. I'm dosing him with Maricyn 2, keeping his temperature constant and slightly elevated, and covering the tank with a black T-shirt to slow the growth of the velvet.

Additionally, my wife's porcupine puffer was acting all sick and lethargic yesterday. I was trying to determine if he was trying to look pale so he could blend in with the sand to better prey on the new little blue fish we added to the tank or if he was sad or in pain or what. (Puffers are smart... that's the problem with smart fish... they can actually get upset or even mad at you and behave strangely based on that. When we first separated the male from the female to give them each a larger tank, he pouted and pined for her for a week, until we put him in a small tank next to the female's tank for a few hours so he could see that she was still around and then moved him over the course of a couple of hours back to his tank, a few feet at a time and then 15 minutes between moves. After that, he was cheery again.)

Luckily, after a couple of hours, the male puffer seemed to be over whatever the issue was, so perhaps it was something he ate. I just wish that fish would all get better and stay that way. I suppose we've been fairly lucky up until this point; we would have the occasional emergency, but they were never stacked up on top of each other all at the same time. Hopefully they'll soon get back to a sense of normalcy. I'm hoping so, because just the maintenance on four aquariums and a pond is a lot of work and it's mostly heavy lifting, so it's pretty much up to me. I get to clean the pond filter this weekend, by the way. (yay.)

Thursday, August 14, 2008

Whoa... How long was I out?!

I would like to say something here about how I simply stepped away from the Internet for a few years, just as a sad attempt at humor, but since I just got back from a recent trip to Gatlinburg, Tennessee in which I had virtually no Internet access, it somehow seems like something I'd rather not even joke about.

The truth of the matter is that I've been busy, busy, busy attending to a lot of other things, far from the least of which being working on GameVortex.com. For one thing, my darling bride has not been able to keep the sites running up to the level they used to since her New Beetle was rear-ended by a couple of 18-wheelers (yes, she lived and yes, we still have the car... three cheers for German engineering). Since she's operating at a slower pace these days, its been up to JRNip and myself to try to automate and streamline processes to take up the slack.

In addition, Google changed all the rules "while I was out," requiring us to scramble to change the way we do things so that our pages were actually indexed in Google. That, however, is another story... for another post... or perhaps a book.