Thursday, February 16, 2006

UV Filters

While writing the previous post I was tempted to make the analogy that sudo is similar to putting a UV blocking filter on the front of a camera lens, but the analogy breaks down so fast it really isn't accurate. Since a great many people use UV filters indiscriminately, it seemed appropriate to point out when they are useful, when they are not, and why that analogy is not accurate.

A UV filter is a piece of glass that has been treated to block UV light. The actual cutoff wavelength for a UV filter depends on the manufacturer, so I won't go into that here. Originally the purpose was to get rid of the bluish UV "haze" that shows up on some photo emulsions that are particularly sensitive out past the blue.

Most UV filters are not used for this purpose. They're stuck on the end of an expensive piece of glass (known from this point on as "the lens") in order to protect it from fingerprints, dust, mist, salt spray, etc. And protect they do! Take a good look at the last element in a 35mm camera lens some time and see what it looks like. Considering how pristine they look when they start life, they can look pretty bad after a few trips into the field.

But any time you stick a transparent piece of something into an optical system, you change the resulting image quality. This is a fact of nature. It's not something that can be avoided, it simply is. Unfortunately with filters, the change is rarely one for the better. There are two effects that are well-known and much-discussed, which I'll touch on next. But there is a third effect that few ever mention. I'll touch on that last.

Any optical element is made to the best tolerances money can buy. The catch is, not every element has the same amount of money dropped on it. If you use a high end professional lens costing upwards of $10,000, expect it to perform a little better than a consumer level mass-produced lens costing $95. At the same time, expect a 50mm lens (optically quite simple) to cost less than an 18-350mm image stabilized zoom lens of the same quality by the same manufacturer (trust me... optically quite un-simple).

But we're talking about filters! These are flat pieces of glass! Exactly. And how flat they are depends on how they were made, which is directly reflected in their price. A high-end camera filter may be flat lapped on both sides for good parallelism and optical quality. Such a filter will also likely be treated with anti-reflection coatings (or AR coatings for short). A low-end filter won't have the AR coatings and will likely be made from common float glass.

