Navigation

Making a Page footer STAY at the bottom

I have tried many, MANY ways over the years to reliably get a web page footer to stay at the bottom of the page. Most methods involve setting many div heights to 100%, which somehow makes it all magically happen.

I have found a much more reliable method.

  1. .footer{
  2.     position: absolute;
  3.     bottom: 0;
  4.     z-index: 5;
  5.     width: *your page width*
  6. }

I have only tried this method with fixed width pages, but it seems to work well. Better than any other method I used. Please note that the z-index is set to make sure the footer appears on top of other elements, and may need to be adjusted.

Funny Link

This made my laugh hysterically, then I realized they weren't serious..Lunix.

Thoughts and ramblings

189912543v6_150x150_Front.jpg

Wow, You know when it's been a while since you've posted on your blog when you forgot what it looks like..

I haven't been able to get much time for blogging, as I was brought on full-time at my new job, and had several projects to work on. Unfortunately, this means I also put Nanobyte on a backburner for a bit too. I was hoping for an alpha release of the CMS this month, but that likely won't happen now.

The weather in Wisconsin has been bitter cold, with random snow storms. I've forgotten that people's I.Q. seems to drop about 50 points in the winter.. must be the cold air hitting their brain. 2 days after a snow storm, I saw 4 cars spin out on my 12 mile drive to work. People just need to learn to slow down, and that they wont get there more than a few minutes faster by going 10MPH faster than they should be.

After all my hard drive issues, I finally got my server (Taranis) back up and running on OpenSuse 11.1. I must say, it has some nice features. It came with the drivers for my HP Photosmart 2700 printer built right in, and I haven't had any issues at all with it. I also use the same distro at work as my main desktop, and it works fairly well, but I had a few issues specific to development work.

I found out today that the jQuery Help forums that I help moderate might become the official jQuery forums. That is exciting news, and I hope that it happens, as the forums jQuery has in place at the moment seem to be lacking.

On a final note: Nanobyte will be available under the Mozilla Public License (MPL) beginning with the Alpha release of the CMS. I believe Open Source is what drives the IT world, and I plan on keeping it that way.

T Minus 12

left-4-dead.jpg

It's now just after 7 PM, that means that in 12 hours, OpenSuse 11.1 is released, and all hell will break loose on the OpenSuse servers.

Why am I so excited for this release? I'm not entirely sure. I was working on my server last night, trying to get it ready to be rebuilt. The storage drive died a few weeks ago, and I just got it back from repairs, and I was able to to a zero-fill on the OS drive to fix a few S.M.A.R.T. errors on that drive. I was about ready to install OpenSuse11.0 again, and realized that I had about 36 hours before I could get the latest and greatest.

I could have just as easily installed 11.0 and upgraded after the fact, but I am a firm believer of clean installs.

In other news, as an early Christmas present, I found out that I am going to be getting full-time hours at my new job- at least until January.. we will see what happens after that. It is so great to have a job that I love. I have gone from help desk support to PHP Programmer. It is the greatest thing in the world to know that all of the work I put into learning PHP and honing my skills was all FOR something besides having a constructive hobby.

Left4Dead came out in November, and I was lucky enough to be given a copy as a gift. It is such an awesome game. It is infinitely better than Team Fortress 2 (which I never really got into) and is very fast-paced. A 5 level campaign takes about 90-120 minutes to complete, and is dependent on Teamwork. If you are into FPS type games, and have NOT played L4D, I suggest getting on the bandwagon.

Compressing included javascript files

I have been hard at work on Nanobyte, trying to get it ready for Alpha status. I recently worked out file compression to make the pages load faster, and thought I would share.

