Monday, September 27, 2004

Countdown to 100

With seven games left, the Royals are only 2 losses away from 100. Chances are good that 2004 will end up being the worst year in franchise history. Lots of chances are coming in 2005, as the team tries to learn from this dismal season.

Looking ahead to 2005...

Harvey/Sweeney - 1B (is there no way to keep Pickering on this team?)
??? - 2B
Berroa - SS
Teahan - 3B
??? - LF
DeJesus - CF
Nunez - RF
Buck - C

I'd like to see the Royals move Berroa over to 2B and let Andres Blanco take over at short. Blanco's defense can save more runs than Berroa's offense can create. It looks like Randa's option will not be picked up, so Teahan hopefully Teahan will be ready.

Relaford will likely be gone, so I think Graffanino will return as utility infielder. GM Allard Baird has said that he's going to sign a power hitting corner outfielder to take over LF. Somebody like Juan Gonzalez would be nice - of course, only if he shows up to the ballpark.

The rotation is really up in the air. The Royals are in a strange predicament where they have lots of options, but none really stand out:

Grienke (the ace)
Hernandez (back from Tommy John)
Snyder (back from surgery)
Appier (back from the dead)
Mike Wood (not bad since coming in the Beltran trade)
Miguel Asencio
Denny Bautista (came in the Grimsley trade, looks good but needs seasoning)
Dennys Reyes (probably betting in the pen)
Darrell May
Brian Anderson (can we please lose at least one of these guys????)
Jimmy Gobble
Chris George
Jimmy Serrano

Whew! That's a long list. The sad part is, it's hard to pick 5 out that I would want in my rotation.

I'll catch 2 more games this season before they pack it up for the winter. It'll be interesting to see what moves they make this off-season.

DVD Reviews

The release of the "STAR WARS" trilogy on DVD, led me to Best Buy to pick up that and a few other DVD's.

I've always been annoyed by George Lucas's reluctance to release the original films on DVD. I'm not sure what his issues were. He's always been very particular that his films are presented exactly how he wants, and DVD is the perfect medium for this. Lucas released the trilogy on VHS years ago, but as we know now, VHS is no comparison to DVD.

The STAR WARS trilogy did not disappoint. All three movies have been enhanced and the audio especially is impressive. It's important to note that the movies are not the original movies, rather the "Special Edition" movies that were released to theaters a few years ago.

The movies definitely have survived the test of time, as the films are all as enjoyable, if not more, than when I saw them some 25 years ago. My son, who just turned 11, finds them mesmerizing, which speaks volumes for their appeal.

The other DVD I picked up was "RUSH In Rio." I've always been a Rush fan, but no necessarily fanatic. Throughout my high school and college years, a buddy and I would make a point to catch Rush in concert whenever they passed through Kansas City. The DVD was an impulse purchase after seeing it playing one of my favorite songs, "YYZ" on a TV in the store.

The DVD includes 2 discs, a concert disc of the band's final concert of the recent tour in Rio. The second disc, which I haven't seen yet, includes a documentary and enhanced versions of a couple of the songs.

I was excited to pop this one into the DVD player in my home theater to hear it in its 5.1 glory. Boy, was I disappointed.

The audio on the concert DVD is awful. Imagine taking a poor quality recording of a noisey concert, then adding excessive doses of reverberation to it. After 2 or 3 songs, I found myself being annoyed by the sound - so much so, it was quite a relief to turn it off. Typically, a concert recording is made up of direct feeds from the microphones and sounds systems, and crowd noise is added in for ambiance. This DVD sounds like it was made with Radio Shack microphones sitting in the middle of the crowd. The crowd noise is way too loud, and the music is terribly muddy and difficult to hear.

