Interesting article by Bruce Schneier:
I especially like the property tax example.
Monday, August 17, 2009
Sunday, August 09, 2009
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.
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.
in jail.
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.
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.
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}
\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:
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.
Saturday, May 23, 2009
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...
@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
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.
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.
Sunday, May 03, 2009
Friday, May 01, 2009
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
Friday, April 24, 2009
Larry Morris
Monday, April 20, 2009
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:
A simple but convincing line on this debate is from the Huffington post, via a NY Times blog.
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
Sunday, April 12, 2009
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.
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
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
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.
Sunday, March 29, 2009
Saturday, March 28, 2009
Caffeine works
I'm very surprised by this. Caffeine definitively makes people perform better, even if they are habituated to its use.
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.
\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
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...
Thursday, March 19, 2009
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
1 month, single entry: $65
1 month, multiple entry: $110
3 months, single entry: $90
3 months, multiple entry: $150
Wednesday, March 11, 2009
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."
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
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
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
Low fee index funds beat both hedge funds and actively managed index funds
Yet more data to support that fact that most investors should buy low-fee index funds.
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.
Red, and perseverence
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.
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.
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
Friday, January 30, 2009
Sunday, January 18, 2009
Jewish MP (member of parliament) against the Gaza violence
http://www.youtube.com/watch?v=qMGuYjt6CP8
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
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.”
Wednesday, December 31, 2008
Monday, December 29, 2008
Deadweight loss
Interesting article about deadweight loss at Christmas. I've always thought gift certificates or cards are a bad present. I was wrong.
Intrigued by this mismatch between wants and gifts, in 1993 Joel Waldfogel, then an economist at Yale University, sought to estimate the disparity in dollar terms. In a paper* that has proved seminal in the literature on the issue, he asked students two questions at the end of a holiday season: first, estimate the total amount paid (by the givers) for all the holiday gifts you received; second, apart from the sentimental value of the items, if you did not have them, how much would you be willing to pay to get them? His results were gloomy: on average, a gift was valued by the recipient well below the price paid by the giver.
The most conservative estimate put the average receiver's valuation at 90% of the buying price. The missing 10% is what economists call a deadweight loss: a waste of resources that could be averted without making anyone worse off. In other words, if the giver gave the cash value of the purchase instead of the gift itself, the recipient could then buy what she really wants, and be better off for no extra cost.
Non-cash gifts from extended family were found to be least efficient
Perhaps not surprisingly, the most efficient gifts (those with the smallest deadweight loss) were those from close friends and relations, while non-cash gifts from extended family were the least efficient. As the age difference between giver and recipient grew, so did the inefficiency. All of which suggests what many grandparents know: when buying gifts for someone with largely unknown preferences, the best present is one that is totally flexible (cash) or very flexible (gift vouchers).
Sunday, December 28, 2008
Obama and Warren
A cogent post about Obama's choice of Rick Warren for the inauguration.
By the historical standards of presidential hubris, Obama’s disingenuous defense of his tone-deaf invitation to Warren is nonetheless a relatively tiny infraction. It’s no Bay of Pigs. But it does add an asterisk to the joyous inaugural of our first black president. It’s bizarre that Obama, of all people, would allow himself to be on the wrong side of this history.
Obama and exercise
I just keep liking this guy more and more.
It's a schedule he started as a 22-year-old student at Columbia University in New York, and it immediately transformed him. In his 1995 autobiography, "Dreams From My Father," Obama said he was a casual drug user and an underachiever until he decided to start running three miles each day. He stopped staying out late, fasted on Sundays and became a voracious reader, spending most of his time alone in his apartment reading classic literature and philosophical texts.
Physical fitness yielded mental fitness, Obama decided, and the two concepts have been married in his mind ever since.
Saturday, December 27, 2008
Drugs and doctors
A damning book review, written by an editor of the New England Journal of Medicine, against the medical profession and pharmaceutical industry.
The problems I've discussed are not limited to psychiatry, although they reach their most florid form there. Similar conflicts of interest and biases exist in virtually every field of medicine, particularly those that rely heavily on drugs or devices. It is simply no longer possible to believe much of the clinical research that is published, or to rely on the judgment of trusted physicians or authoritative medical guidelines. I take no pleasure in this conclusion, which I reached slowly and reluctantly over my two decades as an editor of TheNew England Journal of Medicine.The medical profession is truly losing the trust of the public. Consider the rising rate of people opting out of immunizing their children. After reading articles like this, you can almost sympathize.
Thursday, December 18, 2008
Anthony McGill is playing at Obama's inauguration
A great clarinetist I went to high school with is playing at Obama's inauguration with Yo-Yo Ma and Itzhak Perlman.
Sunday, December 14, 2008
Bubbles
Fascinating article about financial bubbles and human psychology, complete with experiments.
Saturday, December 13, 2008
Mouse euthanasia
There was a mouse in my kitchen sink this morning. I trapped it in a yogurt container. I'm not sure what to do with it. I looked up "humanely kill mice". I found a surprising amount of literature. Apparently freezing (I was going to just leave it outside in the trash) is not recommended. Apparently it's very painful. I think I'm going to try a small animal gas chamber. Seems simple enough. Kind of like a science experiment too. I don't have the guts to grab it by the tail and bang it against a table, as most people suggest.
.....
Hmm. Not sure I'd recommend that method. I just put the yogurt container in a big ziploc bag with a glass of vinegar. Then I undid the lid, and dropped about a tablespoon of baking soda into the vinegar. I was very surprised to see how much CO2 came out. The gallon ziploc was full within about 5 seconds. It definitely did the trick, but perhaps it's a little elaborate. I should have just put a mousetrap in the sink.
.....
Hmm. Not sure I'd recommend that method. I just put the yogurt container in a big ziploc bag with a glass of vinegar. Then I undid the lid, and dropped about a tablespoon of baking soda into the vinegar. I was very surprised to see how much CO2 came out. The gallon ziploc was full within about 5 seconds. It definitely did the trick, but perhaps it's a little elaborate. I should have just put a mousetrap in the sink.
Wednesday, December 10, 2008
Monday, December 08, 2008
Funny
From the Wikipedia article on AJAX (Asynchronous Javascript and XML):
"Despite the name, the use of JavaScript and XML is not required, and they do not have to be used asynchronously."
"Despite the name, the use of JavaScript and XML is not required, and they do not have to be used asynchronously."
Sunday, December 07, 2008
svn peg revisions
I needed a peg revision for the first time today. I deleted a directory from a repository, say foo at revision X, and created a new one with the same name. Then I deleted the new one and wanted the old one back. I'm now at revision Y. When I tried to
svn copy -r X foo ./foo
I got the error
svn: File not found: revision Y, path 'foo'
What a strange error message! Why revision Y? Anyway, svn is confused. The solution is
svn copy -r X foo@X ./foo
svn copy -r X foo ./foo
I got the error
svn: File not found: revision Y, path 'foo'
What a strange error message! Why revision Y? Anyway, svn is confused. The solution is
svn copy -r X foo@X ./foo
Friday, December 05, 2008
Monday, November 24, 2008
Tuesday, November 18, 2008
Bach Cantata Pilgrimage
"Study Bach. There you will find everything." -Brahms.
"Not Brook (Bach), but Ocean should have been his name." -Beethoven
I recently got ahold of about a third of the Bach cantatas from John Elliot Gardiner's "Pilgrimage" project. It is supurb, far better than the other two sets of cantatas I've heard before. I've written before about cantata BWV 106, which is impeccable in this collection. I'm also listening to some I've never heard before. BWV 33 jumps out at me as another great example. The rousing first movement theme culminates in a simple hemiola, that is so incredibly effective I smile just thinking of it. I don't often wish I played the oboe, but I certainly do now.
"Not Brook (Bach), but Ocean should have been his name." -Beethoven
I recently got ahold of about a third of the Bach cantatas from John Elliot Gardiner's "Pilgrimage" project. It is supurb, far better than the other two sets of cantatas I've heard before. I've written before about cantata BWV 106, which is impeccable in this collection. I'm also listening to some I've never heard before. BWV 33 jumps out at me as another great example. The rousing first movement theme culminates in a simple hemiola, that is so incredibly effective I smile just thinking of it. I don't often wish I played the oboe, but I certainly do now.
Why a Detroit bailout is a terrible idea.
http://online.wsj.com/article/SB122669746125629365.html
I agree completely, especially with the oft given rationale that it would allow GM to retool to build fuel efficient vehicles. "It's like asking the cigarette industry to help with cancer research".
Update:
Here's another one. I hadn't heard of Leyland. Perhaps the WTO may actually keep us from doing something stupid this time, rather than keeping us from protecting sea turtles.
http://www.nytimes.com/2008/11/18/business/economy/18car.html?em
Update:
Yet another, from Mitt Romney. I haven't agreed with anything he's said since his presidential campaign.
http://www.nytimes.com/2008/11/19/opinion/19romney.html?em
I agree completely, especially with the oft given rationale that it would allow GM to retool to build fuel efficient vehicles. "It's like asking the cigarette industry to help with cancer research".
Update:
Here's another one. I hadn't heard of Leyland. Perhaps the WTO may actually keep us from doing something stupid this time, rather than keeping us from protecting sea turtles.
http://www.nytimes.com/2008/11/18/business/economy/18car.html?em
Update:
Yet another, from Mitt Romney. I haven't agreed with anything he's said since his presidential campaign.
http://www.nytimes.com/2008/11/19/opinion/19romney.html?em
Monday, November 17, 2008
Saturday, November 15, 2008
Thursday, November 13, 2008
Malik Rahim
Last night I went to an awards dinner for the Thomas Merton Center. The main award recipient was Malik Rahim, a community organizer from New Orleans. The stories he had to tell were horrific, but the speech overall was empowering. Mostly he stressed getting involved in social justice work where you are.
Wednesday, November 12, 2008
Tuesday, November 11, 2008
The Irrelevant South
A very upsetting article about the racist South. The only silver lining is that the South is becoming increasingly irrelevant in politics. It's almost a shame how much they will benefit from the expected expansion of infrastructure and social services.
Sunday, November 09, 2008
Evil
If only there were evil people somewhere insidiously committing evil deeds, and it were necessary only to separate them from the rest of us and destroy them. But the line dividing good and evil cuts through the heart of every human being. And who is willing to destroy a piece of his own heart?
-Solzenitzen, The Gulag Archipelago
-Solzenitzen, The Gulag Archipelago
Friday, November 07, 2008
The Problems of Philosophy
Tuesday, November 04, 2008
iPod fiasco
My iPod had a little accident while I was home in CA for my grandfather's funeral. It was raining for the first time in six months, and I happened to be out doing errands. Somehow, my iPod managed to fall out of my pocket while I was getting in the car. The door closed on the cord though, and I didn't notice. I then proceeded to drag the ipod along the pavement and through big puddles for 3 blocks or so. Surprinsingly, the ipod structure didn't look damaged, but all the water did its work, and after a few death throes (flickers), it became a no longer I-functioning body.
I got a new iPod the next day. Besides CoverFlow, which is truly annoying, the new iPod nanos are nice. I also discovered a good auction site, uBid, something like ebay, but for new things. There I got a Macally mirage cover for it. It's very nice.
I got a new iPod the next day. Besides CoverFlow, which is truly annoying, the new iPod nanos are nice. I also discovered a good auction site, uBid, something like ebay, but for new things. There I got a Macally mirage cover for it. It's very nice.
Monday, November 03, 2008
Unison Aborted
I use the Unison file synchronizer extensively. I was very disappointed when I was recently trying to copy a directory structure I copied from a cd lately. I ran unison, and it failed with the sole message "Aborted". No file or directory name, no hint to the problem. After much frustration, I finally found the problem. The Windows machine that made the cd had for some reason created a bunch of files beginning with a ".". (perhaps for indexing purposes?) After deleting these files with
find . -name "\.*" -exec rm -f {} \;
Unison worked correctly. Why couldn't they issue a reasonable error message?
Update:
Turns out those '.' files were "Resource forks", a Mac HFS relic. If you
add "rsrc = false" to the profile, it will ignore the offending files.
find . -name "\.*" -exec rm -f {} \;
Unison worked correctly. Why couldn't they issue a reasonable error message?
Update:
Turns out those '.' files were "Resource forks", a Mac HFS relic. If you
add "rsrc = false" to the profile, it will ignore the offending files.
Subscribe to:
Posts (Atom)

