Archive for November, 2007
Laptop Battery Life Test
Posted by bumscientist in Computing, Digital Rights on November 30, 2007
I was checking the MacBook Pro for battery life and noticed that the most grueling tests are based on playing a DVD since spinning the DVD takes a lot of energy. This is not typical usage at all. If I were to watch a DVD, I would first rip it to my hard drive and watch the mounted iso. This is an excellent exercise in fair use. First, I don’t have worry about the disc skipping. My current laptop has a first generation laptop DVD drive, so sometimes I get skipping when I watch a DVD, which is very unfortunate. To get around this, I have to watch it from my hard drive. I’m willing to wait for the DVD to copy over, which takes just as long as watching the DVD, because it is such a horrible experience to watch a DVD that skips.
The MacBook Pro has everything I want, except for maybe a solid state drive. I’m still weary of those, because they intrinsically have a lot of non-working areas, which gets bypassed by circuitry on the drive. A flash based drive definitely has a shorter retention lifespan than a disk drive, but it should take less power and is shock proof.
LAMP
Posted by bumscientist in Computer Science on November 11, 2007
LAMP – Linux, Apache, MySQL, and PHP used for running websites.
After many years, I now have a working LAMP website. This wordpress blog doesn’t really count, because it’s already fully packaged. I tried looking for the wordpress equivalent of a photo gallery, but I couldn’t find one. When you can’t find something off the self, you have to build it yourself. The skeleton of a gallery is working now. The webserver is running Slackware Linux on my PII 350 MHz desktop computer. It wasn’t too hard to set it up after I read the tutorials on w3schools. I used the XHTML and CSS tutorials for another website, so that helped knowing what to make the PHP output. Another useful tool is the W3C Markup Validation service.
BMP and 32-bit alignment
Posted by bumscientist in Computer Science on November 10, 2007
I use bitmaps for my 3D graphics programs since they have a very simple file format that I can write a parser for in a few hours. There was a bmp class that I had lying around from a long time ago that was used to load textures to render on OpenGL primitives. Since textures are usually square and powers of 2, you can be a little sloppy and still have the code work, like flipping the rows and columns. The picture will only be flipped or rotated 90 degrees. You can catch that if you billboard an object, but not if you have some texture like an asteroid, which was what I was using it for. The flipping of the rows and columns didn’t trip me up, but it was the 32-bit alignment that did. Since the texture is a power of 2 in width/length, it will definitely be 32-bit aligned, so you don’t have to worry about padding. Since I’m using 24-bit color, 8 bits per color channel it is possible for me to be misaligned if my “bytes times (width times column)” isn’t divisible by 4. 24 bits or 3 bytes does not divide by 4, so the width or column has to be divisible by 4. When I tried to load a 131 by 23 pixel image, my read and write functions for the bmp failed miserably. It was only after some more reading that I realized I had to pack extra bytes to make it 32-bit aligned.
32-bit alignment is a big issue for performance since the CPU bus handles data in chunks of 32 and now more commonly 64 bits.
Now, back to the whole point of talking about bitmaps. I’m using a bitmap loader to test my PNG writing code since making frames for a movie take a lot of space unless you use compression. Hard drive space is cheap, but not that cheap. I love PNGs since they are royalty free and work well.
The Bum Scientist
Posted by bumscientist in Annoucement on November 10, 2007
Version 2.0. I lost the database for the first try.