Tuesday, December 28, 2010
Making sphinx work with postgresql
Friday, December 24, 2010
Getting postgis to work with django (and sphinx)
def _get_database_engine():
...
elif 'postgis' in settings.DATABASES['default']['ENGINE']:
return 'pgsql'
grant select on table spatial_ref_sys to chineseblade;
grant all on table geometry_columns to chineseblade;
grant all privileges on database mydb to chineseblade;
Sunday, July 25, 2010
Death of a dreamer
Monday, March 22, 2010
Obama Care, Not Even Wrong
On the following Monday I had a lunch conversation with a colleague, and the issue of health care was briefly brought up. My colleague said that he just could not understand why anybody could have opposed the bill, why anybody would think that universal health care could be a bad thing. I was quite surprise by that statement, coming from a highly educated intellectual. Because nobody thought that universal health care was a bad thing, in the sense that it was morally unjustified. People opposed it for economical reasons. People opposed it because they had not been convinced that the benefit to the nation would outweigh the economic cost. My colleague's comment just made me realize that some supporters of the health care bill had only been considering the bill on moral righteousness, not on economical feasibility.
When I pass by a homeless person on the street, I also feel the moral obligation to help. Everyone should be entitled to a roof over the head, as much as everyone should be entitled to care in sickness. But there is no legislation for universal housing.
New York City has aggressively cut its subway services. Now I often wait twice as long for a train as before. No one could have thought that cutting subway service was a good thing. But sometimes it is the fiscally responsible thing to do. Policy making is not so much about doing the morally right as about setting the right priorities, and investing the resource where it will benefit the society the most.
There are many things that should be deemed universal rights, the "good things", but in reality are not available to everyone, for the simple reason that there is not enough of it to share. It seems strange to me that some legislators are arguing the health care bill on the moral ground: "If you think it is right, you gotta help us finish the fight." That seems like sports trash talk, not a cool headed argument. The morally correct is not always economically right.
If anything, better education for everyone makes more sense than health care for everyone. After all, people don't fall sick often, and most minor ailments heal by themselves. Poor education, on the other hand, hurts a person for life, day in, day out. A better education is not only essential to maintain United States' competitive edge, but it will also better equip the Americans to evaluate the legislative bills more rationally, instead of being swayed by politicians' hot-headed rhetorics.
I kept wondering: if universal health care was such an obviously good thing, why was Massachusetts the only state in the nation that independently enacted it? Why did all the other states choose not to follow suit on their own and enact their own universal health care for their state citizens?
Even if we limit the debate entirely to the moral ground, I cannot fully justify universal health care, since it is not truly universal health care, but only health care for AMERICANS! Majority of the world's population live in poverty and do not have access to many basic life's needs. I personally detest any entitlement from a privileged birth, even though I accept it as a fact of life. But please do not use it as the basis of a moral argument. It is plain hypocrisy!
Obama called the passing of the bill "what change looks like". I am very disappointed. What Obama promised on his campaign was bipartisan politics. What I expected to see was a pragmatic approach to tackling the nation's most urgent problems, not the old ideological bigotry. The health care bill was passed without a single Republican vote. It was passed not because it was resoundingly convincing to the majority, but through insidious political manouvres that would surely anger its opponents and further divide this nation. If this is what change looks like, it is not the kind that I can believe in.
Friday, March 05, 2010
Cheaper expensive
A person with even the faintest turn of mind in economics, like me, can predict what such price restriction would do. There would be no more La Perla bras, no more Oliver Peoples sunglasses, and no more Breguet watches. So far as we want to keep luxury merchandise around, there is no way to drive down their prices, for the simple reason that price is not the paramount factor in the purchase of luxury goods. Luxury goods compete in other dimensions: quality, design, and brand recognition. The rich buy what they desire, not what is cheap.
For the same reason it will be all but impossible to rein in the cost of healthcare without sacrificing the quality of care. When we go see doctors, the cost of treatment is seldom on the top of our mind. Money is no good to anyone who is too sick to enjoy spending it. There is no financial incentive for the doctors not to prescribe the best - and often the most expensive - treatment, and there is little financial incentive for the patients to turn down a costly but presumably efficacious prescription. Healthcare is analogous to luxury goods in that the providers compete not in price but in the quality and effectiveness of care. This may sound heartless - how can something essential such as physical well-being be compared to a Gucci coat or a Hugo Boss gown! But economics is a cold-blooded reptile that knows only incentives and no morals. So long as there is no incentive from either party to control the cost at the consumption end of healthcare, i.e., when the patient sees the doctor, driving down the cost will remain political hot air.
Sunday, February 21, 2010
Dogs as pet and meat
Another noted a local saying: "when the dog meat is being simmered, even the gods become dizzy with hunger."
The Pursuit of Happiness
... that they are endowed by their Creator with certain unalienable Rights, that among these are Life, Liberty, and the pursuit of Happiness.Note that it is the pursuit of Happiness - not Happiness itself - that is among the unalienable Rights. The Obama administration and the current Democratic Party seem to leave out that crucial word "pursuit", and they kowtow to Americans' sense of entitlement. Forgotten are J.F.K.'s words "Ask not what your country can do for you - ask what you can do for your country." Americans now want their happiness handed to them on a plate.
It is often asserted that the citizens of the welfare states, such as the Scandinavian countries, are happier, and that Americans are among the less happy in the world. The surveys may say so, but the immigration trends seem to point to the opposite - I personally know quite a few friends who came to the States from the Scandinavian nations. Do immigrants come to the United States in search of misery? That seems to violate the basic human instinct.
Some Americans will always be happier than others; that disparity will remain ubiquitous in this world. But the strength of the United States lies in its social mobility. Nobody is limited by his or her circumstance of birth; everybody is truly blessed with the equal and unalienable right: the pursuit of happiness.
Math in Tax
If your itemized deductions are subject to the limit, the total of all your itemized deductions is reduced by the smaller of the following reduced by two-thirds:
80% of your itemized deductions that are affected by the limit. See Which Itemized Deductions Are Limited , earlier, or
3% of the amount by which your AGI exceeds $166,800 ($83,400 if married filing separately).
That is a mouthful, and the rule seems contrived! Who stipulated it? The numbers seem to come out of the blue without rationale. To a scientist, it borders on the absurd. It is analogous to defining the speed of light by saying that light travels at the speed such that in a minute it covers the distance of one billion times the height of the White House on the north side. Anybody care to point me to the origin of this rule?
To assist the Americans to figure their itemized deductions, the IRS publication includes a worksheet that breaks down the calculations step-by-step. Here are lines 9 to 12:
9. | Enter the smaller of line 4 or line 8 | 9. | 2,784 | ||||
10. | Divide line 9 by 1.5 | 10. | 1,856 | ||||
11. | Subtract line 10 from line 9 | 11. | 928 | ||||
12. | Total itemized deductions. Subtract line 11 from line 1. Enter the result here and on Schedule A, line 29 | 12. | 141,212 |
Here is how to figure the limit on itemized deductions, in layman's language, but for the arithmetically more adept:
If your itemized deductions are subject to the limit, the total of all your itemized deductions is reduced by the smaller of the following:More concisely, if the total of your itemized deductions is smaller than 3/80, or 3.75%, of the amount by which your AGI exceeds $166800, your eligible deduction will be limited to (1 - 4/15 ) = 11/15 ~ 73.3% of your total deductions; otherwise (if you manage to list a lot of itemized deductions compared to your AGI), your eligible deductions will be the total deduction reduced by 1/100 (AGI - $166800), and since that reduction is a fixed amount, there lies your opportunity of tax evasion.
- 4/15 of your itemized deductions that are affected by the limit. See Which Itemized Deductions Are Limited , earlier, or
- 1% of the amount by which your adjusted gross income (AGI) exceeds $166,800 ($83,400 if married filing separately).