Tuesday, January 31, 2006

Oracle bind variables in C# (more bad examples)

I knew there was a reason why I hate developing code targeted for and using Microsoft objects.

A little background before I continue. I work for an employer that has an ERP system and other systems back-ended by Oracle database. We are being asked to start developing in Microsoft's C# language using Visual Studio 2005 and the .Net 2.0 framework. I have a little C and a little Java experience, a little more JavaScript experience and a decent amount of Oracle programming experience (growing every day, yay). The book I have, "Programming C#, 4th Edition", has minimal but decent examples and notes for developers transitioning from C/C++, Visual Basic and/or Java. My first task was to get a simple console application built to read the database.

Step One: Read the Database

Actually this wasn't too hard after I figured out when developing C# applications using ADO.NET you must add a reference to the Oracle client or you will get an error when you build and no Oracle specific references will appear in the drop-downs while you code. A Google search helped me on that one.

Step Two: Use Bind Variables on the Same Query

This task seemed simple enough; use the .Parameters.Add(variable, type, size, value) for each parameter in a query like "select * from schema.table where column between :lovalue and :hivalue". It's not that simple. To make a long story short: It took three hours after going through Oracle's site, Google, and searching through the local MSDN before I found the code I needed in the OracleParameter remarks. Here is the code:

oraCommand.Parameters.Add(":lovalue", OracleType.VarChar , 2).Value = "AA";

For the love of what's good in this whole damn universe would it help to actually have a decent, working piece of example code? I've bitched about this before and it is still just as tiring and frustrating and makes me want to gouge my damn eyeballs out with the serrated edge of my tape dispenser.

You know how it works in COBOL? The same way it has for years and years and years:

EXEC SQL Select column into :ws-column from schema.table were column between :ws-lo and :ws-hi
END-EXEC.

Bloody'ell. Can someone tell me why using about fifty statements (or more if you encapsulate database crap into a separate class) to read a damn table is better than a simple and standard two-line EXEC interface?

Happy Birthday, Grouchette

Happy Birthday my affectionate, agreeable, amiable, angelic, appealing, attractive, beautiful, beloved, charming, cherished, companionable, considerate, darling, dear, dearest, delectable, delicious, delightful, dulcet, engaging, fair, generous, gentle, good-humored, good-natured, gooey, heavenly, kind, lovable, loving, luscious, mild, mushy, patient, pet, pleasant, pleasing, precious, reasonable, sweet-tempered, sympathetic, taking, tender, thoughtful, treasured, unselfish, winning, winsome angel, beloved,  darling, dear, dearest, flame, honey, loved one, lover, paramour, spark, sweet, sweetheart, truelove, turtledove girlfriend!

Tuesday, January 24, 2006

Windows Firewall and Microsoft's iSCSI Initiator

I couldn't figure out why I could see the SAN and my logical devices but I could not log on to those devices. I opened a port for Windows 2003's firewall to allow iSCSI in but it wasn't until I allowed all ICMP traffic that I was able to connect with the firewall up. I'm sure if I felt like messing with it I could determine exactly which of the ICMP requests were needed but oh well.

Microsoft's technical hardware specification made references to being able to receive and send an echo request. There were no other pieces of information from Microsoft or through Google.

Monday, January 23, 2006

Crooked?

I’m beginning to wonder if a certain company is crooked. I offer the following items of evidence:
  1. Said merchandiser advertises shrimp at buy one get two free but the sign over the bag of shrimp has a different UPC code than the shrimp in the bags in the container below that sign. The shrimp on sale is nowhere to be found.
  2. Said merchandiser has shoes on sale and a sign over them advertising a price. I buy the shoes and they ring up full price. I have to immediately take the shoes to returns, they let me know that was a mistake in the flyer and the display needs to be changed.
  3. Said merchandiser has humidifiers on sale for roughly $20. The humidifier pictured in the ad is not noted as being on sale and a price tag cannot be found. The brand on sale cannot be found. The product rings up for $32.
  4. Said merchandiser has 100 count multivitamins on sale – buy one get one free; save $10. The sale display tag is over a different multivitamin, not the one on sale. The regular price for the multivitamin indicated and pictured in the ad is roughly $4. The cost of the 300 count multivitamin is $10.
How it the hell can this merchandiser screw up so obviously, so continuously is beyond reason; unless it might be intentional.

My girlfriend had a similar incident with a different local merchandiser. She had to remind the cashier “that’s on sale” for seven out of eight items. A nationwide drug store advertises multiple sale items but once you enter the store you would be lucky to find half the product because it either doesn’t exist or is located on a shelf distanced away from the logical organization of the product (i.e. a non-season food product next to Christmas stuff not other food items or in a “sale” section).

Saturday, January 21, 2006

Old aquarium pictures

