Monday, September 6, 2010

FTK projects

Note to self: a brief and likely incomplete list of FTK projects that I worked on:
  • Transition from space points to raw hits (with Kohei Yorita)
  • Implementation of two-dimensional pixel superstrips
  • Advanced grid infrastructure, dq2 dataflow management
  • Branch of PandaTools for FTK jobs
  • Bank production (with Alberto) on the grid: without subregion inefficiency
  • Python wrappers that automate bank production and FTK simulation:
  • PBS and threaded job submission scripts
  • SS-shifted architecture
  • Split architecture, also known as "Option B" (with Constantinos Melachrinos)
  • Text-based and root-based track and region lookup
  • Empiric linearity studies, including FTK simulation with halved B-layer
  • Minimum pT for FTK simulation studies (increase from 1 GeV to 1.5 or 2.0 GeV)
  • hashmap-based implementation of AM that works with arbitrarily small superstrips
  • HOLA card firmware, testing, and commissioning
  • Automatic Trigger Validation shift software

Sunday, September 5, 2010

Free software for windows

Note to self: here is a list of useful windows programs that can be downloaded for free:
  • PDFCreator installs a virtual printer that creates PDF documents from any application that supports printing
  • VLC - a media player that plays/converts all non-DRM and non-RealMedia formats. Also includes an excellent video streaming server
  • OpenOffice - complete replaces Microsoft Office (Word, Excel, Powerpoint)
  • Chrome - an extremely fast web browser from Google that is well integrated with their online offerings
  • utorrent - lightweight but highly configurable bit-torrent client
  • TrueCrypt - encrypted file containers
  • Putty - quick ssh access from Windows
  • Xming - X-server for windows. Unfortunately, I sometimes find it buggy on Windows 7 with Putty:-(
  • Winscp - SFTP client
  • VirtualBox - my favorite virtualization solution
  • Notepad++ - programming editor with syntax highlighting and tabs
  • Windows PowerShell - replaces "cmd" on windows
  • unxutils - port of common GNU linux utilities to windows (ls, grep, find, etc)
  • FastStone Image Viewer - image viewer with basic batch processing capabilities
  • Paint.Net - replaces Photoshop for most purposes
  • FormatFactory - convert between video formats
  • 7-Zip - archiver/unarchiver that includes support for 7zip and rar
  • CCleaner - simple junk cleaner

Tuesday, April 6, 2010

Concurrent Filing of I-130 and I-485

In case this is useful for someone: here is a cover letter and a list of documents that we sent to USCIS when we applied for my green card. All paperwork was split into four separate binders (corresponding to four primary federal forms that had to be filed) and sent out in one thick envelope. Our application was approved very promptly, and our immigration officer appeared to be very satisfied with the paperwork.

Cover Letter
March 10, 2009
Mary Poppins (marypoppins@gmail.com) and John Stark (jstark@gmail.com)

Address:
5555 Woodlawn Ave, Apt 55
Chicago, IL 65555

Phone:
773-555-5555

USCIS
Attn: FBAS
131 South Dearborn - 3rd Floor
Chicago, IL 60603-5517

Re: Concurrent Filing of I-130, Petition for Alien Relative and I-485, Application to Register Permanent Residence or Adjust Status

Petitioner (U.S. Citizen): Mary Poppins
Beneficiary (Alien Spouse): John Stark

Dear Sir/ Madam:

Please kindly find enclosed concurrent filing of Forms I-130, Petition for Alien Relative and I-485, Application to Register Permanent Residence or Adjust Status for my husband, John Stark and supporting documents.

Copies of documents submitted are exact copies of unaltered documents and we understand that we may be required to submit original documents to an Immigration or Consular officer at a later date. Note that some copies came out bigger or smaller than the originals due to our printer configuration, but in all cases all relevant information is legible and easily readable.

The following page lists the full contents of the package. Feel free to contact us if we missed something, or if you need further evidence in support of this application.

Thank you very much.
Sincerely,
Mary Poppins _____________________ March 10, 2009
John Stark _____________________ March 10, 2009

Package 1: I-130 and evidence
1. Payment of $355 fee for I-130 form (personal check) 
2. I-130 form
3. Copy of sponsoring citizen’s unexpired passport
  1. Biographical Page
  2. All other non-empty pages (visas and entry stamps)
4. Copy of sponsoring citizen’s CERTIFICATE OF NATURALIZATION
5. Copy of intending immigrant’s passport
  1. Biographical page
  2. Visa and entry stamps
6. Copy of intending immigrant’s I-94 card
7. Certified copy of Marriage Certificate from Cook County, IL
8. G-325A form for sponsoring US citizen
9. One passport-style photo of sponsoring US citizen
10. G-325A form for intending immigrant
11. One passport-style photo of intending immigrant
12. Proof of a bona-fide marriage
  1. Introduction letter describing how we met and got married
  2. Statement from the bank (our joint checking account is highlighted)
  3. Photo from family reunion showing intending immigrant, sponsor, and their parents

Package 2: I-485 and evidence
1. Payment of $1010 for I-485 and biometric fee
2. I-485 form
3. I-693 form, Medical Examination (in a sealed envelope)
4. Certified copy of Marriage Certificate
5. Copy of intending immigrant’s birth certificate
  1. Declaration of translator
  2. English translation
  3. Actual copy (in Polish)
6. Copy of intending immigrant’s passport
  1. Biographical page
  2. Visa and entry stamps
7. Copy of both sides of I-94 form
8. Copy of intending immigrant’s SEVIS I-20 form (F-1 student)
9. Letter from intending immigrant’s current educational institution
10. G-325A form for intending immigrant
11. Two passport-type photos of the intending immigrant
12. Resume and list of publications of intending immigrant
13. I-864 form, Affidavit of Support
  1. Introductory letter explaining sources of funds used to satisfy income requirements
  2. Original job offer from sponsor’s current employer
  3. Recent paycheck stub for sponsor
  4. A letter from intending immigrant’s Ph.D. advisor
  5. Recent paycheck stub for intending immigrant
  6. Tax documents
    6.1. 2008 joint tax return for sponsor Mary Poppins and intending immigrant John Stark
      6.1.1. Joint 2008 Federal Tax Return
      6.1.2. Mary Popins' 2008 W-2 (University of Chicago)
      6.1.3. Mary Poppins’s 2008 W-2 (Awesome Investment Bank Inc.)
      6.1.4. John Stark’s 2008 W-2
    6.2. 2007 tax return for sponsor, Mary Poppins
      6.2.1. Mary Poppins’s 2007 Federal Tax Return
      6.2.2. Mary Poppins’s 2007 W-2
    6.3. 2007 tax return for intending immigrant, John Stark
      6.3.1. John Stark’s 2007 Federal Tax Return
      6.3.2. John Stark’s 2007 W-2
      6.3.3. John Stark’s 2007 1099-INT (Bank of America)
    6.4. 2006 tax return for sponsor, Mary Poppins
      6.4.1. Mary Poppins’s 2006 Federal Tax Return
      6.4.2. Mary Poppins’s 2006 W-2
   6.5. 2006 tax return for intending immigrant, John Stark
      6.5.1. John Stark’s 2006 Federal Tax Return
      6.5.2. John Stark’s 2006 1040-X (amended return)
      6.5.3. John Stark’s 2006 W-2
      6.5.4. John Stark’s 2006 1099-INT

Package 3: I-131 and evidence
1. I-131 form
2. Explanation showing the circumstances that warrant issuance of an Advance Parole Document
3. Copy of intending immigrant’s passport
  1. Biographical page
  2. Visa and entry stamps
4. Copy of both sides of I-94 form
5. 2 photos

Package 4: I-765 and evidence
1. I-765 form
2. Copy of intending immigrant’s I-94
3. 2 photos

Thursday, March 11, 2010

Joel's 12 steps to better code - in HEP

This is inspired by Joel's 12 steps to better code:
http://www.joelonsoftware.com/articles/fog0000000043.html

Although we are high energy physicists, most of our time is spent writing code (in C or C++). So I thought it would be curious to see how we measure up to the best practices advocated by professional programmers.

  • Do you use source control?
Yes. We have 3-4 people actively working on the code in Chicago and about 2 people in Italy, so version control was very useful. We started with CVS provided by ATLAS, and got upgraded along with everyone else to SVN in 2009.
  • Can you make a build in one step?
Yes. We have a bash wrapper that sets up and builds the software in one step. However, some environment variables need to be set by the user. For developers / active users, this is not an issue, but newbies often have trouble.
  • Do you make daily builds?
No. That would be useful, and some members of the team suggested it, but we never got around implementing it. As a matter of fact, we don't even have a set of robust test cases. I had committed a simple big-picture test a while ago, but it never caught up and is probably deprecated by now.
  • Do you have a bug database?
No. But it would be very useful! I remember cases when bug fixing was delayed and sometimes forgotten altogether until someone else got hit by the same bug (superstrip map format, anyone?)
  • Do you fix bugs before writing new code?
No. And that's a problem. In academia, we are often under pressure to produce results, even with buggy code. So we end up introducing temporary workarounds and forgetting about them...
  • Do you have an up-to-date schedule?
Yes. We don't have a formal centralized schedule, but it is constantly brought up in weekly meetings (and thus kept in agenda pages), with specific tasks and approximate completion dates. Interestingly, the completion date estimates are almost always a factor of two shorter than what they end up being in practice.
  • Do you have a spec?
No. But I don't think we could. New ideas pop up almost every week, so the spec document would be completely fluid. Effectively, we have that in the agenda pages for the weekly meetings.
  • Do programmers have quiet working conditions?
No. We have offices, but we usually share them with another grad student. This results in frequent chatter about stuff unrelated to work, with the subsequent drop in productivity.
  • Do you use the best tools money can buy?
Yes. Lucky us - we can get academic discounts on fancy electronics design software, or sometimes just get it for free. And the GNU compiler collection is free anyway - and it's very good!
  • Do you have testers?
Haha, testers in academia? On a more serious note, first-year grad students effectively act as testers before they learn enough to start coding new projects themselves.
  • Do new candidates write code during their interview?
No, we are physicists after all, not programmers. Some people starting a Ph.D. in high energy physics don't even know how to close an emacs window and are completely clueless when the compiler throws an error message. But to be fair, most of us had quite a bit of coding experience before coming to grad school.
  • Do you do hallway usability testing?
In a way, we do. A newly written feature often immediately gets into the hands of a beginning graduate student who will run it and report any problems or unexpected results.

Cooking attempt # 1

So Meng made a bet with me that I won't be able to cook a meal entirely on my own. Although I HIGHLY dislike cooking, I just had to prove her wrong. So here goes:

Homemade Chicken Fettuccine (from allrecipes.com).

1 yellow pepper - $0.26
1 broccoli - $0.58 (will last for one more meal)
whipping cream - $1.79
parmesan cheese - $2.38 (will last for several meals)
8oz mushrooms - $1.49
1 club of garlic - $0.33 (will last for several meals)
pack of butter - $3.49 (will last for several meals)
1 garlic salt (spices) - $0.99
3 chicken breast halves - $5.69

Total cost, weighting multi-day items appropriately:
0.26+0.58/2+1.79+2.38/4+1.49+0.33/4+3.49/6+0.99/10+5.69=10.88

Thus, the total cost is: $10.88
It took 2 hours of my time (excluding shopping time), and will feed 2 people two times.

Outstanding Asian Movies

A few years back I discovered that some movies by Chinese filmmakers resonate particularly strongly with me. I especially love movies that describe life in China under Japanese occupation and later during Cultural Revolution.
The following movies include both mainline blockbusters and rare gems. Some of them I simply found beautiful, while others left me thinking for days.


Zhang Yimou (China):
  • Shanghai Triad
  • The Road Home
  • To Live
  • The Story of Qiu Ju
  • Not One Less
  • Raise the Red Lanterns
  • Hero
China (other):
  • Lust, Caution
  • Xiu Xiu (The Sent Down Girl)
  • Chungking Express
  • Balzac and the Little Chinese Seamstress
  • 2046
  • Crouching Tiger, Hidden Dragon
Kim Ki Duk (Korea):
  • Samaritan Girl
  • 3-Iron
  • Spring, Summer, Fall, Winter... and Spring

    Saturday, September 5, 2009

    The science of Economics: Krugman vs Cochrane

    On September 2 Paul Krugman wrote an article in New York Times titled How Did Economists Get It So Wrong. First, Krugman presents several quotes from the last bull market in which prominent economists (including current chairman of the Fed) suggest that the science of macroeconomics has resolved most internal disputes and entered a "golden era", rendering the possibility of another Great Depression impossible. Of course, the market crash of 2008 puts these statements comically out of place, and Krugman makes sure to emphasize that Chicago economists got it particularly wrong by sticking to "Dark Age" research.

    The reason economists failed to predict the current downturn, according to Krugman, is because their models concentrate on the interactions of rational participants in perfect markets, largely ignoring human psychology and deviations from idealized models. Furthermore, Krugman claims that economists became fixated on creating "beautiful" mathematics for the sake of mathematics (remember Dirac?).

    Brief history of economic thought
    First, for those of us who haven't taken a course in economics for a few years, Krugman reminds how the science of macroeconomics developed since the birth of the field:
    • In 1776 Adam Smith publishes his landmark book The Birth of Nations, in which he introduces a free and perfectly efficient market that guides economic development by an invisible hand.
    • By early twentieth century, Smith's view is refined with the addition of externalities that disturb the perfectly efficient market model, in what became known as a neoclassical model of macroeconomics. However, in this view the market still rules supreme and requires no regulation from the state.
    • After the Great Depression, John Keynes publishes The General Theory of Employment, Interest, and Money, in which he argues that private sector sometimes leads to inefficient outcomes and requires active policy responses from the state to stabilize perturbations from the business cycles. Financial markets, in particular, are labeled by Keynes as "casinos" driven by the raw emotions of its participants.
    • In the second half of the twentieth century, Milton Friedman leads a broad reversion to neoclassical ideas. He advocates monetarism - limited intervention by the government that only needs to keep monetary supply consistently growing to prevent recessions.

    The two camps of economics
    Keynes considered financial markets a casino largely driven by emotions of the participants. But post-60's economists geared towards efficient markets (Fama), and this became a dominant thought in economics. Even 1987 market crash (still unexplained) didn't raise enough eyebrows. This culminated with CAPM, which assigns values to portfolios of equities, bonds, and derivatives assuming that all investors rationally balance risk against reward. Greenspan, in particular, was a large supporter of financial deregulation.

    Forty years ago macroeconomics divided into two camps: saltwater school (relatively Keynesian, concentrated around the coasts), and freshwater (more neo-classical, concentrated in midland universities).

    Edward Prescott's and other freshwater economists' explanation for why demand-driven recessions happen in a rational and efficient market: changes in demand have nothing to do with business cycles, but are caused by fluctuation in the rate of technical progress amplified by rational response of the workers, who voluntarily decide to take time off in unfavorable economic conditions (Great Depression -> Great Vacation).

    New Keynesians modified neo-classical orthodoxy to include minor additional effects, so that active policies to fight recessions could be justified. But they didn't go far enough to explain drastic effects such as Japanese real estate bubble or collapse of the Asian financial system in 1997-1998.


    New-Keynesian economists are now incorporating elements from behavioral finance, which, according to Krugman, freshwater economists reject as a mere "curiosity with no real consequences" (of course, this might just be populist labeling on Krugman's part). Andrei Shleifer et al summarize this with the following line:
    "the market can stay irrational longer than you can stay solvent"

    Krugman presents several quotations by Greenspan and others that show that they didn't believe raising housing prices throughout 2005 constituted a bubble (since bubbles don't exist in neo-classical view under efficient market hypothesis).

    How to deal with recessions
    Normally, the Fed starts buying short-term Treasury debt (Treasury Bills) from banks. This drives the government rates down and investors seeking higher returns move to other assets. This in turn drives their interest rates down, which normally results in increased economic activity. Here is the history of rate reductions:
    • 1990 recession: 9% to 3%
    • 2001 recession: 6.5% to 1%
    • 2008 recession: 5.25% to 0%
    In the current recession, even driving the short-term interest rates to zero failed to kick-start the economy. Keynesian economics suggests that in this case the government has to pick up public spending to compensate for the decrease in private spending. Apparently, freshwater economists (particularly in Chicago) are strongly against such Keynesian interventions - such as Obama's stimulus spending plan.

    Cochrane's response
    John Cochrane, one of the most prominent economists at the University Chicago, posted a rebuttal. He treats Krugman's article as a personal attack against his enemies, which now include both freshwater economists and New Keynesians.

    Cochrane summarizes Krugman's article with the following points:
    • Macroeconomics failed to predict the financial crisis of 2008
    • Financial markets are intrinsically inefficient due to irrational investors (use behavioral economics!)
    • Huge fiscal stimulus packages are beneficial, even when they are financed through trillion-dollar deficits. Krugman likes the stimulus package, and this was probably the most important point of his oped. Political reasons? (is he running for office?)
    Cochrane explains that the very foundation of modern economic theory is that nobody can predict economic cycles - not government bureaucrats or hedge fund managers. This uncertainty over predictions is built into the theory - this is sort of like quantum mechanics in physics that states that even given positions and velocities of a system, one cannot non-probabilistically predict its evolution in time.

    "Efficiency" in the markets does not promise stability. In fact, Cochrane says that "stable growth" would be a violation of efficiency (is he referring to fluctuations in the rate of technological progress?).

    Free market is a bad system, but it is a better system than all other alternatives that involve government intervention. Freddie Mae, Fannie Mac, and Congress tried to regulate the mortgage markets - and looks where we are today. Regulators are just as irrational as the market participants.

    Ricardian equivalence theorem: debt-financed spending cannot have any effect because people, seeing a higher future tax liability, will simply start saving more. But: works in China which uses non-debt based stimulus. And: what if people bank on accelerating increase in GDP growth to go around an increase in taxes.