Rounded Corners and CSS3

NOTE — June 7, 2010:
This page is a little out of date; the main Webkit browsers now work better with NO prefix on the styles. It’s time to say goodbye to -webkit-. In the following discussion, using the standard syntax will work with Chrome, Safari, and Opera as well. The table referenced below has been updated to reflect the newer browsers.

If you poke around this site you will see boxes with rounded corners. If you use Safari or Firefox, you will see even more.

Rounded corners are implemented here in two different ways. The main boxes with the drop shadows are done the old-fashioned way, the way that works on most browsers. Each corner is a graphic with an alpha-channel shadow, and the edges are yet more graphics, repeated as needed to span the distance between the corners. The boxes expand and contract infinitely in both directions. It’s not bad. It’s also a pain in the butt.

Yet, I like rounded corners. They seem friendlier. I have broken down, therefore, and in a few places I have added browser-specific style information to create a softer-feeling blog. Since the rounded corners are purely cosmetic — everything still works just fine in browsers that don’t support border-radius — I’m not too worried about it.

However, while I was looking into the border-radius CSS property, I discovered several sources that didn’t get it right.

Here’s the deal. The CSS3 standards draft includes a property called border-radius. Exactly how that property is going to work has not been finalized, but it’s not likely to undergo any more major revision. Meanwhile, Firefox and Safari have already worked out their own border-radius implementations, called -moz-border-radius and -webkit-border-radius respectively. Other browsers see the -moz and the -webkit prefixes and ignore the property.

Unfortunately, neither implementation matches how the proposed border-radius property will act. Oh, dear. When the browsers are updated to match the standard, those -vendor-border-radius properties may break. A lot of Web designers out there don’t seem to realize that.

NOTE: probably at this point you should open up this handy table to follow along.

It’s not all doom and gloom, however. As long as people using the vendor-specific border-radius properties keep things really simple, there won’t be a problem. Here’s the skinny:

std-br-15
All four corners with 15px radius
<style type="text/css"> .roundedBox { -webkit-border-radius: 15px; -moz-border-radius: 15px; border-radius: 15px; } </style>

will put a nice rounded corners on any block element of class roundedBox. Safari 4 and Firefox 3.5 (the browsers I have to test on) will work today, and when the formal border-radius is adopted and the other browsers support it, everyone will be happy. (Remember, of course, that in the meantime a large part of your audience will still see squared-off corners.)

The tricky part comes when one wants to specify elliptical corners, or specify different radii of curvature on different corners. When you start getting fancy, things get a little messed up. Let’s tackle the second one first, because it’s possible to find a way to specify the different corners that makes everyone happy. It’s just long-winded.

border-radius is really shorthand for four properties: border-top-left-radius, border-top-right-radius, and so forth. Therefore it’s perfectly safe to specify each corner independently, and all the browsers will act the same way:

moz-br-20-10
top-left and bottom-right 20px radius, others 10px
<style type="text/css"> .roundedBox { -webkit-border-top-left-radius: 20px; -webkit-border-top-right-radius: 10px; -webkit-border-bottom-right-radius: 20px; -webkit-border-bottom-left-radius: 10px; /* different! */ -moz-border-radius-topleft: 20px; -moz-border-radius-topright: 10px; -moz-border-radius-bottomright: 20px; -moz-border-radius-bottomleft: 10px; border-top-left-radius: 20px; border-top-right-radius: 10px; border-bottom-right-radius: 20px; border-bottom-left-radius: 10px; } </style>

Note that the names of the four corner properties are different for Mozilla. Aargh. All the more reason to hope the spec is finalized soon. I put the four properties in the order the software considers them when parsing the shorthand notation, just to get into the habit.

All those lines of CSS can be a pain in the butt, but it’s bulletproof and will work on into the future. But wouldn’t it be nice if you could use shorthand for the border radius the same way you do for margins and padding? The boys at Mozilla thought so, and the CSS3 standards team thought so, too. Webkit (Safari) seems content to only support the long-winded method for now (at least support it properly – more on that later).

Before talking about the differences between the browsers and the CSS3 spec, let’s take a quick look at the theory. As with properties like border, the border-radius property is just a shorthand so you don’t have to specify each corner individually. If you use one number, like border-radius: 10px; the style will be applied to all the corners. If you supply four values, the four corners each get their radius set, starting with the upper left and working clockwise. So far, so good, but there’s trouble ahead.

[The following has been edited since it was first published. I first said that Mozilla was doing the following drawing wrong, but it looks like they have it right and Safari is wrong. Sorry for any confusion. To make up for it I added box-shadow here and there for browsers that support it. They’re sweet!]

The difference is elliptical corners. CSS3 calls for them, but the draft isn’t very well-written. The mystery lies in what should happen when two values are specified: border-radius: 20px 10px. When you are specifying a single corner, the result will be an elliptical curve. When using the shorthand, however, Safari draws all four corners with the same ellipse, but Firefox (and the CSS3 spec) draw round corners that turn out just like the example above.

According to the spec (by my reading), when using shorthand if you don’t use slashes you don’t get ellipses.

