Michael A. Covington    Michael A. Covington, Ph.D.
Covington Innovations
Ichthys
Previous months
About this notebook
Search site or Web
- - -

Daily Notebook

- - -

Dictionary of Computer and Internet Terms Astrophotography for the Amateur How to Use a Computerized Telescope Digital SLR Astrophotography

Popular topics on this page:
The best way to center a web page
Comments in HTML
Are bundled web browsers monopolistic?
Inflation: Get ready for misleading headlines
Application.DoEvents() considered harmful (1)
Application.DoEvents() considered harmful (2)
Don't BSF PORTC on a PIC

For more topics, scroll down, press Ctrl-F to search
the page, or check previous months.

Astrophotos:
Omega Centauri
Many more...

If you'd like to show your appreciation of the Daily Notebook, please consider making a contribution to my department at the University of Georgia. Thanks!

-
-

2009
May
30-31

A snapshot of Omega Centauri

Exercising authorial privilege, I deleted the boring notes about the economy that were briefly posted here, in order to bring you, instead, this exciting picture. To be precise, this is the least work I've ever done, and the least specialized equipment I've ever used, to get a successful deep-sky picture.

This is a 5-second exposure (in moonlight!) with a Canon 40D on a fixed tripod with a Sigma 50-mm f/2.8 lens wide open, at ISO 1600, with in-camera noise reduction. The image was subsequently processed with Photoshop and Neat Image, but heavy processing was not required — what you see here is very close to what came out of the camera.

Omega Centauri is the most spectacular globular cluster in the sky, but seen from our latitude, it barely clears the southern horizon. It is the fuzzball at the lower right.

I'll see you in June!

2009
May
29

Very short note

The defunct brands Circuit City and CompUSA are back, and they are both basically TigerDirect under other names. (Which is good; TigerDirect is a good company to deal with.)

2009
May
28

Short notes

Lots of new software to test: Windows 7 RC, Visual Studio 2010 Beta, and Windows Vista SP2 are all out. I haven't installed any of them yet.



A thought about school vouchers: If public colleges operated like public schools, you would be assigned one college to attend and couldn't apply to any other; the quality of your education would be strictly tied to where your parents live; and public-college administrators would gripe about the very existence of private colleges. Thank goodness none of these is the case. In fact, Georgia has the equivalent of a voucher program for college — the state HOPE scholarship program will pay your state-college tuition or, if you choose, a substantial amount toward your private-college tuition.



An odd byway of church history: During the Middle Ages the story came in from India of a saint who had been raised in isolation by his father, a king, but who became a Christian anyhow. He was given the name Josaphat (initially given as Ioasaph or Iodasaph, and then remodeled to resemble Jehoshaphat in the Old Testament).

Knowledgeable people eventually realized that this was the story of the Buddha, mistaken for a Christian saint. The name Ioasaph came from Greek via Arabic, where it was something like Yodasaf, and in Arabic, Y and B are easy to mix up; the word is actually a corruption of Bodhisattva.

Now you know. This is, by the way, uncontroversial; it is not a new discovery or speculation.

Note: Once the name Josaphat became well-known, it was given to other people, one of whom became a (real) saint (in 17th-century Lithuania). So there was a real St. Josaphat as well as the legendary one.

2009
May
27

Don't BSF PORTC on a PIC
Nor PORTA or PORTB...

I was experimenting with a PIC16F690 microcontroller on the PICkit-2 demo board. Following one of the example programs, I set PORTC to output and then did a

   BSF PORTC,0

to turn on the lowest-numbered LED. It worked fine.

Next, I decided to turn on three LEDs, so I changed that line of my program to three lines:

   BSF PORTC,0
   BSF PORTC,1
   BSF PORTC,2

Only the first and third LEDs came on. Why?

Important clue #1: I had no trouble turning on all three LEDs with the instructions

   MOVLW B'00000111'
   MOVWF PORTC

This ruled out incorrect TRISC settings and various kinds of hardware problems.

Important clue #2: The MPLAB simulator also gave anomalous results, but not quite the same as my anomalous results. This puzzled me.

The solution: BSF is a read-modify-write operation. It tells the CPU to read the contents of a memory location, set one of the bits to 1, and write it back into the same location.

