Tuesday, December 22, 2009

HP computers are racist

This is unbelievable!  The face recognition software on HP computers will track a white face, but not a black one.

Saturday, December 19, 2009

The bus comes for those who wait.

Carmen Herrera sold her first painting in 2004 at age 89.  Now she's a super star.

Tuesday, December 15, 2009

Tuesday, December 08, 2009

Tuesday, December 01, 2009

Inspirational

I hadn't heard of Ida Tarbell until I read Simon Johnson's nice rebuttal of an argument I've found persuasive in the past.

The Pinker-Gladwell debate is entertaining

Stephen Pinker and Malcolm Gladwell have been going at it over predictors of success, such as IQ score and a football player's place in the draft.

A surprising fact

Benford's Law

Tuesday, November 24, 2009

Poignant story about a runaway with Aspbergers.

Saturday, November 21, 2009

Wednesday, November 18, 2009

11/18/09

  • More pirates.  
    • Interesting point:  "In the attack, the Alabama's crew also took evasive maneuvers and used a new technique to repel pirates: a so-called long-range acoustic device, which emits high-pitched sounds painful to the human ear."  
  • Psychology in the subway.  Some interesting tidbits. 
    • "The more justification that was offered, however, the less likely people were to stand up."
    • "Incidental touching was more likely to occur among same-race, same-sex passengers."

Friday, November 06, 2009

Links for 11/6/09

Good QuickCheck tutorial

Profiling + Template Haskell + Cabal

Cabal makes building, installing and distributing a Haskell program very easy.  Template Haskell makes writing cool pattern matching easy.  Profiling makes, well profiling easy.  But how can you do all these things together?  TH doesn't work well with profiling, so you need to compile twice.  Once with no profiling to make regular .hi and .o files.  Then again with profiling, renaming the .o and .hi files to .o_p and .hi_p in order to make it work.  With Cabal, you can basically do the same thing.  Compile once without profiling

runhaskell Setup.lhs configure --user
runhaskell Setup.lhs build
runhaskell Setup.lhs install

then again with the following additions to your cabal file, in the ghc-options section:


-prof
-auto-all
-osuf p_o
-hisuf p_hi

This should build the TH project with profiling support.

Sunday, November 01, 2009

Quotes for 11/1/09

  • He’s highly educated – and rather better than a country like this deserves.  -- Gore Vidal on Barack Obama
  • God looks after alcoholics, little children, and the United States of America. -- Otto von Bismarck
  • "I wish you and your family also as to your friend Merry Christmas and a happy New Year and I hope that we'll meet again in a world of peace and freedom in the taxi cab if the accident will."    I like that very much: "If the accident will."  -- Kurt Vonnegut, Slaughterhouse Five
  • "The Dresden atrocity, tremendously expensive and meticulously planned, was so meaningless, finally, that only one person on the entire planet got any benefit from it. I am that person. I wrote this book, which earned a lot of money for me and made my reputation, such as it is. One way or another, I got two or three dollars for every person killed. Some business I'm in." -ibid



Links for 11/1/09

Good op-ed by a rancher against meat demonization.  He reiterates Michael Pollan's point that grass fed, organically grown beef has low environmental impact.  Far lower than, say, Brazilian soybeans.

Fact about Incendiary bonbs:
Modern incendiary bombs usually contain thermite, made from aluminium and ferric oxide. The most effective formula is 25% aluminium and 75% iron oxide. It takes very high temperatures to ignite, but when alight, it can burn through solid steel. In WWII, such devices were employed in incendiary grenades to burn through heavy armor plate, or as a quick welding mechanism to destroy artillery and other complex machined weapons.

Saturday, October 31, 2009

Quotes for 10/31/09

"Everything reminds Milton Friedman of the money supply. Everything reminds me of sex, but I try to keep it out of my papers." - Robert Solow

Friday, October 30, 2009

Siege of Leningrad

Siege of Leningrad.  Pointed out in the Yale food course in the lecture on starvation.  In the rationing, manual laborers were given about 700 calories per day.  Non-manual laborers around 400.   Citizens recalled that the paste to put up wallpaper was made of potatoes.  Wallpaper was stripped off walls, and the dry paste was scraped into pots and boiled into soup.  Leather as well.  This was by the end of the first year.  The siege lasted another 1.5 years.  Then the cannibalism began.  After the corpses were eaten, children began disappearing.  The government made it illegal to sell fresh meat.  Over 1 million deaths by starvation.  1.5-3 million overall.  After the siege was lifted, it was formally illegal to speak of the cannibalism that took place during the siege.

Articles for 10/30/09

  1. Interesting Wal-Mart hack.  How can personal information be so poorly protected by such a massive store?
  2. Draw a symbol, and get the LaTeX code back.

Thursday, October 29, 2009

Blue footed bubi

Who knew?









Richmond rape case

The recent Richmond High School rape case (article 2) has a number of disturbing qualities.  The short story is that a 15 year old girl left a dance at the school, met up with some people on the side of campus, and was brutally raped by 6-10 young men, while the whole incident was observed by something like a dozen other people. Particularly important is that no one at the scene called the police, and the grisly mess lasted for nearly 2 hours.

In addition to the facts of the case, a number of comments also grabbed my attention.  The perpetrators currently in custody are aged 21, 19, 17, 16, and 15 years old.  The 21 year old has not been charged yet as far as I know.  The 19 year old is apparently the main assailant.  The DA apparently will seek life in prison for him, as well as for the juveniles (to be tried as adults).  An investigator from the police department is quoted as saying
  "These suspects are monsters. And, I don't understand how this many people capable of such atrocious behavior could be in one place at one time."