std-br-20-10
All four corners with elliptical curvature
<style type="text/css"> .roundedBox { /* four elliptical corners */ -webkit-border-radius: 20px 5px; moz-border-radius: 20px / 5px; border-radius: 20px / 5px; } </style>

NOTE: The most recent builds from webkit.org match the spec. I don’t know when those changes will reach Safari, but sites using the two-value shorthand may have to deal with some inconsistencies between browser versions. Not sure, but I would avoid using that syntax just in case.

What about if four values are specified?

std-br-20-10-5-30
All corners different
<style type="text/css"> .roundedBox { /* four different circular corners */ /* no effect! */ -webkit-border-radius: 20px 10px 5px 30px; -moz-border-radius: 20px 10px 5px 30px; border-radius: 20px 10px 5px 30px; } </style>

Once again Webkit-based browsers like Safari and Chrome fall short. The Webkit team seems content to get the longhand method of specifying corners right, but not the shorthand. Mozilla, in the meantime, has worked out the most complex and versatile form of the shorthand, but disagrees with the spec fundamentals.

To use shorthand to specify four different elliptical corners, you would use something like:

-moz-border-radius: 20px 10px 20px 5px / 5px 10px;

where you specify up to four horizontal radii and then up to four vertical radii. The numbers before the slash are the horizontal radii, starting from the top left. If only two numbers are given, they alternate. Three numbers means top-right and bottom-left share. The y-radius values are the numbers after the slash, and are distributed the same way. Clear? Good.

I have read that if the text rendering is vertical, the horizontal and vertical parts are reversed, but I see nothing about that in the proposed specification.

This will make a lot more sense if you study the twoblue-shaded lines of the table.

While we’re looking at the table, note that Safari is perfectly capable of displaying the most complex borders, but they have not implemented the shorthand notation (except for the bit they did wrong). They’ve done the hard part, but left out the one-day coding job of parsing the shorthand strings into the properties for each corner. Odd. The rules are really very simple for a machine.

So what does this all mean?

In conclusion, while it’s possible to write different sets of -vendor-border-radius CSS properties and get what you want, things start to get quite messy. It’s a lot of effort for aesthetic touches that half your audience won’t see for the next couple of years. I’d advise just staying away from elliptical corners for now, and specifying round corners individually if any are different. It’s a bit more typing, but it’s a lot safer. Stay away from -webkit-border-radius: with two values.

Bad Judgement

I wrote this scene over the course of two days, and I stopped myself before I edited all the fun out of it. (At least, I hope I did.) Lenore and Tommy seem to be in a heap of trouble, but can they even trust each other? The scene that comes after this one is awesome, if unwritten.

As a reminder, here’s the premise:

Your PROTAGONIST is in a jam. He (or she) had been relying on deception in order to further his objective, but his ENEMY has figured out the ruse. Write the scene in which your protagonist’s LOVE INTEREST confronts him with this information acquired from the enemy – while in staging it in a tricky or dangerous situation.

I learned a few things while writing this… but let’s cut to the chase.

