Tuesday, February 21, 2012

The Insanity of Stock Trading in the 21st Century

As anyone who's read my blog or otherwise knows me is aware, I have more than my share of criticisms of capitalism. I am not sure it is possible to come up with a better economic system than one that is market-driven. I am very certain, however, that our political system - whose sole purpose should be to protect and improve the quality of life of its citizens - must put boundaries around the behavior of capitalists.

In other words, the political system must taken priority over the economic system.

OK, well, let's put that aside for the moment. Let's just focus on the concept and then the current reality of the stock market.

The fundamental point of a stock market, from what I understand, is to provide a way for companies to obtain investment - and, closely related to that, allows an individual to make such an investment, to both express support for a company and benefit from its success.

That all sounds good to me, and I have certainly participated in the stock market over the last few decades. Now, my wife and I are contemplating selling any and all stock we have and avoiding the stock market like the plague.

Why? Because the entire system seems so fundamentally corrupted, so deeply oriented towards speculation (legalized gambling), so out of control, that it is now a destructive force in our society. And the aspect of the stock market that I think most clearly demonstrates all of this is computerized trading.

Here are a few quotes and links to articles that really drive this home for me:

Nanosecond Trading Could Make Markets Go Haywire

"It’s as if computerized trading has created a new world, one where the usual rules don’t apply, populated by algorithms and only dimly understood by the people who made them...."There’s this whole world below 650 milliseconds. It’s like landing on another planet,” said Neil Johnson, a complex systems specialist at the University of Miami and co-author of the study, released Feb. 7 on arXiv. “It’s an enormous part of the market which is out of human reach."

Yes, that's right folks - an "enormous part of the market which is out of human reach."

"One new computer chip built specifically for high-frequency trading can prepare trades in .000000074 seconds; a proposed $300 million transatlantic cable is being built just to shave 0.006 seconds off transaction times between New York City and London.)"

Think about this: a company spending $300 million to lay a cable across the Atlantic just to make stock transactions .006 seconds faster! Blows my mind to think about all the effort, all the money - and perhaps one or persons will die in accidents laying that cable? - just so some Wall Street and London firms can trade that tiny fraction of time faster!

"Verifiable figures are elusive and estimates vary wildly, but it is claimed that a one millisecond advantage could be worth up to $100m (£63m) a year to the bottom line of a large hedge fund."

It is now estimated that some 70% of all stock transactions occur through computerized trading and they happen so quickly and so frequently that they clearly have nothing at all to do with investment and economic growth.

These transactions are all about "gaming" the system, manipulating stock prices (and the conditions that drive stock prices up and down), to extract profit out of that system without providing any benefit to the stock market, the society, the world.

I know, I know - what a whiner. And I will keep on whining - all the way out of the stock market.

Tuesday, January 10, 2012

Ever wanted to debug lobs, object types, XML docs in your IDE?

"Exotic" datatypes, like large objects, object types, XML documents, etc. are being used by more and more Oracle development teams. And those teams, of course, are using one of many different IDEs for PL/SQL, including Toad, SQL Navigator, PL/SQL Developer, SQL Developer, etc. 

These IDEs come with source code debuggers, but unfortunately Oracle's implementation of the Java Debug Wire Protocol (JDWP) comes with a number of limitations, including:

- CLOB: Only the first 511 characters are shown.
- BLOB: Only the first 510 bytes are shown.
- XMLTYPE, ANYDATA, ANYDATASET, ANYTYPE: No value is shown.

If you'd like to see Oracle address these limitations in the upcoming 12c version, check out my PL/SQL Obsession blog for details.

Friday, January 06, 2012

Is it Onion or is it Science?

I hope that you are aware of the Onion, a hilariously satirical newspaper and website. It continually amazes me how funny and sharp they can be, week after week.

For example:

Obama Openly Asks Nation Why On Earth He Would Want To Serve For Another Term

Citing three years of exhausting partisan politics, constant gridlock in Congress, and an overall feeling that the entire nation has "completely lost it," President Barack Obama openly asked a campaign-rally crowd Tuesday why he'd want to serve another term as president of "this godforsaken country."

"My fellow Americans, I come to you today to ask, why?" Obama said to 1,200 people gathered inside a gymnasium at Taylor Allderdice High School. "Why can't our congressional leaders work together to create jobs? Why can't Wall Street ever be held accountable? And most important, why on God's green earth would I voluntarily subject myself to this nonsense for another four years?"

and how about this:

Scrunch time: The peculiar physics of crumpled paper



"WHEN you throw out your Christmas wrapping paper this year, don't tell Narayanan Menon and Anne Dominique Cambou. You'll be throwing away examples of their painstaking research.That's because they study the physics of crumpled balls of paper, which contain deeper mysteries than you might expect."

