Sunday, December 23, 2007

The many panes of Windows, Pt 4, The Registry

In the beginning was a frill. Windows 95 "enriched the user interface" by permitting every file to display a custom file icon, something that Windows 3.1 did not support. For Explorer to paint the file icons, it needs to find each icon on disk, and suck it up to the screen. It was decided to create a fast, ram resident database to hold all the needed file pointers. Such a data base, dubbed "the registry" was troublesome to create, so it was generalized to support any program's need to remember things while running. For instance, Windows programs want to remember the size and position of their window (full screen or something less), what files they had open, and what options the users had set, and where the home directory was. Provisions were made to hold patches to the code, and user authorizations, and to start programs.
The major attraction of using the registry is copy protection. The application's install program writes the needed keys into the registry. The program checks for the presence of these keys in the registry as evidence that the program hasn't been pirated. You cannot get MS Office to run on another machine by the simple trick of copying all the MS Office files to the other computer.
The copied program will note the absence of registry keys and refuse to run. Writing the needed keys into the registry by hand is theoretically possible, but in practice it is just too hard. Presto, instant copy protect for programs. The utility of this copy protection became obvious to every programmer and every Windows application uses it now.
Downside. Every program or virus running on the machine can change the registry, and the changes stick, making the damage permanent. The registry is very powerful, it can run anything on the hard drive, alter the code in any program, and change many important windows defaults, such as the default web site web browsers visit upon startup. Coding errors in ordinary applications can do things to the registry that break windows, windows applications , drivers and hardware. The S32EVNT1.dll bug was caused by a faulty registry key. The opportunities for malware to damage the system thru registry modifications are enormous. The registry is one humungous security hole waiting for a place to bite.
And we are stuck with it forever. Changing the powers of the registry would break many programs. For good commercial reasons Microsoft works hard to make each new version of windows run last year's programs, so the registry security hole is with us forever.

Christmas Pageant, mission accomplished