INT. GETAWAY CAR
LENORE (26,) a willowy blonde, is behind the wheel of a souped-up GTO, her hair blowing in the wind from the sunroof. She is grinning maniacally as she flies down a two-lane blacktop. Abruptly she cranks the wheel and the car goes into a sideways skid, kicking up a cloud of dust as she comes to rest by the prison wall. Sirens blare. She leans over, pulls the handle on the passenger door, and TOMMY (28,) tall and angular, jumps in. He is wearing orange prison overalls and his dark hair is buzzed short. Lenore stomps the gas pedal with her bare foot and the car leaps away. Up on the wall a few of the guards shoot at the fleeing vehicle.
Lenore is so excited she can’t sit still; she is bouncing in the seat.
LENORE
Hey, baby!
She leans over to kiss her boyfriend, almost driving off the road in the process. Tommy sits with arms folded, staring straight ahead. Lenore hesitates, then looks up barely in time to straighten the car before it goes in a ditch. Her enthusiasm is diminished.
LENORE
Ain’t you happy to see me?
TOMMY
Surprised you bothered to come.
LENORE
What?
Lenore slams on the brakes and the car comes screeching to a halt. Tommy bounces off the dash. Lenore glares at him.
LENORE
Just what are you insinuatin’?
Tommy glances back behind them. In the distance are the flashing lights of pursuing police cars.
TOMMY
Can’t we talk about this later?
LENORE
I’m not moving one inch until you explain to me what that remark was supposed to mean.
TOMMY
The cops are coming!
Lenore sits back and sets her jaw. A tear leaks from one eye.
LENORE
I don’t care.
TOMMY
You want to talk? Fine! Judge Hastings come down to visit me the other day.
Lenore pounds the steering wheel.
LENORE
(to herself)
That bastard!
TOMMY
He says you two been gallivanting all over town.
LENORE
Gallivanting!
TOMMY
That was the very word he used.
Lenore smashes down on the gas and the car rockets forward in a cloud of burning rubber.
LENORE
(under her breath)
I’ll gallivant his sorry ass…
TOMMY
So what about it?
Lenore picks up a pistol and puts on a bright smile.
LENORE
I got your favorite gun in the back seat.
TOMMY
Is it true? What he said?
The cars behind open fire, but with little effect.
LENORE
Can’t we talk about this later?
Lenore holds her gun out the window and fires a few shots. She pops the magazine from the gun and, driving with her knee, loads in another one. The car hits a bump and skids wildly. Tommy bounces off the head liner.
TOMMY
Dammit! Watch where you’re going!
LENORE
Tommy, we need drivin and we need shootin, and I got the only steering wheel.
Tommy sighs dramatically and reaches into the backseat and pulls out a wicked-looking automatic rifle. He caresses the finish.
TOMMY
Hello, baby.
LENORE
You two can cuddle later. It’s time to go to work.
Tommy works the bolt and takes a breath. He sticks his head out the sunroof and fires a few bursts with increasing glee. One of the pursuing cars skids off the road. Tommy laughs and sits down.
TOMMY
Whoo! Yessir! Tommy’s back!
He pops up and fires off another burst, spraying bullets behind them until he runs out. Return fire punches holes in the trunk. He sits down to reload. Lenore holds her gun out the sunroof and fires randomly. She swerves a little just for fun. Tommy looks over at her, grinning.
TOMMY
I love you, Sugar Pie.
LENORE
I love you too, Hunny Bear.
He leans over and kisses her hard, then turns back to the job at hand. He hesitates as he’s putting a fresh magazine into his gun, and pops out a cartridge. It has a dull gray case.
TOMMY
What’s this?
LENORE
What’s what?
He holds a bullet up in front of her, an inch from her face, blocking her vision. She swerves as she bats it away. He bounces off the dashboard again.
TOMMY
These cartridges have steel cases! You know Black Beauty here only likes brass.
LENORE
But the steel’s so much cheaper. Money’s tight right now.
Tommy stutters, trying to make sense of what she just said.
TOMMY
Money’s… what? Tight? We have thirty million dollars!
Lenore cringes and occupies herself with driving and shooting. A bullet come through the car, shattering the rear window and spidering the windshield.
LENORE
It’s just… not available right now.
Tommy is beyond words. More bullets hit the bodywork of the car. Tommy reaches up through the sunroof and fires, but his heart’s not in it. Lenore looks over at him and tries a feeble smile.
LENORE
It’s… invested?
Tommy points his gun at Lenore. He is shaking with rage.
TOMMY
Invested where.
Frightened, Lenore points her gun at Tommy. Ahead two police cars are blocking the highway; Lenore and Tommy don’t see them. After a momentary standoff the two begin to shout simultaneously, jabbing at each other with their guns.
TOMMY
Where’s the goddam money?
LENORE
Don’t be this way, Tommy. Don’t get all crazy on me now. Remember what the doctor said. You’re scaring me, baby.
TOMMY
Does Hastings have it? Hasting’s got our goddam money, don’t he? You gave Hastings our goddam money!
LENORE
No!
Lenore pauses and realizes that Tommy has handed her a convenient scapegoat. She “confesses” through her tears.
LENORE
Yes! It’s Hastings! He… uh… he tricked me, Hunny Bear. He said… We have to get our money back!
Tommy nods, suddenly calm.
TOMMY
You shoulda just said.
He gestures up the highway.
TOMMY (CONT’D)
Road block.
Lenore keeps the gas to the floor and braces herself. The engine is roaring and starting to smoke. The speedometer climbs. Tommy puts his seat belt on; ahead, police begin to scatter. The two face forward, their calm faces shiny with sweat.
LENORE
I’m sorry about the cheap ammo.
TOMMY
We’ll talk about it later, Sugar Pie. You got some drivin to do.
Lenore scans the scene ahead, concentrating, then cracks a little smile.
LENORE
Roll down your window.
Tommy works the window crank.
TOMMY
I love it when you smile like that.

Round One Complete

There are still several hours left before the deadline, but, well, I was done, so I submitted my entry. I just saw this message:

Seeing this screen means your entry arrived.

Finally, congratulate yourself for having the courage to say,
“I can create on deadline,” and then doing it. Yay!

There is nothing more to do; my fate is in the hands of the judges now. Let’s all keep our fingers crossed for a top-100 finish. Think positive thoughts and all that crap. I’ll be posting my entry here in a while, but I’m going to reread the rules to make sure it’s OK first.

To the rest of you still working on the challenge: You can do it! Go Team Muddle!

Lost Weekend, Home Stretch

With nineteen hours before the end of round one in the Cyberspace Open, I’m feeling pretty good about the way it’s going, but there’s still plenty of room for improvement. I spent last night working with two of the plots from the list above. I really like the idea with the multiple personality disorders, but try as I might I couldn’t come up with a confrontation scene that could stand alone well enough to not confuse the reader. In an actual movie the viewer would already understand things that someone reading the scene cold would not know. The light of my life had a bunch of great suggestions that make the idea really intriguing, though. I’ll file the idea away for another time, when I’m drinking beers with a producer. Green light by the third round, baby!

