Monday, February 20, 2017
Friday, April 30, 2010
CURDATE() in Oracle and MySQL
There's a big difference between CURDATE in Oracle and MySQL: Although they look similar, in Oracle, the following will work:
CURDATE + 1 or CURDATE -1 wil give you today's date +/- 1 day
However, in MySQL, the following seems to work:
CURDATE() + 1
However, it doesn't actually do a date calculation, it just adds 1 to the integer returned by CURDATE()! So that, if today is 2010-04-30, then
CURDATE() + 1 in MySQL returns 20100431 -- which is a nonsense date!
This can bite you hard if you don't suspect it, since it seems to work just fine most of the time, just not around month boundaries!
Instead, you need to use the ADDDATE(CURDATE(), INTERVAL 1 DAY) syntax in MySQL to get the correct behavior.
Sunday, April 19, 2009
How the banks are impeding economic recovery
The following article from the May 2009 Atlantic is a must-read for anyone who's curious about how we got into the present economic mess: The Quiet Coup, by Simon Johnson.
Johnson is a former IMF economis, now working at MIT's Sloan school, who has seen many other countries, mostly third-world, going through the same economic crisis that we now see in the US and worldwide. The usual cause of the problem, and the most difficult barrier impeding actual recovery, from his IMF experience, are the oligarchs running the financial system, and the government, of the countries in question.
His argument is that the US has become like a banana republic, in that it's being held hostage by a financial elite that got us into this mess, and is now resisting with all its might any change that would reduce its power.
In effect, the debate over who was most to blame for the financial crisis: lack of government regulation, or overoptimistic bankers, is a false dichotomy. In a sense, they are part of the same problem: the US is being run by financial elites who believe they are above law and any other power.
Scary stuff, but essential for understanding where we are right now.
Johnson is a former IMF economis, now working at MIT's Sloan school, who has seen many other countries, mostly third-world, going through the same economic crisis that we now see in the US and worldwide. The usual cause of the problem, and the most difficult barrier impeding actual recovery, from his IMF experience, are the oligarchs running the financial system, and the government, of the countries in question.
His argument is that the US has become like a banana republic, in that it's being held hostage by a financial elite that got us into this mess, and is now resisting with all its might any change that would reduce its power.
In effect, the debate over who was most to blame for the financial crisis: lack of government regulation, or overoptimistic bankers, is a false dichotomy. In a sense, they are part of the same problem: the US is being run by financial elites who believe they are above law and any other power.
In its depth and suddenness, the U.S. economic and financial crisis is shockingly reminiscent of moments we have recently seen in emerging markets (and only in emerging markets): South Korea (1997), Malaysia (1998), Russia and Argentina (time and again).
...
But there’s a deeper and more disturbing similarity: elite business interests—financiers, in the case of the U.S.—played a central role in creating the crisis, making ever-larger gambles, with the implicit backing of the government, until the inevitable collapse. More alarming, they are now using their influence to prevent precisely the sorts of reforms that are needed, and fast, to pull the economy out of its nosedive. The government seems helpless, or unwilling, to act against them.
Scary stuff, but essential for understanding where we are right now.
Tuesday, July 01, 2008
Kill -9
If you don't know that "kill -9" refers to, I don't recommend listening to this, because it won't make any sense...
(not safe for kids or work)
http://www.monzy.com/intro/killdashnine_lyrics.html
Here's a sample of the lyrics (though you gotta listen to the song for the full effect):
(not safe for kids or work)
http://www.monzy.com/intro/killdashnine_lyrics.html
Here's a sample of the lyrics (though you gotta listen to the song for the full effect):
My posse throws down like leaky bucket regulators;
I was coding shit in MIPS while you were playing Space Invaders.
With my finger on the trigger I run ./configure
Yo, this package is big, but MY package is bigger.
I roll my weed with Zig Zag while I zag-zig splay,
And I do a bounds check before I write to an array...
Subscribe to:
Posts (Atom)