Bill's Computer Circus
Don't get caught with your system down.
NOTICE: This web site may not render correctly in older browers like Internet Explorer 5.2 for the Mac. May the gods help you if you are using Internet Explorer on any machine! Otherwise, if this site does not look right on your browser, please let me know what browser you are using (and what version and on what computer). Thanks!
"Visual Basic makes the easy things easier. Delphi makes the hard things easy."
-- unknown
Wednesday, October 19, 2005
 
I've Been MAMEd!
I was playing with the new Playstation 2 that my wife and I bought a week or so ago. I have never been much of a game player, but I got hooked on this Wallace and Gromit game, which turned out to be a lot of fun. The only problem is, it doesn't satisfy our desire to find something that two people can play at the same time. But then again, we have only turned on the PS2 twice since we bought it.

So, I got to thinking, there's got to be some good computer games out there - something simple and fun to play that didn't require a separate game console. Being that I am not a serious gamer, I'd probably be happy with Pong (in fact, I have an original Pong game, but it doesn't show video anymore). But I thought I would poke around to see if I could find some of my old favorites ported over to the PC, like Gorf and Asteroids.

Sure enough, I hit paydirt! I found MAME - a Multiple Arcade Machine Emulator (I believe that is what it translates to). There are still copyright issues with possessing the game ROMs, but you know I had to try some of them out. At least I think I can legally have Gorf, because I bought the game cartridge for my Commodore 64 years ago (I think that is the *only* game I have ever bought, or even really played at home, before). But this thing was the real deal, just as I remember it. Now I want to build a control panel with a joystick and buttons just like the real arcade game.

But I also found Asteroids and fired that up. That game is still so fun! It is so basic and primitive and simple (but maybe not easy) as far as games go, but it is so much fun to play - and it is just as I remember it! It is so cool to play these old games again. I won't feel too guilty if I hang on to the Asteroids ROM file, since I spent so much money in the arcades as a kid playing this game, I should probably own an entire console. They got their money!

Anyway, I don't have much time to be playing games, but now I know I have a couple of old standbys that I can fall back on when the mood strikes. I do need a little R&R now and then. It seems like I never do anything fun on the computer. Well, now I can!

posted by Bill  # 1:42 PM
Thursday, October 13, 2005
 
Listen While You Read
After visiting Orion's McBlog and enjoying the experience of listening to music playing while reading the latest entry, I thought I would add music to my blog, too. I think you can kind of get an idea about a person by what music they listen to, plus the music can set the mood for the reading experience.

I don't think I will change my song every day...although I could automate that. I created a little Flash movie that you can see in the right nav bar - it is just a very simple MP3 player. Currently, it can only play one song that I hard-coded into it. But I will be expanding on it over time, adding XML functionality and maybe a desktop or web-based utility to make it easy for me to update the song. I also want to have it keep a history of songs that have played - and the dates they were posted - so you can scroll back and see what you missed. I don't have the disk space to retain all the song files, but at least I will include the title and artist. I will also add a display to the face of it to show information about the song that is currently playing.

The first (and current) song as of this posting, is "What I Am" by Edit Brickell.

I don't know if I will do the same with my Haphazard Musings blog, but if I had a song up there today, it would be Highway to the Danger Zone. Check it out.

posted by Bill  # 11:28 AM
Saturday, October 08, 2005
 
Going Anywhere?
What...is...the...deal...with...Blogger...these...days? Seems...they...can't...keep...up...with...the...demand.
Just...when...I...start...using...it...regularly, they...suddenly...get...slow.
It...is...very...frustrating. I...don't...have...time...for...this.

posted by Bill  # 12:10 PM
Tuesday, October 04, 2005
 
The Web is Bent. Standards, Anyone?
Now I know why Web technology is the way it is. It is so people like me can get paid to spend an entire day to produce a piece of code that I should have been able to write in about 15-30 minutes. Now, if I only had a job, this would be a more attractive picture to me.

But my wife is trying to get me in where she works. I'm not sure how that will work out if that happens. Time will tell.

