Preston L. Bannister { random memes }

2009.02.28

Can a modern country have a monarch?

Filed under: General, Politics — Preston @ 12:39 pm

Can a modern country have a monarch? As an American I am inclined to think the entire notion absurd, and quaint. On the other hand, from my slowly accumulating readings and reflections on state and society – there is a place for exceptional individuals in the state. The founders of this country carefully divided governance among individuals (presidents, governors, mayors) and groups (congress, assemblies, councils). Absolute monarchs were almost always a flawed notion – but carefully trained families with a significant but carefully circumscribed role – there might be a workable, useful solution.

From watching the above video – I suspect the Swedes may have something right. I do not understand a single word of Swedish, but there are other aspects to communication aside from language. Somehow I suspect the guy may be entirely decent, and well worth his position.

To put this in context – I saw in person a local guy running for Sheriff of our county several years back. He spoke well, but at the end I found I did not trust the man. He did get elected, but was eventually removed from office and accused of corruption. If you are a good judge of character (whatever that means), perhaps simply seeing – in person – someone speak, reveals enough clues to their true nature.

Anachronism or not, I have a sneaking suspicion the Swedes got this right. (That this apparently-official communication appears on a popular video-sharing service on the web, is also an encouraging clue.)

Got here following a bit of humor.

Absent minded

Filed under: Humor, Personal — Preston @ 9:28 am

In the kitchen this morning, to make breakfast. Had a small amount of diced salami and bacon (both very nice) left over from dinner last night. Simple to fold that into an omelet. Started gathering and preparing the needed bits.

In the kitchen, my mind is always wandering. Reflecting on a book I am reading. Perhaps musing about a bit of obscurity from the prior days. Puzzling out a current problem (which covers the prior two, also). As a result I tend to be a bit absent-minded. This morning – after opening the refrigerator for the third time, each time at a loss what to do once the door was open – thought it good to be unwatched. Turned back to the counter, where everything was prepared, except for the missing eggs.

The dog was watching, alert and polite. I have no doubt as to his interest, but little idea as to his thoughts.

2009.02.23

Guess I’m a little slow…

Filed under: Humor, Personal, Software — Preston @ 1:51 am

Self-judgment is always tricky. Some bits took me a long time to figure out.

Whenever I go into a new situation, I expect to find someone much smarter. It never seems to work out that way. Often I find folk as-smart, but never (yet) anyone I thought clearly smarter. (Worse, I tend to over-estimate the abilities of folk I know.)

Yet my expectation persists.

I have had some occasional odd interactions with folk in the past, that I did not understand at the time. Easy to forget that other folk have insecurities of their own. Years after one episode, I figured out the most likely and unexpected explanation.

My career-path meant I got heavy exposure to client-server programming very early. I tend to think through the issues fairly throughly (perhaps I have an odd notion of “fun”), when presented with an interesting problem. A decade later, I started at a company that had a client-server product. The product had clearly got some of the principles I had arrived at, badly wrong. After starting at Quest, and seeing the current-generation product, I heard there was a guy working on the next-generation of that same product. So I went to the guy and outlined all the things I thought he should do for the next generation product. On one point he said something like “we thought about doing that, but it was too hard”, for which my answer was “we did that on my last project, and it worked out very well”. I think the guy’s name was Jeremy.

I was just trying to be helpful.

What I did not know at the time was that what I had seen demonstrated was in fact the next-generation product, the result of two years of Jeremy’s work. So instead of criticizing the old generation to offer advice for the new generation … it must have sounded to Jeremy like this new guy was tearing apart his best work. The product was called “Vista”.

Then things got much worse.

Not many folk are intimately familiar with both Windows and Unix programming. Vista was a Unix-only product. Most folk in that outfit were Unix-only. Since I knew both platforms, I got tasked with porting Vista to Windows. Another guy – a long-term hand at the company – was tasked to work with me. The other guy – John? – I knew and liked. He was pretty sharp, but had other obligations. After a few weeks he bowed out, claiming that he was only going to slow me down.

I am a sucker for challenging problems – and always have been.

There were about a half-dozen programmers working on the Vista product. I had to keep up with their changes, while building a port to Windows, against an ever-diverging source-base. After six months of very intense work, I had a dual port. The same source base could be compiled to generate either a Windows or Unix version of the product. To keep up the necessary pace, I had isolated myself from most of the daily workings of the group. Along the way I found some perfectly astonishing bad code. I had assumed that programmers with equivalent levels of experience, but who had spent their entire careers doing only Unix programming, would be far better than I in that domain. Working through the Vista source code, I found out that I was wrong – and very badly wrong. Since I was under huge time pressure, I took an extremely pragmatic approach. When I found a malfunctioning section of code, I first tried to read through the code. If I was unclear what the code was meant to do, I re-wrote the section of code for clarity. At this point I usually realized the original code contained a number of errors. Code-level errors do not necessarily translate to customer-level errors, and the pressure on my time was enormous, so I made no effort to report my findings.