and from the same article:
"Despite technological advances, it is still extremely difficult to peer inside a simple scrunched-up paper ball with any detail."

Well, OK, actually, that second article is from New Scientist, a quirky science magazine from the UK. It's generally a fascinating read, delving into all sorts of scientific curiosities, and never shying away from the areas where science and society/politics intersect. I urge you to check out the website and even subscribe.


Tuesday, December 20, 2011

Isn't She Beautiful?

What can I say? I just have to share this wonderful photo of a smiling Loey Lucille....



Sunday, December 11, 2011

The PL/SQL Whisperer

That is my new nickname, after my latest round of trainings in Europe.

I spent two days in Berlin, training 25 developers at an event sponsored by DOAG. Then I headed over to the Netherlands to spend a couple of days with 37 developers at an AMIS-sponsored training.

But on Tuesday, after I completed the first day of training without the assistance of a microphone, my voice said "Bye, bye!". I woke up Wednesday morning to discover I had lost the ability to speak above a whisper. DOAG hustled, did what was necessary, and brought in a portable microphone/speaker system. AMIS made certain to have the same ready to go on Thursday.

And so for three straight days, I whispered about new features of PL/SQL in 11g and much more besides. The attendees were very good natured about this less than optimal situation. One person said it made the whole class more exciting - it was as though I was giving away secrets, that no one should hear- except for the very special people in attendance.

Several students in the Dutch class even found themselves whispering to me when they asked a question - whispering, it turns out, is socially contagious! And I was quickly anointed the "PL/SQL Whisperer." Well, I can think of worse names, but I sure hope that soon I will recover my voice.

This was only my fourth business trip all year, which is a truly wonderful change from previous years (a less than fantastic result is that I will lose my Platinum status on American Airlines next week, so it will be tough to even get exit row seats when I do fly).

It was, unfortunately, a bit of a hard week on the road. Besides losing my voice, my flight on Wednesday from Berlin to Amsterdam was cancelled. I had to reroute through Zurich, but the flight to Zurich left late, so while I was able to just make the connection to Amsterdam, my bag did not follow along with me. By the end of the first day of training at AMIS offices, I had quite the five o'clock shadow. But the bag was delivered on Thursday, so it wasn't really such a big deal.

And then on Friday, I celebrated the end of a long week with a night in Amsterdam. Had a nice dinner with good friend, newly-minted Oracle ACE, AMIS consultant and father of three wonderful children, Patrick Barel. Then I went back to my hotel room to catch up on email and call my wife via Skype.

But the wireless network was not available. So the manager dutifully visited my room with an ethernet cable and (as far as I could tell) had to jam the cable a bit forcefully both into the wall and into my laptop. That made me uncomfortable. And still no Internet access.

So then he agreed to let me use the Internet in a different room - which led to a very irritating discovery: the ethernet plug would not come out of the back of the laptop. The spring that holds the cable in place had snapped. Manager Jon poked at it for a while, making me more uncomfortable, but it would not come out. Oh, I was very bummed and finally gave up, had him cut the cable so I could take the darn thing home, and figured I would have to have a technician get it out.

Yuch.

But then the day manager visited in the morning before I left for the airport. He had better tools and was able to quickly remove the plug. Whew, what a relief.

Both classes went well (of course, the students might feel differently, I suppose) - the PL/SQL community in Germany and the Netherlands is wide and deep: lots of very experienced developers attended. So I learned a few things along the way, which will soon make themselves known in PL/SQL Challenge quizzes.

I also made an interesting discovery about how students concentrate on and extra information from the hundreds of slides and hours of talking I give them to them in a two day class. I covered FORALL in the class, also its SAVE EXCEPTIONS clause. I showed slides, ran code and talked about how if at least one statement raises an error, Oracle will save the exception information and then raise the ORA-24381 error. I talked about how you should avoid writing an exception handler like:
WHEN OTHERS THEN IF SQLCODE = -24381
and instead you should declare your own exception and assign it to this error, so
you can write an exception handler like:
WHEN my_errors.forall_failure 
Then right at the end of the course, I talked about avoiding the hard-coding of error numbers and showed -24381 again as an example.

In the AMIS class, we ended with a short quiz. Two players tied for highest score (they selected 19 of 21 choices correctly across 5 questions - quite good!). So it was necessary for these two hotshots to engage in a sudden-death tiebreaker. The way I do this is I show a slide with a question and the first person to answer correctly wins.

The first slide asked: "Which feature of PL/SQL does this number relate to?" And then I showed "-24381". I thought there would be an instant response, given how often I showed and mention this number in the class.