I was going through "My Documents" on my main workstation and came across some older pictures of my aquariums back when I had just a 29 gallon, 10 gallon and 5 gallon tank.

picture of 10 gallon tank

This is the 10 gallon tank that contained the pearl gourami left for me in a plastic Blue Jackets cup by my neighbor who was moving away, three platys (one still living), two bronze corydoras (in back left of half pot), and little plec #2.

picture of 5 gallon corydora fry tank

This is a snapshot of the offspring produced by the two parents (bronze corydoras above) in a 5 gallon tank.

picture of 29 gallon tank with tiger barbs

This 29 gallon tank started it all. It came down from Michigan with my girlfriend. The fish that survived initial forays into aquarium management were the tiger barbs (featured here). There are two albino corydoras, old plec and little plec #1 (RIP, killed by the shark). The 29 gallon tank was taken down and later rebuilt with a sand base and currently has most of the surviving fry from the 5 gallon tank above (about eight are in my 55 gallon tank). Sometime soon I'm going to donate the fry to Jack's Aquarium and Pets in try my hand at cichlids.

Friday, January 13, 2006

Shuttle SN85G4 v3 xPC

SN85G4 pictureA little while ago I purchased a SN85G4 v3 xPC made by Shuttle. To quote their own page: Enter the 64-bit computing epoch with this bleeding-edge NVIDIA nForce™3 250 and AMD Athlon 64-based small form factor (SFF) computer. Configured to run Microsoft® Windows® XP 64-bit version, the SN85G4 delivers scalable platform and longevity second to none. Now there are some things wrong with this statement.

First, their driver download site does not have Microsoft® Windows® XP 64-bit version drivers. All drivers are for Windows 2000/XP (32-bit). The RAID driver disk does not have 64-bit drivers..

Second, nVidia’s driver download site has beta Windows XP Professional x64 drivers but they haven’t been touched since 2004 (EditionVersion: 6.25 BETA Release Date: November 19, 2004). The 6.25 RAID disk is missing a file required to install the disk drivers. The 6.23 drivers (released in beta 10 days previous to 6.25) did seem to install correctly. Both drivers come with known issues including: “audio pops and clicks may occur while playing certain games”, “occasional hangs may occur with these drivers”. Judging by the date on those BETA drivers I can assume nVidia has little or no interest in maintaining that driver set (probably because they are concentrating on nForce4 on the AMD Socket 939 instead of the SN85G4’s AMD Socket 754)..

Third, for the RAID drivers you should go to Silicon Image’s web site at IP address 12.24.47.20 (yeah, no domain name)..

Personally, I think this is a shame. The SN85G4 is probably the best looking small form factor PC on the market. Things were a little cramped when the video card was installed but everything else is laid out very well otherwise..

There is a really good thread at Atomic PC called XP x64 – The Essential Collection that was a very good help.

Wednesday, January 11, 2006

Install Oracle and PHP OCI8 module on Ubuntu

This was somewhat of a pain in the rear end. I started from this Ubuntu Forums archived post: Howto: Install Oracle Instant Client and PHP OCI8 module.

To save yourself some trouble make sure you have C++, PHP-CLI, PHP-dev, PEAR and make installed (I forget the few other dependancies).

The instant clients I got from Oracle unzip'ped to an additional directory: instantclient_10_2, so go ahead and unzip it to the /opt/oracle directory then create two symbolic links to /opt/oracle/instantclient.

Everything else is pretty much straight forward.

Monday, January 09, 2006

Wasted weekend (bad karma)

While I was sick this weekend I decided to re-encode all of the PAL format Divx/Xvid encoded Windows AVI files so they will fit on two recordable DVDs and the playback on my Philips DVP642 DVD player. I didn't want to tie up my main workstation so I took the ten horror movies (already on a USB drive) and moved them over to a secondary workstation I use for development and other junk. It's just as powerful as the main workstation but has three times the storage. I carefully separated the video and audio streams, re-encoded some of the audio to save space (AC3 to CBR MP3), wrote the base Avisynth script to do the frame conversion, queued up all of the files in Gordian Knot, and spent most of the weekend encoding. Each movie took about two and a half hours. One video was a problem so I encoded it to a lossless codec then re-queued it.  Today, I multiplexed the audio and video streams, adding plenty of video stream information for each movie. I burned the first five to DVD, took them to my player, and none of them would load.

What happened?

I turns out on the Main settings for Profile AS @ L5 there is a checkbox for something called Quarter Pixel (QPEL). It was checked. My player does not support QPEL. It tries to read the file, gags on it for a few moments, then craps out to the next file it can read.

Well, #*$&%^@!

Well...

It's been a while since I've written something. In the span of a couple of weeks I've lost two family members who passed away before Christmas and New Years, had a birthday, had a computer at work die, and gained about six pounds back. Good grief...