When I had finished, the group cut-over to using my source-base. They were a bit surprised to find that I had kept current with all their changes. (I had a secret weapon. They were using RCS-based source code control. I used CVS to track their changes.) What was worse was that I had almost-accidentally killed off a large part of their bug list. The code inspection and re-coding for clarity was just to make the port work, but had the side-effect of eliminating a lot of existing bugs. By this time Jeremy had been made manager for the group, and he called me in and yelled(!) at me, while admitting this. I was confused.

What I did not realize – until years later – is how this looked from Jeremy’s point of view.

Imagine a new guy at your company walks into your office, and details all the things wrong with the project you have worked on for the past two years. Imagine he claims to have done something you thought was too hard to do. Now imagine that the new guy is tasked with something you cannot do. You expect him to fail (and I know he did). Instead of failing he delivers a result that not only works, but is much improved over your best work.

Did I mention that Jeremy was made manager for the Vista group, and that I reported to him?

Midway through the project, I realized each client instance of the server in the Unix implementation of the Vista server was started via inetd. Since the Vista server-side incorporated Ghostscript, and the Ghostscript initialization took 20-30 seconds (loading a large amount of font information, mainly), this put a serious crimp in per-client startup time, and a pretty serious load on the server when there was a lot of clients. Since the Ghostscript initialization was the same for all clients, if the Vista server was run as a server, the per-client startup could be reduced to milliseconds, and the total load placed on the server hugely reduced. I went to Jeremy to explain how this could be done. He angrily rejected my suggestion, for no logical reason that I could discern. I was puzzled, but went back to the all-consuming task of completing the port.

Imagine that annoying new-guy offers a suggestion (which he has already implemented and demonstrated) that improves the startup time of your pet project by a few-thousandfold. At this point Jeremy really did not like me, and I had no clue as to why.

Naturally I had taken the same approach with the Windows port, so the per-client startup time was almost instantaneous.

After finishing the Vista port (to the great pleasure of the Marketing folk, who could now sell Vista into the Windows market), I got tasked with another port. I had a conversation with a distinctly grumpy Jeremy, who had to admit that the Vista port worked, and since I was apparently some sort of legend (not to my knowledge), I was tasked to port another product.

The next product was called “Shareplex”, and was a database replication product for Oracle databases.

I had used Oracle as a programmer/user a fair amount while at FileNet, so I was pretty familiar with Oracle at a user-level. Knowledge of Oracle at the reversed-engineering level needed for third-party database replication was entirely outside what I knew. Moreover the guy in charge of the group had written a book on Oracle performance tuning, so I felt entirely out-classed on both fronts.

Again, I was one guy trying to keep up with an active development group of about a half-dozen, while performing a port from Unix to Windows. It quickly became plain that I could not perform testing in the same labor-intensive manner as the existing group. (It also struck me as odd that there were no comprehensive test suites for a potentially mission-critical product.) So I came up with a series of Perl scripts to perform a series of automated tests against the database-replication product. The tests created, exercised, and destroyed a series of progressive, then semi-random, series of structures, data, and operations.

At the end of the port – another six months of very intense work – I had another dual-port. The same sources could be compiled for either Windows or Unix. The tests I had built proved that the port worked just as well as the original Unix code – and also proved that the original code did not work.

I was stunned. I had no idea how to proceed from that point.

What I did not realize at the time was that I had given two important group managers reason to hate me. A few weeks later, Charles – the Shareplex group manager – escorted me to a meeting, where I was fired.

Much later, I learned that the Shareplex product was withdrawn from the market, and took another 2-3 years of rewrites before it became a marketable product. The conclusions I derived from my tests were right, but I did not, at the time, know what to do with the information.

Without knowing, I had intimidated co-workers, by doing things that they could not.

This morning I made a different connection along the same lines….

When I worked at FileNet, the company hired in a new graduate from CalTech. Management treated him as if he was a living legend. Dan was a fairly smart guy, but I kind of doubted his ability to walk on water. Fairly early on, he did a performance analysis in the area in which I was working, and made a couple fairly elementary mistakes (for a first-year Physics student), and circulated some bogus results. I sent out a correction, but did nothing else.

What I did not take into account was his likely insecurity as a guy promoted well past his peers. Any sort of criticism was likely seen as a serious threat.