I find it hard to believe that musicians like Rush (and they are the most talented musicians I've ever seen) would allow this travesty to be released.

Tuesday, September 14, 2004

Royals and Yanks

I was at the stadium last night for the Royals impressive win over the Yankees. The Royals were able to capitalize on poor pitching and put up 10 runs in the 5th inning (and 5 more in the 7th).

I was at the game with a buddy who knows a Royal Lancer. The Lancers are responsible for selling season tickets. He let us watch the last few innings from the Stadium Club. It was nice. The Club is a restaurant that overlooks the field. Some folks think this is the best way to take in a game. I disagree.

I found that while in the Stadium Club, I really didn't feel like I was at the game. The Club is behind glass windows, so you can't hear the crowd. Or the music. Or the announcer. They do pipe in the radio broadcast, so you can get some idea of what's going on. The view of the field is pretty good. The Club is on the 3rd base side, down the line a little bit.

But I feel like baseball is best experienced up close. I'm very fortunate to have been able to join with a group who purchases season tickets down close. The seats are about 5 rows up from the club seats, right behind the visitor's on deck circle. From there, you can really hear the crack of the bat and the ball hitting the catcher's mitt. I'm very lucky to be able to catch about 10 games a year from these seats.

Football, on the other hand, is best experienced up high. Good thing, since my Chiefs seats are in the upper deck... way up there...

Digital Signatures

It's been a while since I've blogged. I'm working on an InfoPath project and that has consumed my working hours and several of my free time hours as well.

One pretty cool thing we will be using in the project is the Digital Signature capability in InfoPath SP1.

Our form will include several views that are used to populate one large schema with data. The form will not be completely filled out at one sitting. As users fill out the various views, we will allow them to digitally sign the data thus certifying its validity. InfoPath SP1 allows us to sign just certain pieces of the data as we move through the process. Once the data is signed, it will become read-only to prevent tampering, either accidental or intentional.

The above MSDN article give a good background on signing data in InfoPath.

Wednesday, September 08, 2004

My Worst Nightmare

The 2004 Royals.

Okay, now my other worst nightmare. You're making good progress on a project, writing all kinds of kick-butt code. There's one piece you're not quite sure about, so you GOOGLE it. You find a perfect example, but you unexpectedly get pulled away. By the time you return, you're late for your son's baseball practice, so you shut down the laptop and hit the road.

Now, you can't find that piece of code to save your life....

If anybody knows where that InfoPath JScript code is that opens an XML file from the file system and reads elements out of it, please let me know.

In the meantime, check out these valuable InfoPath resources:
InfoPath Team Blog
Greg Collins and Patrick Halstead's InfoPath Site

AH HA! I found it! It was at the InfoPath Team Blog, and it was an item describing how to dynamically update the xsf file. You can find it here.

Thursday, September 02, 2004

Greinke's Night

Well, we finally got a glimpse of what the future may hold last night. Zack Greinke pitched a perfect game into the 6th, and only gave up 2 hits before leaving after the 7th. (BTW, can somebody please tell me why Pena took him out? Under 100 pitches and obviously dominating the Tigers. He gave up two cheap singles but got out of it by inducing a double-play ball).

Greinke's either dumb like a bag of hammers, or a mad genious. When he speaks, it sounds like a tree talking. But on the mound, he playfully toys with hitters. Last night, he decided to drop in a 50 mph curve for a strike. His quote in the paper this morning:

“I told myself,” Greinke said, “don't start laughing out here because you'll make everyone mad at you. You can't go out there and be a clown on the mound.”

Don't start laughing??? I can just see him out there chuckling at his own brilliance. Soren Petro reported on WHB this morning that Greinke was in the tunnels working on a knuckleball. He's 20 and he already knows more pitches than a Kirby vacuum salesman.

If only the rest of the Royals organization wasn't in tatters. It would be fun to see Greinke grow to be the most dominating pitcher in baseball AND to have some guys around him who can score runs for him (lucky he was so good last night, as the Royals could muster just 1 run).

Wednesday, September 01, 2004

InfoPath Fun

Just finished a proof of concept with InfoPath. What we wanted was an automated way to convert a completed InfoPath form to TIFF in order to archive it in a document imaging system. Turns out it's possible, but a bit painful.

The first step is to write code in the form to capture it. That can be done by "signing" the form. When designing it, you can specify which pieces of data should be signed. For signing to work, the form must be Fully Trusted. See the InfoPath SDK for more info on fully trusted forms. Once that's done, I can capture the form in the OnSign event like so:
// The OnSign handler can be customized only in fully trusted form templates.
var Signature = eventObj.SignedDataBlock.Signatures.Create();
var PngNode = Signature.SignatureBlockXmlNode.selectSingleNode(".//sp:ScreenDumpPNG");

var fso = new ActiveXObject("Scripting.FileSystemObject");
var a = fso.CreateTextFile("c:\\TestFormPNG.txt", true);
a.Write(PngNode.text);
a.Close();

eventObj.ReturnStatus = true;
}


As you can see, the form is being captured and saved as a Base64-encoded PNG file. In my test, I fire this event by using a button that when clicked runs this line of code:
XDocument.SignedDataBlocks(0).Sign();


Once the Base64-encoded PNG file is saved, we can use System.Drawing.Imaging to grab that PNG and convert it to TIFF. Of course, it needs to be decoded to binary first. I wrote a little VB.NET Windows app that does this. Here's what it looks like:
Dim inFile As System.IO.StreamReader
Dim base64String As String

Try
Dim base64CharArray() As Char
inFile = New System.IO.StreamReader("C:\TestFormPNG.png", _
System.Text.Encoding.ASCII)
base64CharArray = New Char(inFile.BaseStream.Length) {}
inFile.Read(base64CharArray, 0, inFile.BaseStream.Length)
base64String = New String(base64CharArray, _
0, _
base64CharArray.Length - 1)
Catch exp As System.Exception
' Error creating stream or reading from it.
System.Console.WriteLine("{0}", exp.Message)
Return
End Try

' Convert the Base64 UUEncoded input into binary output.
Dim binaryData() As Byte
Try
binaryData = System.Convert.FromBase64String(base64String)
Catch exp As System.ArgumentNullException
System.Console.WriteLine("Base 64 string is null.")
Return
Catch exp As System.FormatException
System.Console.WriteLine("Base 64 length is not 4 or is " + _
"not an even multiple of 4.")
Return
End Try

'Write out the decoded data.
Dim outStream As New MemoryStream(binaryData)