And PORTC is a memory location, but not a normal memory location. Since it can be used for output, digital input, and even (on the 'F690) analog input, PORTC has separate circuits for reading and writing. The value you read in is not going to be the same as the value you've output.

And that's why each BSF turned on one bit, but often failed to preserve the bits turned on by previous BSF instructions. Now you know.

2009
May
26

Good news about PIC microcontrollers

I ranted, Jack Ganssle published my rantings, and Microchip, Inc., listened.

The latest MPASM assembler does not use the old .COD file format, so it no longer bumps into the old 62-character path length limit.

There are other good developments. The latest MPASM is easier to use than its predecessors; it steers you toward generating relocatable code (so the "wrong" way of doing things is no longer the default); it comes with a C compiler that looks good; and it supports PICkit-2 as a programming device.

I haven't tested any of this exhaustively, of course. More news soon.

2009
May
25

Next hot issue: interchange fees

The new credit-card legislation, in final form, is now on line here and, in elegantly typeset PDF, here.

I predict that the next hot financial issue will be interchange fees, the 2% to 5% charges that merchants pay in order to process credit-card transactions.

The new law includes a section commissioning a study of interchange fees. Most of us don't realize that the merchants are often required to keep the fees secret and forbidden to charge extra for taking a credit card. Since a retailer's whole profit (not markup, but profit, after all business expenses) is typically something like 4%, those interchange fees can't just be absorbed. Indirectly, they are a substantial part of our cost of living.

Nobody minded interchange fees as long as they could assume that credit cards make people spend more money. But now that all of America is getting on a budget, that assumption no longer holds.

2009
May
24

News from the credit-card battlefront

As often happens, what I'm seeing in the economy is different from what the news media are reporting. Supposedly, before the new laws take effect, credit-card companies are going to raise everybody's interest rates sky-high and lower their credit limits.

Well, out of the blue, Chase has just lowered the interest rates on two credit cards that I use occasionally. They are leaving the credit limits alone.

I have two thoughts about this.

(1) Do I lead a charmed life? Or is it just that I pay my bills? The world seems to be full of people who don't actually make the payments (even minimum payments) on time. Some of these are genuine hardship cases, and some aren't.

I put some of the blame on the lender if they didn't verify ability to pay. But not all of it. Word has gotten out that credit-card issuers will settle unpaid debts for reduced amounts of money, and you should hear the people calling financial radio and TV shows asking how to get out of paying their bills.

(2) If the credit-card issuers actually did what they were threatening last week, they would simply put themselves out of business. Raise all the interest rates? Lower all the credit limits? OK, we'll just go away! That's not actually what they want.

Maybe we're heading into a world where not everybody can get a lot of credit. You need income and evidence of responsible behavior. I remember that world. We lived in it until about 1990, didn't we?

2009
May
23

Translation of the day

Seen in an art supply store, on a bottle of glue...

On one side: Tacky Glue.

On the other side: Colle Inélégante.

That's not what they mean by "tacky," folks!



Sponges for your soldering station

Everything old is new again. Unexpanded cellulose sponges are in the grocery stores again as a special "biodegradable" product.

They are about 3 mm thick when taken out of the package, and they expand to about 12 mm when wet.

In their thin state, they're easy to trim to fit a soldering station, and because they're not plastic, they don't melt onto the hot iron when you wipe it. (They're used damp, of course.) These sponges had become a hard-to-find specialty item. Not any more!



Electrical mystery

My graduate student David Robinson had a spooky experience the other day while trying out some simple circuits on a Radio Shack educational kit (apparently one that is no longer made). He had two circuits on the breadboard at once. One was an LED and resistor. The other one, more complicated, did not concern us:

When he turned the power switch off, the LED continued to glow dimly!

After a while, we figured it out. The power switch on this very low-cost kit does not actually switch all of the batteries out of the circuit. Instead, it switches the ground wire, and then:

When it's turned off, you can have a kind of backflow problem that is ordinarily more familiar to plumbers than electrical engineers!

2009
May
22

Application.DoEvents() considered harmful (2)

In our last exciting episode, we established that, if a Windows Forms application needs to busy-wait, it must do this:

while (some condition)
{
   Application.DoEvents();
   System.Threading.Thread.Sleep(1);
}

in order to handle Windows events while waiting, without tying up the CPU excessively. Also, the programmer must prevent the user from doing things that are incompatible with the background thread, like launching the same computation again.

Today, let me contrast two paradigms of multi-threaded programming. Let me also make it clear that I'm only talking about Windows GUI applications. A console application, with no GUI that needs to remain responsive, can indeed simply launch threads and Thread.Join() them with no further ado, because it's OK for a console application to stand still while waiting.