ANYway, I was helping my wife with a problem she has at work. She is helping revamp a web-based interface to allow users to customize the presentation colors. One of the problems is, the developers of the web site did not appear to have a strong grasp on some fundamental concepts behind cascading style sheets (like, for one, the cascade) and JavaScript. My wife has recruited me on a couple issues in this matter, since the developers there are strapped, and she thinks I'm some kind of computer god or something.

Today's task (that actually began yesterday) was to find a way to add color to some navigation tabs. Whereas this might sound like a simple thing to do (and might otherwise be a simple thing to do, given the proper tools), it was about as far from trivial as you can get.

First of all, there is this JavaScript code that she found online to implement nifty rounded corners on things using stylesheets (as opposed to using graphic images). I use this code on this Computer Circus blog, in fact. But it does some funky things, not the least of which is to add 5 pixels to the top and bottom of the element that is being rounded, creating a potential alignment nightmare if you don't factor this into the design from the beginning (like I did on this blog).

This code essentially toys with the background color of the element and tweaks the stylesheets behind the scenes. It can get ugly. But on top of this ugliness, is another script - that I wrote - that addresses PNG images. Most all browsers on the planet support PNG images to some degree, except Internet Explorer. There is a hack, however, to make them work via stylesheets. I implemented that hack where background images are used. When you have a background image in an element, and it is a PNG image with some transparency, then the background color of that element will shine through the transparent regions. This is the approach that was taken for adding color to these navigation tabs.

The problem is, due to other mitigating factors that I won't get into, if a PNG is used within an IMG tag, I had to write some JavaScript to scan the entire document on page load and apply a LoadAlpha filter to all the images behind the scenes, so that they would appear with normal transparency in IE. These images appear gray for a moment, because they are not replaced with their transparent renditions until after the entire page has loaded.

Another problem comes in when you want to round the corners of an element (say, a table cell) that has an image in it (say, a tab) - whether background or in an IMG tag. Suddenly, the image appears with 5 pixels of rounding above it, so you get this colored tab with a line of full background color above it. The idea behind rounding the background color was to match the rounding of the tab image so that it appears as though there is just this colored tab sitting there, with the color of the body background filling in around it - like you would expect.

But this 5-pixel offset makes it look like crap (which is a nice way of putting it).

So, I had to address this problem with a different approach. OMG. What I did was just put the transparent tab images in place, normally, (using a table to layout the tab images), and behind the scenes, using JavaScript, I created a new DIV element with the proper color and rounded corners on it, and stuck it behind the table with the tabs in it, aligning it perfectly with the tab images.

Due to the conflicting nature of web browers and their inability to conform to standards (not to mention their different INTERPRETATIONS of the standards), this implementation was an absolute nightmare.

Can you say, "nightmare?"

In order to put the DIV behind the table, I had to specify a z-index that was lower than the table. In most browsers, this was not a problem. But in FireFox, I couldn't get the colors to come through, and if I specified a positive number, all I could see was the DIV and it blocked out the tab images. What I didn't realize was that, according to the standards, z-index only applies to positioned elements. So, in order to get that to work, I had to go into the HTML and add a DIV tag around the table and give it a stylesheet to specify position:relative;top:0;left:0; - then, suddenly, the z-index:-1; specification on my dynamic DIV became effective, and I could see the color shining through the tabs like it was supposed to. That only took about 4 hours to figure out.

By the way, this story is very condensed - there are a lot of problems I had with this implementation that I am not reporting here. I probably can't even remember them all.

But another problem was with the nextSibling reference. My code looked for the tabs, which were each comprised of three adjacent table cell (td) elements (one for the left tab image, one for the right tab edge image, and one for the middle portion of the tab, the width of which could vary, and which had a background PNG image tiled horizontally to complete the tab picture -- plus the text that appears in front). My code would find the first of the three tags, and compute the width of the new DIV element by adding the width of the three TD tags together. In most browsers, I could use nextSibling to refer to the next adjacent TD tag. This makes sense. But not in FireFox, apparently. The nextSibling reference in FireFox referred to some text element, and nextSibling.nextSibling refered to the next TD element.