Focusing on the non-participating witnesses first, the first thing that's been on my mind regarding this case is the seemingly similar case of Kitty Genovese
that will be well known to anyone who took Psychology 101.  There a woman was beaten to death in broad daylight on a busy New York City street.  Similarly, no one watching the violence escalate called the police.   After the initial name calling and sermons on how NYC is a den of thieves, psychologists went around asking witnesses why they didn't call the police.   They replied that they figured someone else had already called them.  This led to numerous studies on group behavior that corroborated the claims.  It's one of the reasons I think Psychology 101 is the most important courses in college:  If you are aware of your tendency, as a human being, not to act in group situations, you can overcome your natural response, and get something done.

This seems slightly different though, since due to the remote location, any witness could see what any other witness was doing, so it would probably be clear if someone had called the police or not.  I'm curious whether there were threats of physical violence to the crowd from the attackers if anyone alerted the police, or if it was something like a Roman Colosseum spectacle.  In Gangleader for a Day, minorities from the Robert Taylor homes just don't call the police, since the police are frequently abusive and infrequently get anything done there.  Perhaps something like this was at work.

The second thing that sticks in my mind is the immediate response of the DA that he will not only seek to try the minors as adults, but will seek life in prison for all 4.  Even the oldest (currently charged), at 19,
is depressingly young.  Now, I'd agree that they obviously pose a danger to society, and should spend time in prison.  But a 15 year old getting life?  It is possible that he is a young psychopath that will do nothing but rape and pillage as long as he's on the streets.   Yet I find that incredibly hard to believe.  The interesting thing to me is the quote.  Again
  "These suspects are monsters. And, I don't understand how this many people capable of such atrocious behavior could be in one place at one time."
Indeed.  It seems highly improbable that 6-10 sociopaths happen all to go to the same high school and happen to all be hanging out together after a dance.   (Though, on second thought, any gang would probably satisfy this description.)  I think it is important to figure out what was going on in their minds (e.g. peer pressure) while this was happening.  The fact that the area is impoverished and known for gang violence, also would seem to play some kind of role.  I hope the psychology department at Berkeley researches this crime as seriously as those researchers studying the Genovese case.

In Stumbling on Happiness, Dan Gilbert reports on research showing that, almost unbelievably, about half of the people involved in horribly traumatic experiences similar to this one (though indeed this must be near the top of the list of most horrendous crimes) are able to recover psychology from the trauma.  I pray that the victim of this tragedy is one of these resilient ones.

Tuesday, October 27, 2009

Supertasters

I'm listening to the new food course from Yale online.  The most interesting fact so far is the existence of supertasters.  Basically, some people react to tastes much more strongly than others.  For instance, a supertaster might experience broccoli as extremely bitter.  I'm constantly amazed when people don't like things like olives or avocados.  Perhaps if I could experience their presumable super-reaction I'd dislike them as well.

Outrun a horse?

Is this true?  From http://www.nytimes.com/2009/10/27/health/27well.html?em  Seems impossible to me.
Most mammals can sprint faster than humans — having four legs gives them the advantage. But when it comes to long distances, humans can outrun almost any animal. Because we cool by sweating rather than panting, we can stay cool at speeds and distances that would overheat other animals. On a hot day, the two scientists wrote, a human could even outrun a horse in a 26.2-mile marathon.

Sunday, October 25, 2009

Cool hack

http://en.wikipedia.org/wiki/Xor_linked_list

Efficiency

I ran into a friend coming out of the grocery store last night.  In mock surprise, I said "What are you doing grocery shopping on Saturday night?".  She replied, "Well, if I go on Sunday morning I spend so long shopping.  On Saturday night, well, it's sad to be grocery shopping, so I get done quickly."

Friday, October 23, 2009

Oil Creek State Park

The most undervalued park in western PA.  A perfect place for a short weekend backpacking trip.

Funny rant on SFO travel.

So true. Public transportation to SFO is bad.

puzzles

Article on Martin Gardner, the math puzzle guy.

Wednesday, October 21, 2009

Monday, October 19, 2009

Against Transparency

Article by Lawrence Lessig on the surprising downside of donation transparency in government.

Wednesday, October 14, 2009

Best PL quote I've heard since CADE.

This one also involves Derek Dreyer.

http://www.iai.uni-bonn.de/~ralf/WG2.8/24/slides/derek.pdf

"Great, but who cares about the Apply functor?  It's a very lame functor."

Tuesday, October 13, 2009

Monday, October 12, 2009

Death penalty

