Saturday, July 28, 2007

Update on my beautiful Insight

As I expected, State Farm has declared the car a total loss. The estimate for repairing the car came to over to $8000. The pleasant State Farm fellow told me that the cash value of the car is $7750. I get an extra $900 for low mileage (51000 in 7 years!), plus $600 for good condition.

Sigh....it is very sad to see the results of all my efforts to keep the car in fine shape and drive it minimally results only in an extra $1500.

Add in sales tax and per diem reimbursement for rental car (which I didn't use, but still I get the per diem), and State Farm stands ready to hand over about $10600 for my wreck of a car.

Which I suppose is not bad considering I paid twice that seven years ago.

But for now, I do not intend to purchase another car. I can do without. Instead, I will check out Zipcar or I-Go, car-sharing services. And ride my bicycle whenever and wherever possible.

Goodbye Insight, it was nice to drive you....

Sunday, July 15, 2007

Nasty Karma - goodbye Insight....

Sigh....Eli and I went to NY this weekend to celebrate my mom's 75th birthday, plus Sally's 4th birthday, plus Laurie's birthday...and we had a great time, made even more enjoyable by my more or less accidentally renting a red mustang convertible:


So that was fun, and the water balloons were fun, and Evan did some great cooking, and so on....then on Sunday Eli and powered our way back to LaGuardia and managed to hop standby onto an earlier flite. We arrived at O'Hare an hour earlier than expected, hopped into my Insight and off we went.

And two miles from home, stopped at a red light, an absolute jerk of a driver SLAMMED into the back of the Insight, at maybe 20 or 30 MPH. And now my beloved automobile, with only 58000 miles on it after 7 years, averaging 50 MPG, no longer sold by Honda, looks like this:


We were covered with glass chunks. My back and neck got whipped around; hopefully I won't be stiff as a board tomorrow. Eli, too. But we are OK right now, anyway. I am very bummed out, though. I didn't have collision on the car any longer, so I have filed a claim with Sandra "My brakes didn't work" Luke's insurance company and sure they will pay, but probably not to fix it, just declare it totaled and write me a check. Goodbye Insight.

Very sad day for me....and to get hit by an idiot who actually puts the following on her windshield:


That is, upside down: If you can read this....ROLL ME OVER.

In other words, she advertises the fact that she is a reckless driver. What a loser.

No, I am the loser. Ah well, I just have to tell myself over and over: it's just a car, just a thing.

But it was such a nice thing. The best car I ever owned.

Wednesday, July 11, 2007

How Oracle describes PL/SQL for 11g

It is summertime, right? I hate it when I am so busy that I barely notice summer in Chicago. Aw, that's an overstatement. I've been out. I've ridden my bicycle a couple of times. I've seen people visiting the beach. I even played some basketball with teenage nephews who absolutely ran circles around and over me. [I will, however, state for the record that in one game, I scored 7 of the 15 points. Dang, I was hot.]

And I also did some work on Oracle 11g during the beta program (which officially ended on July 11, with the launch of Oracle latest and greatest version).

So I eagerly downloaded the Oracle Database 11g Application Development PDF to check out its high level commentary regarding PL/SQL and other dev languages available for use against and within the Oracle database.

Under the heading of PL/SQL, this document offered several interesting statements:

"PL/SQL is an imperative 3GL..." An imperative 3GL? I'd never seen or heard of that before. Now, as some of you may know, this ignorance of mine should not be a big surprise. I have little formal training in computer programming (three 101 classes in 1979, to be precise), so lots of the fancy verbiage goes whistling past my head. This one sure did. Imperative? What the heck is that? Thank the heavens for Wikipedia, which tells us that an imperative language is "a programming paradigm that describes computation as statements that change a program state. In much the same way as the imperative mood in natural languages expresses commands to take action, imperative programs are a sequence of commands for the computer to perform." Oh, OK, right. PL/SQL is a procedural language.

"It...supports exactly the same datatypes as SQL." Now this really surprised me. I think I know what Oracle intended to say....that PL/SQL supports all the datatypes of the SQL language, and that is the case. But let's be clear: PL/SQL's set of datatypes is a superset of the SQL datatype domain. For example, PL/SQL supports Booleans, which Oracle's SQL language does not.

"While it is available in other environments, this document focuses on PL/SQL that is stored and compiled in the Oracle database." This sentence my eye because of the word "environments." I know that PL/SQL can be run on the "frontend" inside the Oracle Developer Suite: Forms and Reports (which, interestingly, Oracle refers to as Traditional Oracle Tools). But where else do you use PL/SQL? Perhaps they are talking about Application Express, but that is still PL/SQL code that is stored in the database, I believe. So what are all those other environments?

And, finally, the most delightful aspect of this high level description:

"A best practice used by many Oracle customers is to have client code access Oracle Database only by calling PL/SQL subprograms." Yes! This is one my mantras, these days. Namely, "SQL is bad" aka "All SQL statements are hard-coding and hard-coding is bad" aka "Hide all your SQL behind a procedural (imperative!) API." It's very nice to see this argument for using PL/SQL highlighted in Oracle's description. By the way, for more details on what I am talking about here, check out Practical Best Programming.

I will, in a near future blog on ToadWorld, talk more about the actual new features of PL/SQL for Oracle Database 11g. Now, however, it is time to head to the airport for a weekend in NY to celebrate my mom's 75th birthday.

Adios!

Saturday, June 16, 2007

Who would've thought that fighter jets have ideologies?

I read today an obituary for Brigadier General Robin Olds (1922 - 2007). He flew 107 combat missions in 1944 and downed 12 enemy aircraft. But he is apparently best known for leading the biggest air battle in Vietnam, and I quote from the Los Angeles Times obit:

"Commanded an Air Force wing that shot down seven communist MIGs over North Vietnam."

Who would've thought it? A communist MIG. Not even "Communist MIG". No, that MIG apparently believed that wealth should be re-distributed equitably throughout society (or perhaps just among other MIGs?).

Perhaps the silliness of this statement would be clearer if the obit applied the same rule to both "sides", as in:

"Commanded a capitalist Air Force wing that shot down seven communist MIGs over North Vietnam."

Ridiculous, eh?

What's my point? That the propaganda of that war ("Stop the spread of communism!") was so insidious, is so deeply ingrained in our society that even decades later, the writers of the obit could not bring themselves to describe those planes as the Viet Cong MIGs they were.

Back in the 1960s, President Johnson lied to the US people about a fictitious battle in Tonkin Bay to justify the war in Vietnam. That lie, and the millions of others, large and small, that followed all the way up through 1975 (not the least of which involved Henry Kissinger's war crime of secretly diverting B2 bombers to devastate Laos and Cambodia with which we were not at war), fueled the "line" that the US of A was on the front lines of the battle to stop the spread of Communism.

In fact, the military my parents supported through their tax dollars conducted a brutal war against an entire people, killing some 2,000,000 Vietnamese - many of them women and children.

Yet this still cannot be generally and easily acknowledged in our media. How sad, how tragic, how disturbing.

Especially given the same process is now being used to conduct the war in Iraq. And now they are my tax dollars being used to fund the way. This really sucks. What a crappy democracy we have here. Soon, I will have the exciting choice of Clinton vs Guliani or Clinton vs McCain or Obama vs Romney or.... well, it is really very nice of those in control to at least give us two people between which to choose.

'Cause if I could only choose from one person, well, then clearly we would not have a democracy.

Of course, when I am using a black-box voting machine built by Diebold or Sycamore (both companies controlled by heavy contributors to George Bush and the Republicans), who knows? I might only really be choosing from among one person!

Thursday, June 14, 2007

Photos from Paris

I spent one afternoon in Paris. Took the Metro from the Grand Arch (La Defense) to Hotel du Ville, walked to the Pompidou, had a great time there, enjoying much interesting art and snorting in disbelief at other, more absurd pieces (like three big canvasses of white, nothing but white). Then walked over to the Louvre, checked out Mona Lisa (a bit disappointing - too much security), ignored the crucifixions and portraits of dead people, and found some amazing "Islamic Art" from centuries past. Enjoy!

http://www.flickr.com/photos/60694364@N00/sets/72157600346060716/

(See if you can figure out which art is from the Louvre and which from Pompidou.)

Monday, June 11, 2007

Upcoming trainings by yours truly in Europe

A reader asked me to post details about my end of summer trip to Europe to do a triplet of two day trainings for Oracle. Here's the info and links:

Czech Republic (30th and 31st of August)

Croatia (homepage)(3rd and 4th of September 2007)

Slovakia (6th and 7th of September)

I hope to see some of you there. Please do come up and say hello if you learned about the class through this blog (come up and say hello anyway!).

Thanks, SF

PS - I am now in Brussels (it is 12:30 AM on Tues June 11). I spend Sun and Mon in Paris. On Sunday, visited both the Lourve and the Pompidou Center. Incredible places. Will be posting photos soon on Flickr.

Wednesday, June 06, 2007

Summery Activity

I can sort of remember a time when I spent lots of time outside in the summer, really noticed the season (and it is a fine one in Chicago...I don't mind it when Chicago occasionally gets very hot). Lately, though, I seem to be so busy on books or products or trainings - and traveling - that the last couple of years, I will suddenly notice the color of the leaves turning and say to myself: "Wait a minute! How did it get to be Fall?"

And the upcoming summer is looking like another one of those, since I am preparing for or working on all of the following:

* My presentations and test-a-thon materials for ODTUG Kaleidoscope on June 18 - 21 in Daytona Beach, Florida. This most-excellent developer's conference has lots of PL/SQL content, plus we (ODTUG, Quest Software and O'Reilly Media) are organizing the second-ever PL/SQL Test-a-Thon! I hope you are coming. You can find more information about, and register for, Kaleidoscope here.

* The second Oracle PL/SQL Programming 2007 conference will be held in mid-September in New Jersey. Two days of intensive training, discussions and test-a-thons for PL/SQL developers. Which means I need to start organizing those materials as well! Almost 300 developers came for OPP2007-I in February. If you missed that one, join us for OPP2007-II!

* The new Quest Code Tester Trial Challenge: we just set up a new and hopefully fun way to learn about Code Tester and possibly win a signed set of my books. Simply download the trial version of Code Tester, install it and explore. Then answer the ten questions in the Challenge and submit your answer. If they are all correct, your name will be added to the pile from which a winner of my books will be chosen (courtesy of O'Reilly Media!).

* I head back to Europe at the end of August to visit Prague, Zagreb, Ljubljana and Bratislava, doing two-day Oracle trainings and Quest seminars. I very much look forward to returning to Prague and seeing Croatia, Slovenia and Slovakia for the first time. But before then I need to write a bunch of new training materials. Sigh....

* Finishing up the second edition of Oracle PL/SQL Best Practices. I originally planned to do a fairly minor rewrite, add some new best practices and update old references, but otherwise leave it unchanged. Ha! That plan has certainly changed. I have, instead, decided that this book needed to stop taking itself so seriously, and have a bit more fun with best practices. I think you will be both entertained and enlightened as you read the exploits of a four person development team (Sunita, Delaware, Lizbeth and Jasper), part of the (fictitious) My Flimsy Excuse dotcom venture. More on this book soon....

* Quest Code Test development: we are QAing release 1.6 (automated XML testing, many bug fixes, much faster performance with a remote database, and much more) and then moving right into development of release 1.7 (major improvements in usability and much smarter test case generation, to name just two key enhancements). I would love to do nothing but help develop Code Tester. It isn't possible, but I cherish every moment I get to work on the backend code! By the way, you can download the 1.6 beta here.

Well, that's what my summer is looking like. I hope you are finding more time for leisure in yours.

Hey, but I am not complaining! I work from my home, take lots of breaks, go outside - life is good, very good, just busy.....

Tuesday, June 05, 2007

Quseful #3: Don't put COMMIT; in your application code!

Why would I say that? Because a COMMIT; in your code is an example of hard-coding, and as we all know, hard-coding is bad. "Hard-coding?" you ask, "What is Steven talking about?"

Well, to find out, please visit my ToadWorld blog. I have decided to publish my Quseful's over there, rather than on my personal blog!

Regards, Steven

Wednesday, May 30, 2007

Back from a week in Europe - a travelogue

I have a been a very busy boy. Just spent the last week living in (well, visiting anyway) a different hotel every evening, moving between six cities in four countries in Europe as follows: Frankfurt, Dusseldorf, Zurich, Munich, Stockholm, Copenhagen.

Some might find that exhausting, but I am a lucky fellow: my body and mind are not much affected by jet lag nor by many hotel changes. Plus, I try to stay very disciplined about exercising each day and eating lots of fruit and vegetables, avoiding meat. So I made it back home without getting sick, without getting tired, actually returning totally energized by my time in Europe, because....

I gave my latest best practice presentation, now titled Practical Best Programming, to a total of over 400 developers (with the single largest turnout - over 150! - taking place in Dusseldorf, at an event cosponsored by Quest Software, the German Oracle User Group, and Trivadis). You can download this presentation at:

http://oracleplsqlprogramming.com/PracticalBestPLSQL.html

How bad can a trip be when I spend a big chunk of it talking to lots of people who actually seem to want to hear what I have to say, laugh at lots of my jokes (so kind!), and show proper appreciation for my (Quest's) amazing new tool: Quest Code Tester for Oracle?

Can't be bad at all. Here are some highlights:

* First, the weather. It was sunny and warm, even hot, throughout. The downside of this fact is that I felt absolutely compelled to abandon my laptop and hotel room and go outside whenever possible to enjoy the real world.

* The Das Stadel and Modern Art
(MMK) Museums in Frankfurt were very enjoyable. Lots of the art in the MMK was whimsical and amusing. Some of it seemed, well, ridiculous. Blobs of formless clay strewn about on the floor. Dates ( "12 OCT 1997") painted on small canvasses, filling a whole room. Not my cup of tea. But others...well....check out the photos: Frankfurt

* A lovely run along the Isar River in Munich, very close to the Hilton, where I stayed and presented. A very beautiful park, full of mothers and their children enjoying the outdoors, people riding bicycles....I wish that my legs and lungs were stronger so I could have covered more territory and breathed in even more of that clean air...photos:
Munich

* Hotel breakfast buffets: while I am trying to lower the importance of food in my life (with the intention of reducing the quantity of food I ingest), I definitely take every possible opportunity to eat fresh fruit. Most business class hotels in Europe feature extensive breakfast buffets containing a wide variety of fresh fruit, yogurt, healthy cereals, fresh juices and so on. Eating fruit makes me feel great!

* My friends at Quest, in particular Daniela, Calle and Patrick. Daniela and Calle worked very hard to organize my week of events and she is clearly a professional - very organized, great attention to detail, strong commitment to carrying out the highest quality programs. Patrick, an SC, shared the agenda with me for three days, showcasing critical best practice functionality in Toad, including CodeXpert, SQL Optimizer and Benchmark Factory.

* Raffling my books: O'Reilly Media generously provided books to raffle off to participants at each location. That wasn't the highlight, though it was certainly a great thing for those who won. What I liked most about the raffle is that we used PL/SQL technology to pick the winners! At first, I used this simple block of code to pick winners (we had a number forevery name):

BEGIN
DBMS_OUTPUT.put_line (ROUND (DBMS_RANDOM.VALUE (1, 70)));
END;
/

But that led to duplicates (randomly!) and also since there some no-shows at each event, I would have to run this block lots of times to give everything away. It was a bit clumsy. So I enhanced this simple block into a stored procedure with this header:

PROCEDURE pick_winners_randomly (
total_count_in IN PLS_INTEGER
, winner_count_in IN PLS_INTEGER
, ineligible_in IN VARCHAR2 DEFAULT NULL
, delimiter_in IN VARCHAR2 DEFAULT ','
)

With this procedure, I pass in the total number of attendees, the total number of possible winners (how many prizes we have), the list of ineligible numbers (those next to the names of people not in attendance) and delimiter for the inelgibile list. Then we could pick and immediately show all raffle winners in a matter of a second or two with a block like this:

BEGIN
pick_winners_randomly (50, 10, '4,22,27,33,47');
END;

If you would like to see the code for this handy program and possibly use it yourself, click here.

* I am now flying back and was lucky enough to get an upgrade. So I can work for 6+ hours on the way home! Very exciting. Really. Sadly, at this point in my life, I am SO busy and traveling so much, that I feel like I need to stay in my hotel room and order room service to minimize time spent on meals. And I try to fill every available chunk of time with typing on my laptop. Sigh....well, I have a great life and I chose to take on all the work I am doing. Anyway, I just learned something very interesting and useful: on American Airlines, odd numbered flights mean that the flight attendants ask Business Class passengers for their menu preferences from "aft to forward" - meaning if you don't eat meat, like me, then you want a seat towards the back so they won't have run out of fish or vegetarian meals. And on even-numbered flights, ask for a seat up towards the front. Now that's the sort of information I would rather not have be important in my life. But there you have it.

* My last day on the trip was spent in Copenhagen. We finished the morning seminar and lunch at 1 or so. After visiting the Quest offices nearby, I went out for a long walk, meandering through several really nice parks and ending up at the Statens Museum of Art. I've gotten tired of seeing paintings of crucifixions and little baby Jesus from the Middle Ages, but I always enjoy finding the relatively few modern paintings that affect me deeply. On the way back from the museum, I found the Assistens Kirkegard, an enormous cemetery containing the graves of many famous Danes, like Soren Kirkegard and Hans Christian Anderson. It is a truly beautiful, incredibly peaceful place. And that evening I visited the expansive Frederiksberg park. Most striking there were the raucous nesting birds - and I am talking big birds like herons. They made a LOT of noise and it was very fascinating. Photos:
Copenhagen

* Another unusual and troubling site at the Frederiksberg park was this . As far as I could tell, it was used by parents to hang items that belonged to a child who had died, as a way of saying goodbye. Pretty darned spooky.

Oh and by the way, if you are looking for some entertaining ways to pass the time and still use your knowledge of PL/SQL, check out the brand new Toad Squared Flash game:

http://www.toadworld.com/LandingPages/ToadSquared/tabid/168/Default.aspx?qac=ToadSquaredBloggers

Sunday, May 27, 2007

Google's goal to organise your daily life

As I traversed Germany this past week (more on that in my next blog entry), I came across an article in the Financial Times (May 23) with the title:

Google's goal to organise your daily life

I found the lead paragraph quite alarming:

"Google's ambition to maximise the personal information it holds on users is so great that the search engine envisages a day when it can tell people what jobs to take and how they might spend their days off."

Someday, according to Eric Schmidt, Google CEO, we could head over to Google for answers to the question: "What shall I do tomorrow?"

Does that sound good to you? Frankly, I find it a bit terrifying.

My feeling is that one of the biggest problems facing humanity today is that so many people have abandoned critical, self-aware thinking. Instead, they absorb hours of high-bandwidth programming in the form of ads, sponsored links, pop-ups, and brand-saturated television and movies. They rely on the narrowest sources of information conceivable to "educate" them about what is going on in the world (and they are getting narrower and more focused and directed all the time).

And they, we, all of us, are completely overwhelmed by data. We have more "information" available to us than ever before, but it is not making us better-informed or more sophisticated in our thinking. Instead, we act more and more like sheep, being led about with gentle prodding and the occasional nip at our heels. We voluntarily give up our privacy in the form of personal information, in search of a "free" search engine or a "free" video or a "great deal" on another electronic gadget.

Every step along the way, we come closer and closer to the ideal world -- for corporations and marketers, that is. A world in which our every move is closely tracked (voluntarily) and our every purchase is driven by, virtually determined by, tightly-beamed messages that enter our brains through ever "richer" formats (amazing graphics, extraordinary resolution, fantastic sound) that are impossible to ignore (we are wired that way).

And so at some point, when we need to decide what our next job should be, we will ask Google what we should do. Hell, by that time, Google will probably wake us up at 7 AM Monday morning and tell us: "You are dissatisfied with your job. It's time to move on. And Coca Cola is offering some fantastic positions for people just like you!"

Not interested?

Then opt out from the Eyeball Economy: Don't click on any sponsored links. Don't click on pop-ups. Don't give up any personal information and take every opportunity to turn off a company's gathering of your data. Seek out varied sources of information (check out thenation.com - that should give you a different perspective on life and politics in the US and around the world).

AND TURN OFF THE TELEVISION! Don't watch commercial TV. I think that television is much too powerful, compelling and addictive -- we are hard-wired genetically to respond to and be drawn to human voices speaking to us, to react to moving images that closely resemble the real world. We really can't turn away from the tube once it is blaring into our faces. Best to stay away.

Instead, go out and do something instead: exercise, walk around the nearest park, visit your public library (one of the most precious resources any free society has to offer and support), hang out with friends, play board games, discuss politics instead of sports and weather (ask yourselves: why did we, the citizens of the "greatest democracy on earth" let George Bush steal two presidential elections - Florida in 2000 and Ohio in 2004? That should be good for an hour of two of animated talk).

So much to do, so little time to watch.

Lots of photos for your viewing pleasure....

I finally got around to loading up photos on Flickr from my recent international trips, so if you would like to see what catches my eye as I travel, here are some links:

Buenos Aires
Bogota
Medellin
Frankfurt
Munich
Copenhagen

Enjoy!

Sunday, May 13, 2007

Where in the world was Steven Feuertein?

I have decided to keep track of the places I've visited around the world, focusing primarily on those locations outside the United States.

On the one hand, I have no reason to think anyone but me would be interested.

On the other hand, I realize that the fact that I have been able to see so much of the world (and there is so much more to see) is a privilege that most others can never experience. I want to honor and acknowledge that privilege by publishing my WITWWSF.

You can see it here. Enjoy!

An Ode to Oscillococcinum

Oscillococcinum - a strange name for a very wonderful medicine!

I just spent a week in Latin America, performing (it does seem these days that I perform as much I inform) Best Practice seminars organized by Quest Software and its partners in Buenos Aires, Bogota and Medellin.

On Friday, two hours before my talk in Medellin, I came down with flu symptoms: bad headache, every inch of my skin sensitive to the touch and painful, very tired. This was bad news. I had a three hour talk to do.

Fortunately, I was carrying a dose of Oscillococcinum in my bag for just this situation. I quickly poured the first dose of a hundred tiny white pills under my tongue.

It didn't help me over the next few hours; it doesn't take effect that quickly, but afte taking the other two doses over the rest of the day, I woke up Saturday morning at 4:30 AM ready to head to the airport and home, completely free of flu symptoms.

Oscillococcinum had done it again, for me! Incredible....

Oscillococcinum is a homeopathic remedy made by Boiron. It is incredibly effective and the fact that you probably don't know about it says a lot about the power of the pharmaceutical industry.

I urge you to find Oscillococcinum at your nearest natural food store and stock up. Also, visit your nearest drugstore (CVS, Walgreens, etc.) and if they do not carry Oscillococcinum, ask them to do so.

When AP is the enemy, who is our friend?

AP = Associated Press

AP is one of the major news content providers to newspapers, websites, etc.

In April 2007, Tom Curley, AP president and CEO, said this about reporting in Iraq, and particularly the Anbar province: "It is about the Associated Press. We are the target. Freedom of the press is the target....There has been an extreme effort to shut down coverage from an out-of-control place. That is what the facts show.”

I read this quote in today's Sunday Tribune's column by Clarence Page, Held without charges.

Page informs us that two journalists, including Bulil Hussein of AP, have been detained and held without charges, by the US military. In the case of Hussein, AP has thoroughly investigated his activity in Iraq and can find no evidence to back up even the vague speculations made public by the Pentagon regarding Hussein.

If people like the CEO of Associated Press, must now openly declare that he and his company are the targets of the US government and military, we are in a very bad, very dark moment in our history.

And it is going to get darker and worse, unless U.S. citizens find their voices and do more than elect a Democrat in 2008.

Our nation is not perfect. But it is surely one of the best efforts to create a society of humans in which the rule of law holds sway over the actions of its individual members. That rule of law establishes the foundation for our democracy (also very imperfect), and it is something of which we should all be proud.

George Bush and Dick Cheney trample on those laws and undermine our democracy. They lie to us and barely even bother to cover for those lies. They hand over billions of our tax dollars to their friends in companies like Halliburton and Blackwater, even as those companies provide the most corrupted, degraded services in exchange for those funds.

And we let it happen. Well, I don't know that there's much I can do about it, but I will state publicly and add my name to whatever efforts are going on towards this end:

George Bush and Dick Cheney should both be impeached. They should be removed from office as quickly as possible. Indictments should be brought against them, and they should be arrested for their crimes.

Impeach Bush
Impeach Cheney


Saturday, May 05, 2007

$100M worth of sand?

I can still remember many years ago when, after I sat through a "blockbuster" (and quite dull) Schwarznegger movie with an enormous budget, I vowed not to go to the theaters to watch any movie with a budget of $100 milllion and higher. Talk about ridiculous uses for so much money!

So when I read the following juicy details about the special effects in Spiderman 3, well, I felt a little bit ill:

http://www.wired.com/wired/archive/15.05/pl_screen_p78.html

Blockbuster season's
most expensive movie star isn't a clean-cut actor. It's a pile of sand. It took a 30-person f/x team two years of CG-heavy lifting to crank out Thomas Haden Church's villainous Sandman. The laborious supporting character is also rumored to be a big reason Spider-Man 3 ran an estimated $100 million over its original $200 million budget. "This isn't just an effect like a twister or a tidal wave," says Scott Stokdyk, visual f/x supervisor. "Because it's a character, each particle of sandpile has to roll and have a direction and a target and start forming in and be part of a flow that forms into a volumetric shape." The illusion meant a crash course in developing software simulators that made sand behave like a fluid or a gas one instant and a sack of tiny marbles the next. Sand supervisor Doug Bloom says: "We did six years of R&D in two years. We honestly started the project not knowing how we'd be able to finish it." But will Spidey 3 hit box office pay dirt? Only time will tell.

They spend $100M just on getting the special effects right for the Sandman villain? What the hell is wrong with them, and wrong with us, with humans, that we would tolerate such a disgusting expenditure of money at a time when there is so much pain, so much need?

I know, I am such a whiner. Fine. Whiner, I will be. I will not see Spiderman 3 in the theaters. Maybe I will bother to watch it someday on an airplane, or at home.

Thursday, May 03, 2007

What is wrong with this picture?


I was in Las Vegas (Mandalay Bay Hotel and Convention Center) for the Collaborate07 Oracle User Group (s) conference. As usual, a very surreal experience, which was certainly driven home by this poster in the hotel elevator.

So....do you notice anything odd about the poster?

Wednesday, May 02, 2007

Quseful #2: The String Tracker Package

What's the point?

Sometimes you need to be able keep track of strings (names of some sort, usually) that you have used, so you do not use them again. I ran into this need, in fact, when I was building some backend code for Quest Code Tester for Oracle. We generate test code (a PL/SQL package) for the tests you described through the UI. That generated code includes declarations of variables. I can't declare a variable with the same name more than once. So I need to remember what I previously declared. To do that I built the qu_used package, which evolved into the string_tracker package.

The package requires Oracle Database 9i Release 2 and above, since it takes advantage of string-indexed collections. It is, I believe, an excellent demonstration of the elegance possible in one's code through the use of this structure.

I hope you can get as much value out of this package as I have.

Show me the code!

Sorry, rather than show you all the code here (very clumsy), I offer the source code and any supporting files in this zip file.

You can also download my entire "demo zip", containing all the scripts and reusable code that are part of my regular trainings. The zip for this Quseful is inside that zip as well.

Here are the files in the Quseful2.zip:

string_tracker3.pks - the lastest and greatest specification of the string_tracker package

string_tracker3.pkb - the lastest and greatest body of the string_tracker package

string_tracker.sql - a demonstration of using this code (also found below)

q##STRING_TRACKER.qut - a Quest Code Tester export of the test definition I built to veirfy that string_tracker works. You can import this into an installation of Code Tester and confirm for yourself that string_tracker works as advertised.

How do I use it?

The package contains several programs:

string_tracker.clear_all_lists Deletes all lists you may have defined in string_tracker in your session.

string_tracker.clear_list Deletes just the list specified in the call to clear_list.

string_tracker.create_list Creates a new list. Provide the name of the list, whether or not you want the strings in the list to be case-sensitive, and if you want to overwrite a list that already exists with this name.

string_tracker.mark_as_used Mark the specified string as "used" in the specified list.

string_tracker.string_in_use If the specified string is currently "used" in the specified list, return TRUE. Otherwise, return FALSE.

Examples

Here is an example of using string_tracker that mimics my own actual application of this package inside Code Tester.

I have a collection of outcomes (the tests I will perform after I test is run). For each outcome, I need to declare a local variable to hold the data. Since I can create more than one outcome for a particular OUT argument, I must be sure to avoid duplicate declarations.


DECLARE
/* Create a constant with the list name to avoid multiple,
hard-coded references. Notice the use of the subtype
declared in the string_tracker package to declare the
list name. */
c_list_name CONSTANT string_tracker.list_name_t := 'outcomes';

/* QCGU: A collection based on a %ROWTYPE associative array type */
l_outcomes qu_outcome_tp.qu_outcome_tc;
BEGIN
/* Create the list, wiping out anything that was there before. */
string_tracker.create_list (list_name_in => c_list_name
, case_sensitive_in => FALSE
, overwite_in => TRUE
);
/* QCGU: get all the outcome rows for the specified test case. */
l_outcomes := qu_outcome_qp.ar_fk_outcome_case (l_my_test_case);

/* For each outcome... */
FOR indx IN 1 .. l_outcomes.COUNT
LOOP
/* IF the string has not already been used... */
IF NOT string_tracker.string_in_use (c_list_name
, l_outcomes (indx).variable_name
)
THEN
/* Add the declaration to the test package. */
generate_declaration (l_outcomes (indx));

/* Make sure I don't generate duplicate declarations. */
string_tracker.mark_as_used (c_list_name
, l_outcomes (indx).variable_name
);
END IF;
END LOOP;

/* Clean up! */
string_tracker.clear_list (c_list_name);
END;


Gotchas

Keep the following in mind:
  • With string_tracker, you can keep track of multiple (approximately 4.3 billion) of lists of used strings. Each list may contain approximately 4.3 billion strings in it.
  • These lists only persist for the duration of your session (they are stored in package variables), and they consume PGA memory.
  • The package requires Oracle Database 9i Release 2 and above, since it takes advantage of string-indexed collections.
Do you like it? Do you use it?

I'd love to hear what you think of this utility and, in particular, if you found it useful. So please don't hesitate to post a comment on this blog or send me a note at steven@stevenfeuerstein.com.

About Qusefuls

A Quseful is a Quick and Useful (as opposed to Quick and Dirty) tip on now to write programs in the Oracle PL/SQL language more effectively. I will publish Qusefuls on my blog (feuerthoughts.blogspot.com) on a regular basis. Each Quseful contains a description of the tip ("What's the point?"), some PL/SQL code you can install in your environment to implement the tip ("Show me the code!"), an example of how to use the code to help you get your job done ("How do I use it?").

Sunday, April 22, 2007

God Bless the Congress of the United States of America!

This is a great country. I am very lucky to have been born where I was, when I was.

This fact was driven home to me very forcefully tonite by a visit to My Yahoo, where I found some exciting news, news that made me proud to be an American.

As I am sure you are aware, a young man killed 33 people at Virginia Tech several days ago. A horrible, horrible event. He was clearly deranged, a madman. And look what he did with all those guns. A massacre.

Well, Congress is not wasting any time in showing that it means business when it comes to protecting the citizens of this great nation, the citizens who, in fact, put those men and women where they are today.

No, sir, Congresspeople are contemplating swift and strong action, as explained by this article from Reuters:

U.S. Congress may act to keep guns from mentally ill By Thomas Ferraro Sun Apr 22, 4:09 PM ET

WASHINGTON (Reuters) - Prompted by the Virginia Tech massacre, a U.S. Congress reluctant to tackle gun control may pass limited legislation to help keep firearms out of the hands of the mentally ill, lawmakers and aides said on Sunday.

"Given the horror that happened at Virginia Tech, I think there's a real chance of passing this," said Sen. Charles Schumer (news, bio, voting record), a New York Democrat, told "Fox News Sunday."

A Republican leadership aide agreed, telling Reuters, "If there is a consensus, and it is in lieu of knee-jerk draconian measures, (the chances are) probably really good." ... more

==========================

Can there be any doubt about the great wisdom of our leaders?

I certainly agree with them: people who are mentally ill should not be allowed to own weapons.

This is a great time to be an American.

I pity all the other people around the world who have to be some other kind of person, like a European or even a Chinapean.

But maybe, just maybe, if you help the National Rifle Association establish a lobbying office in your country, then your nation, too, can rise to greatness.

In the meantime, it is entirely possible that God will only bless America.

Tough break, world.

Saturday, April 21, 2007

Quseful #1: Trace argument passing

About Qusefuls

A Quseful is a Quick and Useful (as opposed to Quick and Dirty) tip on now to write programs in the Oracle PL/SQL language more effectively. I will publish Qusefuls on my blog (feuerthoughts.blogspot.com) on a regular (hopefully at least weekly) basis. Each Quseful contains a description of the tip ("What's the point?"), some PL/SQL code you can install in your environment to implement the tip ("Show me the code!"), an example of how to use the code to help you get your job done ("How do I use it?").

What's the point?

A very good habit to develop is to add application-level tracing to your code. This tracing capability should be something you can turn on and off from outside your application code. Use it to keep track of application-specific information that is being used or processed by your code.

Options for tracing include:

Whichever tracing option you choose, information that very often needs to be traced/verified are the values that were passed into a program through the parameter list (IN and IN OUT arguments). Programmers usually write such tracing code themselves, which can be a major pain in the neck when you have lots of arguments.

Below you will find a program that extracts the arguments of a program from the ALL_ARGUMENTS data dictionary view and generates a starting point for your argument tracing. It assumes that your tracing function takes two string inputs:

  1. the context: defaulted to the name of the program you provided
  2. the trace message: a single string that contains concatenations of all the arguments in the form ARGUMENT_NAME = ARGUMENT_VALUE.

You may well need to change either this program or the output from the program to match your actual tracing interface or to remove any arguments whose type does not allow implicit conversions to strings. At least it will have generated a nice starting point for you, saving a bunch of time.

Note: many thanks to Jornica for his help in enhancing and testing this utility!

Show me the code!

Sorry, rather than show you all the code here (very clumsy), I offer the source code and any supporting files in this zip file.

You can also download my entire "demo zip", containing all the scripts and reusable code that are part of my regular trainings. The zip for this Quseful is inside that zip as well.

How do I use it?

Call gen_trace_call and pass it the name of the program for which you need argument tracing. It then queries the correct argument information from ALL_ARGUMENTS and generates code by displaying it on the screen with DBMS_OUTPUT.

This program has four arguments:

pkg_or_prog_in

The name of the package that contains the subprogram you want to trace, or the name of the schema-level function or procedure you want to trace.

pkg_subprog_in

If tracing a program in a package, provide the name of that function or procedure here. If tracing a schema-level program, pass NULL.

nest_tracing_in

Pass TRUE (the default) if you want to nest your tracing call within a conditional statement that is used to first see whether or not tracing is enabled. This is useful for reducing the runtime overhead of tracing when disabled.

tracing_enabled_func_in

The name of the function (or chunk of code) that you want to run to see if tracing is enabled. The default is 'qd_runtime.trace_enabled', which is the function used by the Quest CodeGen Utility to check to see if tracing is enabled.

trace_func_in

The name of the function that you want to call to do the tracing. The default is 'qd_runtime.trace', which is the trace function offered by the Quest CodeGen Utility.

Examples

Here are some examples, generating code for programs that are available in my "demo zip" file. Please note that I have formatted all code using Toad's auto-formatter. It will not be quite as pretty "out of the box". I have also turned on serveroutput before running these scripts.

1. A schema-level function (betwnstr.sf):

DECLARE
/* AFTER ENTERING - IN and IN OUT argument tracing */
PROCEDURE trace_in_arguments
IS
FUNCTION bool_to_char (bool_in IN BOOLEAN)
RETURN VARCHAR2
IS
BEGIN
IF bool_in
THEN
RETURN 'TRUE';
ELSIF NOT bool_in
THEN
RETURN 'FALSE';
ELSE
RETURN 'NULL';
END IF;
END bool_to_char;
BEGIN
IF qd_runtime.trace_enabled
THEN
qd_runtime.TRACE ('BETWNSTR'
, 'STRING_IN='
|| string_in
|| ' - START_IN='
|| start_in
|| ' - END_IN='
|| end_in
|| ' - INCLUSIVE_IN='
|| bool_to_char (inclusive_in)
);
END IF;
END trace_in_arguments;

/* BEFORE LEAVING - OUT and IN OUT argument tracing */
PROCEDURE trace_out_arguments
IS
BEGIN
IF qd_runtime.trace_enabled
THEN
qd_runtime.TRACE ('BETWNSTR', 'RETURN_VALUE=' || return_value);
END IF;
END trace_out_arguments;
BEGIN
NULL;
END;

You will find an example of betwnstr that includes this tracing logic in it in the betwnstr_with_tracing.sf file.

2. A function inside a package (dyn_placeholder.pks/pkb):

DECLARE
/* AFTER ENTERING - IN and IN OUT argument tracing */
PROCEDURE trace_in_arguments
IS
FUNCTION bool_to_char (bool_in IN BOOLEAN)
RETURN VARCHAR2
IS
BEGIN
IF bool_in
THEN
RETURN 'TRUE';
ELSIF NOT bool_in
THEN
RETURN 'FALSE';
ELSE
RETURN 'NULL';
END IF;
END bool_to_char;
BEGIN
IF qd_runtime.trace_enabled
THEN
qd_runtime.TRACE ('DYN_PLACEHOLDER.ALL_IN_STRING'
, 'STRING_IN='
|| string_in
|| ' - DYN_PLSQL_IN='
|| bool_to_char (dyn_plsql_in)
);
END IF;
END trace_in_arguments;

/* BEFORE LEAVING - OUT and IN OUT argument tracing */
PROCEDURE trace_out_arguments
IS
BEGIN
IF qd_runtime.trace_enabled
THEN
qd_runtime.TRACE ('DYN_PLACEHOLDER.ALL_IN_STRING'
, 'RETURN_VALUE=' || return_value
);
END IF;
END trace_out_arguments;
BEGIN
NULL;
END;

3. Same function, but using overrides for the tracing programs:

DECLARE
/* AFTER ENTERING - IN and IN OUT argument tracing */
PROCEDURE trace_in_arguments
IS
FUNCTION bool_to_char (bool_in IN BOOLEAN)
RETURN VARCHAR2
IS
BEGIN
IF bool_in
THEN
RETURN 'TRUE';
ELSIF NOT bool_in
THEN
RETURN 'FALSE';
ELSE
RETURN 'NULL';
END IF;
END bool_to_char;
BEGIN
IF mypkg.tracing_on ()
THEN
mupkg.show_action ('DYN_PLACEHOLDER.ALL_IN_STRING'
, 'STRING_IN='
|| string_in
|| ' - DYN_PLSQL_IN='
|| bool_to_char (dyn_plsql_in)
);
END IF;
END trace_in_arguments;

/* BEFORE LEAVING - OUT and IN OUT argument tracing */
PROCEDURE trace_out_arguments
IS
BEGIN
IF mypkg.tracing_on ()
THEN
mupkg.show_action ('DYN_PLACEHOLDER.ALL_IN_STRING'
, 'RETURN_VALUE=' || return_value
);
END IF;
END trace_out_arguments;
BEGIN
NULL;
END;

Gotchas

Keep the following in mind:

  • You have serveroutput turned on to see the output from this program.
  • If your parameter list contains complex datatypes, like records and collections, you will definitely need to modify the output before it will work.
  • It will only generate trace information for programs defrined in the current schema. You can add a schema argument to the program and change the user_arguments reference to all_arguments to generate code for programs in other schemas.
  • On Oracle9i, you will still be facing a limit of 255 characters in a call to DBMS_OUTPUT.PUT_LINE (rises to 32K in 10g and above). You can avoid this issue by substituting the call to DBMS_OUTPUT.PUT_LINE with a program that works around this issue, a number of which are available in my "demo zip", including the pl.sp procedure and the p.pks/pkb package.

Do you like it? Do you use it?

I'd love to hear what you think of this utility and, in particular, if you found it useful. So please don't hesitate to post a comment on this blog or send me a note at steven@stevenfeuerstein.com.

About Qusefuls

A Quseful is a Quick and Useful (as opposed to Quick and Dirty) tip on now to write programs in the Oracle PL/SQL language more effectively. I will publish Qusefuls on my blog (feuerthoughts.blogspot.com) on a regular (hopefully at least weekly) basis. Each Quseful contains a description of the tip ("What's the point?"), some PL/SQL code you can install in your environment to implement the tip ("Show me the code!"), an example of how to use the code to help you get your job done ("How do I use it?").

Saturday, April 07, 2007

Green and ethical hotel-ing

As I write this post, I am flying at 33000 feet in a Boeing 777, heading back home after two weeks in Europe (Copenhagen, Zurich, Vilnius, Amsterdam). I stayed in four different hotels.

I have been doing lots of (too much) traveling for many (too many) years. Yet it was only on this trip that I felt like I was finally hitting my stride, with everything I needed in place to make my trip really, really smooth.

In the bad old days of travel, I had a single backpack that I used (a) to carry all of my computer gear and extras for traveling, (b) to take to the fitness center for workouts, and (c) for just about anything I needed a pack for. So I was constantly moving stuff in and out of the pack. This meant that every time I was leaving for a trip, I had to make sure the pack contained everything I needed.

About two months ago, I had a brainstorm: why not buy another backpack and use it only for business travel? Then I can keep all the gear I need in that pack all the time. When I need to travel, I drop my laptop in and off I go! So I got a very nice Targus backpack for about $20 (CompUSA was going out of business and the pack was about 66% off.), and I put inside it:

* A mouse (regular size and functionality). I can't stand the Thinkpad touchpad. I need a mouse to do any serious work.

* A very cool in-your-hand "one finger mouse". This comes in really handy when I stuck in a coach seat, with no room for a regular mouse. Iwould have to scrunch up my shoulders to use the touchpad, and that really hurts my upper back. With the trackball, I can fully extend my arm and move the mouse from any position.

* A super-thin, but stiff Wowpad mousepad that I can put right over indentations sometimes found on a fold out airplane tray, and which normally louse up a mouse. I talked about this in a previous blog entry.

* An Imak computer glove that has a built-in beanie-bag that provides support for my palm and wrist. It goes wherever I go.

* The IGo universal adaptor so I can plug into the on-board electricity and not be bound to just battery power. Note: I found mine on eBay for half the cost of retail.

* An extra battery for the laptop. Oh wow, that can sure come in handy. On a recent trip, I waited till the last minute to pack and run for the airport. Now, when I put my laptop in the dock, I have to take out the battery, because it is (both are) an extended life battery and it sticks out the back. So this time around, I grabbed the laptop and dropped into my pack - without putting in the battery! Without the spare already in the pack, I would have been in BIG TROUBLE.

* An inflatable Eagle Creek lumbar pillow. Very nicely designed and a big help for avoiding lower back stiffness and aches on long flights.

* A headset with microphone that I can use with Skype. I am very much enjoying Skype when I travel internationally. It makes staying in touch back home so much easier. And I barely ever use Skype for computer-to-computer conversations. I can call "real" telephone numbers and pay something like $.021 per minute.

Well, that's about it for the gear I use on most every flight or most every trip.

And with my pre-prepped backpack, it all comes with me, all the time. How wonderful! So that's a big improvement over past travel experiences.

But it gets even better. I went to Denmark and Switzerland on this trip, and one thing I have noticed over the years about hotels in these northern European countries is that they often have a thick quilt for a top sheet on the beds (it is actually like a blanket that is slipped inside a sheet). That's very nice when it is very cold, or when a person easily gets cold. But that's not me. I tend to "run hot." I prefer fewer blankets and have trouble sleeping when I get too warm. This has caused problems in the past.

So I bought another travel accessory for this trip: the Cocoon TravelSheet. This very lightweight silk sheet is actually a superthin sleeping bag, of sorts. You spread it on your bed and lie inside it. It even has a section near the head into which you can slide a pillow, so it stays nicely in place. The whole thing compresses to the size of a large orange. How cool is that? So I figured I could use it when I would otherwise have to sleep under a heavy quilt-sheet.

But what I realized upon arriving at my first hotel, is that I could make much better use of this sheet than I had thought: I could simply lay it down on top of the nicely-made bed and never actually use the hotel linens!

What's so great about that? Well, two things that I can think of:

* I reduce the amount of linen that must be washed, saving water, cutting back on the phosphate and bleach pollution that washing produces. I simply come home from my trip and wash my nice silk travel sheet.

* Cleaning staff do not have to tear down and remake the bed. They can clean the room faster and they are less likely to strain themselves. "Strain themselves?" you ask. "What is Steven talking about?"

Many hotel chains are "upgrading" their rooms and implementing "sleep systems" that usually involve lots of pillows, heavy blankets, higher thread count sheets, and so on. Sounds really comfy, right? Well, there usually is a downside for someone in such situations. Cleaning staff now have to deal with more and heavier linens, and work harder to clean the same number of rooms in the same amount of time as before. Injuries are on the increase.

So by using my travel sheet, I am not only more comfortable, but I reduce pollution and improve the quality of life of at least one other human being. I like that.

Finally, I make sure that whenever I travel, I have $5 or the equivalent in foreign currency to leave as a thank-you for the cleaning staff. Two perspectives motivate my giving:

1. The way I see it, the more personal a service that a person provides to you, the more important it is that you leave a tip for that person. Someone cleaning up in my hotel room is essentially cleaning up my temporary home, including my bathroom. That's very personal.

2. As far as I can tell, the less visible the worker, the less they are likely to be paid. I don't think cleaning staff are paid very well, but they work very hard. So I feel it is important to complement their meager hourly wages.

So, in conclusion, I suggest that if you too travel an awful lot, that you:

* Prepack as much as you can to avoid unpleasant surprises ("Oh no! I forgot my power cable!").

* Find ways to minimize the ecological impact of your hotel stays. The level of convenience and luxury provided in business hotels tracks closely with the amount of resources consumed and waste produced.

* Leave tips for your room cleaners. Those few dollars will mean little to you and I, but an awful lot to people who are probably earning minimum wage.