Slime Update Archive - October 2002

CSS Design

CSS-only designs are great. When you get right down to it, they’re a lot easier to make than table-based layouts are, and yet people still think they’re “advanced.” Sure, there are tricks and hacks that need to be known, but they’re nothing compared to the complications of learning when to nest tables where, where to set widths and heights in what way, and where clear spacer gifs are necessary. CSS can be learned faster than such complicated use of tables can. Plus, it has the added advantage that your structure and content is internally separate from the presentional aspects of the design, making both of them easier to change. Good deal.

Some argue that the hacks aren’t worth it. Tricks such as Tantek’s box model hack and using @import versus <link> tags to hide styles from certain browsers, they say, are messy and void the usefullness of CSS based design. I disagree. Let’s face it: there will always be hacks, because there will always be browsers that don’t get things right. Tables used for layout are hacks, and require further hacks to get things to work right in all browsers, especially if you’re dealing with Netscape Navigator. So, these people argue that we’re just substituting one set of hacks for another when we move from table based design to CSS based design. True. But there’s more to it then that.

As I said, and has been said before, but can’t be said too often, using CSS separates style from content. As I sit here now, typing in these words, I don’t have to worry about getting the font tags correctly around them, or about making sure my TDs match up properly. I’m typing paragraphs inside <p> tags. When I want emphasis, I use <em> tags, not because I know they’ll make things look italic, but because I know they’ll cause things to be emphasized. If I want “emphasized” to mean “italic,” then I’ll specify that in my style sheet. But I don’t have to worry about that now: now I’m just writing content. I already created the presentational aspects of what you’re reading. That’s in separate files elsewhere on my hard drive. That is the advantage that CSS gives you: deal with the presentation now, deal with the content later. It’s a lot easier that way.

Even the hacks, like the box model hack, almost always stick to this rule. Presentational hacks are in the style sheet. Contextual hacks (if any exist) are in the markup. The separation remains. There are exceptions, but they’re uncommon.

Yet, despite all these advantages, there’s one thing that bothers me about CSS designs. Look at this page. Look at scottandrew.com. Look at diveintomark.com. And look at zeldman.com’s new design. All of these are CSS based, and the thing they share is excessive use of whitespace. Whitespace can be a good thing, but sometimes what a design needs is for things to fit snugly, and CSS doesn’t really offer that. CSS based designs tend to have obvious separations between the elements of the page: the sidebar, typically, the content area, and perhaps a header. Table based designs have the advantage that these elements can touch each other, even share the same borders, and really work together. CSS designs always emphasize the separation between these elements, which isn’t always a good thing.

Maybe we’ll see this improve as CSS expands and as browsers support it better. Because personally, I’d like to get away from this separate-boxes look and be able to make something that looks like it’s all one piece, while still using CSS.

Posted at 2 PM on October 29, 2002

Slime-POV Update

Naturally, Slime-POV has at least one bug. I’ve fixed it on my machine, but I’m going to wait a bit before uploading a new version, in case there are more. In fact, I may implement one more feature before I do so. Much as I want to get away from the code, I think I’ll need this feature.

But today I do my Data Structures and Algorithms homework.

This entry is being uploaded a little late... FTP wasn’t working yesterday. That’s not cool. Anyway, I implemented that feature, and may do more just for the heck of it. Who knows. I still have some DSA to finish.

Posted at 1 PM on October 26, 2002
Edited at 1 PM on October 27

Slime-POV

Slime-POV released! Now I can finally get back to the rest of my life.

Thanks to povray.co.uk for linking to this.

Posted at 11 PM on October 23, 2002
Edited at 1 PM on October 24

My Day

I woke up this morning and decided to quickly implement a feature in my upcoming POV-Ray patch: noise generator functions. I figured it’d take an hour or two and then I would do my homework.

”But what’s this?” I thought, “A memory error?” And sure enough, it was. Something was trying to be accessed that didn’t exist. How strange. Oh, wait, I’d seen this before. Rebuild All files and everything should be fine.

Hmm, strange, that didn’t fix it. The error remained. Did it have something to do with my creation of the Noise_Generator struct? Perhaps, but all the functions that manipulated it were flawless. How strange.

Well, “let’s debug,” I thought. Don’t see the problem here. Don’t see the problem there. Alright, let’s go through the entire program, from start to finish, while it renders an image. Nothing behaved strangely. Maybe this wasn’t my fault? Maybe this was a bug in POV-Ray itself?

Nope, the official version of POV-Ray rendered the image fine, no problems. Well, they altered the source code slightly before releasing it; maybe that’s what was wrong. Re-unzipped the source code into a new folder. Built it. Ran it. No problems. This was most certainly my fault.

”Well,” I thought, “nothing to do but step through the entire program once again, this time keeping a close eye on the problematic variable.” So I did. Stepped. Checked the variable. Stepped. Checked the variable. “Aha! Here’s where it was changing. Now that’s strange. When this pointer is assigned a new value, this other pointer simultaneously changes. That’s absurd. Must be a compiler error.”

Downloaded a VC++ update. Nothing changed.