I'm not against the death penalty in principle.  In practice though, it's usually impossible to
know for sure if the guy is guilty.  At least if you imprison a guilty person, you can let him
out when you realize your mistake (and the governor doesn't interfere with the case).
This simple fact and the further fact that executing someone actually costs more than keeping
them in prison for life makes the death penalty seem completely wrongheaded.

http://www.newyorker.com/reporting/2009/09/07/090907fa_fact_grann/

Sunday, October 11, 2009

Weird Haskell import behavior

Say you have a module A:

module A where

class A a where
  a :: a -> a

Now you wish to write a module B that instantiates A.A.
Since you don't want to include the whole namespace of A, you try

module B where

import A(A)

instance A Int where
  a = id

This fails to compile because it says 'a' is not a visible method of class A.  The strange thing is it compiles if you instead write

module B where

import qualified A
import A(A)

instance A Int where
  a = id


I find this strange since you don't have to write

instance A Int where
  A.a = id

Importing with brackets brings only those names into scope, thus making a not
visible.  But I fail to see why importing all of A qualified allows you to figure
out that a (unqualified) is visible.

A good article day

Great article about the celebrity chef Jamie Oliver, and his crusade in America.

Another good one by Malcolm Gladwell comparing dog fighting and football injuries.

Thursday, October 08, 2009

Haskell strictness

The following Haskell program eats 2GB of memory in about 5 seconds:

index n i (x:xs) = if x == n then i else index n (i+1) xs
main = putStrLn $ show $ index 0 0 [1..]

This seemed odd to me, since it is tail recursive.  The problem is that the i+1 does not get evaluated, and therefore creates a thunk at each recursion step.  Compiling with -O2 fixes this, as does the following fix

index n i (x:xs) = i `seq` if x == n then i else index n (i+1) xs
main = putStrLn $ show $ index 0 0 [1..]

This simple example just shows how you really have to unlearn your most fundamental strict functional  programming beliefs if you start hacking Haskell.

Good column on health care by Nicholas Kristof

Tuesday, October 06, 2009

A dissenting opinion on electronic voting.

M. Shamos at CMU is the first computer scientist I've seen argue that paper trails are a bad idea in electronic voting.  I don't agree with his biggest point, but I think that there is some interesting
sociological information there.  For example, requiring paper trails by law stifles technological
innovation since anything non-paper-based would be illegal.

Monday, October 05, 2009

Cabal oddity

When you use Cabal to make a library, you have to be careful about what you include in the 'exposed-modules' section.  If you don't include a module, and you refer to it in another library, the code will compile, but not link.  It will give you an uninformative (ar) error message about undefined symbols.
This will even happen if you export modules that use unexported modules.  I think of this as a bug,
but for now, I suggest exporting every module that might be touched by an export.

Excellent article about Larry Summers

http://www.newyorker.com/reporting/2009/10/12/091012fa_fact_lizza?currentPage=all

Thursday, October 01, 2009

Best GHC option

-B:
Sound the bell at the start of each (major) garbage collection. Oddly enough, people really do use this option! Our pal in Durham (England), Paul Callaghan, writes: “Some people here use it for a variety of purposes—honestly!—e.g., confirmation that the code/machine is doing something, infinite loop detection, gauging cost of recently added code. Certain people can even tell what stage [the program] is in by the beep pattern. But the major use is for annoying others in the same office…”

Monday, September 28, 2009

Haskell IRC

The Haskell IRC channel is great.  For those of you who don't know, IRC is an old school chat room.  The Haskell instance has dozens of knowledgeable people on at any time of day.   They are generous with beginners like me.  I've asked a few dozen questions by now, and always got an answer within a minute or two.  If you're learning Haskell, I highly recommend it.

orangutan and hound

http://www.huffingtonpost.com/2009/09/26/orangutan-and-hound-dog-b_n_299010.html

Sunday, September 27, 2009

Yuri

I was at Microsoft Research in Redmond this week.  I met a Russian logician named Yuri Gurevich who told me a funny story about a math class when he was a child:


I remember, in a geometry class, my teacher wanted to prove the congruence of two triangles. Let’s take a third triangle, she said, and I asked where do triangles come from. I worried that there may be no more triangles there. Those were hard times in Russia, and we were accustomed to shortages.
He was afraid they might have run out of triangles!

Good article on Met director

http://www.nytimes.com/2009/09/27/arts/music/27mcgr.html

Saturday, September 26, 2009

Alicia de Larrocha's NY Times obituary.

Design Patterns

I've been using Haskell a lot lately.  I wanted a deeper understanding of the interaction of type classes, since the number of type variables in mine is exploding as I try to simulate the ML module system in type classes.  Obviously I'm doing something wrong.  Thus, I've been reading the standard papers on functional dependencies, etc.  For variety, I figured I'd reread some object oriented programming stuff, since they've thought a lot about class relationships.  (Though type classes bear little resemblance to OO classes, there are some similarities.)  So I picked up the Gamma et. al Design Patterns book.  I know I live in a functional programming bubble, but I'm surprised at some of the stuff I'm reading.

  p.22.  On "parameterized types" aka. parametric polymorphism, aka. generics.
  "None of the patterns in this book concerns parameterized types, though we use them on occasion to customize a pattern's C++ implementation.  Parameterized types aren't needed at all in a language like Smalltalk that doesn't have compile-time type checking."
It sounds as if the authors think of compile-time type checking as a scourge on programmers that
forces them to use parameterized types.  
  To be fair, they do say that parametric types are another way (the other two being class inheritance and object composition) to structure your programs, each having strengths and weaknesses.  Interestingly, they point out that you can't change the implementation of a polymorphic function at run time.  That's true (I think) but I'm struggling to understand what they mean.  For instance, you might have two implementations of sorting with different behaviors (e.g. one better on one kind of data, the other on another kind), and you might notice that a chosen sort of an input stream is performing badly and want to switch to the other algorithm.  This is an easy thing to do in ML or Haskell, as I suppose it is in C++.
Thus, I don't know what they mean by saying you can't change the implementation at runtime.  Do they mean, the implementation of a single function?  If so, I have no idea why you would want to do that.  How could you reason about your function f if sometimes it's calling f1 and other times it calls f2?
   The abstractions of design patterns seem interesting, but I'm not seeing yet how to apply the ideas to functional programming.

Sunday, September 06, 2009

Babysitting coop

Fascinating story from Paul Krugman:
I like to explain the essence of Keynesian economics with a true story that also serves as a parable, a small-scale version of the messes that can afflict entire economies. Consider the travails of the Capitol Hill Baby-Sitting Co-op.
This co-op, whose problems were recounted in a 1977 article in The Journal of Money, Credit and Banking, was an association of about 150 young couples who agreed to help one another by baby-sitting for one another’s children when parents wanted a night out. To ensure that every couple did its fair share of baby-sitting, the co-op introduced a form of scrip: coupons made out of heavy pieces of paper, each entitling the bearer to one half-hour of sitting time. Initially, members received 20 coupons on joining and were required to return the same amount on departing the group.
Unfortunately, it turned out that the co-op’s members, on average, wanted to hold a reserve of more than 20 coupons, perhaps, in case they should want to go out several times in a row. As a result, relatively few people wanted to spend their scrip and go out, while many wanted to baby-sit so they could add to their hoard. But since baby-sitting opportunities arise only when someone goes out for the night, this meant that baby-sitting jobs were hard to find, which made members of the co-op even more reluctant to go out, making baby-sitting jobs even scarcer. . . .
In short, the co-op fell into a recession.

Monday, August 17, 2009

Self-inforcing protocols

Interesting article by Bruce Schneier:

I especially like the property tax example.

Sunday, August 09, 2009

cat flap

I learned this week that Newton invented the cat flap.

Sunday, August 02, 2009

LSUIPresentationMode change

I've been using the LSUIPresentationMode trick to hide the Mac toolbar for most applications.  With the latest update, it doesn't look like you can set the number to 4, the options being strings.  You need to now right click and select Show Raw Keys/Values in order to set the number to 4.

Best quote(s) of LFMTP

I think it's a tie

1) Gilles: Higher order matching with dependent types is undecidable.
    Jason: Really?  Who proved that?
    Gilles: I did.

