Thursday, July 31, 2008

Total solar eclipse


The exploratorium in San Francisco, my favorite museum as a child, is
webcasting the total solar eclipse from China tomorrow. Check it out! More info at Wikipedia:

It's happening from 8-12 UTC. Here in PA we're at UTC-5, but because of daylight savings it's UTC-4, so PA folks can watch from
4-8 AM.

Tuesday, July 22, 2008

Knitro

I've been using a nice nonlinear optimizer called Knitro. It's not free, but has
a free student license. This note regards installing Knitro. You first fill out a form
and get a license. You are suppose to put the license in a file so that the
executable can see that you have permission. I followed all the instructions, but
I kept getting the following error:

### Could not find a valid license.
Your machine ID is 93-04-3c-a2-d3.
Please contact info@ziena.com to obtain a license.
Go to http://ziena.com/trial.html for a KNITRO student version license.
Failed to find a Ziena license.

If you get this, make sure you have no spaces after the license key. Once
I removed the spaces it worked.

Monday, July 21, 2008

Random fact: flammible flour

From wikipedia:

Flour dust suspended in air is explosive, as is any mixture of a finely powdered flammable substance with air,[1] see Lycopodium. In medieval flour mills, candles, lamps, or other sources of fire were forbidden. Some devastating and fatal explosions have occurred at flour mills, including an explosion in 1878 at the Washburn "A" Mill in Minneapolis, the largest flour mill in the United States at the time.[2]

Random fact: flammible flour

From wikipedia:

Flour dust suspended in air is explosive, as is any mixture of a finely powdered flammable substance with air,[1] see Lycopodium. In medieval flour mills, candles, lamps, or other sources of fire were forbidden. Some devastating and fatal explosions have occurred at flour mills, including an explosion in 1878 at the Washburn "A" Mill in Minneapolis, the largest flour mill in the United States at the time.[2]

Wednesday, July 09, 2008

Fireflys in Pittsburgh

The best place to see fireflys in Pittsburgh is in Frick
Park at 9:15 PM. They are only very active for about
30 minutes, but if you catch it it's an incredible thing
to see. The best place is in one of the canopies that
are very dark at 9:15 because of the tree cover.

Sunday, July 06, 2008

poison ivy

I have a bad habit. When I walk through a place with lots of bushes and trees, I'll absentmindedly
tear a leaf off a tree or bush and tear it up slowly while I'm walking.
I don't like that I do it, because it seems rather destructive. I just
don't think about it much.

In CA, we have poison oak. In the summer it looks like this:
I'm very careful not to touch it, as I'm quite allergic. I had it
bad once in 7th grade, and I've been very careful since.

In Pittsburgh, they don't have poison oak. They have poison ivy. I didn't know
what it looks like until this week, when I started getting rashes
on my wrists, neck and back. For those of you who are moving from CA to the east, this is what poison ivy looks like:
It's really not a good idea to pick these leaves and tear them
to little pieces. Take it from me.

It's actually fascinating how it works. The oil from the leaves somehow modifies the proteins of the skin cells into which it comes in contact. The proteins it modifies are responsible for notifying your immune system that the cell is indeed part of your body, and
is not a foreign object. Once the oil manipulates the protein, your body can no longer tell
that your own skin is part of your body, and starts attacking it. Miracles of evolution abound.

PS: If you've never read them, Steven Jay Gould and Loren Eisley's books are filled with such facts and anecdotes.

Saturday, July 05, 2008

Shell award


I just won 92K British pounds from the "Shell
Petroleum Company of England"! I'm even more excited, because
when they write the number in decimal, it was 92,000,000.00
so I think they really mean I won 92 *million* pounds. I just
need to contact the "fiduciary agent" with my email address, bank
account and credit card numbers to claim my prize. They're
throwing in a beautiful Russian mail-order bride as well. So long
grad school...

Friday, July 04, 2008

Typing SML values

I recently spent a few weeks learning the basics of Haskell.
One of the many strengths is the ability to give the types
of functions in a structure. This seems like a necessary
feature, but it is lacking in SML and O'Caml. For instance,
in Haskell I can write

incr :: Int -> Int
incr x = x + 1

In ML I'd either write

fun incr x = x + 1

and hope I can do the static typing in my head, or else
the horrible

fun incr (x : int) : int = x + 1

Note that it is possible to give incr a type in a
signature, but if I don't want to expose incr (it's
just used in the implementation), I'm out of luck.
While this example may not be entirely convincing, when
functions take many arguments, and are nested, it becomes
increasingly difficult to do mental type checking.

A hack to do this in SML is

fun incr x = x + 1
val incr : int -> int = incr

in O'Caml

let incr x = x + 1
let incr : int -> int = incr

Granted, this is not nearly as nice, but ML will catch
type errors this way.