Meanwhile, God getting distracted while making the universe will probably end up as a short story. As a scene in a feature film it actually told too much of the story. (Unless God and his rival spend the entire time messing with each other’s universes, until one universe breaks quarantine… hmm.)

Similarly waysided are the demons/aliens/whatevers taking over the Earth. Some fun ideas there, but I never came up with that sparkling moment of conversation that sells a scene. It’s probably better as a short story, too. Finally, protagonist as a criminal is actually based on an idea my sweetie and I hashed out one night which will make a great screenplay someday. I couldn’t get all the pieces right in my head to work it for this competition, though. Later, the title alone will sell it.

In the end, it’s the car chase. I don’t know why, but that’s where my creative juices flowed with the lowest viscosity. Little moments all strung together into something fun (at least, I think it’s fun). Drivin’, shootin’, arguin’, fibbin’. Mortal danger and true love. Outlaws on a two-lane blacktop.

Meanwhile, fuego is over on his side of the Atlantic, writing away. I have no idea what he’s cooking up, but it’s sure to be good. It’s too bad he’ll have to settle for second place.

Happy Talk Like a Pirate Day!

It be takin’ a majer hollerday fer me ta notice tha’ we no be havin’ any event countdown on yon sidebarrr. I be addressin’ that oversight afterrr tha’ weekend. Arr!

1

Thinking Out Loud

The Cyberspace Open has been going for six hours now, and I’ve got some ideas percolating. Round one, which provides an entire weekend to write a scene, may be the most difficult because there is time for over-thinking and over-editing. Then mix in the “I’ve got lots of time, I can watch cartoons” trap and there are plenty of potential pitfalls. I’m not too worried, though. I’ve spent the time since the premise was distributed (see the previous episode) coming up with different approaches. Deception, confrontation, difficult task, and somewhere in the background there’s a bad guy, pulling strings. Not bad.

I’ve spent the last few hours simply brainstorming, coming up with different ideas that are off the beaten track but contain lots of room for drama. Tonight is the night when any idea is a good one. Here are a few I’ve come up with so far, in no particular order. None of them are perfect, but they all have something going for them.

  • God is busy creating the universe when his girlfriend comes in to confront him about cheating in the universe-building contest. God has pulled five consecutive all-nighters and just wants to get the damn thing done so he can rest the next day. During the argument he accidentally creates man, or maybe the tree of knowledge. Strongly implied are ensuing hijinks.
  • Protagonist is a notorious criminal – her rival (ex-boss?) tips off her boyfriend, who is inconveniently a cop (or the father of kidnapped children?). (She spends a lot of time dealing with the police.) It turns out that this time she is trying to use her skills for good to thwart ex-boss, but that’s going to be a hard sell, (hostages at risk?). Boyfriend is plenty pissed off and not ready to provide any constructive conversation. Perhaps she’s defusing a bomb during the conversation?
  • Enemy and love interest are both the same guy – with multiple personality disorder. Enemy persona has been leaving clues for love interest persona to find. Protagonist is trying to hide the truth from the love interest persona while dealing with the enemy persona in a way that won’t harm love interest persona.
  • Powerful outsider (demon from hell, alien from outer space, whatever) has been sent to Earth to enslave humanity. All beings in the universe love hot Earth women, though (look it up!). Chance for gender bending since outsider can choose inappropriate disguise. Some swashbuckling Biff-type has tipped off the lovely Tiffany that her BFF is not all she (he/it) appears to be. Good chance for some space opera dialog.
  • Bonnie-and-Clyde-style car chase. Bonnie has just broken Clyde out of jail. While the outlaw couple are drivin’ and shootin’, Clyde mentions to Bonnie that the Sheriff told him that Bonnie’s been right friendly with a certain judge. They have to cooperate to get away, but that doesn’t mean they have to be civil about it. The argument and the chase peak when the car breaks down… and they roll to a stop just over a county line — into the jurisdiction of a friendly judge.

And there they are. They range from fairly mainstream stuff that provides a lot of room for style, to the rather ridiculous. I could have sworn there were more; I should have been writing them down all along. If I think of others, I’ll add them here. Most likely the idea I go with is one I haven’t thought of yet.

Here We Go!

The first premise is out:

Cyberspace Open Round 1 Premise

Your PROTAGONIST is in a jam. He (or she) had been relying on deception in order to further his objective, but his ENEMY has figured out the ruse. Write the scene in which your protagonist’s LOVE INTEREST confronts him with this information acquired from the enemy – while in staging it in a tricky or dangerous situation.

Have at it! Pencils down Monday at 9 a.m. Pacific Time.

Wish me luck!

Health Update

Honestly, I don’t think this episode is very interesting. That happens sometimes. Still, if you want to learn the magic secrets of my fitness success, read on! Lose weight! Get in shape! No dieting! Extra hyperbole!

When I first made the leap over the pond from Prague to San Jose, I knew things would be different. First there are the obvious benefits of sharing an abode with one’s sweetie, but there are other changes as well. Notable changes included diet and exercise. I paused today to contemplate their effects. Good habits are the best health insurance anyone can have.