It took three weeks of rehearsals, two dozen costumes, but it worked. We had every small child in the church (and a few who aren't members yet) . Numbers of children kept growing at each rehearsal. The whole thing came together this morning, the parents and the congregation were charmed, the church was full and everyone had a good time. Plenty of non speaking parts (sheep, shepherds and angels) for the preschool set, a fine solo of Silent Night from a teenager.

Saturday, December 22, 2007

Lead in Toys causes Chinese factory manager suicide

It is not known how dangerous lead containing toys are to US children, but they can be fatal to Chinese workers. The factory involved in the first Mattel recalls, Foshan Lee Der Toy Co. has shut down entirely. The plant office is secured with a yellow bicycle lock. Boxes of Fisher Price toys for toddlers can be seen stacked in the warehouse. The factory's owner committed suicide after the recall. The company laid off their workers, the concrete company dormitory stands empty.

Fixing broken Windows

Daughter's brand new HP XP laptop started acting up after three days. HP XP means HP's brand name on the laptop with factory installed XP rather than Vista. A clueful software whine (C:/blahblah/yaddayadda/symantec/S32EVNT1.dll has failed to initialize) started to appear when ever Fprot antivirus, Civilization, or Simcity was launched. Since daughter and laptop are scheduled to depart for Krygystan in a week (Peace Corps) I decided to see what was what.
Googling for "Symantec" and "S32ENVT1.dll" and "failure" brought up a world of hits. Apparently this problem is widespread. After reading a bunch of hits, the story begins to unfold.
Laptop had come from the factory with a "free trial version" of Norton Anti virus. Due to a bad rep, extreme sluggishness and irritating cost we had uninstalled Norton and put in AVG.
Turns out that Norton Antivirus doesn't uninstall properly. It leaves some trash in the registry that causes the S32EVNT1.dll error. Going to this helpful website: http://www.majorgeeks.com/Norton_Removal_Tool_SymNRT_d4749.html
guided us to a special Symantec written cleaner-upper program that swept the trash from the registry and all Symantec software right off the computer. It then plead for us to re install Symantec products but we didn't fall for that pitch.
Laptop now works perfectly.
Why do I have to troubleshoot brand new Windows XP systems? Why is Windows so damn tender that it needs antivirus kludges to exist, and is so additionally tender that said anti virus kludge breaks Windows?

Friday, December 21, 2007

Mitigating the sub prime mess

Paulsen, our treasury secretary, has been pushing for a voluntary cutting of slack, for hard pressed home owners. In a burst of stupidity, banks began to issue teaser rate sub prime mortgages. The home owner got a couple of years of mortgage payments that he might be just barely able to pay. That's what makes it sub prime, the borrower doesn't really have enough income to carry the mortgage. Two years into this deal, the mortgage payments go up, a lot, the mortgage is "reset" to "market interest rates". About a million borrowers are looking right down the barrel of foreclosure when this happens.
One million forclosures is bad news for the lenders, the home owners, the neighbors, and the local tax base. The lenders loose half their money, the home owners are out in the street, the neighbors property values take a big hit, and the foreclosed property doesn't pay taxes.
The lenders take a real short haircut. If the property were salable, the owners would sell it rather than turn it over to the bank. The property that falls into the hands of the bank is the property that won't sell. If the owners can't sell it, the bank can't either. Usually the property is auctioned off and the lenders recover about half of what they lent out.
The lenders are better off if the homeowner keeps paying on the mortgage. With that in mind, Paulsen has been urging the banks to give the homeowner's some slack, namely holding the teaser rates for another five years. Sounds like a win-win to me. Bank avoids the losses from foreclosure, the homeowner gets to stay in the house. Plus I have heard the "teaser" rates were hefty to start with and the "market rate" to which the loan reset was high enough to class as usury.
For some reason, the Wall St Journal is against this plan. Two editorials have spoken against it, although the reasoning is unclear. WSJ has been nattering about "sacredness of contracts" and "let market forces prevail" but these are sound bites, not serious reasons. The lenders will be better off accepting a lower but still hefty "teaser" interest rate than losing half their capital in a foreclosure.

Fantasy Lead on Lehrer's News Hour

The Newshour did a piece on lead in toys last night. The opening was alright, they actually reported a real live number, the lead limit is 600 parts per million. Then they showed a fancy non contact lead-detector instrument with a pistol grip looking for all the world like a refugee blaster from a science fiction flick. This technological marvel was pointed at a few suspect toys, who promptly put their hands up, and registered 500 parts per million, comfortably below the limit.
This provoked a tirade from the anti lead lady on the show. She felt it was horrible that the toy contained any lead at all, rather than virtuous that the toy met written standards. Then she moved deeper into fantasy, telling us that lead was removed from gasoline to reduce the lead in the environment, AND, the decrease in the US crime rate since the 1970's was due to less lead getting into children and turning them to crime.
Wow. Three whoppers for the price of one. Manufacturers whose product meet standards are to be praised for their diligence. Tetra ethyl lead was removed from motor gasoline to preserve the life of catalytic converters, not people. Lead poisons the catalyst, and the converter stops converting. There is zero evidence that lead causes criminal behavior.
That this much fantasy was aired on a respectable TV news show is evidence of how ignorant the newsies really are.

Thursday, December 20, 2007

The cult of vague generalities, air traffic style

Lehrer's NewsHour did a piece on air traffic control, and what ought to be done to keep the planes moving. They talked for several minutes. Just once, briefly, one of 'em mentioned the real problem, lack of airports. Then the flow of vagueness rushed forth, carrying us viewers along into a sea of mush. No discussion of the real problem.
An airport can only do 60 flights an hour. For safety sake, you have to allow the landing aircraft to slow down and clear the runway before the following aircraft can put his wheels down. And you have to let the aircraft taking off get clean off the runway into the air before the following aircraft releases his brakes. Both of these actions take about a minute, so you get a limit of about 60 planes an hour. You can put in dual runways, and use one for takeoff and one for landing, but that's about it.
We have 53 big cities ("standard metropolitan areas") in the country. Some biggies like New York have three airports, most others (Boston, Philadelphia) have only one. Ball park figures, we have 100 airports in the US. ALL the flights have to depart one, and land at another. Once in the air, there is plenty of air to spread 'em out in. The bottleneck is the airports.
What to do? Build more airports, but we all know this is hard. Nobody wants an airport in their back yard, and the things are frightfully expensive. Send more traffic into secondary airports. Actually this works. For instance, Manchester New Hampshire is as easy to drive to as Logan airport for everyone on the north shore. Manchester is very lightly used whereas Logan is jammed. Ten percent of the Logan traffic could go to Manchester and passengers would be happier. Finally, use bigger aircraft, that carry more passengers, and fly them less frequently. The airlines hate this. They want to offer lots of flights so passengers are more likely to fly them rather than a competitor. Frequent departures mean less time to gather passengers, so they operate smaller aircraft, more often. Regulations could be invented to reduce the number of small aircraft flights into bottlenecks like New York.
All the other stuff they talk about (opening military airspace, expensive upgrades to the air traffic control system) are window dressing, or pork for the makers of ATC equipment.