2) Derek: Have you looked at how I do it in MixML?  How do the methods compare?
    Florian: I haven't looked, but I'd be surprised if they are different.  If you do it right, it ends up like this.
   Derek: I was going to say, if you do it right, it ends up like MixML.

Friday, July 31, 2009

Computer security

A British hacker somehow managed to shut down the US Army's computers for 24 hours.
I didn't hear about this.  I thought this comment was interesting.
He had used his own computer with a 56K dial-up modem at his London home with no password protection and somehow managed to evade every security measure the U.S. military had adopted.
70 years seems excessive.  Perhaps the Army should hire this guy rather than put him
in jail. 

Tuesday, July 28, 2009

Monday, July 27, 2009

Haskell 'import qualified'

Haskell's module system is a bit weird.  Consider the following:

import qualified Data.List as L
import qualified Data.Char as L

x = L.concat []
y = L.toUpper 'c'

How can this make sense?  I was interpreting

import qualified Data.List as L

as

structure L = Data.List

in SML.

Apparently the qualified import just makes a new namespace and
dumps all the names from the modules into it.  If there is a conflict,
you simply can't use the name.  For instance, if it was Data.Map and Data.List,
then L.union would be ambiguous.

Tuesday, June 30, 2009

DMTCP Checkpointing

Checkpointing is the ability to stop a process, save it, and restart it later.  As a user of HOL Light, checkpointing is nearly essential, since every time you start the system it evaluates all of mathematics from scratch.  Loading advanced libraries can take upwards of an hour.  Checkpointing is hard to get right though, and I haven't found a single program that works on the latest Linux kernel.  I started using DMTCP this weekend, and it works perfectly.  I highly recommend it.  The steps are simple.

1) Install DMTCP using a Debian package or from source.
2) dmtcp_checkpoint -n ocaml
3) #use "hol.ml";; (to start HOL Light)
4) dmtcp_command -c (from another terminal.  This checkpoints the process)
5) Kill the ocaml process.  Then do dmtcp_restart on the saved binary.

Works like a charm.

Monday, May 25, 2009

Latex Alert + Array + Infer bug

You can't do the following in Latex:


\documentclass{beamer}
\usepackage{proof}

\begin{document}

\begin{frame}
  \begin{array}{c}
    \alert{\infer{A}{A}}
  \end{array}
\end{frame}

\end{document}

For some reason you can \alert an \infer outside of an \array, but not inside.  Weird bug.

Workaround:  Use tabular instea


\begin{frame}
  \[
  \begin{tabular}{c}
    \alert{\infer{A}{A}}
  \end{tabular}
  \]
\end{frame}

Sunday, May 24, 2009

Old Jade and the Zombie!

I'm currently reading

History and Future of Implicit and Inductionless Induction:
Beware the Old Jade and the Zombie!


by Claus-Peter Wirth.  My favorite quote so far:

 In practice, however, refutational completeness by itself does not help in refuting
invalid conjectures or in finding finite proofs for inductively valid formulas.
Only theoreticians completely detached from reality can consider nonterminating
proof attempts in refutationally complete inference systems to be
successful proofs.

Tuesday, May 19, 2009

WTF??

The Senate just passed a bill controlling credit card companies.  What the **** is Tom Coburn thinking?  No wonder people hate Congress.  (Why anyone would need a loaded gun in a national park is a good question, but somewhat beside the point.)
One amendment attached to the Senate bill by Senator Tom Coburn, Republican of Oklahoma, would restore a Bush administration policy allowing loaded guns in national parks. That provision is not in the House version, so there may be discussions between the two chambers over the issue.

Thursday, May 14, 2009

BibTeX oddity

Comments don't always work in BibTeX files!  I had the following in my bib file:

@STRING{lncs = {LNCS}}
% @STRING{lncs = {Lecture Notes in Computer Science}}

I wanted the shorter "LNCS" rather than "Lecture Notes in Computer Science".  For some reason, the long form kept showing up in my bibliography.  Transposing the lines gives the desired effect.  Weird...

Tuesday, May 05, 2009

Designer Clock Puzzle

Guess what's special about this clock.  (Thanks to Florian Rabe for pointing this out.)

Monday, May 04, 2009

Pushcart Prize