Behaviors:

Diet: I eat just as much as I did in Prague, in fact, I think I eat more. But while volume has increased, so has quality. Home-cooked meals are just plain healthier. (Did you know that there are special heavy versions of mayonnaise sold only to restaurants? No one would buy them in the stores, they’re too obviously unhealthy. But at your local diner your taste buds will rejoice, and you will say, “man, they have good salads here,” never knowing just how much saturated fat you dumped into your gut while thinking you were eating healthy food. But I digress.) My sweetie loves to cook and I love to eat her cookin’. Despite that I’m sure my fat intake is much lower, and my salad intake is through the roof.

Diet part 2: Alcohol and caffeine. Going from being a bachelor who wrote in bars in Prague to being a significant other who works at home has curtailed alcohol consumption considerably. Reduced calories from beer may completely offset the extra calories from all the food I’m eating. Not that we are teetotallers, mind; I still enjoy the joys of grape and barley, just not as much. Caffeine intake is down as well, as I won’t have five cups of tea to hold off the beertender.

Exercise: My sweetie already had a workout schedule for three days a week, and naturally I joined in. We join her family and because her brother is autistic the schedule is very rigid. This means no weaseling and no putting off until later. When it is time to work out, we do it, and I’ve been taking my gym time very seriously. (Although ‘gym’ is a bit of an exaggeration – the development where my sweetie’s folks live has an exercise room with a few machines in varying states of decay.) My sweetie and I have tried to extend out exercise habit to some of the off days as well, but that’s not been as successful. Just today I geeked around all afternoon and plain forgot to get up and go pursue Jim. Still, I’m getting a good workout on a regular basis.

Results:

Weight: I had really hoped to lose some weight. For one thing, my knees won’t last forever, but they’ll last a lot longer if I can take some of the stress off them. It’s too early to tell if it’s a trend, but if anything I’m gaining weight. Weight can be a deceptive measure, however…

Shape: Now here we have some good news. Although my weight may not be trending the right direction, its distribution certainly is. More muscle, less fat. I haven’t measured, but I expect I’ve added an inch around my chest. Some of my shirts are noticeably tighter up there. That’s good. From her vantage point, the light of my life tells me that my waist is getting trimmer, at least on the sides. So far my pants don’t feel any looser, but hopefully the belly fat will start to go eventually as well. There’s no hurry as long as the trend is in the right direction, and there’s still plenty of fat left on me to burn. (The very top lump in the classic ‘six-pack abs’ is visible if you know where to look and catch it in the right light.)

My arms and legs, never places to gather fat, look pretty good, if I say so myself. Not muscular by any stretch, but good definition. It’s gratifying. I flex my legs sometimes just to watch the muscles pop out.

Joints: My weakest points are my elbows and knees. Unfortunately almost every exercise ever invented applies force through those joints. (Maybe I need the Thigh Master!) So far they’re holding up all right. My old separated shoulder bothers me sometimes. Good candidate for arthritis, the doctors told me back when I was doing physical therapy. No point worrying about it, though.

Other: When I was younger I had very low blood pressure, low enough I wasn’t allowed to give blood. My resting heart rate often dipped below 50 (funny story about that… for another day). That was a long time ago; last time I had my blood pressure taken the nurse said it was on the high side – high enough to warrant watching. I haven’t watched. I don’t have any real measure of how I’m doing except that after working out I’ve been getting head rushes, like I did in the old days. It’s hard to believe only a few months of exercise could make such a dramatic difference, though, especially since I still have at least twenty pounds of extra fat on my frame. The head rushes may actually be a warning sign of something else. (I poked around online but didn’t find much helpful.) I just took my pulse and it’s 57 bpm, which I think is on the low side, which I choose to believe is a sign of cardio health.

Conclusion:

Overall, I have to say that there’s something to the whole “eat right and exercise” fad. It’s working for me, and I’m not depriving myself in any way. It’s actually… fun! As a bonus I get to watch my sweetie work out at the same time. Yow!

A Browser Experiment

Quite by accident this morning I stumbled across an image format that might turn out to be really cool. Unfortunately, like all things Internet, it’s not much use until the various browsers agree on how it should work. Just for giggles, I thought I’d play around with it a bit. Internet Explorer users — even IE 8 — need not continue with this episode.

One of the cool things about SVG is that it’s more a drawing system than an image format. Image files contain a set of instructions the computer uses to render the picture. That’s not especially new, but it’s nice to have a standard system built into browsers. With something like this I can write code on the server to generate very sophisticated and pretty graphs, without a lot of technical hoo-ha. It would be especially nice for some of the images used in the basic design of this site.

So here is an svg image, plopped into the page the way any image would be:

Emblem-fun

Alas, only those using Opera and Safari will see it. (PLEASE correct me if I’m wrong!) Alternately, here’s the contents of that same image file, plopped into the regular XHTML of this site in a big ol’ svg tag:

You can look at the source for the page and there it will be, all the drawing instructions used to render this happy little face. (Note that I removed some extraneous parts that connected to the source of the graphic (sodipodi) to see if I could make the image work.)

