Thursday, January 28, 2010

The Referencing

How many books do you typically pick up for a new (ad)venture like learning some new technology? I get too many, myself. I always have. It’s a habit I am trying to break.

When I learned all of this Web stuff, I was a freelance writer, and contracted with both General Electric and Microsoft to run a couple of their online forums. I could do this from anywhere, at any time, along with my writing, so it worked great for a few years. But when it came to learning something new, like this new-fangled markup language HTML, it was hard for me because when I most-often had questions, it was at about 2:30am. And remember, I lived not in Silicon Valley, but in Nebraska. So if I didn’t understand something, I was well and truly hosed until someone woke up and logged-on, who also happened to know more about it than me and was willing to help. Those are tiny odds. That kind of environment will just naturally slow a fella down.

And so I came to be a fan of Buying Too Many Books. If I didn’t understand the way material was presented in Learn HTML in 24Hrs, maybe I could make something of the same section in Teach Yourself HTML in 24Hrs or HTML for Dummies or The QuickStart Guide to HTML or HTML in a Nutshell or one of the other titles. When I started this, most books were at or under $20, and I would gladly have paid that much to have someone to ask in the tiny hours of the morning, so to me it made sense.

I recommend you buy only two books, however. At the most. Mark Twain said “The man with a watch always knows what time it is; The man with two watches is never quite sure”. This holds for books, as well.

If all you have is Ain’t We Got HTML? you can get a very good grasp of the issues at hand by reading and understanding it. But when you toss in HTML for Days you start carving up a very different pie. One slice will be Things You Already Knew. Some huge percentage of this new second book is going to be review, in other words. I would place those pages just slightly above the level of Wasted Money. Another slice is going to be Things You Didn’t Know. This is the real value in any second book, things it may have taken you years to pick up on your own, or things you may have just missed entirely. But there’s another final slice: Things You Thought You Knew That Are Wrong. See, one book is going to tell you to always do something, and the other book is going to tell you to never do it. It is then up to you to determine which book is right, and why.

As you add more books, those slices change size relative to one another, even as you continue to “make the pie higher”. Stir in three or four books, and you quickly get to the point of diminishing returns as far as new information goes. But there will be ways that another author explains things that might resonate with you. Still, there is even more opportunity for conflicting information.

I have had the advantage of having writerly relationships with various publishers and so I got a lot of my books free or at greatly reduced cost. And here at work there is a tiny little line-item in the budget devoted to increasing Mark’s technical kuh-nowledge, so I have the job pick up a book now and again.

The last book I personally bought was one of the learning JavaScript titles. Right now, though, I have only a single book for JQuery. And I have only a single book about Drupal. We’ll have to see how long that lasts.

Wednesday, January 20, 2010

The Coloring

Jamie sang “You should have seen it in color” last year. Good song, and a good lesson for Web Developer -types the world over. Using color, wisely, can be one of the best things you can do on any Web page. But how do you get the colors you want or need? And how can you be sure that what you have indicated is going to be what page visitors will actually see?

The answer to that last question, first: You cannot. There are differences in the way Mac and PC monitors display colors. Things are just naturally going to look brighter or darker as you move from one machine type to another. And there is no telling with laptops. We must have sixteen different display technologies today for traveling computers and no two seem to be on the same page there—even when they are on the same page. And don’t forget the handheld market. Smart phones and iPods and such will all have a different view on things, too. Remember, too, that users can adjust the brightness and contrast of their monitors at will.

Given that there are about a skillion colors in nature and millions of colors in computering, how do you know that the “Red” you want is the “Red” you will get? If your needs are simple, and you don’t particularly care about which Red you get, you can actually use the name Red. This is supported in all browsers, along with fifteen other colors: Aqua, Black, Blue, Fuchsia, Gray, Green, Lime, Maroon, Navy, Olive, Purple, Silver, Teal, White and Yellow. These are the color names specified in the, well, specification, for HTML 4.

In addition to these, most browsers now also support the CSS named colors, with names like Bisque, BlanchedAlmond, FloralWhite and Snow, each subtly different from one of the originals. If you use a named color like WhiteSmoke, it will look the same on each area of the page you have indicated, though again it may look different when viewed on PCs and Macs, or laptops and handhelds.

But what if you need to (I can say this, I’m Lakota) go completely off the reservation? Then you get into the various ways of indicating which colors you want on your page. Some will indicate the Red, Green and Blue values, as rgb(184,0,0) but the most popular way is to use the Hexadecimal triplets.

With a leading octothorp, #, six digits indicate the Hexadecimal values for Red, Green and Blue. The first pair indicates the Red value, the second the Green and the final two digits are the value of the Green channel. So, #081F0C means we need “08” of Red, “1F” of the Green and “0C” of the Blue. This gives you a very dark green, maybe one of the hundreds of colors sold as “British Racing Green” over the years.

If the two digits in the pair are the same, then you can use shorthand and only indicate three numbers. #FC0 stands-in for #FFCC00, then, giving you the same golden-yellow. In Hex, 0 is none, 1 is very little and F is all there is. #000000 then, is Black, while #FFF is White. Here’s a tip from your old Unca Mark: Any time the triplets are equal, you are moving along the Black-to-White line, representing some shade of Gray. #303030, then, with all channels reporting “30” as their value, is a darker Gray than, say, #CDCDCD, which is very pale. Thirty is close to zero, while C and D are nearer to F.

Wednesday, January 13, 2010

The Scripting

One of the things I’m going to try to do better this year is starting these things. I never know when to begin a story, you know? Some people like that, some are annoyed by it. The first time I met my wife, we talked of course about What We Did and when she found out I was involved in computers, she asked how they worked? I stumbled around through Herman Hollerith and Blaise Pascal and eventually all of the way back to the abacus. She came back, and we have been together more than twenty years, now. Is it any wonder I love her so? But I need to do a better job at making beginnings.

