This map is really clever.
Realtime Map of US Shoe Purchases from Zappos.
7 April 2009 |
4:01 |
General |
No Comments
Reloading a File in Adobe Reader
2 April 2009 |
21:49 |
Computing, Linux |
No Comments
When working on document in LaTeX that is going to wind up as a PDF (e.g. my thesis), I prefer to look at it in Adobe Reader. Acroread seems to give the best impression of what the document will actually look like. In practice, though, I use xpdf, because it has a “reload” capability that allows me to immediately view changes. Acroread doesn’t have this. However, someone very clever has come up with a workaround. I found out about it here, and it is evidently due Alexander Grahn.
Create a file called ~/.adobe/Acrobat/8.0/JavaScripts/reload.js with:
reloadCurrentDoc = app.trustedFunction(
function(currentDoc) {
app.beginPriv();
currentDocView=currentDoc.viewState;
currentDocPath=currentDoc.path;
currentDoc.closeDoc();
currentDoc=app.openDoc(currentDocPath);
currentDoc.viewState=currentDocView;
app.endPriv();
});
app.addMenuItem({
cName: "reloadCurDoc",
cUser: "Reload",
cParent: "File",
cExec: "reloadCurrentDoc(event.target);",
cEnable: "event.rc = (event.target != null);",
nPos: 0
});
app.addToolButton({
cName: "reloadCurDoc",
cExec: "reloadCurrentDoc(event.target);",
cToolText: "Reload the current document",
cEnable: "event.rc = (event.target != null);",
cLabel: "Reload",
nPos: -1
});
Reopen Acroread and you now have a reload button!
When working on document in LaTeX that is going to wind up as a PDF (e.g. my thesis), I prefer to look at it in Adobe Reader. Acroread seems to give the best impression of what the document will actually look like. In practice, though, I use xpdf, because it has a “reload” capability that allows me to immediately view changes. Acroread doesn’t have this. However, someone very clever has come up with a workaround. I found out about it here, and it is evidently due Alexander Grahn.
Create a file called ~/.adobe/Acrobat/8.0/JavaScripts/reload.js with:
reloadCurrentDoc = app.trustedFunction(
function(currentDoc) {
app.beginPriv();
currentDocView=currentDoc.viewState;
currentDocPath=currentDoc.path;
currentDoc.closeDoc();
currentDoc=app.openDoc(currentDocPath);
currentDoc.viewState=currentDocView;
app.endPriv();
});
app.addMenuItem({
cName: "reloadCurDoc",
cUser: "Reload",
cParent: "File",
cExec: "reloadCurrentDoc(event.target);",
cEnable: "event.rc = (event.target != null);",
nPos: 0
});
app.addToolButton({
cName: "reloadCurDoc",
cExec: "reloadCurrentDoc(event.target);",
cToolText: "Reload the current document",
cEnable: "event.rc = (event.target != null);",
cLabel: "Reload",
nPos: -1
});
Reopen Acroread and you now have a reload button!
Len Adleman’s Sneakers Anecdotes
2 March 2009 |
19:50 |
Computing, General, Science and Math |
No Comments
Computer scientists and mathematicians like the movie Sneakers not only because it is about cryptography, but also because the jargon about factoring used in the movie is authentic. The reason it is authentic is because the directory brought Leonard Adleman (the “A” in “RSA”) in to help them. He’s written up some memories about the experience here.
Computer scientists and mathematicians like the movie Sneakers not only because it is about cryptography, but also because the jargon about factoring used in the movie is authentic. The reason it is authentic is because the directory brought Leonard Adleman (the “A” in “RSA”) in to help them. He’s written up some memories about the experience here.
The Best Credit Crisis Explanation Video
20 February 2009 |
20:19 |
Economics, General |
No Comments
This is absolutely the best explanation of the credit crisis I have seen to date:
The Crisis of Credit Visualized from Jonathan Jarvis on Vimeo.
This is absolutely the best explanation of the credit crisis I have seen to date:
The Crisis of Credit Visualized from Jonathan Jarvis on Vimeo.
Preventing Line Breaks of Equations in Latex
19 February 2009 |
21:08 |
Computing, Science and Math |
No Comments
I learned a new Latex trick today. Sometimes you have math notation inline with text, like when you use $…$. Sometimes with long equations, however, you get line breaks. Like if you have $a+b+c+d+e$, it might happily break it into $a+b+c$ and $+d+e$ on the next line. This is ugly, but using tildes as in normal text doesn’t do the right thing for spacing. The way around this is to also include curly braces like ${a+b+c+d+e}$.
I learned a new Latex trick today. Sometimes you have math notation inline with text, like when you use $…$. Sometimes with long equations, however, you get line breaks. Like if you have $a+b+c+d+e$, it might happily break it into $a+b+c$ and $+d+e$ on the next line. This is ugly, but using tildes as in normal text doesn’t do the right thing for spacing. The way around this is to also include curly braces like ${a+b+c+d+e}$.
Cambridge Annoyances
19 February 2009 |
18:42 |
Britain, General |
No Comments
There are a lot of neat things about being a grad student in Cambridge, but one thing that gets on my nerves is that I’m on the “Junior Members” mailing list at St. John’s College and cannot remove myself. The Junior Members are basically everyone who’s not faculty, but the SJC admins feel the need to email this entire group every time some undergrad does something stupid. Case in point:
Subject: Dress in Hall
To all junior members
Dress in Hall
Some junior members evidently need to be reminded that the dress code for Hall is smart casual. The porters have instructions not to admit those dressed for the beach or other diversions.
PAL
Dean
It’s like being in high school again or something.
There are a lot of neat things about being a grad student in Cambridge, but one thing that gets on my nerves is that I’m on the “Junior Members” mailing list at St. John’s College and cannot remove myself. The Junior Members are basically everyone who’s not faculty, but the SJC admins feel the need to email this entire group every time some undergrad does something stupid. Case in point:
Subject: Dress in Hall
To all junior members
Dress in Hall
Some junior members evidently need to be reminded that the dress code for Hall is smart casual. The porters have instructions not to admit those dressed for the beach or other diversions.PAL
Dean
It’s like being in high school again or something.
Metric Intuition from XKCD
5 January 2009 |
16:43 |
General, Humor |
No Comments
XKCD has a great comic about building metric intuition. Even having lived in the UK quite a bit, I still have a hard time thinking about Celsius. The little chart is both hilarious and useful.
XKCD has a great comic about building metric intuition. Even having lived in the UK quite a bit, I still have a hard time thinking about Celsius. The little chart is both hilarious and useful.
Evaluating Amazon EC2 for Scientific Computation
6 November 2008 |
3:16 |
Computing, Linux, Research, Science and Math |
No Comments
I’ve written some fairly heavy Markov chain Monte Carlo code in Java and would like to let it run for a while. The cluster in the Inference Group is not terribly up-to-date and it’s obnoxious to run computationally-significant jobs on colleagues’ desktops anyway. This seemed like a good opportunity to try out Amazone Elastic Compute Cloud (EC2). The idea with EC2 is that you can fire up an “instance” whenever you want and you just pay for when it’s running and for the bandwidth. For scientific computation this is very appealling. I don’t always have jobs to run, so it would be nice to just pay for what I need. They have the “normal” instances that are meant for hosting web applications and they also have “high-CPU” instances that would seem well-suited for scientific computation. They have a “medium” type (c1.medium) and an “extra large” type (c1.xlarge). The medium instance has two virtual cores, 1.7GB of memory and costs $0.20/hour. It seems roughly equivalent to a Core 2 Duo. The extra large instance has eight cores, 7GB of memory, is 64-bit and costs $0.80/hour.
It is really easy to get one of these up and going. You can just follow the instructions in the Getting Started Guide. You need to set up various security aspect (which you can do easily from the command line) and then fire up an instance. You need to pick one of the virtual machine images (AMIs). I suggest using one of the Ubuntu images here.
The frustrating part is that unlike web hosting, in scientific computation I want to fire up an instance and take it down easily. Unfortunately, any data on the instance is lost when you take it down. So, to get the tools required for your work, you will need to make a custom image. You start with a base image, set it all up and then store off your custom image to Amazon S3. From there you can start an instance from your private image just like you could with the public instances. Whatever calculations you make will need to be stored somewhere else if you shut down the instance again. If you have some ephemeral state that you require for starting your computation then you’ll need to upload it whenever you fire up a new instance.
So, it’s not a magic bullet, but it seems to have some nice potential. The 8-core machine is kind of like renting a Ferarri for a day. Even though my code parallellizes quite well, I don’t get anything near linear speedup. I think this may be due to limited cache-coherency. Nonetheless, it seems about twice as fast as the dual-core machine.
I’ve written some fairly heavy Markov chain Monte Carlo code in Java and would like to let it run for a while. The cluster in the Inference Group is not terribly up-to-date and it’s obnoxious to run computationally-significant jobs on colleagues’ desktops anyway. This seemed like a good opportunity to try out Amazone Elastic Compute Cloud (EC2). The idea with EC2 is that you can fire up an “instance” whenever you want and you just pay for when it’s running and for the bandwidth. For scientific computation this is very appealling. I don’t always have jobs to run, so it would be nice to just pay for what I need. They have the “normal” instances that are meant for hosting web applications and they also have “high-CPU” instances that would seem well-suited for scientific computation. They have a “medium” type (c1.medium) and an “extra large” type (c1.xlarge). The medium instance has two virtual cores, 1.7GB of memory and costs $0.20/hour. It seems roughly equivalent to a Core 2 Duo. The extra large instance has eight cores, 7GB of memory, is 64-bit and costs $0.80/hour.
It is really easy to get one of these up and going. You can just follow the instructions in the Getting Started Guide. You need to set up various security aspect (which you can do easily from the command line) and then fire up an instance. You need to pick one of the virtual machine images (AMIs). I suggest using one of the Ubuntu images here.
The frustrating part is that unlike web hosting, in scientific computation I want to fire up an instance and take it down easily. Unfortunately, any data on the instance is lost when you take it down. So, to get the tools required for your work, you will need to make a custom image. You start with a base image, set it all up and then store off your custom image to Amazon S3. From there you can start an instance from your private image just like you could with the public instances. Whatever calculations you make will need to be stored somewhere else if you shut down the instance again. If you have some ephemeral state that you require for starting your computation then you’ll need to upload it whenever you fire up a new instance.
So, it’s not a magic bullet, but it seems to have some nice potential. The 8-core machine is kind of like renting a Ferarri for a day. Even though my code parallellizes quite well, I don’t get anything near linear speedup. I think this may be due to limited cache-coherency. Nonetheless, it seems about twice as fast as the dual-core machine.
The $700B Bailout in Perspective
24 September 2008 |
3:21 |
Economics, Politics |
No Comments
The proposed bailout of the financial services sector is a “loan” of $700 billion. I put quotes around “loan” because the whole point is for the government to buy bad debt, so it’s really a handout. We all will buy our little share of these bad mortgages, regardless of whether we took out some ridiculous loan to flip a condo or not. Slate puts it in perspective:
There are about 300 million men, women, and children currently living (legally) in the United States, so the bailout is equal to roughly $2,300 per person. That’s right around what we each paid, on average, for gas and oil in 2006 ($2,227) and a bit less than our average personal tax burden ($2,432).
Think the price of gas is too high? Well, you could buy gas or you could pay for the bailout. Are you someone who complains a lot about welfare recipients getting money from your taxes? Here you go – you’re providing retrospective welfare to people who got rich taking the risks that caused this crisis. That’s basically all of your tax dollars right there: no Iraq or Afghanistan, no health care or veterans’ services, no highways or education – all your tax money this year is going straight to this bailout.
The proposed bailout of the financial services sector is a “loan” of $700 billion. I put quotes around “loan” because the whole point is for the government to buy bad debt, so it’s really a handout. We all will buy our little share of these bad mortgages, regardless of whether we took out some ridiculous loan to flip a condo or not. Slate puts it in perspective:
There are about 300 million men, women, and children currently living (legally) in the United States, so the bailout is equal to roughly $2,300 per person. That’s right around what we each paid, on average, for gas and oil in 2006 ($2,227) and a bit less than our average personal tax burden ($2,432).
Think the price of gas is too high? Well, you could buy gas or you could pay for the bailout. Are you someone who complains a lot about welfare recipients getting money from your taxes? Here you go – you’re providing retrospective welfare to people who got rich taking the risks that caused this crisis. That’s basically all of your tax dollars right there: no Iraq or Afghanistan, no health care or veterans’ services, no highways or education – all your tax money this year is going straight to this bailout.
The Dangerous Sarah Palin
21 September 2008 |
20:15 |
Politics |
No Comments
This Newseek article presents a fantastic case as to why Sarah Palin is actually a dangerous choice to govern the United States. The author goes on to discuss the bizarre situation in US politics where qualifications for office are actually a detriment:
Ask yourself: how has “elitism” become a bad word in American politics? There is simply no other walk of life in which extraordinary talent and rigorous training are denigrated. We want elite pilots to fly our planes, elite troops to undertake our most critical missions, elite athletes to represent us in competition and elite scientists to devote the most productive years of their lives to curing our diseases. And yet, when it comes time to vest people with even greater responsibilities, we consider it a virtue to shun any and all standards of excellence. When it comes to choosing the people whose thoughts and actions will decide the fates of millions, then we suddenly want someone just like us, someone fit to have a beer with, someone down-to-earth—in fact, almost anyone, provided that he or she doesn’t seem too intelligent or well educated.
This Newseek article presents a fantastic case as to why Sarah Palin is actually a dangerous choice to govern the United States. The author goes on to discuss the bizarre situation in US politics where qualifications for office are actually a detriment:
Ask yourself: how has “elitism” become a bad word in American politics? There is simply no other walk of life in which extraordinary talent and rigorous training are denigrated. We want elite pilots to fly our planes, elite troops to undertake our most critical missions, elite athletes to represent us in competition and elite scientists to devote the most productive years of their lives to curing our diseases. And yet, when it comes time to vest people with even greater responsibilities, we consider it a virtue to shun any and all standards of excellence. When it comes to choosing the people whose thoughts and actions will decide the fates of millions, then we suddenly want someone just like us, someone fit to have a beer with, someone down-to-earth—in fact, almost anyone, provided that he or she doesn’t seem too intelligent or well educated.
Credit Crisis Cartoon
19 September 2008 |
16:33 |
Economics |
No Comments
There is a great (although badly-drawn) cartoon here that explains very well how we got into this credit crunch.
There is a great (although badly-drawn) cartoon here that explains very well how we got into this credit crunch.
Ari Melber Calls a Duck a Duck
12 September 2008 |
17:24 |
Politics |
No Comments
This is a fantastic video from MSNBC where a journalist named Ari Melber destroys a McCain representative on a blatant misrepresentation that the campaign is attempting to make about Obama’s voting record.
This is a fantastic video from MSNBC where a journalist named Ari Melber destroys a McCain representative on a blatant misrepresentation that the campaign is attempting to make about Obama’s voting record.
Useful Hurricane Tracker
8 September 2008 |
19:23 |
General |
No Comments
Stormpulse.com looks like it might be a good (although maybe too fancy) way to keep an eye on hurricanes in the gulf. I bring this up because at the moment, Ike is headed directly for my hometown.
Stormpulse.com looks like it might be a good (although maybe too fancy) way to keep an eye on hurricanes in the gulf. I bring this up because at the moment, Ike is headed directly for my hometown.
Great Post About the RNC Message
5 September 2008 |
16:35 |
Civil Liberties, Politics |
No Comments
Even though I often agree with them in principle, I pretty much ignore the Daily Kos people as being the Democrat equivalent of the Drudge Report and Rush Limbaugh. However, this post really spoke to me, and makes an observation that I have also been making: the Republicans just seem to want to slam Obama et al, without ever talking about issues. I feel confident that there are planks in McCain’s platform that I would agree with, but they never come up. A few weeks ago, I thought this was a valid complaint against the Obama campaign, but in the interim he’s become much more clear about the specific ways he wants to change things. The McCain campaign has not been doing this. From the article:
All I heard was a long stream of extremely bitter attacks against Barack Obama, none of which go even the slightest step towards solving the problems of this country. When I tuned in, Rudy Giuliani was firing off some attacks, but I expected that – every convention has some room for criticism of the opposition.
But Palin’s speech was obviously meant to be the centerpiece, the real statement about the direction of the Republican party.
And I heard absolutely nothing about their plans for the future.
The article also talks about Palin’s “joke” about “worrying about reading terrorists their rights” and the author is spot on. If we are really the “good guys” in the War on Terror, we have to fight the good fight and we have to support human rights to the very end, no matter what. What the hell is America about if not about fundamental human rights? That’s what the very idea of America is: freedom of speech, freedom of religion, freedom of the press, the right to bear arms, equality in representation, and the right to a fair trial.
Even though I often agree with them in principle, I pretty much ignore the Daily Kos people as being the Democrat equivalent of the Drudge Report and Rush Limbaugh. However, this post really spoke to me, and makes an observation that I have also been making: the Republicans just seem to want to slam Obama et al, without ever talking about issues. I feel confident that there are planks in McCain’s platform that I would agree with, but they never come up. A few weeks ago, I thought this was a valid complaint against the Obama campaign, but in the interim he’s become much more clear about the specific ways he wants to change things. The McCain campaign has not been doing this. From the article:
All I heard was a long stream of extremely bitter attacks against Barack Obama, none of which go even the slightest step towards solving the problems of this country. When I tuned in, Rudy Giuliani was firing off some attacks, but I expected that – every convention has some room for criticism of the opposition.
But Palin’s speech was obviously meant to be the centerpiece, the real statement about the direction of the Republican party.
And I heard absolutely nothing about their plans for the future.
The article also talks about Palin’s “joke” about “worrying about reading terrorists their rights” and the author is spot on. If we are really the “good guys” in the War on Terror, we have to fight the good fight and we have to support human rights to the very end, no matter what. What the hell is America about if not about fundamental human rights? That’s what the very idea of America is: freedom of speech, freedom of religion, freedom of the press, the right to bear arms, equality in representation, and the right to a fair trial.
NFL Television Broadcast Maps
5 September 2008 |
15:22 |
NFL |
No Comments
Brenda and I are often wondering what games exactly will be shown in our area on Sundays. We no longer have this problem, however, due to this site. It provides maps of the major network coverage of the upcoming weekend’s games.
Brenda and I are often wondering what games exactly will be shown in our area on Sundays. We no longer have this problem, however, due to this site. It provides maps of the major network coverage of the upcoming weekend’s games.
Jon Stewart Shreds Media Commentators
4 September 2008 |
17:58 |
Humor, Politics |
No Comments
Brain Function Discussions
20 August 2008 |
16:14 |
Research |
No Comments
There has been a really interesting (and inbox-filling) debate about the correct course for brain research on the comp-neuro (that’s “Computational Neuroscience”) mailing list. There is a summary of the discussions here.
There has been a really interesting (and inbox-filling) debate about the correct course for brain research on the comp-neuro (that’s “Computational Neuroscience”) mailing list. There is a summary of the discussions here.
ICML Lectures Online
19 August 2008 |
21:24 |
Research, Science and Math |
No Comments
You can now see a video of a talk I gave at the 2008 ICML/UAI/COLT Workshop on Nonparametric Bayes over at VideoLectures.net, along with a bunch of other talks from the Helsinki conferences, including one given by Oliver Stegle about a paper we wrote together.
You can now see a video of a talk I gave at the 2008 ICML/UAI/COLT Workshop on Nonparametric Bayes over at VideoLectures.net, along with a bunch of other talks from the Helsinki conferences, including one given by Oliver Stegle about a paper we wrote together.
Installing Tom Minka’s Lightspeed on Linux
19 August 2008 |
17:26 |
Computing, Matlab |
No Comments
I am a huge fan of Tom Minka’s Lightspeed Toolbox for MATLAB. I am so dependent on it that I can’t even remember which functions are native to MATLAB and which are Tom’s inventions. However, Tom is at Microsoft Research Cambridge and so he doesn’t spend much time making sure that it works easily on Linux. So every time I install it, I have to modify the installation file “install_lightspeed.m”. So, here is the diff:
25,29c25
< if ispc
< w = fullfile(matlabroot,'toolbox\matlab\elmat\repmat.m');
< else
< w = fullfile(matlabroot,'toolbox/matlab/elmat/repmat.m');
< end
---
> w = fullfile(matlabroot,’toolbox\matlab\elmat\repmat.m’);
84,85d79
< lapacklib = '-llapack';
< blaslib = '-lblas';
148c142
< eval(['mex -f ' fullfile(matlabroot, 'bin/matopts.sh') ' matfile.c']);
---
> mex -f matopts.sh matfile.c
Note that this doesn’t really fix everything. I still get errors regarding ‘matfile.c’ but it’s an improvement.
I am a huge fan of Tom Minka’s Lightspeed Toolbox for MATLAB. I am so dependent on it that I can’t even remember which functions are native to MATLAB and which are Tom’s inventions. However, Tom is at Microsoft Research Cambridge and so he doesn’t spend much time making sure that it works easily on Linux. So every time I install it, I have to modify the installation file “install_lightspeed.m”. So, here is the diff:
25,29c25
< if ispc
< w = fullfile(matlabroot,'toolbox\matlab\elmat\repmat.m');
< else
< w = fullfile(matlabroot,'toolbox/matlab/elmat/repmat.m');
< end
---
> w = fullfile(matlabroot,’toolbox\matlab\elmat\repmat.m’);
84,85d79
< lapacklib = '-llapack';
< blaslib = '-lblas';
148c142
< eval(['mex -f ' fullfile(matlabroot, 'bin/matopts.sh') ' matfile.c']);
---
> mex -f matopts.sh matfile.c
Note that this doesn’t really fix everything. I still get errors regarding ‘matfile.c’ but it’s an improvement.
Radford Neal Has a Blog
19 August 2008 |
16:14 |
Research, Science and Math |
No Comments
You won’t find many people with Bayesian chops like Radford Neal at the University of Toronto. Fortunately for the rest of us, he’s started a blog.
You won’t find many people with Bayesian chops like Radford Neal at the University of Toronto. Fortunately for the rest of us, he’s started a blog.