I discovered a great short story series in the library, more or less by accident.  It's called
The Pushcart Prize.  The collection I checked out, The Book of Short Stories, contains stories by Tobias Wolff, Tim O'Brian, Mona Simpson and many others.  It's a fantastic collection.

Friday, May 01, 2009

Big dog

Quite an amazing video.

http://www.youtube.com/watch?v=W1czBcnX1Ww

Wednesday, April 29, 2009

Air quality

Great.  Pittsburgh is the worst city for short term particle pollution.  And second worst (behind Bakersfield) for worst long term particle pollution.

A lot of Americans feel comfortable about air pollution, and we often think that it's a problem in a few well-known places, said Dr. Norman H. Edelman, chief medical officer for the American Lung Association....
Pittsburgh topped the list of cities most polluted by short-term exposure to particles. It's still a dangerous city for particulate pollution, pointed out Edelman.

Tuesday, April 28, 2009

LaTex?


\int_{0}^{1}\frac{x^{4}\left(1-x\right)^{4}}{1+x^{2}}dx

=\frac{22}{7}-\pi

LaTeX Error Message Fail

Friday, April 24, 2009

Larry Morris


I was in Alexandria, VA last weekend and visited the Torpedo Factory Art Center.  It's a bunch of small art studios where artists work and sell their wares.  It is a nice place to visit!  I loved the work of Larry Morris.  He makes wonderful sculptures depicting the lives of these tetrahedral people, something like a comic in three dimensions.  There is something poignant and touching about them. 

Monday, April 20, 2009

Gay marriage

Another good opinion piece.

Pot vs. alcohol

I'm not sure what to think of the narcotic legalization debate.  It seems totally obvious that our black market is fundamentally fueling the world narcotics trade, replete with gang and militia violence.  On the other hand, it is hard for me to imagine walking into a bar and seeing people snorting cocaine.  I see no problem with marijuana though.  I found it a little discomforting to see hoards of stoned people in the coffee shops of Amsterdam, but it is no more disconcerting than seeing a group of drunks at a frat party.  Eventually, I suppose drugs should be totally legalized.  Perhaps this can occur when old fogies like me either pass on or get over our prejudice.  Allowing people in the US to voluntarily destroy their lives with drugs seems more acceptable in the big scheme of things than permitting poor neighborhoods all over the world, including the US, to be run by thugs with guns.  