And I was shocked to discover that neither of the students recognized the error code. I stared at them, surprised. Really? When I talked about it, referenced it multiple times, in the last two days?

Well, OK. We went on through several questions without success and then Christian Rokitta identified correctly that the optimizing compiler was first introduced in Oracle Database 10g. So congratulations to Christian for his first place showing, and to Danny Ven for the other score of 19 and his second place.

I am not exactly sure what to conclude from the inability to recognize the -24381 code. Perhaps students in my courses are confronted with so much information that they automatically filter out low level details. That way, they will be able to concentrate on the bigger picture.Certainly, people usually do not complain about how little I cover in my classes or how slowly I go through the material. And right at the beginning, I tell them to focus on principles and concepts, don't worry about all the technical details.

So I guess they took my advice!

In any case, now it is 4 AM on Sunday and I am (a) back in Chicago (hurray!) and (b) awake due to jet lag and (c) still without a voice and (d) most sadly, without a PL/SQL Challenge website. For some reason, it is unavailable but hopefully that will be fixed really soon.

Friday, December 02, 2011

Gingrich the Man - When the bar is set very low

Here's what Newt Gingrich says about himself:


"I don't claim to be the perfect candidate. I just claim to be a lot more conservative than Mitt Romney and a lot more electable than anyone else."

Wow, now that's truly inspiring, Newt. Not.

Mostly it just tells you how terrible the field of Republican candidates for President are, for 2012 - with Gingrich himself admitting it.


Isn't it strange that in a nation with the power and prestige of the United States, in a nation with just two parties competing for power, that the Republicans are left to choose between the likes of Bachman, Santorum, Gingrich, Paul, Cain, Romney and Huntsman? 


Of course, Huntsman seems lots more human, rational and sane than the others (except for the Mormon part, to which "rational" surely does not apply - as it does not apply to Catholicism, Judaism, Islam, etc. - by definition). But he doesn't stand a chance.

Wednesday, November 23, 2011

Gingrich the Historian: Bring Back Child Labor!

"It is tragic what we do in the poorest neighborhoods, entrapping children in, first of all, child laws, which are truly stupid," said the former House speaker Friday at the Kennedy School of Government at Harvard. "Most of these schools ought to get rid of the unionized janitors, have one master janitor and pay local students to take care of the school. The kids would actually do work, they would have cash, they would have pride in the schools, they'd begin the process of rising."

Newt Gingrich considers himself to be a "historian," which dictionary.com says means "an expert in history; authority on history." And history is, in turn, "the branch of knowledge dealing with past events."

Perhaps Gingrich really is an expert on past events, in that he knows that they happened, and even perhaps what happened. For example, he is likely aware of the horrific abuse of children in the past, before there were "truly stupid" laws governing how and when children could work. He is probably not so aware of widespread problems today of child slavery and abuse - 'cause it's not in the past and he is a historian.

But he also seems to be a blithering idiot. How else to explain his belief that you could pay some really poor children in a school to clean up after the other, better-off children, and that this would be a good thing (instill a work ethic, and so forth)? Was he ever a child? Perhaps his grasp of personal history is terribly weak. Children can be incredibly cruel beings.

How long would it take before some evil bullies started taking dumps right on the floors in the bathroom stalls? Or deliberately eating and then puking up lots of disgusting stuff? The children who took these jobs would become laughingstocks of the entire school, objects of scorn and abuse.

But, OK, suppose that wasn't the case. Suppose that all the children in the school are really nice to each other, and would never think of doing such awful things to one another?

Presumably the school has more than a handful of really poor children, anxious to put the janitor father of some other children out of work (thereby sending the whole family into poverty) so that they can work their way out of laziness and someday become a grown-up janitor (but not at a school).

Which of these deserving and desperate children get the jobs? How do you choose? Or perhaps you rotate the honor, so that the income (surely well below minimum wage, that job killer, right, Newt?) and lessons are spread across many young minds and bodies? But then the lesson will be diluted. They might only be able to pull themselves up by a quarter of a bootstrap, which might not be enough in the 21st century.

And so on.

We all had a great laugh at Herman Cain's expense when he couldn't come up with an answer to how he felt about Obama's actions in Libya. And that was pretty funny (and awful, too, when you consider that this man claims to want us to take him seriously as a possible finger on the button of nuclear destruction). 

But why isn't Gingrich being similarly mocked and taken to task? He is supposed to be some sort of deep intellectual, fully informed about past events, ready to take on the future. And this is the best he can do? Offer up some half-assed, incredibly destructive, completely un-thought-out call to return to a past in which children were routinely abused and taken advantage of in order to increase profit margins?

Shame on you, Newt Gingrich.