So I looked at the memory addresses of the variables. Interestingly, all the variables that were changing simultaneously were at the same memory address. “How strange! How could that happen?”

Debugged the program five times in a row, each time pulling the breakpoint backwards a little farther. “Hmm, the memory addresses are identical right when the variable is originally created. Very strange behavior. I wonder what this keyword means, anyway? I suppose I should look that up.”

A quick Google search revealed: “A union is like a struct where all the member variables are at the same memory address.”

Oh.

I’m pulling my Noise_Generator pointer out of the union now.

It’s been a productive day. Homework will have to wait until tomorrow.

Posted at 1 AM on October 21, 2002

Twenty Liner

Thirteen lines of Javascript. Not counting CSS, HTML, or lines consisting of just }. You gotta love the fact that this is a single, legal line of code in Javascript:

elems[a].style.left=((Math.abs(xposs[a]+elemsize/2-event.clientX) < circlesize && Math.abs(yposs[a]+elemsize/2-event.clientY) < circlesize) && (distboth=(distxsqrd=(distx=xposs[a]+elemsize/2-event.clientX)*distx)+(distysqrd=(disty=yposs[a]+elemsize/2-event.clientY)*disty))<circlesizesqrd && distboth != 0)?(elems[a].style.top=yposs[a]+Math.floor(Math.cos(distboth/circlesizesqrd*Math.PI/2)*distysqrd/distboth*circlesize/4*(disty!=0?disty/Math.abs(disty):1))+'px',xposs[a]+Math.floor(Math.cos(distboth/circlesizesqrd*Math.PI/2)*distxsqrd/distboth*(distx!=0?distx/Math.abs(distx):1)*circlesize/4)+'px'):(elems[a].style.top=yposs[a],xposs[a]);

Update: the code is now 17 lines of Javascript, but should run much more smoothly.

Posted at 2 AM on October 17, 2002
Edited at noon

contentEditable

Internet Explorer 5.5+ users:

  1. Click this link.
  2. Click somewhere in the text on this page.
  3. Type.

Thanks to Scott LePera for pointing out the functionality of the contentEditable property, which I had overlooked as being one of those boring random properties that Internet Explorer attaches to HTML elements.

Posted at 9 PM on October 16, 2002

Blah

It’s been two days since I posted anything, yet I have little to post. Check out Current Work; that’s really all I’ve been doing since my last post, aside from writing a paper. Hopefully I’ll get out a little tonight.

Posted at 6 PM on October 11, 2002

Multimedia Century Exam

The midterm could have been worse. It was just like any history test I’ve ever taken. I wrote down what I knew, which almost coincided to what I was supposed to write about, and passed it in. I think I’ll get about a C on it. Too bad, there goes my 4.0. It was bound to happen sooner or later: I’m excellent at math and programming, but really bad at most other things.

As if that’s not enough, there’s a really cute girl who sits in front of me in that class that I actually got up the courage to talk to earlier in the semester, but then somehow found myself unable to follow it up later, and now I’m watching her leave with some other guy the last few classes. I wouldn’t mind so much if she wasn’t the first pretty girl I’ve seen in a year and a half. I hate this place for that reason. And other reasons. But that one most of all.

Warcraft 3 came out with a significant new patch. It makes computer AI allies actually help you when you’re attacked, and tell you when they’re going to attack someone else. Maybe I’ll find the time to play a few games soon, now that the stupid midterm is over.

Posted at 8 PM on October 9, 2002

School Work

I just finished three pages of a five page paper due Friday, and on Wednesday (2 days from now) I have a four hour midterm in my art history class. Well, it’s really two two hour tests with a two hour break inbetween. Still...

Don’t forget to check out “Current Work.” Remember that there are other sections to this page. =)

Posted at midnight on October 8, 2002
Edited at 7 PM

Career Fair

The career fair was somewhat uneventful. I only really talked to one company that produced video games. I might have a chance of getting a job with them over the summer, but it’s unlikely that I’ll really try to get it, because they’re around Here, and during the summer I tend to live over There. So it probably won’t happen. But it didn’t hurt. The problem is that this is primarily an engineering school, so there were very few graphics or web design related companies at the fair.

On the other hand, it was nice to update my resumé and realize all that I’ve learned in the past two years.

Now I have to write a rough draft for my Writing class and study for an art history exam. Everything else I’ve been working on in my spare time is getting boring. I hate it when that happens. Maybe I’ll put down POV-Ray for a while and write up something on DHTML for this page.

That’s not a promise though. =)

Posted at 4 PM on October 5, 2002

POV-Ray woes

You know it’s a bad sign when you think back to what you’ve done over the past few days and nothing comes to mind.

I’m annoyed with POV-Ray. Not only does it have some pretty significant bugs with triangle mesh rendering, but there are a number of bugs that were reported during the beta testing phase which were ignored and I am now dealing with. Perhaps I’ll work with the source code and make my own bugfixes. If I can figure it out. =)

Career fair at school is coming up. I gotta fix up my resumé.

Posted at 6 PM on October 3, 2002