Except… hmm. The latter doesn’t work at all anywhere (that I know of). Obviously I’m missing something, but at this point it’s not worth figuring out. I did try to paste in an example directly from Mozilla’s site; maybe WordPress is subtly messing up the data. Or something else. If SVG ever becomes more universal, I’ll revisit it.

Edited to add: it looks like the browser has to load a file with an xhtml extension to know how to deal with other xml embedded in the code like that. Unfortunately, if your tell the browser that you are using xhtml, you have to use it exactly correctly. Alas, several of the plugins, and amazon, and Google, provide code that is not strictly compliant, and I shudder to think what would happen if I tried to validate all those old episodes I brought over from iBlog. Firefox can also use the <embed> tag to display the graphic, but ironically it is not compliant.

Let’s try the <object> tag and see if Firefox has relented and begun to support it:

Just for grins I specified a different size, to show the S in SVG. Safari didn’t do it right, but my version of Firefox and Opera did.

Note: The original graphic is under GPL and I got it from here.

Note 2: Since this episode, I’ve done some pretty extensive work with SVG, including using scripts to modify the image — even changing the actual structure of the image interactively. Try the dots!

Gambler’s Update

I’m not sure my sports curse still applies to the San Diego Chargers, (the Padres certainly managed to suck without me), but although I did just check in on tonight’s game in time to see San Diego fumble while deep in Raider’s territory, I’ll not be watching the rest of the game.

Reminder: Cyberspace Open

Round one of the Cyberspace Open writing contest is this weekend, and it’s going to be a hoot! While I don’t know whether anyone out there is interested in participating at an official level (if you are, you must enter by the 16th), I thought I’d remind you just in case. Even if you don’t register officially, you can still play along. Whee!

From the official Web site, here is the description of round one of the competition:

Round One: Your Lost Weekend

This round is like this real-life situation: A producer calls you at 5 pm Friday and says “We desperately need a new scene first thing Monday, or production stalls, with a $50,000/hour crew sitting around!”

This is your chance to save the production. We send every entrant the same premise and set of characters by email at or slightly before 5 p.m. Friday, Sept. 18, 2009. The premise will also be posted above on this page where indicated in case you don’t get the email.

Contestants will have the entire weekend, until 9 AM Monday Sept. 21 — but not one second more– to write and submit one final version of one scene, three to five pages long, on line.

Then, judges from CoverageInk.com, the manager of the competition, will grade each scene. Entrants will receive feedback and a score from a judge by email.

Exactly 100 highest-scoring writers advance to the tighter deadline of Round Two.

I don’t know about anyone else, but I’m really looking forward to participating. When I get the notification of what the scene is supposed to be about, I’ll post it here, and when I submit my entry I’ll post that here as well. If anyone else writes something based on the challenge that they would like to share, I’ll happily post that as well. It could be a movie scene, but you could attack the subject in regular prose, poetry, or even photos if you want. I’m the only one who has to please a judge. Use it as an excuse to spend some time with your creative side.

At the very least, please stop by over the weekend and cheer me on!

Screenplay Taxonomy

When writing a screenplay, the word ‘scene’ has a very specific definition. More or less, whenever the scenery on screen changes, it’s a new scene. Walk from the kitchen to the living room, new scene. Walk back, new scene. Simple enough. At first blush it seems similar to the scenes of a stage drama, but it really isn’t. In a screenplay, scenes can change quite frequently, and may only last a few seconds. You can have many scenes that fill the dramatic role that a single scene does on stage. For instance, in a screenplay, the scene can change several times during the course of a running battle.

I’m working with script-writing software that allows me to rearrange scenes, but what I really want is a way to manipulate the groups of scenes that comprise the larger dramatic unit. All the scenes that are part of a chase, for instance. I’ve been fooling the software by calling the scenes that make up the sequence “shots”, so they are treated as part of the same dramatic unit. While this leads to correct formatting and lets me manipulate my script the way I want to, it subverts the meaning of ‘shot’ in a screenplay. It’s not a bid deal for me since calling shots is way, way, down the production road, but it’s still a little off to mislabel script elements like that.

From a storytelling standpoint, the larger unit is the important one — the continuous action that can span several scenes but has a clear identity in terms of the story. I think ‘sequence’ is the word I’ve heard used in that context, but it’s imperfect, and the script-writing software I’m using has no concept of the sequence to help me organize my scenes. Jer’s Novel Writer allows the user to define things like that quite easily, and JersNW performs way better than Celtx on my old laptop, but Celtx provides other shortcuts and automatically formats things in an industry-standard way.

I think it would take me two months to make a screenplay version of JersNW. (If I didn’t use the time to also upgrade the way the documents are structured, which I would do.) It wouldn’t have all the features to help production that Celtx and Final Draft have, but it would be writer-friendly. I often joke that Final Draft is a fine piece of software once you have a final draft – it’s not very good for the actual writing. Celtx seems to want to pursue Final Draft, once again at the expense of the writer.

