November 17th, 2008
I had an idea for a game. It’s a memory game, the idea is to flash a molecule on the screen for a few seconds in the left hand window, then in the window to right the player builds the molecule. That’s basically the game. The player learns to recognize interesting chemicals, learns to break down larger molecules into functional groups as a way of remembering them, and perhaps learns what they are.
As the molecule fades it would be replaced with a picture that goes with the molecule–oranges for citric acid, as a memory aid or a clue for the chemically astute player.
The game could be made easier by having the molecule fade out slowly, or flashing on periodically, or visible through a port.
I don’t really want to write a molecule editor myself, that would take a lot of time and also it turns out to have been done by chemist/programmers many times. Yeah! Some very good molecular editors are out there. I was particularly impressed with Molinspiration WebME editor. Two problems though, it’s 2D and not open source.
Looking further, I found BKchem and molsKetch both of which look good and are GPL licensed but are 2D. Jamberoo is Java based but the molecule editing worked too slowly for a game.
Avogadro is 3D, is GPL licensed so the source code is available, and works on Linux/OSX/Win. It looks good and works well, so I think it would make a good starting point for a game.
Vitamin C in Avogadro:

Posted in Books, Estimation | No Comments »
November 5th, 2008
The national popular vote shifted +8% for the Democratic candidate compared to 2004 but some counties voted more Republican. I think we are seeing the most racist regions of the country, running in a belt across the Southern and Appalachian states. This map likely minimizes the extent of the belt, as in southern state counties with large black populations there was a high black turnout and Obama got a higher percent of the black vote.