Fast-forward a bit over a decade. A marketing guy at my then-current employer wants to go talk to the folk at FileNet. I don’t see a likely gain to the exercise, but went along to support the marketing guy. We end up waiting in the entrance lobby for an oddly long time. Dan walks through the lobby. Dan claims not to know me, with a hint of anger. Odd. To put this in context – the lobby is not on a natural path between any two points within the building (I used to work there). That Dan would walk through the lobby at the time I was there was … odd. That Dan would not remember me (we worked together for about seven years), is … odd.

Since the episode was of no importance, the odd bit stuck, but was otherwise forgotten. In retrospect, if I had indeed made Dan feel threatened, then the combination of oddities add up to a probability. Is it possible I had made Dan feel threatened? Is it possible that we were made to wait until Dan could walk through the lobby? At some point Dan was promoted to CTO. Was the odd delay, odd diversion, and odd lack of recognition … not odd at all?

This morning’s amusement – of no further import. :)

Now … I could be wrong about any of the above. On the other hand, even if right, it seems unlikely that anyone involved would confirm anything. Oh well.

2009.02.22

How to get started?

Filed under: Software — Preston @ 5:44 pm

This is simple programming problem. Tune out if this is not your thing.

Started writing a simple cxi (for CGI-like Xml Interchange, perhaps) program as suggested in a prior scripting-oriented article. Pretty straight-forward coding (with some added clever notions that occurred to me later), right up until I got stuck on how to get the child command started.

Commands to be run by cxi fall into two main groups.

  • Generators – commands that generate output, without reading input.
  • Filters – commands that read input and generate output.

Filters are the easier case.

  1. Read environment for HTTP_ACCEPT.
  2. Read the input for headers.
  3. Read the command line for options.
  4. Based on the last found, select the command to run, and set HTTP_ACCEPT for the child process.

Note that the input must be scanned for headers before the child process can be started. Generators are tricky. We cannot read the input for headers (since there is no input), as this would block, and the child process would never get started. We could require pre-knowledge to distinguish generators from filters (a sort of database of command metadata), but this strikes me as inelegant. Traditionally in Unix there is no way to distinguish between commands that are filters and generators. Any given command could be either.

Need a simple convention to mark a generator. I’m inclined to conflate two needs and address with single solution. At the start of a pipeline of cxi commands, you need to establish the desired intermediate data type, as well as indicate that the command is a generator. Since this a usual case, the presence of a command option could indicate both. So a pipeline of cxi commands would look like:

cxi -t xml ps | cxi foo | cxi bar

In the less-usual case, where the initial command is a filter, and addition option could override and force filter-behavior:

cxi -t xml -f ps | cxi foo | cxi bar

In the less-usual case, where the type is indicated in the environment, then another option to indicate the generator:

export HTTP_ACCEPT=text/xml
cxi -g ps | cxi foo | cxi bar
cxi -g ps | cxi foo | cxi bar

Can’t think of anything more elegant, so will go with the above.

As a slightly amusing sidelight – turns out the GNU getopt is too smart for my purposes, and I will have to use an older “dumber” implementation of getopt. The GNU implementation will pick out options anywhere in the command line, and I want it to stop at the first non-option argument.

2009.02.17

Making pizza

Filed under: Personal — Preston @ 1:03 am

Cooking is a sort of minor hobby. Started back in high school. On one hand my mother was an indifferent cook, so I quickly learned to do better. On the other hand participation in Track and Cross Country meant I had an enormous metabolism. Learned how to make cookies, breads, and large quantities of absolutely perfect brown rice. Once, as a school exercise, figured I was consuming 11,000 calories every day (while weighing less than 130 pounds).

Over the years I have occasionally experimented with different sorts of cooking. I like to experiment! What that means is that I try a lot of things that do not turn out – at first – but after a while I come up with extraordinary results, for whatever is my current interest.

My kids have learned to both value and distrust my cooking. :)

My kids are almost always interested in whatever I make (even when I try to scare them away). First, they sample (cautiously), then (if the result is good) they steal as much as they can eat. This strategy makes sense, as early experiments are often not very good, but later experiments are very good.

One of my favorite examples:

My teenage son walked in. He had just eaten at a fast-food joint. “I am so full, but the broccoli smells so good!” (Then he stole some of my freshly cooked broccoli.) How often do teenagers stuffed with hamburgers eat broccoli – of their own choice? :)

I like to experiment! That means I might use a recipe as a starting point, but – once I’ve learned what works – never use recipes, and never use exactly the same combination of ingredients. At first the results are uneven, but eventually I get good (or better!) results pretty much every time.