So… the Earth cooled and the dinosaurs came. Flash ahead a few years and the Pioneers started putting up Web pages. These were terrific! They offered all kinds of information on all kinds of topics. And they provided links to even more information. You could start out looking up information on where the Holiday Inn is, in Rockville, Maryland and end up learning about how many different kinds of marsupials we have discovered.

But, as with most technologies, we were more adapting than adopting. We were taking the familiar, the books, magazines and newspapers we had all grown up with, and we were putting that kind of information online. Is that progress? We were using $2500 computers to absorb information we used to get for 25¢ from a newspaper. It’s hard to say we were really better off, though the colors were brighter.

We had all of this brain power just sitting there, warming our offices. Couldn’t some of that be harnessed for Good? A computer is fundamentally different from a book, magazine or newspaper. Couldn’t those differences actually be made into advantages?

We developed two kinds of ways to make our pages more thinky. Depending upon what a user was doing with a mouse or keyboard, the look of the page and the information it displayed could be very different, very quickly. And these differences were brought about by using either the Web server, or by using the page visitor’s own computer. We say the technologies are either server-side or client-side today.

Static Web servers work like this: A user calls up a Web page and the server ships it off. That’s it. You get the same page everyone else gets, with the same information on it. If that information ever needs to change, someone has to edit that particular Web page and make those changes. Then everyone will once again get the same, new, information.

Server-side scripting works like this. A user calls up a Web page and the server ships it off. But this time, before it puts the page on the train to your computer, the server goes through the page, line-by-line, looking for little instructions. “Go ask the computer what day and time it is, and put that information here”. “Go ask the computer how much this guy owes, and put that little piece of data there. The changey aspects of the page are all handled by the machine that shipped the information to you in the first place.

Client-side scripting works a little differently. This time, a user calls up a Web page and the server ships it off to them. The page still has little instructions in it, but this time they are for the user’s computer. The computer that displays the page will in some ways be controlling how it looks and works to the viewer.

Imagine a tiny little shoe store. Imagine Amazon.com. The little shoe store probably has a server under the cash register, and may get dozens of hits per day. Amazon gets tons of traffic every minute. The shoe store folks may, in fact, build a new Web page for every shoe they sell. But a store like Amazon.com could never operate that way. They have pages that include various routines to call upon databases and aggregate information in ways nobody could imagine a hundred years ago. The page you see at Amazon.com is probably unique to you and your computer. Nobody else is seeing the same thing in the same way. That kind of variety just isn’t economical if every page has to be marked up individually because they are static. Dynamic pages are the future, and if you’re interested, you should maybe spend a calorie or two looking into JavaScript, PHP and MySQL, ASP and other technologies to make your pages sing and dance.

Thursday, January 7, 2010

The Planning

The last month or so may be what is now commonly called, “A Teaching Moment”. Or maybe we can summarize it with the old Yiddish proverb, Man Plans, God Laughs. So let’s talk about plans, this week. A lot of us are involved in planning, at this time of the year especially. What are we going to do this year? What are the key things we have to get accomplished this year, in order to be invited back next year?

A lot of what we do here is based in the calendar. Schools starts here and it ends here. If you are doing anything that may affect either the students or the faculty or the facilities, it is probably most convenient to do it during a time when school is not actually in session. During Spring Break or at the end of the semester or during the annual holiday close-down.

If you are working on something dealing with the administrative arm or the staff, then there really isn’t a convenient time, but again, because of the product and service we provide, a lot of things will still turn out to be easier if they are done over the various breaks in the actual teaching and learning.

And then we have this last month. Filled with a bad economic news, awful travel news and more than our usual complement of awful weather. Stir in a little illness and maybe a family crisis of one kind or another and you have the makings of a perfect storm of broken plans.

We postponed most of our holiday plans. This was nice because we could. It wasn’t like a space launch where we get one chance today at 4:30 and then don’t get another for six weeks. There was nothing about us all getting together that couldn’t wait.

But there are other events that do have strict timetables. The first day back at work is going to arrive, whether our walks and driveways are good enough to get out and get there or not. Maybe you have a little vacation time banked. Maybe you have to take the bus, a cab or even walk to work if your car won’t start.

I have always been overly cautious. It’s one of the reasons I could promise my wife I would not die in an airplane crash. Nearly every lesson in aviation is backed up by some kind of platitude. One of my favorites: A good pilot may be disappointed in an airplane, but he will never be surprised by one. As I apply full power and gain speed down the runway, you’re looking out the window wondering what your house will look like, from above. I’m thinking “If the engine quits now, I’ll do… X. If the engine quits now, I’ll do… Y. If the engine quits now, I’ll do… Z”. I nearly always have a backup plan or two. What movie do we want to see tonight? What restaurant do we want to visit tonight? On and on….

We got snowed-in and spent three days in the same rooms together. It wasn’t great, but it wasn’t awful, either. We had plenty to keep us occupied. In my little circle, I know people who camped out and worked on major software system upgrades, because they had to get things up and running before that first day back. I know people who had holidays ruined because of illness and because of car trouble. The best of them were able to solider on and at least accomplish something, because they had also sketched out a few alternatives.

So, what is it that you hope to do in the year ahead? Learn a new language? Learn a new program? Learn a new technology? Add something spiffy to all of your Web pages, or take something awful out of all of them? How detailed are your plans, and how detailed are your backups; your Plan-B, Plan-C and so on?

Good luck to you in the year ahead. But remember that things will always go wrong in ways large and small and often in ways we didn’t think we could foresee. I have always maintained that the mark of a true professional is not how they operate when everything is going their way, but how they work when nearly nothing seems to be going right.

It’s a new year. Let’s make the most of it.