Comparing the cheaper filter to the more expensive one, the optical system would suffer from more internal reflections (no AR coating) and more optical aberrations (the glass won't be quite as flat or quite as parallel). As a result, optical quality degrades.

Simple! Buy expensive filters!

Aaaaah, but that's not the whole story. ANY time a flat optical element is introduced into an optical system, spherical aberration is introduced. ANY time. Again, this is a fact of nature and is not something you can just "design out". The act of screwing a filter onto the end of the lens introduces spherical aberration into the optical system.

Before talking about image degradation, I need to take a step back and say that spherical aberration does not necessarily equate to bad image quality. Almost every optical element will introduce spherical aberration. The trick is to balance the spherical aberration, some positive, some negative, so that the entire system, taken as a whole, will have minimal spherical aberration. So you can design a lens to have negative spherical so that it will perform best with a filter of a given thickness and index of refraction stuck on the front of it.

But if you think that's what Nikon, Pentax, and Canon are doing... You have another thing coming.

Even so, this trick has been used before. Schneider and Rodenstock used to make these gawdawful wide angle lenses for 8"x10" view cameras that suffered from horrid light falloff toward the outer corners. No flaw in their design work; when you go past a certain point you wind up with light falloff. You just do. So to fix it they designed the lens with negative spherical and stuck a filter on the rear element that was darker in the middle than on the sides. This evened out the exposure level across the frame, and because of the design choice the system taken as a whole had very little spherical aberration.

I don't personally use UV filters on my lenses. I used to, but I learned how to keep fingers and dirt off my glass. When I do use a filter, I have a very good reason to. Otherwise the filter stays in my bag.

The filters I tote around these days are a circular polarizer, for cutting reflections on vegetation and water, and split neutral density filters for darkening overbright skies so they fall in the same exposure range as the rest of the landscape. I do my black and white photography with a 4x5 camera. For that I have a set of Wratten gels (which, because of their thin cross-section, don't introduce nearly as much spherical as a glass filter.)

-- Pencil

P.S. The analogy! I almost forgot! sudo is a lot like using a UV filter to protect your glass. It'll stop a fingerprint, and help to teach you how not to smudge up your lenses. But if you manage to run "sudo rm -rf /" it'll still erase every file on your computer, just as if you were logged in as root.

P.P.S. sudo doesn't cause spherical aberration, as far as I know.

On the Utility of sudo

I recently had a bad bout upgrading php on two servers from php-4 to php-5. The confusion lay not in the differences between the two, but in how the Linux distribution I use handled these packages. In the end the user forums came to the rescue, and with a little poking around I was able to figure out how to get past the problems I was having.

But again I was struck by the directions in most of the FAQs and forum threads. It seems as if a large number of people running UNIX systems in general, and Linux systems in particular, log in as root to do the bulk of their work. To this day this makes me shudder.

Long, long ago in a career far, far away I ran UNIX machines for a living. Before anyone chuckles their superior all-knowing chuckle and says, "You mean you ran Linux systems," keep the chuckle to yourself. I've run SGI, Concurrent, Sun, IBM, HP, DEC, OpenBSD, and yes, Linux systems. I've been around the block a few times. Early on in my career one of my first mentors disabused me of the notion of logging in as root. Ever. EVER. It was good advice then, and it's good advice now.

Back then the work-around we used was the su command. This allows you to switch what UID you are logged in as. su - root is a quick way to become root, though you need to authenticate using the root password in order for it to work. Not perfect, but at least we had a timestamp in the system logs to indicate someone was dinking around as root. That way when things messed up, we could go back and see who to call.

This was in the day when quarter inch cassettes were considered state of the art. A 1GB disk cost a king's ransom, and a single CPU could serve a large research group. Times changed, and so did the tools. Not many years after this, OS distributions came on CDROM, X-Terms began going by the wayside, and beefy desktops became the norm. Around this time, some wonderful people wrote the sudo command.

sudo lets you run a single command as root. There are two advantages to using this over the old su - root trick: First and foremost, each command is logged. That way when things go wrong you not only know who to call, you know what they did before they ever answer the phone. The other advantage is that you no longer authenticate using root's password: you use your own.

There are other advantages as well. With sudo you can say what commands each person can run, what machines they can run them on, what files they can run them against, etc. It sets up an entire hierarchy of trust relationships between systems and people. Once someone's role on a particular machine is defined, setting up sudo rights so they can do that and only that is fairly straightforward.

Needless to say, once it became available I used it. It made managing machines easier at work, and it's how I ran my machines at home. Everyone around me used it as well, so I began to take it for granted.

Then I changed jobs --

Oh.

People were logging in as root, leaving themselves logged in, and going to lunch! I was apalled. So when the edict came down from on high that we were to mend our ways and be more security-conscious, I was more than happy to deploy sudo across all our servers. Most people took to it. Some did not. In particular application owners like the webmasters were particularly offended by the new scheme. Makes perfect sense, actually. We were stripping them of their rootly priveleges and leaving them with only those commands they actually needed to have in order to perform their job functions.

So they bitched. They moaned. They threw fits at upper management. And... they threw fits at us. Woe betide the person who tells me that having to type "sudo " at the beginning of each privileged command is just too haaaaaard! "I've been doing this at home for the last five years," I told them. Without exception their response was, "Bullshit!" Fine, but I was telling the truth and was happy to show them my logs to prove it. I still use it at home, and if I was still in the industry I'd use it at work, too. The advantages it offers simply outweigh any supposed drawbacks it might have.

And you'd be amazed the things those web admins would try to run after hours! Which leads me to the subject of actually looking at system logs. But that's another story...

-- Pencil

Wednesday, February 15, 2006

Revision and Writing

The third chapter is almost ready for review, but the computer that drives the printer is dead as a post. Alas. It does make me appreciate networked printers more. But it's also giving me an opportunity to try to see the chapter from the reader's standpoint as I wait for parts, and try to re-write it before handing over a hard copy. Maybe a little less red this time. Maybe... In any case, the parts should be in by Monday and I should be back up and running.

On the subject of writing, there's another blog I read frequently. A recent post there caught my eye. On the surface it was about deciding whether to go to a concert, but the real thrust of the post was far stronger, and hit hard. It concerned personal change, growth, and healing. I make it sound trite by describing it with these words, but without reproducing it here word for word I really can't do it justice.

When I read it I was reminded of a song written by Aaron Lewis. The line I'm thinking of was:

These are the words I've never said before:
I think I'm doing ok.

I think I am, too. It's taken me three years to figure it out, but I think I am. There are still ups. There are still downs. There are still times I doubt, but there are more times when I smile and laugh. I can't say I'm this confident, new person. I'll never be that. But when I look in the mirror I now see someone worth keeping around a while longer.

I wrote a comment to them, asking them to please not stop writing. I've never had a response to a comment and didn't expect to see one. So I was a little surprised to see an entire posting in reply. Again, it was extremely well-written and described reading and writing from a viewpoint I haven't often seen expressed. The author said when they were growing up they relied on the works of others to bring joy, despair, humor, emotion, and that they were struck that someone else would react to their own writing in this way.

React I did. And isn't that the point of writing and reading anyway?

-- Pencil

Monday, February 06, 2006

Leap of Faith

Writing is a lot of fun. It's a lot of work, too, mind you, but it is fun. For the last year I've enjoyed my first attempts at the novel form, my first real attempts at fiction. Thank goodness I didn't show any of my early efforts to anyone, though. Even after so little time I can tell they're drivel. Perhaps useful drivel -- I wouldn't mind pulling out a couple of key scenes for use somewhere else -- but drivel nonetheless. Not fit for human consumption.

But I reached a point where I realized I was working in a vacuum and wasn't moving forward. There really was nothing else for it: Time to take the leap and show my copy to someone else.

Easy enough to think about, but actually doing it? That's hard! Even choosing who to share my early drafts with has not been an easy decision. In the end I decided to share them with someone I'e done copy editing for, myself. They've had enough exposure to the sharp pointy end of my editing pen to have plenty of reason to draw their own with vengeance in mind. And so they did! When I got my first draft of the opening chapter back from them, it was fairly dripping with red and whimpering!

But for all that some wondrous things came out of it. Among other things, they actually liked it. They liked the characters. They liked the opening scene. They liked where the story was going, and even said they'd read the next chapter. They also gave me countless suggestions for changes, countless notations on where they were confused, where they lost interest, where the action had stalled, etc. I edited. I revised. I rewrote. And I handed them another draft that came back a little less beat up, a little less messy. And at the very end, wonder of wonders, the notation, "Well written."

Reading back through that revised draft, they may be right. I certainly can't say the earlier drafts were well written. Before incorporating their feedback it was anything but well written. And I know there are many hurdles yet to be leaped before it's ready to submit to a publisher. But I can see that happening now. I'm in the process of revising the second chapter for their review, and am writing the third one. I can't wait!

-- Pencil

Thursday, February 02, 2006

Rivets and Trees

Being able to write again is wonderful. I'm falling into a pattern now that seems to be working well. I look over the stuff I wrote the previous day, make a one-pass revision to get me back into the groove of the story, and then write until I get too cliche. I'll spend the next day thinking over what I did, trying to find a way out of the hole, and by evening I've typically come up with something that'll make the story more interesting. Wash, rinse, and repeat.

The story I'm working on at the moment would probably be classified as fantasy, though depending on how you look at it it could also be considered historical. I'm trying to stick to social structures and accompanying technologies from a particular time and place. But I'm also making things up as I go, so fantasy it is.

But I work in a job that many would consider science fiction, even though it's actually happening right now. To paraphrase Orson Scott Card, I'm writing about chivalry and magic, but I'm living in a world of rivets and plastic. It gets to be disconcerting.

This is one reason why I hope I can get some time off once this project at work is finished. I've asked my boss and he did say yes, but things like that have a way of turning around. The last time I really started to crack we were all pulling hellacious overtime and he suggested I comp some time instead. Take a day off. Relax a little. Then I showed him my project list. Oh well, that was a good idea... It was at least another month before we had a break in the schedule. I was paid well for the overtime, though, so no complaints.

Still, if I can squeeze in two days in a row, I'm hoping it'll help with the writing. Even if I get stuck on one scene I've got a couple of later scenes already sketched out, so I could work on them as well. One entire set of scenes I was thinking I'd have to scrap just got written back into the plot as a way to get me out of the last hole I wrote myself into (yay!) Recycling is a good thing, especially when it comes to writing. Waste not and all that jazz.

But it's got me to thinking: Maybe I should consider a science fiction story next. Living in a world of plastic and rivets, at least I wouldn't be shifting mental gears every time I sat down to write. Then again, maybe that's the whole point. If I can't leave the rivets for the trees, is it really something I want to be doing?

-- Pencil