But all that’s a digression. I really just wanted to ask folks if they knew a better term for ‘group of scenes that comprises a dramatic unit in a screenplay’. It really seems like there should be one.

1

Just Break Up With Her, Already!

One of the apartments in this complex is occupied by students. They are louder than most of the other residents, but most nights it’s no big deal – especially now that school is in session. I was occasionally on the loud side back in the day as well. One of the kids has a girlfriend, however, that is gradually driving me insane. It’s just that, well, she’s bitchy.

The guy’s parking place is right below the window I’m sitting next to right now. Every time she comes or goes there is conversation. Almost always she’s in a bad mood and she’s taking it out on the guy. Or whoever’s on the other end of her mobile phone. Or the other voices in her head. Good lord that woman has a lot of complaining to do, and directly below this window seems to be her favorite place to do it. The hour of the day or night makes no difference; in fact, the later it is at night, the more she’s accumulated to bitch about. 3 a.m.? A fine time to rail on and on with her unseen friends.

Why, oh, why can’t the guy just give her the heave-ho? Is her company at other times so charming that he can ignore the constant stream of complaints I get to hear? Is there some field around this window that puts her in a bad mood? I just want to put my hand on the guy’s shoulder and say, “Dude, if you can put up with that shit, you’re going to make some other girl a fine boyfriend.”

Some quiet, polite girl.

The Worst Thing That Ever Happened to the Internet

I mentioned in the last episode that Internet Explorer was the second-worst thing that ever happened to the Internet. Today I’ll talk about the absolute worst. It’s really a long technical rant that doesn’t matter, but it feels good to let it out. What follows is an underinformed ramble about the scourge that did the most harm to the developing computer network that went on to transform our lives — damage that we still live with today. Without this one corrupting influence, we would have had Internet applications that didn’t suck a decade ago, if not longer. In fact, it was because of this electronic plague that Microsoft was able to cause so much harm with Internet Explorer.

The culprit? The ball and chain that modern technology has dragged along despite its obvious flaws? Hypertext Markup Language, or HTML.

First, let’s start with the name. HTML is not a language. Not even close. It is a document format. That its inventors did not recognize the difference tells you that the wrong guys were doing it.

Second, it’s not a very good document format. At its heart, the inventors wanted a format that did three things: connect related documents, embed external resources (like images) and contain standard formatting information that would be interpreted by viewing software consistently. They were not the only ones developing systems like this; Josten’s Learning invented a similar system when they built the first multimedia encyclopedia for Compton’s New Media. Where Berners-Lee and friends had URL’s, Josten’s engineers created BRU’s, but beyond the initials the function was the same.

I don’t want to be too harsh on Berners-Lee, Cailliau, and the others who grew HTML, but I wish they’d been a little more far-sighted. I say ‘grew’ rather than ‘invented’ because it’s clear that they never sat back and asked themselves “What is a tag? What roles do they perform?” Even now, XHTML, the supposedly more rigorous (if still misnamed) descendant of HTML has fundamental inconsistencies.

For a simple example, take the <br /> tag. It exists because in HTML all whitespace (tabs, spaces, and returns) are mushed together and presented on the screen as a single space. Thus

<p>this markup</p>

and

<p>this
 
        markup</p>

come out the same on the screen. That’s fine if you know what’s going on. But what if you want to put in a line break or a space? Well, for a space you add a special character code &nbsp; and for break you add a tag <br />. Why is one a character and one a tag? Because on the day HTML’s inventors decided they needed line breaks, a tag seemed like a good way to go, even though semantically it had nothing to do with the roles of other tags. It could just as easily been &br; or something like that. That’s how HTML grew up. And thus the World Wide Web was born.

Another fundamental flaw is that the content (what to display) is all mixed up with the presentation (how to display it). What if you want to show the same document in different formats? Nope. While some tags were geared toward identifying the type of content that they enclosed (like the <p> tag), others were direct formatting instructions (like the <i> tag). This inconsistency in the role of tags in a document is a reflection of the organic (and sloppy) way that HTML was grown.

I really can’t blame the inventors of HTML for what came next. Everyone started using it. Everyone. The flaws and inadequacies of the format quickly became apparent. Different document viewers (browsers) rendered things differently. Formatting options were extremely limited. The systems were vulnerable to abuse by unscrupulous people. Right then, there was a chance for people to say, “hold on a second! Let’s take the idea of HTML and apply the lessons we’ve already learned in other branches of computing, and make something that doesn’t suck.”

Rather than scrap HTML, browser makers and others set out to fix it. That was the Big Mistake. After twenty years of tweaking and bickering and incompatible extensions introduced by browser manufacturers and squabbles and lawsuits, HTML has been upgraded from awful to poor. Along the way, companies like Adobe and Macromedia thought to get their technology adopted as a replacement to HTML (the Web in pdf? Interesting…) but those efforts were doomed from the start because they did not provide free, simple tools to create the content.

HTML’s greatest shining virtue (and it’s an awesome one) is that it’s accessible to anyone who can type. Anyone. No special tools required.

