Shouting Into the Void

Site menu:

Categories


Archives

Links:

Meta

Parsing Expression Grammars and Left Recursion

Parsing Expression Grammars are a form of context-free grammars with ordered choice. This reduces ambiguity in the grammar and makes writing simple recursive-descent parsers (and parser generators) quite easy. With memoization, you can parse in linear time. The resulting parser is called a Packrat Parser.

The only problem is handling left-recursion. If you have grammar rules like this:

Expression = Expression "+" Term
           | Term

your recursive-descent parser will recurse until it runs out of stack.

I just noticed a paper on detecting and handling left-recursion: Packrat Parsers can Handle Left Recursion. It’s a nifty technique, but it somewhat reduces the simplicity of the resulting program.

For a finger exercise a while ago I wrote a pretty basic packrat parser generator and used it to implement a C preprocessor. Source is here. When my supply of circular tuits increases I’ll have to look at implementing the stuff from the paper.

Apostasy

Reading sites like Climate Audit and Niche Modeling is a great eye-opener if you want to know where the data comes from that supports the current apocalyptic frenzy around the subject of global warming.

Suffice it to repeat the old saw about “lies, damn lies, and statistics”. The only overall temperature measurements we have are from satellites, and only since 1979. They show that the last ten years have actually seen a cooling trend. Land-based temperature measurements, which go back a hundred years or so, are extremely hard to interpret, due to the fact that most temperature stations are in urban areas, which tend to be hotter than rural areas. Data before a couple hundred years ago is indirect, based on things like ice cores and tree rings. In order to get a reliable picture from that kind of data, you need to make all kinds of initial assumptions about how the data should be interpreted. Then you run the data through an extremely convoluted statistical program. When the tree-ring and ice core data is run through Hanson’s famous program, you get the infamous “hockey stick” graph that shows rapidly rising temperatures for the forseeable future.

The funny thing is, you can run completely random noise through Hanson’s program and it will still output a hockey stick graph.

Anyway, don’t take my word for it:

I am the rocket scientist who wrote the carbon accounting model (FullCAM) that measures Australia’s compliance with the Kyoto Protocol, in the land use change and forestry sector.

FullCAM models carbon flows in plants, mulch, debris, soils and agricultural products, using inputs such as climate data, plant physiology and satellite data. I’ve been following the global warming debate closely for years.

When I started that job in 1999 the evidence that carbon emissions caused global warming seemed pretty good: CO2 is a greenhouse gas, the old ice core data, no other suspects.

The evidence was not conclusive, but why wait until we were certain when it appeared we needed to act quickly? Soon government and the scientific community were working together and lots of science research jobs were created. We scientists had political support, the ear of government, big budgets, and we felt fairly important and useful (well, I did anyway). It was great. We were working to save the planet.

But since 1999 new evidence has seriously weakened the case that carbon emissions are the main cause of global warming, and by 2007 the evidence was pretty conclusive that carbon played only a minor role and was not the main cause of the recent global warming. As Lord Keynes famously said, “When the facts change, I change my mind. What do you do, sir?”

There is no doubt that some parts of the world have been warmer in recent years than in the last century or so. But there is very little reason to believe that those warm spots are part of a global trend, or that they will keep warming. Even in the past thousand years, parts of the world have been much warmer than they are now — the Arctic in the middle ages — and colder — England only 200 years ago.

Ooh, the drama

So I thought that my life for the next month would be all work.

I was walking home last night in the gloaming, when I heard someone crying out. I looked up from the rather silly Australian thriller I was reading. An elderly lady had fallen down and gone boom. I walked over to see blood everywhere from a superfical cut in the lady’s forehead, but there didn’t seem to be any major issues. Another passerby got there just before me and called 911, so I stood around trying to look supportive. Then I managed the demanding and probably superfluous job of flagging down the ambulance that arrived quite quickly.

Nothing to See Here

So it’s been over a month since my last confession. Nothing much to report here. Work is busy, with mandatory overtime as we are theoretically in the last month of a project. I’ll believe that when I see it, since the second-to-last project I worked on went six months over — due to a different company deciding it needed more time, not the company I work for.

Andrea & I have had our condo on the market for over a month as well, but the market seems to have slowed right now.

Back to bug-hunting.

Fire. Them. All.

The Canadian “Human Rights” Commission has now, in addition to “tampering with evidence, tampering with court transcripts, lying under oath, hacking into a private citizen’s Internet account and publishing vicious hate messages themselves,” sent a private investigator to harrass Ezra Levant’s elderly parents:

Vigna [an employee of the CHRC who is under investigation by the Law Society of Upper Canada for disrupting a trial by claiming he was not in a serene state of mind] has been sending a private investigator to my parents’ house again and again, demanding to see me. My parents, who are far more polite than I am, keep telling Vigna’s hired tough guy that I don’t live there anymore. I did when I was a teenager. But that was in 1990.

The last time Vigna’s hired muscle came to my parents’ house, he refused to leave. My parents said he had a Bluetooth phone device in his ear, and seemed to be taking instructions from someone — Vigna himself? — who told him not to go until he had found me. In the end, Vigna’s enforcer must have lost his serenity, too, because he threw some papers down at my parents feet, and stormed off.

Classy.

Doctors as Motivational Speakers

“The more you relax, the less this is going to hurt.”

Periapsis

It occurs to me that I never posted about putting my spaceflight simulator project up on SourceForge. I’ve been much too busy lately to work on it, so it’s up there for anyone to play with.

screenshot

There’s a list of tasks needed to get it to an alpha state in the tracker.

Inconvenient Questions

There’s been a bit of a buzz lately over seasteading, a libertarian project to develop practical floating habitats for people who want to form their own mini-governments in international waters.

The guiding principle is “dynamic geography” — the idea that if people don’t like their government, they can move to a different one. People can try out various different kinds of governments and social systems, to see what works for them.

I think that’s a really cool idea.

But am I the only one to see the huge glaring problem with the details of this particular implementation? How are people supposed to exercise their freedom of choice of government when they’re STUCK ON A FLOATING PLATFORM IN THE MIDDLE OF THE OCEAN?

Musical DNA

Kent sends a link to a recording by our illustrious ancestor Johann Nikolaus Tischer, who was included in Leopold Mozart’s curriculum for his moderately famous offspring.

A Pet Peeve

Something that gets me steaming is the current fashion opposing the vaccination of children. Some perspective:

Even if the myth [that vaccines cause autism] were true, not vaccinating your children would be a poor solution.

It has been such a long time since we’ve had to deal with polio and smallpox, that people have forgotten just how scary they were. In 1952, at the height of the polio epidemics, around 14 out of 100,000 of every Americans had paralytic polio. 300-500 million people died of smallpox in the 20th century. Add in hepatitis A, hepatitis B, mumps, measles, rubella, diptheria, pertussis, tetanus, HiB, chicken pox, rotavirus, meningococcal disease, pneumonia and the flu, and no wonder experts estimate that “fully vaccinating all U. S. children born in a given year from birth to adolescence saves an estimated 33,000 lives and prevents an estimated 14 million infections.”

There may indeed be dangers with vaccinations. But the dangers of not vaccinating far, far outweigh them.