Dim outImage As New Bitmap(outStream)

Dim TIFImage As Image = outImage
TIFImage.Save("c:\TestFormTIF.tiff", System.Drawing.Imaging.ImageFormat.Tiff)

MessageBox.Show("Image has been converted")


Now that my little test is working, I at least know it can be done. Now the real test will be to use this concept in real-world forms. I'll get that chance starting tomorrow when I begin a new project.

The Races

I was checking the box scores this morning and noticed some interesting races as we head into the final month of the season:

AL Central: The Royals, led by Juan Gonzalez's MVP-like season, are making good on predictions they'd win the Central, leading the Twins by a comfortable 10 games. Oh wait... Sorry, I slipped into Bizarro-World for a second. The reality is that the Royals are the biggest disappointment in baseball this year. They entered 2004 bolstered by their surprising over-.500 season last year, but everthing has gone wrong. Not a single player has played to his ability. When the entire team slumps, that's not good. The Royals are heading for their second 100-loss season in 3 years.

Meanwhile, the Twins are poised to win yet another division title, leading Cleveland by 7 games. But the Indians have not given up, and went over the .500 mark with an impressive 22-0 win over the Yankees last night. If the Indians can hang in there, this could be an interesting race.

AL West: This one is close. The A's lead the Angels by just 3 games. The A's have been on fire, winning 8 straight and going 9-1 in their last 10 games. The Angels are just as hot, however, having won 8 of their last 10 games. A couple of off-nights by either team can cost the pennant.

AL East: On August 16, the Yankees' lead was 10.5 games. Today it's 3.5. The Yankees were embarrassed by the Indians last night and have struggled of late. In their last 10 games, the Yankees are 5-5 while the Red Sox are 9-1. The Sox are getting hot just at the right time while the Yankees are looking vulnerable. The Sox were hoping to get a Wild Card berth, but now are in position to overtake the Yankees for the East crown. This one will be fun to watch.

NL Central: WOW! What are they drinking in St. Louis? The Cards are by far the best team in baseball and have a commanding 15.5 game lead over the Cubs. The opposite of the Royals, all of the Cards' players are having outstanding seasons. This race is over.

NL West: The Giants' reign looks to be over. The Dodgers have a 5.5 game lead over the Giants and 6.0 games over the Padres. The Dodgers offense is still sputtering. They've scored 82 fewer runs than the Giants, but they have gotten it done with their pitching. Gagne has faltered a bit of late, but he is still the most dominating closer in the game. I expect the Dodgers to win the division, but then regress to the Pythagorean mean and fall early in the playoffs.

NL East: It didn't look like it early in the season, but the Braves have pulled it together and are poised to win yet another title. Their lead over Florida is 8.5 games.

AL Wild Card: Boston was hoping for a Wild Card berth, and still lead the WC standings with a 2.5 game lead over the Angels. But it looks entirely possible that the Sox could win the East, and the Yankees would be the Wild Card team. Maybe the Yankees should embrace entering the post-season as a Wild Card, given how the WC teams have done the last two years (The last two World Series winners, Anaheim and Florida, have been WC teams).

NL Wild Card: With St. Louis's magical season, the Cubs' only hope is to get in as a Wild Card. They are currently tied with the Giants in the WC race, with the Padres just a half game back. And Florida and the Astros are in it as well, just 3 games back. This looks to be the most exciting race of the season. After last year's tease, baseball lovers should be rooting for the Cubs to make possible that dream World Series with the Cubs vs. the Red Sox.

Now that the races are heating up, I'm sure I will finally start getting my money's worth out of my MLB Extra Innings package. With the package, I can watch any one of these teams on any night. It should be fun!

InfoPath

It looks like I'll be starting a new project soon that involves the creation of about 30 InfoPath Forms.

If you're not familiar with InfoPath, it is a new product that is part of the Microsoft Office Family. InfoPath's main purpose in life is to collect data. It provides an interface to allow developers (or non-developers) to easily create data entry forms. The forms are made up of controls (text boxes, check boxes, etc) and can have all kinds of validation built in to them. What gets created is a template file, that is actually an XML document that defines the form and its data structure.

Users can simply double click the template file to open InfoPath and fill out the form, then the data can be saved as XML, or sumbitted to a database or web service.

While doing a presentation on InfoPath recently, I was asked if, as a developer, I would honestly choose InfoPath over simply writing a quick and dirty Windows Form Application in VB.NET or C#.

That's a good question, since most developers are going to stick with what they are comfortable with. However, I have found that for simple data entry forms, I can build the form in InfoPath much quicker than developing an application. It would have to depend on the situation, of course, but I think InfoPath will find its place as part of larger solutions.

For example, the Office Solution Accelerator for Recruiting combines many technologies. It uses SharePoint and WebParts, web services, and InfoPath together to create a solution for tracking candidates through the interviewing process. InfoPath is actually a small part of the solution, but ties the solution together. Developers need to be able to know when to use which technologies to make a solution work.

For more information on InfoPath, see the excellent InfoPath SDK and check out the InfoPath Team Blog