Don't ask me why.

So I had to add a kludgy hack to my code (I hate that!) to make it work in all browsers.

Then there was the problem of using setAttribute() with STYLE tags. When creating my DIV element, I had to apply the proper style, and I did that using the setAttribute() method. This worked fine in Safari and FireFox. But then I tested it on IE, and everything came crashing down (and you thought Y2K was a problem?). IE hated it. BUT! IE likes if I just do something like el.style.visibility="visible". So, I was able to get it to work in IE by breaking up the stylesheet and assigning it to style properties in this way. Once I got that working, I checked it in Safari and it worked there, too. But FireFox hated it. FireFox needed it to be in the setAttribute() form.

Safari swings both ways.

So then I had to resort to hacking up my code with browser detection to take one branch if the browser is IE, and the other branch for everything else. Who knows if it works with any other browsers.

What a pain in the BUTT this crap is! My GOD, how does anything work on the Web?

I won't even tell you about the hell I went through to get the Pac-Man to run across the screen. But thanks to Orion for the idea!

posted by Bill  # 6:58 PM
Monday, October 03, 2005
 
Now Disappearing in Ring Three
Circus music, please!

How ironic. I was up last night thinking about weird stuff (totally unrelated to computers), so I decided to do something I had been considering for some time now, which was to start a new blog. There have been a number of occasions when I wanted to write about things unrelated to computers, yet refrained from doing so under the auspices of the Computer Circus (despite the many existing unrelated entries). And with all the thoughts buzzing through my head last night, I decided it was time to get up - right then and there - and start a new blog.

Enter Blogger. I logged in and began the process of creating a new blog. First, I had to figure out what to call it. After a few moments of contemplation and a few rejected titles, I settled on Haphazard Musings. I figured that would pretty much cover the gamut of subject matter that may eventually find its way in there.

So then came the process of finding an available blogspot URL. I tried a few different names, but kept running into issues - mainly with the secret "word" (i.e. jumbled letters) that you had to type in from the graphic display as a means of indicating that I was actually a human creating this thing, and not a machine. But I guess the machine couldn't handle that. Between telling me I entered the letters incorrectly and my blogspot URL unavailability, I suddenly found myself staring at a page that was telling me that Blogger was temporarily down for scheduled maintenance, from 4:30-5:30 pm Pacific Time. Considering it was about 1:00 in the morning, I took this with a grain of salt.

However, I was subsequently unable to complete the creation of my new blog. I was a bit annoyed, because I had seen this downtime message a lot over the past two days, and never between 4:30 and 5:30 pm. So I assumed Blogger must be having trouble. And my suspicions were confirmed when I logged out and tried to log back in. This time, I simply got an error page. Then I tried to go to the Blogger home page and got the same error page.

So, I decided to write my first entry for my new blog, offline. I wrote for about an hour and decided to check Blogger again. Still no luck. I tried different computers and different browsers just to make sure it wasn't some cookie confusion or something on my end, but to avail. Blogger was down.

But I was able to visit other blogs (including my own) and post comments to them, so at least I was happy that that functionality was still up. I read a little, posted a little, then went to bed and finally got some sleep. I woke up today and was finally able to log into Blogger...and I found my new blog in my list! This was very odd. But, no surprise, it wasn't working. I finally decided to make the URL the same as the blog title, haphazardmusings.blogspot.com. I quickly selected a template (rather than drudging up one of my own), posted my first entry (and fugding the time to make it reflect the time of the writing), and I was done.

New blog up and running!

This means this particular blog - the Computer Circus - will now remain specific to computer and computing issues, and you can visit my Haphazard Musings corner to get to the more human-readable stuff. Some of it still might not be very consumable, but some of it will undoubtedly be light and silly, or even something serious that people can relate to. It will be interesting to see what transpires.

Whoa! Hey! Did you see that Pac-Man running across the screen?

posted by Bill  # 2:12 PM