My latest cooking puzzle was pizza. I am allergic to tomatoes, onions, and garlic. That pretty much rules out all your usual recipes for pizza. Coming up with a feasible equivalent to the usual sorts of pizza sauce was a bit of a puzzle. (You can order a pizza w/o tomato-based sauce at many pizza joints, but the results are usually uninspiring.) Was watching a cooking show, when a bit of inspiration hit! Tomato sauce is sweet (somewhat), tangy, and (on pizzas) spiced. To make a somewhat sweet, tangy, spicy sauce – used unsweetened apple sauce, with lemon juice, paprika, peppers, and salt – and it worked! (The mass of cheese needs sauce as a sort of balance, so the “right” sauce is important.) First session making pizza, some things worked, some did not. Second session, some did not work, and some did (different than the first). Third session … pretty much everything worked, and really good pizza.

With any luck, the fourth session will take me into the profoundly evil category.

Already bought the ingredients. :)

Disposable appliances

Filed under: Personal — Preston @ 12:10 am

When I was growing up my parents were usually a bit short of money. Much of what we bought was second hand. Some things we made instead of buying. Often things that broke were repaired rather than replaced. That history means I tend to buy things that I expect to last, and tend to try to repair things that break, rather than just throw things away.

First vacuum cleaner I bought was a ~$300 Hoover (in mid-1980’s dollars), very well reviewed by Consumer Reports, that I expected to last. It didn’t. The cord holder broke. The power-assist broke. Replacement parts were hard to obtain and expensive. After a while – despite cleaning – it just did not do a good job as a vacuum. (After that experience, I am unlikely to buy Hoover, again.)

More recently I bought a ~$200 (about year 2001) Sharp vacuum billed as very quiet – and it was! Did a good job of cleaning at first, but after a year seemed less effective, then much less effective a bit later.

Bought a ~$250 Roomba a few years back. The robot vacuum cleaner was very cool, though it needed frequent cleaning, and then broke. Then the replacement broke. Then the next replacement broke. Then the next replacement broke – and I finally gave up on the Roomba.

Bought a ~$150 Dirt Devil, which worked pretty well for maybe a year (or much less). When the results were once again not very good (not impressed with the “Dirt Devil” brand), hit Consumer Reports (which is a good start, but one I do not entirely trust after the first Hoover) and the other review sites.

I prefer to buy high quality products, with the expectation that they will perform well, and last a long time. After mucking through the user reviews, I started to suspect that almost any new vacuum performs better than an old vacuum, and that price may not mean much.

Went to Wal-Mart to buy a cheap replacement vacuum. Settled on a bag-less Bissell, priced $70 on the shelf, and $45 at the checkout. First run – it’s much quieter than the old Dirt Devil, and picked up a lot of dirt the old vacuum had left behind. The new vacuum is lighter, and does a better on edges as well.

Right. Seems to confirm the theory. New vacuums are better than old. At $45 this vacuum is pretty much a disposable item – if it stops performing, I will toss it and buy new.

That something the size and complexity of a vacuum cleaner has become a disposable item (in a very practical sense), is … clearly true, but a bit hard for me to digest. :)

2009.02.13

Questions about urban architecture

Filed under: General — Preston @ 9:02 pm

Sometimes simple things bother me….

In a dense urban environment, in cold climates, why are sidewalks at street level?

Warm air rises. Walkways elevated above baffled entrances (to keep out the wind) should be warmer than exposed sidewalks, and always dry. Elevated walkways across city streets can only improve the flow of traffic. Given the huge investment in large buildings, why not also improve the public space associated with the building? Should enhance the value of first-floor tenant spaces as well.

What are the arguments against?

2009.02.11

Dissonance

Filed under: Personal — Preston @ 1:35 am

There is a television series called “Lost”. In passing I have noted some who seem quite taken by the series. Naturally this made me somewhat curious. When an obvious opportunity appeared, I set my TiVo to record the series.

After watching a few episodes, I wanted all the characters to die. Figured it would improve the species. (Yes, I have not lost track of the fact the characters exist only in a work of TV fiction.) The characters were without exception stupid.

OK, so I know the series was most likely written by Hollywood script writers. These are folks who for the most part have avoided science (and any form of rational thought) as much as they could. Yes, the end result is hideously predictable. Still … I wanted all the characters in the story to die. I really did not care about the “plot” or the “characters”. (Well, as a male, any attractive female biases my response, but in this case, not so much.)

In trying to follow the script, I found myself asking the characters:

“Um. Hello!? This is a survival situation. Maybe now is not the time to engage in silly soap-opera style behavior?”

Of course, in the world of TV marketing, a “soap opera” that sells on the cable “Science Fiction” channel, probably sounds like a good thing. The fact that the actions of the characters make no logical sense is not relevant. I know this.

Have to wonder – if I was in this (fictional) situation – what would I do?

Next Page »