A simple but convincing line on this debate is from the Huffington post, via a NY Times blog.



  •  Huffington Post: Norm Stamper, a retired police chief and member of Law Enforcement Against Prohibition, reviews the pot vs. booze debate on 4/20 day:



  • Over the past four years I’ve asked police officers throughout the U.S. (and in Canada) two questions. When’s the last time you had to fight someone under the influence of marijuana? (I’m talking marijuana only, not pot plus a six-pack or a fifth of tequila.) My colleagues pause, they reflect. Their eyes widen as they realize that in their five or fifteen or thirty years on the job they have never had to fight a marijuana user. I then ask: When’s the last time you had to fight a drunk? They look at their watches.

    Saturday, April 18, 2009

    Dog Bloat

    I'm staying with a friend who has a pitt bull.  I was told not to wrestle with it after it eats, because of dog bloat.  The stomach of some kinds of dogs (deep-chested) can actually be twisted and turned around, causing all manner of harmful effects.  I was very skeptical until I read about it myself.  It's apparently the second leading killer of dogs after cancer.  I had a german shepherd for a few years growing up (another deep-chested dog) and had no idea about this.  It seems like it should be better known.  It actually killed one of my host's dogs a few years ago.  The scariest part is that they can die within an hour.

    Tuesday, April 14, 2009

    ghci maximum input length

    Annoying.  GHCI, the GHC Haskell comiler top level loop, will only allow a fixed number of characters on an input line.  If you copy a long list, say from Mathematica, to the command line, it will give a syntax error.

    Monday, April 13, 2009

    Google Immigration

    Good article about high-skilled immigration. 

    Sunday, April 12, 2009

    Iowa

    is historically progressive!

    Serial comma

    Do you put a comma after 'and'?  Do I like apples, oranges, and pears, or apples, oranges and pears?  The comma appearing before the and has its own name, a serial comma.  The upshot is that in American English you normally use it, and otherwise you generally don't.  Here's a funny example of a case to use it in any language:

    Use of the serial comma can sometimes remove ambiguity. Consider the possibly apocryphal book dedication quoted by Teresa Nielsen Hayden:
    To my parents, Ayn Rand and God.

    Pebble Mine

    I saw the short film Red Gold at this year's Banff Mountain Film Festival.  One of the environmental films was about the Pebble Mine in Alaska.  The short story is that there was recently an enormous amount of copper and gold found very near to Bristol Bay, the most important salmon waters in the world.  Now there is a battle between the mining company that owns the rights, and environmentalists and residents that don't want to see the rivers and salmon runs ruined by mine pollution.  A Men's Journal article gives a good summary.  One of the comments to the article was particularly poignant.

    The problem I see as I visit each summer is that while people like us debate this issue and hope the mining project will not occur, the reality is that every day in this area there are helicopters in the air, and people and equipment on the ground moving forward with the implementation of infrastructure needed for this mine to be created. In other words, we’re talking while they’re working.
    With the horrible track record of open pit mines, I have little doubt that the salmon would be greatly deminished by the pollution.  With hundreds of billions of dollars at stake though, and Alaskans  seeming to care less for their environment than economic development, as seen by the rejected ballot measure in August that sought to protect the area, I fear and suspect the worst.

    Tuesday, April 07, 2009

    MRI

    I got an MRI today because I am participating in a study at UPMC.  It's an enormous machine with a human-size cylinder cut out of the middle.  That's where they slide you in to take pictures of your brain.  I was given simple tasks like matching faces and patterns.  You communicate with the computer using a keypad that is placed in a glove on your hand.  Besides being very noisy, the only thing that bothered me is that during one of the experiments, the magnetic field somehow started stimulating the muscles around my torso.  They started twitching randomly.  It wasn't big, just subtle involuntary movement of the muscles, but it felt really strange.
      One of the tasks was to look at disturbing or upsetting pictures, such as people who had been in accidents, and to try to consciously cast the scenario in a positive light.  For instance, if the picture was of someone who was clearly injured, but was being treated in a hospital, you were instructed to invent some story like, "Well, the person is hurt, but is being well cared for and will be better soon."  I suspect they're testing the effect of "positive thinking" on brain function.  Anyway, it was an interesting experience. 

    Monday, April 06, 2009

    Hilarious

    http://failblog.org/

    Deadlines

    I love deadlines. I like the whooshing sound they make as they fly by.  --Douglas Adams

    Sunday, April 05, 2009

    Hidden Qatar

    Now I don't feel so bad about not getting a feel for the country.  Seems like a challenge even for a BBC reporter.

    Saturday, April 04, 2009

    Light shines in Iowa

    Gay marriage ban is lifted by the state supreme court.  Midwest to California: "Grow up."

    Friday, April 03, 2009

    Balloon attacks?

    I'm reading Into Thin Air.  The author keeps talking about the Jet stream.  I realized I didn't know what it is, so I looked it up on Wikipedia.  Basically it's just fast air currents at a certain position in the atmosphere, at the coldest point.  The wind is so fast, jets that fly in the stream can shave 1/3 off their time flying between Tokyo and LA.  The weirdest thing though, is that the Japanese used balloons filled with explosives, positioned in the jet stream, to bomb America during WWII.  Weird...  The article claims there may be some unexploded balloons in the forests of the West coast somewhere.  

    Thursday, April 02, 2009

    Opinions

    from Doron Zeilberger.  I especially like #3 and #96, of the few I had time to read.

    Tuesday, March 31, 2009

    Hard decisions on K2

    Crazy story.  The death zone of a mountain is the part so high that it cannot sustain human life.  Your body loses oxygen faster than it can replace it by breathing.  Some time in 2008, after 8pm, 10 climbers were stuck in the death zone of K2 when their ropes were all lost during a serac slide.  Some bivouacked, and some descended without ropes in the darkness. 

     

    Saturday, March 28, 2009

    Friday, March 27, 2009

    LaTeX: pdfsync and tabular p-width

    If you include pdfsync, a nice package that adds hyperlinks to a pdf generated from LaTeX, be warned that it will break the p-widths of tables.  For instance

    \begin{tabular}{p{1in}}
    abc def
    \end{tabular}

    will make the column nearly the width of the entire page rather than 1 inch.  I don't have a workaround for this yet.  If you have one, please let me know.  The bug is noted elsewhere, but I haven't seen a correction.

    Saturday, March 21, 2009

    algorithmic-fix

    If you try to use line numbers with the LaTeX algorithmic package and also hyperref, you are in trouble.  You get lots of annoying warnings about symbols being defined twice.  The solution is found here.
    You need to include a little latex package called algorithmic-fix.sty, provided by the author of hyperref.  The content is:

    \NeedsTeXFormat{LaTeX2e}[1994/12/01]
    \ProvidesPackage{algorithmic-fix}%
      [2008/02/27 v0.1 Fixes algorithmic for hyperref (capt...@sommerfee.de)]
    % 1. Replace the two wrong \refstepcounter's with \stepcounter's
    \begingroup
      \long\def\x#1\refstepcounter#2\@nil{%
        \endgroup
        \def\ALC@item[##1]{#1\stepcounter#2}}%
    \expandafter\x\ALC@item[{#1}]\@nil
    \newcommand\ALC@list{%
      \begingroup
        \long\def\x\refstepcounter##1\@nil{%
          \endgroup
          \def\ALC@it{\stepcounter##1}}%
      \expandafter\x\ALC@it\@nil
      \let\list\ORI@list\list}%
    \renewcommand\ALC@setref{}%
    % 2. Define a unique \theHALC@line
    \newcounter{algorithmic}
    \let\ORI@algorithmic\algorithmic
    \def\algorithmic{%
      \stepcounter{algorithmic}%
      \let\ORI@list\list\let\list\ALC@list\ORI@algorithmic}
    \def\theHALC@line{\thealgorithmic-\theALC@line}
    % That's all
    \endinput

    Writing about a program

    I'm working on my thesis proposal.  I'm wondering what details of my theorem provers to include in a text writeup.  There are hundreds of small choices you make implementing a piece of software.  Which are important enough to explain and record, and which are just artifacts of, say a particular choice of data structure?  After reading a bunch of related papers, I think the best answer is that you should include enough information so that if you totally lost the memory of implementing the system, you could produce an "equivalent" program, i.e., one that has "roughly" the same operational behavor.  This should include the high-level optimizations.  An optimization is high-level if it operates at the level of abstraction.  For instance, if your theorem prover does term indexing, the kind of term indexing, and any non-standard tweaks, it performs should be recorded.   The actual structure should be elided.  Perhaps the best way to describe this in SML would be as "maximally abstract" signatures and functors.  Well, I obviously need to think about this more...

    Tuesday, March 17, 2009

    Vietnam Visa

    You need a visa to visit Vietnam.  The fee is not marked on their website.  I called the embassy.

    1 month, single entry: $65
    1 month, multiple entry: $110
    3 months, single entry: $90
    3 months, multiple entry: $150

    Wednesday, March 11, 2009

    Training

    Nice essay about training for a first marathon.

    Tuesday, March 10, 2009

    Monday, March 09, 2009

    Stories from Narita Airport in Tokyo

    Robert Acker, teaching the globalization course Geography 20 at Berkeley, has the following stories about Japan that I thought were fascinating.

    1) He was sitting in the airport, and walked by a store in the airport mall.  There was a sign next to the register, in English and Japanese, that said "I'm out sick for the day.  If you need anything, take it and pay the cashier across the way." 

    2) Global clothing companies budget %4 of the annual expenses for shoplifting.  In Japan it's %0.4. 

    In his humorous words, "If something's not done in a society, you don't do it.  It's as simple as that."

    Sunday, March 08, 2009

    Lots of drafts

    Apple's Mail program is telling me I'm not good at finishing my email correspondence.

    Saturday, March 07, 2009

    Best American Short Stories, 1998


    I just finished a really good collection of short stories that I bought at a thrift store while helping Roland get furniture.  It's from the Best American Short Stories series that I just learned has been produced since 1978.  My favorites:

    Kathryn Chetkovich, Appetites
    Chris Adrian, Every Night for a Thousand Years
    Matthew Crain, Penance
    Padgett Powell, Wayne in Love

    Best dialogue:

    "Does your mamas ever talk to y'all about, you know, God?"
    "My mama says 'God' when she's cussing Melvin"

    "That's not what I mean.  Do they read Bible stories to y'all at bedtime?"

    Freddie's face brightened.  "She rented Conan the Barbarian for us once.  That movie kicked ass."

    Friday, March 06, 2009

    AbeBooks

    I recently used google and ebay to try to find the cheapest copy of Dacher Keltner's Social Psychology textbook.  The cheapest I found was $54 from England.  I just found out about AbeBooks.   (Perhaps I'm the last to know.) This is a great resource.  It is the Orbitz (or Kayak) of book buying.  They had dozens of copies from $34.00.  So my ignorance cost me $20 this time.

    Tuesday, March 03, 2009

    In Memoriam: Jack Schwartz

    I was very sorry to read the following email today.  Jack Schwartz was an inspiring teacher and scientist.  I recall his computational logic course as one of my favorite, and had many interesting conversations with him about his SETL formalization of the Cauchy integral theorem in his own theorem prover.  I was learning HOL-Light at the time, and the contrasts were striking.  I recall being at a lunch with Schwartz, Tom Hales and John Harrison at a Burmese restaurant in Greenwich Village where the topic of conversation turned to formalizing mathematics.  What struck me about him was his youthful eagerness and enthusiasm about the project.  And it was only one of many such projects he was interested in when I knew him.  I hope to be so thoughtful and vibrant at half his age.


        Dear members of the CIMS community,

        It is with sadness that I write to let you
        know that Jack Schwartz passed away in his
        sleep early this morning. He was 79 years old.
        As many of you know, Jack was the founding
        chair of the computer science department and
        the central player in setting the computer
        science research agenda here in the decades
        before and after the department's founding;
        this included seminal work in compilers,
        programming languages, parallel computing,
        robotics, bioinformatics, and multimedia.
        Most of the large-scale research efforts of
        the last forty years in the computer science
        department owe their initial impulse to his
        vision, his tireless energy, and his
        omnivorous scientific curiosity.

        Jack came to Computer Science after a
        distinguished career as a mathematician, the
        junior author of the three-volume "Linear
        Operators" and of numerous books on pure and
        applied mathematics, ranging from C* algebras
        to mathematical economics.  He was an
        inspiring teacher (who at one time or another
        taught pretty much every course in the
        computer science curriculum) and was the
        advisor for more than 50 Ph.D. theses.

        He was a generous friend and an inspiration to
        many of us.

        The Courant Institute will be holding a
        memorial in the next few weeks, to honor his
        life and achievements. We will send a more
        detailed announcement when we have more
        information.


        Richard

        ---

        Richard Cole Deputy Director Courant
        Institute, NYU

    Monday, March 02, 2009

    Free logic programming book.

    A good (free) intro to the theory of logic programming.  It looks like a textbook that went out of print.  Gives a model theoretic account.  Consider also my adviser's notes for a type theoretic approach.

    Sunday, March 01, 2009

    Not so disappointed I'm not graduating this year

    Brad DeLong is reading applications at Berkeley.

    I was just looking through the lecturer applications. OMG. So many people who would be so good in the classroom, and who know so much, and would be such general assets to the Berkeley intellectual community. This has to be the worst year to apply for an academic job in America since... the Great Depression

    And I think we are going to be offering them half-time jobs...

    Friday, February 27, 2009

    Finally found exponential ML type inference in real life

    Today I finally hit SML/NJ exponential type inference.  (Not surprisingly, MLton has no trouble with this example.)  Using the pretty functional record update with a record of size 13, my program was not compiling.  After trying this with smaller records I found that NJ just can't compile this.  Here's the type for makeUpdate with 8 records:


    val makeUpdate8 = fn
      : ('a -> 'b) *
        (((((((('c -> (((((((('c,'d) u,'e) u,'f) u,'g) u,'h) u,'i) u,'j) u,'k) u,
                'e -> (((((((('c,'d) u,'e) u,'f) u,'g) u,'h) u,'i) u,'j) u,'k) u)
                 product,
               'f -> (((((((('c,'d) u,'e) u,'f) u,'g) u,'h) u,'i) u,'j) u,'k) u)
                product,
              'g -> (((((((('c,'d) u,'e) u,'f) u,'g) u,'h) u,'i) u,'j) u,'k) u)
               product,
             'h -> (((((((('c,'d) u,'e) u,'f) u,'g) u,'h) u,'i) u,'j) u,'k) u)
              product,
            'i -> (((((((('c,'d) u,'e) u,'f) u,'g) u,'h) u,'i) u,'j) u,'k) u)
             product,
           'j -> (((((((('c,'d) u,'e) u,'f) u,'g) u,'h) u,'i) u,'j) u,'k) u)
            product,
          'k -> (((((((('c,'d) u,'e) u,'f) u,'g) u,'h) u,'i) u,'j) u,'k) u)
           product
         -> 'l) * ('m -> 'n)
        -> 'm
           -> ('l *
               (((((((('o,'p) product,'q) product,'r) product,'s) product,'t)
                    product,'u) product,'v) product *
                (((((((('o,'w) u,'p) u,'q) u,'r) u,'s) u,'t) u,'u) u,'v) u
                -> ((((((('o,'p) product,'q) product,'r) product,'s) product,'t)
                       product,'u) product,'v) product) * 'n,'x * 'y * 'a,'b,'z)
                Fold.t

    Tuesday, February 24, 2009

    Monday, February 23, 2009

    Trench warfare

    Fascinating discovery when reading the Wikipedia article on AxThe Evolution of Cooperation, recommended in Dacher Keltner's psychology course:

    The book included two chapters comparing Axelrod's findings to surprising findings in seemingly unrelated fields. In one of these, Axelrod examined spontaneous instances of cooperation during trench warfare in World War I, often called Live and Let Live. Troops of one side would shell the other side with mortars, but would often do so on a rigid schedule, and aim for a specific point in the other side's trenches, allowing the other side to minimize casualties. The other side would reciprocate in kind. The generals on both sides were satisfied that shelling was occurring and therefore the war was progressing satisfactorily, while the men in the trenches found a way to cooperatively protect themselves.

    You don't lose an inordinate percentage of heat through your head

    http://www.guardian.co.uk/science/2008/dec/17/medicalresearch-humanbehaviour

    Red, and perseverence

    Just watched a great movie by Krzysztof Kieślowski called Red (Rouge).  Also striking is part of his biography that I read after seeing the movie.

    Leaving college and working as a theatrical tailor, Kieślowski applied to the Łódź Film School, the famed Polish film school which also has Roman Polański and Andrzej Wajda among its alumni. He was rejected twice. To avoid compulsory military service during this time, he briefly became an art student, and also went on a drastic diet in an attempt to make himself medically unfit for service. After several months of successfully avoiding the draft, he was accepted to the Łódź Film School on his third attempt.

    A quote:
    It comes from a deep-rooted conviction that if there is anything worthwhile doing for the sake of culture, then it is touching on subject matters and situations which link people, and not those that divide people. There are too many things in the world which divide people, such as religion, politics, history, and nationalism. If culture is capable of anything, then it is finding that which unites us all. And there are so many things which unite people. It doesn't matter who you are or who I am, if your tooth aches or mine, it's still the same pain. Feelings are what link people together, because the word 'love' has the same meaning for everybody. Or 'fear', or 'suffering'. We all fear the same way and the same things. And we all love in the same way. That's why I tell about these things, because in all other things I immediately find division.

    Thursday, February 19, 2009

    MLton TimeLimit

    Guess what this prints, and after how long:


    val fastTime = Time.fromSeconds 2
    val slowTime = Time.fromSeconds 6

    fun fib 0 = 1
      | fib 1 = 1
      | fib n = fib (n - 1) + fib (n - 2)

    fun bigfib () = fib 10000000

    fun slow () = TimeLimit.timeLimit slowTime bigfib ()
        handle TimeLimit.TimeOut =>
               let in
                  print "slow time out"
                ; ~1
               end

    val _ = TimeLimit.timeLimit fastTime slow ()
        handle TimeLimit.TimeOut =>
               let in
                  print "fast time out"
                ; ~2
               end

    The rather unintuitive answer is "slow time out" after 6 seconds.
    What is going on here?  I guess nesting of TimeLimits is dangerous.

    Tuesday, February 10, 2009

    Annoyed with SML/NJ library

    - HashString.hashString "ds";
    val it = 0wx6CF7 : word
    - HashString.hashString "f1";
    val it = 0wx6CF7 : word

    Surly the default string hash should be better than this.
    I'm using Tom Murphy's SHA1 implementation now.  Slower, but at least I don't have to worry about things like this.

    Monday, February 09, 2009

    Friday, February 06, 2009

    BWV 20

    The baritone aria from BWV 20 is wonderful.  I sometimes loop through random Bach cantatas at work, and some just jump out at me.  The oboe continuo in this is great.

    Hacking road signs

    Reposted from Bruce Schneier's blog.

    Friday, January 30, 2009

    The Terrible Towel legacy

    Amazing story...  It makes me proud of Pittsburgh.

    Sunday, January 18, 2009

    Jewish MP (member of parliament) against the Gaza violence

    http://www.youtube.com/watch?v=qMGuYjt6CP8

    Great idea for running in winter

    http://www.skyrunner.com/screwshoe.htm

    Tuesday, January 06, 2009

    Don't buy Horizon organic milk

    These are just factory farms without antibiotics.

    http://www.organicconsumers.org/articles/article_4746.cfm

    Thursday, January 01, 2009

    Bankers finding new jobs

    Bankers as comedians.
    “Everyone seems to have something else they would rather be doing than their 9-to-5,” he said. “I think that people who are losing their jobs are being forced to pursue their dreams and, in a way, are being liberated from the golden handcuffs of Wall Street and venturing into something that might fulfill them.”