(image from http://nytimes.com/)
On the other side of the coin is Indiana which swung +21% in Obama’s favor–the biggest surprise of the election this year. It looks like Indiana is finally giving up its claim to be the northern-most Southern state and is rejoining the Midwest.
Posted in politics | No Comments »
October 26th, 2008
On 60 Minutes today, Andy Rooney talked about unemployment. Mr. Rooney heard that 10 million Americans are unemployed. Andy refuses to believe this–I guess his friends’ kids are working and his powers of observation don’t extend any further than that. He’s the Inspector Clouseau of commentary.
If many people *are* unemployed, Mr. Rooney knows why–people these days won’t work hard. Why, he worked in a paper mill (for a few months when in college) for $0.45/hour. Convert that from 1939 dollars to 2008 dollars and we have $7.08/hr, higher than today’s minimum wage of $6.55/hr. Of course today’s workers have more taken out for Social Security and Medicaid. In 1939 there was no Medicaid and the SS tax was 2% while today they are 15.3% combined, so today’s single worker takes home $5.97. Mr. Rooney’s short term college job is looking pretty good.
Andy Rooney is as out of touch as John McCain, who said in the Republican primary that American workers won’t take jobs picking lettuce for $50/hour, a whole collection of wrong ideas.
Posted in Journalism, politics | No Comments »
October 14th, 2008
Pepper spray has been around for years now, but there is not commonly available antidote. And we know how the active ingredient, capsaicin acts to active, or hold open, the ion channels that transduce pain signals. In fact, a quick Google shows that capsaicin binds and activates a receptor called the vanilloid receptor subtype 1 (VR1), a member of a group of related receptors called TRP ion channels that are activated by temperature changes.

Capsaicin chemical structure (from Wikipedia)
So an antidote would be an inhibitor of the VR1 receptor, and such a thing should be easy to find, or create, and in fact another Google shows that several have been created. Capsazepine was the first inhibitor discovered, way back in 1994. Activators and inhibitors of this receptor have many potential uses as analgesics and anti-inflammation compounds so there is a lot of research interest. See also, Discovery and development of TRPV1 antagonists.

Capsaicin inhibitor capsazepine (from Wikipedia)
A spray containing one of these inhibitors should be an effective antidote for pepper spray. But surprisingly no such inhibitor is available! The small quantities of purified inhibitors are available in small quantities for research purposes (i.e. capsazepine, 50mg for $455 but I can’t find anyone who has made an antidote preparation. This should be safe and fairly easy. Safe, because it would be applied mainly externally, and because pepper spray is itself fairly safe–aside from the pain and shock it is used to cause. It doesn’t have other, non-specific side effects. And relatively easy to make because the literature describes the synthesis of inhibitors from capsaicin itself. So the starting product used to make an inhibitor can be capsaicin, and capsaicin is readily available in large quantities!
Update:
Wikipedia: Discovery and development of TRPV1 antagonists
A synthesis:
The easiest antagonist to make may be norcapsaicin or nornorcapsaicin, basically capsaicin with a shorter alkane tail. Is is not a great competitive antagonist, but should compete with capsaicin to bind TRPV1.
Norcapsaicin be synthesized from vanillylamine and trans-7-Methyl-5-octenoic acid by reaction with thionyl chloride (SOCl2) to give norcapsaicin. Vanillylamine can be generated by reaction of capsaicin with lipase B from vanillylamine and trans-7-Methyl-5-octenoic acid by reaction with thionyl chloride (SOCl2) to give norcapsaicin. Vanillylamine can be generated by reaction of capsaicin with lipase B from Candida antarctica (ref). Trans-7-Methyl-5-octenoic acid can be synthesized from isobutyraldehye (500 ml, $32) in a 3-step reaction:
“Allylic alcohol 2A was produced by treatment of isobutyraldehyde IA with vinyl magesium bromide at room temperature in 73% yield, and was subsequently subjected to the orthoester Claisen rearrangement by heating with triethyl orthoacetate in the presence of a catalytic amount of propionic acid at 138 °C for 3h. (E)-6-Methyl-4-heptenoate 3A, a common precursor of capsaicinoids (C-8 – C-13), was thus obtained exclusively (E/Z> 100 by a capillary GLC analysis) in the 73% isolated yield… Alkaline hydrolysis of ester 3A gave acid 8Aa in 89% yield” (ref).
Posted in Books, ideas, politics, pseudoscience, Sci general, Science | No Comments »
October 11th, 2008
I ran across a remarkable paper, “The Camel has two Humps”. Incoming Introduction to Programming students all *want* to learn to program, but about half the class never gets the hang of it and never will. The authors found a test that identifies the students that can learn to program.
The authors’ pretest asks questions about variable assignment: a=10, b=20, a=b. There is a typical meaning for these assignments in programming languages but the incoming students may not know them. So the authors classify the type of logic required to reach different answers and whether the students use the same logic for each question or switch around on different questions. Students who come up with consistent answers for different questions are the students who can learn to program.
Here’s a key figure:

This is remarkable, a way to candle incoming CS students and figure out (mostly) which ones can learn to program.
One notable thing that further research can answer is about the oddballs. The 2-3% of initially inconsistent testers that *do* learn to program–what sort of programmers are they? Do they end up writing different programs than the typical programmer?
Posted in Computers, General | No Comments »
August 24th, 2008
I saw the Wordle site for making word clouds and was really impressed. I had a few ideas for doing things differently–showing phrases instead of individual words for example. So I wrote my own version.

It displays phrases, words, or combinations of words and phrases. Text size indicates the relative frequency of different words. The output is a PDF file.

The algorithm used to arrange the words places them randomly on open spaces in the image. Horizontal and vertical placements alternate. There is a bias toward placements towards the center of the image. This helps keep the cloud together. Words difficult to place are shrunk up to 10%. The Postscript font metrics are used to find the exact size of each letter. The allows close word placement.

Here it is: freq_8-08.zip
System requirements: OS X or Linux.
Posted in Software | No Comments »
June 24th, 2008
I find it fascinating that things part of common knowledge today were discovered relatively recently. Here is something not known in the 1860s, from Darwin’s Origin of the Species, p 29-30:
I do not believe, as we shall presently see, that all our dogs have descended from any one wild species; but, in the case of some other domestic races, there is presumptive, or even strong, evidence in favour of this view.
…
The whole subject must, I think, remain vague; nevertheless, I may, without here entering on any details, state that, from geographical and other considerations, I think it highly probable that our domestic dogs have descended from several wild species.
We now know that all dog breeds are descended from wolves through a domestication event or several closely spaced domestication events about 100,000 years ago. This explains why dogs are found with aboriginal human groups throughout the world.
This is from a section describing how in most domesticated animals have many breeds or varieties yet are descended from a single wild species. In the 1860s, the the evidence pointed to more than one wild ancestor for dogs.
Posted in Books | No Comments »
June 16th, 2008
I was thinking about Godel, Escher, Bach – An Eternal Golden Braid because I started up my ant farm. It’s an incredible book, a work of genius that blew my mind when I read it in HS. Turns out Douglas Hofstadter, the author, has a new book out that is described as covering similar ground titled I Am a Strange Loop. So I wanted to reread GEB. I looked around and checked my book list, but no GEB. I’ve really got to pick up a copy!
Posted in Books | No Comments »
June 9th, 2008
Catholic church announcement:

Posted in funny | No Comments »
June 7th, 2008
Ah, health nuttery, a spice that can be added to anything. I’ve heard it many times, that alternative medicine and quack cures have a collection of ideas (all bonkers) that often get combined together. You see all sorts of combinations. Qi magnets, detoxifying magnets, Qi detoxification. Most of these terms mean so little that they can be combined randomly to make a novel-sounding new types of alt. med.
It’s really just like advertising, where there is a pool of non-specific positive adjectives that are slapped on a product to jazz it up. Pick any two or three: new, brighter, improved, best, free, breakthrough, exciting.
That’s all background for describing something that made me bust a gut. Bear Grylls, star of the Man vs. Wild survival show, had caught and gutted a fish. As he often does, he starts chomping on it raw. Then he says it’s high in protein, gives you energy, and helps boost the immune system. Yes, boosts the immune system! One of the universal alt med claims! If you are stranded in the wilderness without shelter, fire, food, or water, ‘Does this boost my immune system?’ is not on your list of priorities. Bear didn’t think through his food options, and think, I could eat a caterpillar, but a fish will boost my immune system more, so I’ll try and catch a fish. No, the choice was a raw fish or nothing, and it is literally true that a fish, being food, would be better for the immune system than not eating for the day. Trivially true, but really, really funny!
Posted in pseudoscience | No Comments »