When I built Nanobyte, I wrote a function to include JS and CSS files with a function that adds each filename to an array for inclusion. With this array, I can combine all of the files into one large file and compress it for viewing.

  1. public static function CompressFiles($fileArray,$type){
  2.         if($type != 'css'){
  3.                 $ob = "<?php
  4.                 ob_start (\"ob_gzhandler\");
  5.                 ?>\n";
  6.         }else{
  7.                 $ob = "<?php
  8.                 ob_start(\"ob_gzhandler\");
  9.                 header(\"Content-type: text/css; charset: UTF-8\");
  10.                 header(\"Cache-Control: must-revalidate\");
  11.                 ?>";
  12.         }
  13.         $filename = './templates/'.THEME_PATH.'/'.$type.'/compressed.php';
  14.         $fh = fopen($filename, 'w');
  15.         fwrite($fh, $ob);
  16.         foreach($fileArray as $file){
  17.                 $contents = file_get_contents($file);
  18.                 fwrite($fh, $contents);
  19.         }
  20.         fclose($fh);
  21.         return $filename;
  22. }

This function does several things.
First, we set the output buffer and headers to add to the new file.
We then tell the function where the file is going to be created, and open it for writing.
Once it is open, we write our PHP code block to the file. To get this to work correctly, the file must have a .php extension.

Next, we read the contents of every included file one by one, and append them to our new file. This makes for one large conglomerated file to include.
After all files have been added, we close the file and return the filename of the new file to be included.

Since the page is a php file, the code block will run, which uses ob_gzhandler to compress the file. Using this on Nanobyte, I have reduced a 420KB total page size down to 168KB.

A side effect of this process is that we also reduce the amount of server requests tht our server hs to process. Overall, I gained just over 3 full seconds for the page to load. before this function, the average load time was 6.2 seconds, we are down to 3.19. Incredible!

One last note: Though the file is a .php file, it CAN be included like a regular JS file.. e.g.
<script type="text/javascript" src="/js/compressed.php"></script>

Fun with windows commands

shutdown-i.PNG

Now that all of my PCs are on the same domain, I have been playing with different commands on the command line, and thought that this one could come in handy for some of you:

From the command line, type shutdown -i.

This will open a dialog box (pictured) and allow you to remotely send shutdown commands to other machines on your network as long as you have the correct privileges on them.

With this command you can specify reasons for the shutdown and allow a set amount of time for any users to save their work before the system shuts down.

The NXE

UH370_nxe_1.jpg

This is a day late, but I got the NXE (New Xbox Experience) downloaded yesterday,a nd I must say, I am impressed. The new interface is easy to use, Graphically Pleasing and I can see why Microsoft thinks this will help target 'non-gamers'.

Elsewhere, I was offered a part-time position as a PHP developer, so I finally got a break and can follow my dreams to a great career. I am also working with 2 friends to form a partnership and get our business license. Stay tuned more for that.

Nanobyte is coming along quickly. I got comment functionality working, but not fully implemented. I also broke my backend to allow posting articles, so it's been a few days since an update has been posted there.

More Good news, My webhost has extended my plan to include UNLIMITED STORAGE AND BANDWIDTH.

I'll wait for you to close your mouth and wipe your chin..

Now for some not-so-good news. My server had a catastrophic failure. First, the largest of the 2 Hard drives went out, and I spent about 3 days getting everything recovered from it. That one is under warranty. 3 days ago, the OS drive started failing. Another 18 hours of drive recovery.. and this one is out of warranty. I think it was the power supply, as once I replaced that and changed P2P-EXT timeout in the BIOS to 1MS everything is working more stably, still need a new hard drive though.

I leave you with the hard drive I WISH I could get:
Dream Hard Drive

Reccomended System Requirements

steamLogo.jpg

I came across something I just just HAD it share today. I decided it was about time I reinstall Steam, since I formatted my PC a few weeks ago. While I was downloading the Steam installer, I noted the system specs:

System Requirements

* Windows 2000, XP or Vista
* 64 MB RAM
* 400 Mhz processor
* 1GB HD space (recommended)
* Internet connection (broadband recommended)

Sure, they look pretty standard, unless you are familiar with Steam. I knew there was one serious flaw in the requirements, but went on installing anyways.

Before I formatted my system, I had backed up my Steam folder - all 21GB of it. That would be for exactly 4 games from Steam. 21 is a little more than 1 if I may say so.

Anyways, I finished installing the client, and decided to download the Left4Dead demo. I received a dialog stating: Disk Space Required: 2220MB Once again, That is over 2BG of data, that I was told by the steam requirements I wouldn't need!

My goal here is not to complain that I was lied to. It is instead to bring a humorous to people's attention. If you are going to install Steam, PLEASE make sure you have at LEAST 20GB of free space.

Big Day for Nanobyte Updates

I had quite a bit of accomplishment on Nanobyte today. User profiles are in place and functional, code highlighting is working and I was able to fix a handful of bugs as well!

The updated code has been committed to SVN.

You can view all the Nanobyte updates at: www.nanobytecms.com

Super Tuesday

xbox360-logo.jpg

I always try to keep politics out of my rants.. not because I am afraid of starting something.. but because there is always something to say. That said, I have one thing to say:

Get out and vote, or don't whine about the electees!

Alright.. now on to more important matters.

My Xbox finally came back for repairs today. This is the end of a 6 week process that made me rip out my hair. IN late September Mary and I planned on a night of Guitar Hero, but instead got the 3 red rings of death (RROD). I called Xbox, and they were very cordial and stated that I would be shipped a box to return the unit to them in.

2 days later that repair was canceled. I called back and repeated the process. I was told that I would receive a mailing label by email to use this time. This was also canceled 48 hours later.

My third call did not turn out any better, but I was assured it would go through. Now, please note all these calls were canceled because I do not have a standard street address, and instead have a "Grid Address" in the form of N12W12345 MyStreet Dr., where N is North, and W is West.

The fourth call I was pretty upset, and was told that they were not allowed to make any more service calls for me because it had failed too many times. I spent 30 minutes on the phone with that person's manager, and was once again told I would be emailed the shipping label.

Can we guess what happened next? Yes, this call too, was canceled. I put it off for about a week, then finally called back. When I was asked if I was SURE I could receive mail at this address, I went off on the person on the other end. They put me on hold for no less than 19 minutes and finally explained that my address would not validate because it was in their system twice.

Twice. Wouldn't that send up a flag that someone maybe should have taken as "Oh, I guess this is the correct address". I received a Box overnight, and finally got my Xbox back today - exactly 7 days later. The only consolation is that I was sent a brand new unit (mfgr date 8/29/08) which means it will not have the same flaws, and will be MUCH MUCH quieter. Oh, and a free month of Xbox Live.