So, now we have style sheets to help separate content and presentation, XHTML to fix some of the semantic craziness of HTML, and browsers are finally starting to agree on what all the formatting instructions actually mean. We could have had that fifteen years ago if people had just let go of HTML, but here we are now, with an almost-functional system. There are still plenty of flaws, however. Things that seem so normal now that we don’t even think about how dumb they are.

Take this blog, for instance. It’s a pretty well-built Web application, based on reasonably up-to-date practices. Yet were you to click the comment link at the bottom of this episode, you would go to a new page. On that new page the browser would reload the same header and the same sidebar it just erased. What a waste! Why does it do it? Because that’s how HTML (and HTTP, the underlying part that communicates with servers) works. There have been abortive attempts to fix that over the years, but they have all been flawed. Now, at long last, techniques have been developed to overcome that problem, but they are not quite ready for prime time yet. For one thing, they are very complicated, and for another they rely on browsers working just right. Why was it so hard to implement? Because at its core the Web was not made that way.

Even in the days when almost everyone was on dialup (except the people inventing HTML), no one stopped to say, “hey, let’s make a way to only update the content that changes.” That problem has now been ‘solved’ by adding a new layer of complexity on Web sites. By adding this layer (on top of CSS and so forth), we get sensible Web applications at last, but we take away the one super-cool thing about HTML. It is no longer a simple format that can be harnessed by anyone with a text editor. We have lost the attribute that was the only reason to keep HTML around in the first place.

So now we have a system that is both inaccessibly arcane and flawed. Yay!

3

The Ghost of Projects Past

I couldn’t sleep last night, and on nights like that it is natural to think of things that might have been. One of the thoughts that grabbed hold of my too-active brain was the memory of PeoplePost, an Internet-based photo-sharing application that allowed groups of people to build scrapbooks together. We called it a virtual refrigerator door. It was pretty slick.

The project failed for a number of reasons. First, we tried to ‘roll our own’ instead of springing for sophisticated Web development tools. (Back then, the tools were very expensive.) To save the cash we added months to the development, and in the meantime something fundamentally changed on the Internet. People began to expect everything to be free. You remember the two-year span when Web services stopped trying to make money and figured they would find some way to be profitable in the future? Probably not, but those were the years we were working on PeoplePost.

This happened as the dot-com boom was just getting started, before Google had finished making the Web a useful place. WordPress did not exist then. No MySpace, no Facebook, no Friendster. Geocities was around, but had PeoplePost taken off, we would have had to invent modern social networking as the next logical step. At the time, our networks were closed communities with no way to discover what other groups were up to.

Another thing that killed us was a dead-wrong prediction I made way back then. I said that the browser was the Swiss Army Knife of the Internet, and that soon people would turn to specific applications to perform specific tasks. “Swiss knife is good,” I said, “but soon people are going to want cutlery.” Boy, was I wrong about that. Instead of using applications designed for a specific purpose, people worked with really crappy applications that worked through the browser. People tolerated crap that worked in some browsers and not others, and they tolerated bad aesthetics, wasted bandwidth (on their modems!), and wretched user interfaces that left them cursing the screen. Why? I still don’t get it.

Nevertheless, we made PeoplePost a downloadable application (with a really slick self-updating scheme), and when people downloaded and installed it, they would then go back to the browser and wonder what to do next. It’s the Internet! It must be in the browser!

The application was written in Java (not Swing, but that’s another post), so we managed to get the whole thing shoehorned into the browser — suddenly dealing with four different security systems and a host of other issues, like Microsoft’s passive-aggressive antipathy toward the language. What a pain. Still, a few people started to use it.

What we really needed at that stage was widespread broadband. We were diligent about saving bandwidth (all graphic elements preinstalled, for instance), but with advertising banners now harshing the lovely fridge door environment and eating up precious pipe, the user experience on a slow modem was not so great. Pictures are big. Still, we got Compaq and HP excited (shared photos become printed photos, which moves paper), and they helped get the product out there.

But we couldn’t charge for it, and we weren’t making money on advertising. It was going to be a long haul to make the product a financial success. An expensive haul. We couldn’t do it.

Skip forward to today. Finally, browsers are getting consistent enough and powerful enough that it’s almost (but not really) possible to make a decent application that runs in the browser. Meanwhile we’ve all been trained to put up with shitty software while online, so actual good software on the Web is big news. Now Internet Explorer (the second-worst thing to happen to the Internet) is finally close enough to the standards that people can write sophisticated user interfaces, using techniques that are often bundled under the term AJAX.

In the intervening years, galleries of many stripes have popped up on the Web, but nothing like PeoplePost. There are places people can share pictures, but they boil down to “here’s a big pile of my pictures; now post a big pile of your pictures.” Nice, but it could be better. A lot better. I was reminded of how cool PeoplePost would be this summer when the family was looking for a place to share photos from the eclipse cruise. There is nothing that allows people to collaborate, to build an album with text and photos and comments, and to allow everyone to contribute to the same album and build a true group identity. Combine that with modern social networking and you’ve got something.

Maybe it’s time to dust off the old failure. Maybe the world is ready for it now.

1