Suppose you have a button that launches a long computation which you want to do in the background. The two paradigms that I have in mind are the following.

Paradigm 1:

The button's event handler
    disables the button (so it won't be pressed redundantly),
    launches the background process,
    busy-waits until it finishes,
    re-enables the button,
    and exits.

Paradigm 2:

The button's event handler
    disables the button (so it won't be pressed redundantly),
    launches the background process,
    and exits.

The background process:
    runs, and,
    when it finishes, raises an event.

The handler of that event:
    re-enables the button,
    does anything else needed,
    and exits.

In Paradigm 2, Application.DoEvents() is not needed because the window's own event handlers are never blocked from working.

Paradigm 2 corresponds to the BackgroundWorker class in C#. It's entirely event-driven. Further, if the background process needs to report anything to the calling process while it's running, it can raise a ReportProgress event and pass one argument of any type. That's how intermediate output can be written to the screen and progress bars can be updated.

2009
May
21

Olds news

Fans of my vintage 1995 Oldsmobile will be pleased to know that all its quirks were repaired today. The horn switches were replaced (without replacing the air bag); the turn signal reset mechanism was replaced; the air conditioner blower motor was replaced; and a crack in the inside left door panel spontaneously healed itself (by re-engaging a clip that had come loose). Now, somebody please buy a few hundred books to pay for this...



Epochal credit-card legislation passes

The Credit Cardholders' Bill of Rights has passed the Senate, and already the banking industry is whining that they're being deprived of their livelihood.

To which I say, Nonsense! Credit-card issuers collect about 3% on each transaction when it takes place. This ought to be enough to sustain them, even if they never collect any interest or late fees at all. After all, they willingly run the debit-card system, which is interest-free, on much less than 3%.

(Credit expert John Ulzheimer is on TV right now, also saying Nonsense very loudly. His message: If the banks downgrade the credit-card system as much as they are threatening to, the customers will just go away, and then where will they be?)

I'll have more analysis of the legislation later. In the meantime, you can read the text here. (The absolutely final version wasn't there yet, as this is written.)

The other day I had an interesting talk with one of the architects of the nationwide credit-card processing system. (I won't name him because he came by to talk about another confidential project, not financial in nature.) Based on what he hold me, and other sources, here's what I think happened.

The original idea of risk-based pricing was a sound one. There is some combination of interest rate, annual fee, and credit limit that will make it profitable to issue a credit card to anyone. You just have to set them correctly. It's like insurance policies.

This is counterbalanced by a principle of ethics: Some offers are so bad that people will only take them if they've been tricked. No matter how much you believe in a free market, do you really think people understand the 29% universal-default rate when they sign up for a Visa card? It's hidden in fine print, and there are even bank executives who don't know about it.

Back in the 1980s, banks didn't have to worry about ethics because regulators did their worrying for them. Credit-card issuers grumbled about usury laws, which made part of the risk-based pricing system impossible (if you calculated that someone needed a 20% interest rate, you couldn't issue him a credit card at all). They didn't seem to appreciate why the usury laws existed.

All of a sudden, the Supreme Court did away with state regulation of credit cards, and (until today) comparable federal regulation was not put in place. Meanwhile, my impression is that the real brains of the credit-card system had moved on to other things, leaving the whole industry in incompetent hands.

Bizarre things started to happen. Somehow, credit cards were issued without verifying ability to pay. "Penalties" became a major income stream.

Today, regulation is back, and we are being warned that credit cards are going to become harder to get. Some people won't be able to get them at all. Yes — you heard it here, folks — money will no longer be lent to people who can't pay it back. Will wonders never cease?



Application.DoEvents() considered harmful (1)

When I was but a lad of 45, I often used Application.DoEvents() in C# programs to make the program respond immediately to mouse events, keystrokes, etc., which it would otherwise ignore during a long computation.

There are several reasons why this is not a good idea.

(0) It's usually more than you need. If all you want to do is make sure the form updates, see if something like this.Update() or textBox1.Update() will do what you need. Instead of performing the update event, this merely places it in the queue for the event-handling loop to handle, and a well-tested Windows subsystem makes sure it behaves reasonably.

(1) It's CPU-intensive. If you're "busy-waiting" for an asynchronous change of some kind, and you do this:

while (some condition)
{
   Application.DoEvents();
}

the current application thread will go to 100% CPU. At the very least, if you must busy-wait, do this:

while (some condition)
{
   Application.DoEvents();
   System.Threading.Thread.Sleep(1);
}

and the CPU load will be much more reasonable.

(2) It can create re-entrant messes. (See a lucid explanation in JFO's Coding.)

That is, it can allow the user to do things that shouldn't be done while the computation is going on — even close the form!

Suppose you write an event handler for a button click, and it contains a loop that executes Application.DoEvents() repeatedly.

What happens if somebody clicks the button again while the computation from the first click is still going on? If you hadn't monkeyed about with Application.DoEvents(), your button wouldn't be listening for clicks yet, and that's the way you want it.

When you "keep the button responsive" you give it the ability to launch multiple copies of its own event handler.

Or, if the user clicks some other button or closes the form, you could yank something out from under the button event handler that's still running (such as closing a form on which controls are being manipulated).

The moral? "Keeping the window responsive" is a concept that requires thought. You cannot both handle events and not handle them. Normally, if you want to maintain responsiveness, the long computation should be put in a separate thread, which runs asynchronously, and its communication with the main window should be strictly limited. You will want to think clearly about what events in the window are possible and what should be disallowed. I hope to write more about this later.

2009
May
20

Melody gets hold of the new lens

Melody, who takes pictures almost every day at her job, is going to get a lot of use out of the lens I reviewed yesterday. Here are a couple of her pictures:

The first one was handheld for 1/6 second at f/32. The second one is more conventional, 1/100 at f/7.

I'm thinking of buying another lens just like it! Image stabilization has matured — this lens performs better, in published tests, than much more expensive earlier models — and it does more for the usefulness of the camera than anything else I've come across lately.

2009
May
19

"Group f/36"?

What is unusual about these two pictures? They have extreme depth of field. Objects are in focus, at once, at many different distances from the camera. This is achieved by using a very small lens opening, f/36, in imitation of Group f/64.

These were taken with a Canon EOS 40D and my new Canon 18-55 EF-S IS lens, which replaces an earlier 18-55 non-IS lens. Verdict? Image stabilization works. I can take sharp handheld photos with a 1/8-second exposure, which means I can use really small f-stops for depth of field, and catering to that need, the lens goes all the way down to f/36.

Of course, at f/36 there is considerable loss of sharpness from diffraction, but that's the kind of blur that is easy to fix via digital sharpening.

2009
May
18

Cultural indicator of the day

Here's how to make a credit card into a plastic bracelet. The introductory paragraph contains a very apt economic observation: "Credit cards are based on the obsolete premise that in the future you’ll have more money than you have today." Which leads me to think that when inflation comes back, credit cards will, too.

Just three years ago, would it have been chic (or even amusing) to wear cut-up credit cards as jewelry? Of course not. We've had a cultural shift.



Short notes

My book sale has had some items added. Take a look...

If you think you know HTML, try this. W3C will gladly tell you that your web page is full of holes.

No matter how boring I make this blog, people keep reading it. Are you still reading it?

2009
May
17

12-volt vacuum tubes on a breadboard

Enough economics — over to electronics for one day. I've found a fascinating Japanese web site (which I can't read) about circuits with 12-volt vacuum tubes, with pictures of a very handy breadboarding setup. (Index page here.)

It's an interesting circuit — he actually drives a speaker with a 12-volt tube whose plate current is about 2.1 mA. For an output transformer he uses a 100-volt to 3.15-volt power transformer, which would give an impedance ratio of (100/3.15)^2 = 1000, turning an 8-ohm speaker into an 8000-ohm load. He might get 30 milliwatts out of the speaker — I wouldn't expect it to be loud.

For more on 12-volt tubes see Jeff Duntemann's 12-volt tube page, which is where I found the link. Yes, you can build vacuum-tube circuits that run on a single 12-volt supply.

Since breadboards are normally rated for 250 volts, there's no reason you couldn't build conventional 150-volt circuits this way too. More things to do after I retire...

2009
May
16

(Extra)

A question for GM and Chrysler

(Originally asked by Pete Albrecht:) Why do you think you'll sell more cars with fewer dealers? Those "deadwood" dealers weren't selling negative numbers of cars, were they?



How a foolish mortgage happened

Read this. As Shakespeare put it, "We may pity, though not pardon thee."

2009
May
16

Open letter to a personal-finance pundit

Dear D---:

You advise people not to borrow money for business ventures or personal purposes.

You tell people to keep their money in money market accounts, savings accounts, and interest-bearing checking accounts.

To whom are the banks supposed to lend this money in order to get the interest that they pay you?

— Michael

2009
May
15

Inflation: Get ready for misleading headlines

Today, your local newspaper is probably reporting both that prices are up and that they're sharply down. To make sense of the confusion, I grabbed a couple of graphs from the Bureau of Labor Statistics.

Here is the seasonally adjusted Consumer Price Index (CPI) since the beginning of 2006:

Note that this is seasonally adjusted and won't agree with the unadjusted raw numbers that you see in the newspaper.

Looking at the graph, what do you see? A huge gasoline price spike last summer. If you leave out food and energy prices, which are volatile, you get this:

Mr. Bernanke's target is for the CPI to rise about 2.5% per year, i.e., about 5 points per year on this scale. And that's what it's doing.

Looking back at the first graph, for the next several months, the news media are going to be reporting an "unprecedented year-over-year drop" in the CPU. That's only because there was an unprecedented spike last summer. We are not in a deflationary spiral just because gasoline is no longer $4 a gallon. In fact, most of us are glad gasoline is no longer $4 a gallon.

Whether the CPI is a fair measure of the price level is another issue. Some claim that, due to changes in methodology made more than a decade ago, it reads low; the real price level increases more than the CPI does. (One issue is whether to track the price of houses. I think the current practice of leaving them out is correct, since houses are investments, not consumables.) Others, including Mr. Bernanke, claim the CPI reads high because people change their purchasing habits very quickly to select goods whose prices are not rising; thus, compared to 1960, we spend more on stereos and less on shoes.

2009
May
14

Very short notes

It turns out my Oldsmobile's horn system can be repaired more cheaply than I thought. In a week I will again have a fully functional car rather than a kluge.

CNN remarks on "weisure," the blending of work and leisure, which I interpret as the end of the arbitrary, sharp split between home and workplace that was introduced by the Industrial Revolution. Farmers have always had their work and their leisure in more or less the same place. So did craftsmen who didn't get swept up into factory work.

2009
May
13

Ending the vogue of arrogant atheism

One of the reasons I believe in God is that, without the concept of a supreme being, the world would be an infinite number of unfathomable mysteries, and there would be no reason to suppose my thoughts make any sense (not even my speculations about the nonexistence of God). This is an old thought, familiar to Augustine and Aquinas, but in modern times lots of people have felt forbidden to think it. Even people who are far from Christian theology and merely want to believe in a divine First Cause.

Enter, now, an excellent review by Stanley Fish of an apparently good book by Terry Eagleton which I haven't read. Some choice quotes from the review:

The fact that science, liberal rationalism and economic calculation can not ask — never mind answer — such questions [about ultimate value and origins] should not be held against them, for that is not what they do.

And, conversely, the fact that religion and theology cannot provide a technology for explaining how the material world works should not be held against them, either, for that is not what they do. When Christopher Hitchens declares that given the emergence of "the telescope and the microscope" religion "no longer offers an explanation of anything important," Eagleton replies, "But Christianity was never meant to be an explanation of anything in the first place. It's rather like saying that thanks to the electric toaster we can forget about Chekhov."

Of course, the very existence of science derives from the notion of a Creator. Here is another good Eagleton quote (pointed out by my colleague Nathan Gilmour) that didn't make it into Fish's review:

Because there is no necessity about the cosmos, we cannot deduce the laws which govern it from a priori principles, but need instead to look at how it actually works. This is the task of science. There is thus a curious connection between the doctrine of creation out of nothing and the career of Richard Dawkins. Without God, Dawkins would be out of a job. It is thus particularly churlish of him to call the existence of his employer into question.

And Fish's last lines, about Eagleton's expression of frustration, really resonate with me:

[Eagleton] is angry, I think, at having to expend so much mental and emotional energy refuting the shallow arguments of school-yard atheists like Hitchens and Dawkins. I know just how he feels.

So do I. Dawkins and Hitchens demand our attention by opposing freedom of religion. If they weren't out to reduce my freedom, I'd ignore them.

2009
May
12

Is it monopolistic to bundle Internet Explorer?

I'm against monopolies, in general. Microsoft shouldn't be allowed to do anything unfair to suppress Apple or Linux. But I don't understand why the Justice Department feels they shouldn't be allowed to bundle Internet Explorer with Windows.

Greg Mankiw argues cogently as follows:

Is it bad for consumers when a company bundles products together? My father bought a primitive car air conditioner and installed it himself in our 1962 Buick. Now, cars and air conditioners are routinely sold together — and consumers are better served. A three-piece suit, a ham-and-cheese sandwich, and a semester at Harvard are all made of components that could be sold separately. Not even the most zealous Justice Department lawyer would try to break up these products.

When a company (Microsoft) has a monopoly over a valuable product (Windows), it appears to have consumers over a barrel, forcing them to buy something they don't want. But why would it? A monopolist does not gain by bundling its valuable good with an undesirable one. The best way for a monopolist to profit is to provide precisely the product that consumers want...

Read the rest. I think part of what is going on in their muddled heads is that they think Microsoft is forcing people to buy Internet Explorer and pay extra for it. Not at all. They're not even forcing people to use it. I got IE8 free from Microsoft and am using Firefox anyhow.

2009
May
11

Summer? What summer?

This year I am, thank goodness, not "out for the summer." As commonly happens when I have a research grant, I'm full-time with the University all summer long. And in fact we're quite busy right now, so please pardon my lack of responses to e-mail.

But, for the first time in several months, I am in a position to take new consulting jobs, at least if they're not too big. I'm allowed to consult up to a total of 8 hours a week while working full-time for UGA.



It's UGA, not UGa, sadly...

I'm a bit sad to find that the University's official style manual says University of Georgia is abbreviated UGA, not UGa. One of the main reasons, I suspect, is that Microsoft Word's spelling checker won't let you type UGa.

Of course, U.Ga. clearly stands for "University of Georgia." Without punctuation, this is UGa, and without lowercase letters, UGA.

But please don't call it U.G.A. — "University of Georgia A...what?"

The name of the university is not "University of Georgia at Athens" as some people think. There is no University of Georgia anywhere else. Although we do have some extension sites, we do not have complete universities under the same name in other towns. The other University System institutions have their own names, such as Valdosta State University, not like the University of California at Berkeley, Los Angeles, San Diego, or what have you.

2009
May
10

About that graduation photo...

Modern DSLR lenses, even low-end ones, are sharp. This is part of the same picture I posted yesterday (the full-resolution version of it, of course, not the downsampled image that I put on the Web). Canon 40D camera body, low-end Canon 18-55mm (USM) zoom lens, exposure 1/200 second at f/10, ISO 800, zoomed to 39 mm. No tripod, of course. Standard Photoshop editing was done, including contrast adjustments to the face area and the diploma and sharpening of the diploma.

We could never have done this with Tri-X Pan. Nowadays, a DSLR sensor is sharper than most lenses. Back in the film era, almost all lenses were sharper than the film.

2009
May
9

Sharon Covington, Associate of Arts

Sharon is the first of her generation to get a college degree. (Cathy is farther along with her studies, but the University of Georgia does not give a diploma after just two years.) Several more college degrees are coming in rapid succession in the next few years.

2009
May
8

I'm on YouTube...?

I've just been told that a short snippet of one of my recent speeches is on YouTube. It's only 37 seconds extracted from this. Most of the speech makes more sense than that...

I didn't know I was being recorded.

2009
May
6-7

Busy

The Daily Notebook will resume in a couple of days. We have a lot going on, including Sharon's upcoming graduation from Emory-at-Oxford with an associate's degree (two-year degree, half of a B.A.). Since this is only the first half, Cathy is wishing her "Hap Gradu".



My networks

I now belong to LinkedIn, FiledBy, and Facebook and will be glad to accept network requests ("friend requests") from friends and correspondents. (Especially long-lost old friends — I'd be glad to hear from you!)

2009
May
5

Una pregunta...

If I write "Cinco de Mayo" at the top of today's shopping list, will I wind up with 5 jars of mayonnaise?

2009
May
4

Will Obama's science funding backfire?

President Obama is rapidly beefing up federal spending on scientific research. As a scientist, I stand to benefit directly from this, so I should be in favor of it. And indeed I'm in favor of basic research. But think about what might go wrong.

As one of Obama's own economic advisors has pointed out, the supply of scientists is inelastic — it can't grow or shrink rapidly. So the most immediate effect will be higher pay for the scientists who are already there. (Good for me!) Numerous university professors will get to work 12 instead of 9 months per year.

The second effect is that in five or ten years, there will be plenty more scientists. That's how long it takes to recruit bright students into Ph.D. programs and educate them. As they come onto the job market, the initial boom will be over and salaries will moderate.

Third, in ten or fifteen years, funding will be cut back again — politics being what it is, we won't keep up extraordinary funding levels forever — and then scientists' careers will be sacrificed to downsizing.

And the worst thing about it is, nobody will see it as downsizing. Most research scientists aren't federal employees and don't have civil service jobs. They work for universities, where competition for tenure is ruthless. Their employers will say that some scientists are being let go because they are "not as productive" as their colleagues — productive meaning successful and/or lucky at bringing in grant money.

I've seen this happen before as research funding fluctuated through the 1970s, 1980s, and 1990s. Particularly in the biological sciences, there are platoons of Ph.D.'s whose entire careers are contingent on grant money — meaning they could be wiped out by a sudden shift in the political wind. This is much worse than depending on a fluctuating business market whose fluctuations can be foreseen. The Congressman from Podunk doesn't care about giving you a soft landing when he and his colleagues decide that they don't understand your research, so it ought not to be funded.

All my own recent research grants have been from industry, not government, so I've been somewhat insulated from this. I'm glad I'm not a newly minted biomedical Ph.D. who needs 30 continuous years of NIH grants from now until retirement!



Did banks eat our scientists and engineers?

I can confirm at first hand (if only anecdotally) President Obama's observation that the overgrowth of the financial sector drew too many Americans away from professions such as science and engineering. When I was at Yale, it seemed that every mathematically inclined undergraduate wanted to be an "investment banker," whatever that was (only the cognoscenti had heard of it).

By the mid-1980s, I was at UGA and it seemed that everybody wanted to major in "business" (except for the thousand or so who wanted "computer science" until they found out it wasn't just word processing and spreadsheets). Business-school students printed a T-shirt showing a BMW in front of their college. Salve lucrum...

The notion became current that financiers are glamorous and drive BMWs, but engineers and scientists (and even real economists) are dorks who wear crooked ties like Dilbert. And behind it was the notion that real work should be done in Japan and India — we Americans would just manage and finance it. Weren't the British saying such things just before they lost their prominence in the world economy?

To this day, plenty of people maintain that the state of Georgia needs hundreds of colleges offering degrees in "business," but that the two engineering schools that we had in 1885 are still enough.



The emergency prosthetic horn button

My 1995 Oldsmobile is now officially a jalopy — it has had an improvised repair.

The horn switch failed and the horn started honking spontaneously as I drove along. I yanked a fuse and took the car to Car Craft, where Bob Richards, the mechanic I've known and trusted for 20 years, advised that a full repair would cost $800 because it involves an air bag module. [He continued digging for information and later found out that this is not the case.] Instead, Bob cut a wire and left it to me to install my own horn button.

So I got a marine-type horn button, spray-painted it to match the dashboard, contact-cemented it to the top of the dashboard (no screws — I want to be able to undo this later), and (on Saturday afternoon) finally completed the wiring. If the engine and transmission continue to hold up well, I'll probably have a fully authentic repair done in a year or two.

2009
May
3

Short notes, mostly economic

Not one of you wrote in to tell me that, when initially uploaded, yesterday's entry was dated May 10 instead of May 2. Fixed now...

I see definite signs of the recession ending, or at least bottoming. Go to your favorite stock market site and compare the S&P 500 with the Volatility Index (.VIX). (Note to people reading this in the future: When you click there, you'll get a current chart, not necessarily the chart for the day this was written.)

Declining volatility, not just rising stock prices, is what convinces me things are returning to normal. (We could also think about the volatility of the volatility...) Then there's improving consumer sentiment, and no deflation if you don't count food and energy, i.e., mostly gasoline.

The New York Times has an interesting think piece about the efforts to rescue Chrysler Corporation. It's a strange episode no matter how you view it. But the most interesting observation? "This may come to be seen as Mr. Obama’s 'Nixon in China' moment. Just as it took a conservative Republican to open relations with the largest Communist country in the world, it took a liberal Democrat to break the U.A.W." (Thanks to Pete Albrecht for the link.)

In other financial news, the interest rate on Series I Savings Bonds has dropped to zero. That's because the inflation rate has gone negative (about -5% annualized for the past six months, due to falling gasoline prices). The bonds pay a fixed rate (fixed for life, depending on when you bought them) plus the inflation rate, and the sum of the two is guaranteed never to go below zero. No matter; I'm going to hang onto my bonds and wait for the inflation that's coming. Because I bonds are linked to the non-seasonally adjusted CPI, we tend to have alternating half-years of high and low rates.

Much-needed credit-card regulation is marching toward enactment, but it won't cover "business" credit cards. Sole proprietors should continue using personal credit cards for business expenses.

Finally, read about how John D. Rockefeller saved the whales (by making kerosene cheap enough to kill off the market for whale oil for lamps). Scroll to the middle of the page, which is about other good deeds inadvertently done by "evil" 19th-century capitalists.

Bottom line? In a market economy, you can't get rich unless you offer people something better than what they already have. It may not be as good as they later wish, but it has to be better than what they already have, or they won't take it. This is related to Doug Downing's observation about sweatshops: If people work in them voluntarily, it's because the alternatives are even worse, and what we need to do is open up more opportunities rather than forcibly close the sweatshops.

2009
May
2

Yet another book

Authorship is coming fast and furious this year — here's my third new book, and the only intentional one. (The first two were, respectively, an unexpected reprint of an older book and a Spanish translation of a recent one.)

This one is a milestone because Cathy is on the title page as an author (along with Doug Downing, who originated the project; myself; Melody; and "with the assistance of" Sharon).

Get 'em while they're hot!



The truth about comments in HTML

[Updated twice.]

As programming languages go, HTML is not only weirder than we imagine, it is weirder than we can imagine. Much of the weirdness is concealed by the fact that web browsers routinely ignore what they don't understand, without giving error messages, so you can write very bad code and not know it, especially if you test with only one browser.

Last night I ran into a discrepancy between the way Firefox and Internet Explorer handled a commented-out section of a web page. And that led me to open Pandora's box.

We all know, or think we know, that HTML comments begin with "<!--" and end with "-->".

That is a dangerous half-truth. The true (and strange) definition is that a comment begins with "<!", contains zero or more comments delimited by "--" "--", and ends with ">". At least according to one source. I know from direct experience that not everyone understands it exactly that way.

There is method to their madness. The idea is to allow you to put comments into declarations like this:

<!DOCTYPE blah blah --comment-- blah --comment-- blah >

but you probably can't trust web browsers to interpret such things correctly.

The bottom line? A comment should never contain "--" for any purpose other than marking its beginning or end. This is slightly annoying. Not only can you not comment out a comment, you can't comment out anything containing two hyphens in a row. Nor should you ever end a comment with "--->" or anything else containing superfluous hyphens.

I'm told that in HTML 5.0, sanity will prevail, and comments will simply begin and end with "<!--" and end with "-->" the way we always thought they did.

2009
May
1

The best way to center a web page

Thanks to several people in the newsgroup comp.infosystems.www.authoring.html, I've come up with the best way to adapt web pages to screens of variable size. What you do is set a maximum width, so the lines won't get too long on a wide screen, but let the text rewrap to a narrower width (insofar as the content allows it) when the screen is very small.

I've implemented this in the Daily Notebook, starting today, and you'll notice lots of small changes in layout. You may have problems if you are using a browser older than Internet Explorer 7 or Firefox 3, but such is the price of progress.

To do the trick, follow roughly this schema, which shows the important parts in boldface:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Title goes here</title>
</head>
<body style="max-width:800px; margin:0 auto 0 auto; padding:10px">
...body of your web page here...
</body>
</html>

The DOCTYPE declaration is important in order to get all web browsers to act alike; it declares that you're using HTML 4.01. The max-width style attribute is not recognized by some older browsers.

Declaring padding:10px is optional but guarantees at least 10 pixels of margin no matter how small the screen is.

In the Daily Notebook, paragraphs (HTML code p) also have a max-width rather than a width, so under some conditions they can rewrap independently of what is around them. If anybody is reading the Daily Notebook on a cell phone, this should help.



Short notes

You will gather that the Daily Notebook is now much closer to conformity to HTML 4.01, although it isn't perfect because I see no reason to rewrite code that works well.

I would like to hear from anyone who is using an ImagingSource (DFK, DMK, etc.) color video camera for planetary imaging. How much of a step up is it from a modified ToUCam?

Econ-observation of the day: I think I picked up whiffs of the real-estate bubble starting to burst back in 2005, and indeed even earlier, when people were getting (as Jeff would say) "twitchy" about property values. In our own neighborhood there was a move to regulate the mailboxes "to improve property values." Given that hardly any houses were for sale at the time, what was the point? Trying to make reality keep up with imagination?

- -
- - - - -
If what you are looking for is not here, please look at previous months.