FREE hit counter and Internet traffic statistics from freestats.com

Wednesday, June 30, 2004

Stark on Baird

Here's another assessment of the Beltran deal by ESPN's Jayson Stark. Basically the same take. If Teahan hits then all is well.

Tuesday, June 29, 2004

Beta 1 of Visual Studio 2005 Available

Today, Microsoft announced that the beta 1 is available at TechEd Europe. In addition, they announced that they're going to ship Express versions of the tools that include:

  • Visual Web Developer 2005 Express Edition, a lightweight tool for building dynamic Web sites and Web services

  • Visual Basic 2005 Express Edition, a streamlined programming tool for beginning programmers to learn how to build exciting Windows applications

  • Visual C# 2005 Express Edition, Visual C++ 2005 Express Edition, and Visual J# 2005 Express Edition, targeted programming tools for students and enthusiasts who wish to learn the fundamentals of computer science

  • Microsoft also ships SQL Server 2005 Express Edition, an entry-level database for hobbyists, enthusiasts, and students developers

  • Rule 10.18(i)

    The only even mildly interesting thing that happened in last night's 10-1 drubbing of the Royals by Baltimore, a game which I scored for mlb.com, was the application of rule 10.18(i). So the rule doesn't role off your tongue? Let me refresh your memory.

    "(i) When pitchers are changed during an inning, the relief pitcher shall not have the benefit of previous chances for outs not accepted in determining earned runs. NOTE: It is the intent of this rule to charge relief pitchers with earned runs for which they are solely responsible. In some instances, runs charged as earned against the relief pitcher can be charged as unearned against the team"

    And so last night in the 4-run Orioles 7th Matos doubles, Gibbons singles and score Matos, 1 earned run for Darrell May. However, Hairston reaches when Mike Sweeney drops a throw from third baseman Desi Relaford (his second dropped throw of the night but only the first for which he's charged an error). Runners now at first and second. The runners go on to pull off a double steal before Roberts doubles scoring both of them. Clearly Hairston's run is unearned to May. At this point Tony Pena brings in Scott Sullivan and as 10.18(i) indicates Sullivan starts with a clean slate in terms of his earned runs. Sullivan goes on to give up a single to Newhan but Roberts is thrown out at the plate on a nice throw by David DeJesus from centerfield. Tejada then singles and Palmerio pops out on an infield fly to Graffanino. Without the error Palmeiro's popout would be the third out. However, Lopez then singles to left scoring Newhan before Bigbie flies out to left. So Sullivan is charged with an earned run for Newhan's run since Sullivan does not get to take advantage of the fact that there should have been 2 outs when he entered the game. This is then credited as an earned run to the team (TUR in the mlb.com scoring system). As a result, the boxscore for the Royals pitching looks a little strange:


    IP H R ER BB SO HR ERA
    May 6.0 8 7 6 2 2 1 5.90
    Sullivan 2.0 3 1 1 0 2 0 3.47
    Field 1.0 2 2 2 3 1 0 3.60
    9.0 1310 8 5 5 1


    Looking for more interest in the conventional manner when I score tonight's game.


    Other Royals Notes:
    Joe Randa was placed on the DL after last night's game, Allard Baird announced during a mid game press conference. He'll have arthroscopic surgery on his knee, which will then require 3 to 4 weeks recovery time. Hopefully he'll be back before the trade deadline provided the Royals can find a deal he'll approve (he has a no-trade clause). In the meantime it looks like Relaford will play third.

    Mike Wood pitches today, his first appearance this year in the majors. John Buck will do the catching and so two-thirds of the Beltran deal will be on display.

    The Royals also acquired Jose Bautista from Tampa Bay on a rule 5 pick. Bautista is a 23 year old first baseman who played for both the Orioles and Devil Rays this season. He'll be assigned to AAA Omaha.

    Monday, June 28, 2004

    Tie Goes to the Runner?

    Recently, an interesting conversation ensued on the SABR listserv regarding the phrase "a tie goes to the runner". Is this true?

    In the official MLB rules the only phrase I can find (repeated in rule 6.05(j) and 7.08 is "the defense must tag him [the batter] or first base before he touches first base."

    To me this indicates that a tie does indeed go to the runner since the word "before" is used. However, several on the SABR site argued that umpires are taught that there is no such thing as a tie and so there will always be a correct call. Interestingly, one of the contributors to the SABR list noted that the "1875 DeWitt's Umpires Guide was emphatic that ties go to the runner: 'If simultaneously, the base runner is not put out...'". He also noted that when he umpired he was instructed that a close play was an "out that you needed to sell". Is that still the training for MLB umpires? If so, it would appear that umpires are in fact allowing ties to go to the fielder in contradiction to the written rule.

    While training umpires that there are no ties may be necessary, in reality there are limits to both visual and auditory human perception. In fact, another poster noted that if two events occur within 0.05 seconds it is impossible to reliably judge which occurred first. He also notes that auditory reaction times are typically quicker than visual ones. And so in practice there are ties and so it would be nice if the rule book addressed the issue specifically.

    Sunday, June 27, 2004

    Fear and Awe

    This morning the pastor preached on 1 Peter 2:17, "Honor all people, love the brotherhood, fear God, and honor the king" (NASB). He then used this passage to discuss three levels of authority that Christians are under starting with God, continuing with fellow believers, and then including secular rulers.

    While there are all sorts of implications that fall out of the third exhortation ranging from the justification of the American Revolution to honoring leaders like Bill Clinton, I was most interested in his description of the "fear of the Lord" as the Old Testament says and was reminded that Proverbs notes that this "fear" is the beginning of knowledge. But what exactly is the fear and why is it the beginning of knowledge?

    Obviously, our English usage of the word fear is restricted to irrational phobias (as in spiders or heights) or the entirely rational dread of physical pain and suffering. Here, however, fear retains the older connotation of reverence, respect, and awe. At its core I think you can describe this fear as one basic to humanity and that is brushed up against when one can tear ones self away from our blinding self-centeredness long enough to glimpse reality as it is. I think we see it when contemplating the summit of a distant mountain, the expanse of the ocean, or the vastness of the universe. In fact, it was this properly basic fear that gave man and continues to give men an experience of the supernatural, or the Numinous. The Numinous or "Awful" then is the beginning of, or the first stage of, religious feeling that only when connected with a personal and moral God becomes "the Holy".

    The connection between the Numinous and a moral God was described well by C.S. Lewis in The Lion, the Witch, and the Wardrobe when the children Peter, Susan, Lucy, and Edmund are being led by Mr. and Mrs. Beaver to find Aslan.

    "Aslan?" said Mr. Beaver. "Why, don't you know? He's the King. He's the Lord of the whole wood, but not often here, you understand. Never in my time or my father's time. But the word has reached us that he has come back. He is in Narnia at this moment. He'll settle the White Queen all right. It is he, not you, that will save Mr. Tumnus."

    "Is-is he a man?" asked Lucy.

    "Aslan a man!" Mr. Beaver said sternly. "Certainly not. I tell you he is the King of the wood and the son of the great Emperor-Beyond-the-Sea. Don't you know who is the King of Beasts? Aslan is a lion-the Lion, the great Lion."

    "Ooh!" said Susan, "I'd thought he was a man. Is he quite safe? I shall feel rather nervous about meeting a lion."

    "That you will, dearie, and no mistake," said Mrs. Beaver; "if there's anyone who can appear before Aslan without their knees knocking, they're either braver than most or else just silly."

    "Then isn't he safe?" said Lucy.

    "Safe?" said Mr. Beaver. "Don't you hear what Mrs. Beaver tells you? Who said anything about safe? Of course he isn't safe. But he's good. He's the king, I tell you!"


    So then why is the experience of the Numinous the beginning of knowledge? I think its simply because without a reverence, respect, and awe for a creator there is no central Fact from which the rest of reality flows. If the reductionists are correct and our experience of the Numinous is merely brain chemistry run amok, then there is no basis for reason, no basis for morality, no basis for service towards your fellow man, and in the end no basis for belief in a reality outside your own brain.

    Saturday, June 26, 2004

    Kauffman Park Effects Revisited

    Well, after almost half a season I thought it would be good to revisit the park effects at Kauffman stadium I blogged about in January. In that analysis I found that during the period from 1991-1994 when the park was astroturf and the dimensions were as they are now the park factor was 109 (in other words 9% more runs were scored in Kauffman Stadium). During the period from 1995-2003 when grass was installed and the fences moved in the park factor remained 109 although during the period 2001-2003 it was around 127, at or near the top each season.

    This offseason the fences were moved back and according to the ESPN calculation the park factor thus far in 2004 is 84, good for 27th in baseball. In addition, the factor for homeruns is 69, 29th out of 30 only leading the new PETCO park in San Diego where it is 64.

    So it appears that moving the fences has had an effect although it will probably be several years before we know how big the effect is. The other thing I noticed from my previous analysis is that park factors seem to carry a large standard deviation and so yearly weather patterns and other factors may play almost as big a role as park dimensions (.15 for the Kauffman data) for certain ballparks (I would think more so in the midwest). For example, although I don't have any concrete data, this spring in Kansas City has been wetter and cooler than any I can remember since moving to the area in 1995. This idea was born out to some extent in the analysis done about Coors Field I blogged about earlier this month.

    Beltran Joins the Killer B's

    As a Cubs fan I can't say I'm happy about the Royals dealing Carlos Beltran to the Astros. However, as a Royals fan I think that GM Allard Baird did what he had to do given the ridiculous financial world in which Major League Baseball operates.

    As for Houston, they gave up Octavio Dotel now bound for the A's, who had converted 14 of 17 save opportunities and struck out 50 in just 34 and 2/3 innings. They'll be handing the reins over to Brad Lidge who has better numbers than Dotel, although he is more prone to injuries given his mechanics. Beltran will now patrol center field with Biggio moving to left. It'll be interesting to watch Beltran negotiate the hill and flag poll at Minute Maid park. In the long run, since the Astros can't sign Beltran, it's a pretty risk move but an understandable one given that with aging stars like Kent, Biggio, and Bagwell, they need to win this year.

    Of course the A's desperately needed someone to fill out their bullpen having blown 14 of 27 save opportunities to date.

    In the meantime the Royals pick up three prospects:

  • C John Buck, 23. He was hitting .300 at AAA and will now be inserted as the starting catcher. His power numbers were much better in 2001 and he has been hampered by injuries since. He also has little plate discipline. He's a big guy with a slow release behind the plate so it'll be interesting to see if he sticks as a major league catcher or ends up in the Mike Sweeney mold assuming he develops as a hitter.

  • 3B Mark Teahan, 22. By all accounts he was the key to the deal. He'll be assigned to Omaha for the time being until Joe Randa can be traded. He was hitting .275 with 8 doubles in 20 games for Sacramento and earlier hit .335 for AA Midland. At this point he hasn't found his power and whether he develops it will determine whether the deal goes down as a good one for the Royals.

  • P Mike Wood, 24. He was putting together a solid season in Sacramento going 11-3 with a 2.80 ERA. He keeps the ball down and tops out around 90 mph. He'll immediately enter the starting rotation along with Grienke, Reyes, Gobble, and May. His H/IP ratio has never been stellar nor has his K/IP or K/BB ratios. Seems to me like more of a fourth or fifth starter if he sticks at the big league level.


  • Clearly, the strength of this deal for the Royals is the possibility that they've found three major league starters who are all cheap, one of whom may just end up being above average. At the same time it gives playing time to David DeJesus to see if he can develop into a leadoff hitter. While it doesn't get them any closer to contending over the next several years, it does allow them to save some money. It will be interesting to see if the Glass family now cuts the payroll back in the $35 million range next year since they're freed from the $9 million Beltran was earning and will be rid of the salaries of Grimsely, Stairs, Gonzales, and Randa. Given the pendulum swing back to the youth movement I would expect that to be the case.

    On a side note, perhaps the most ridiculous comment I heard this week was on a sports talk radio show where the host was criticizing Beltran as perhaps not a player the Royals wanted anyway since he has never won a batting title, MVP, or led his team to the playoffs. Clearly, this shows a lack of understanding in what it means to be a player that helps his team win. Over the last 3 and half years his OPS has been in the .875 range, he's the best defensive center fielder in baseball, and he's the highest percentage base stealer in history. The fact that he's not won playoff games with the Royals has no correlation to his skills or his contribution to the team. On any team that Beltran goes to next year he will immediately displace the current centerfielder.

    Thursday, June 24, 2004

    Jon Box and INETA

    Here's a nice little video of Jon Box talking about how to start a .NET User's Group. Good stuff Jon.

    Wednesday, June 23, 2004

    CF and Amazon Redux

    For another example of using the Amazon web services from the .NET Compact Framework see mobile guru Michael Yuan's blog. I did something similar several months back.

    Tuesday, June 22, 2004

    Ground Outs Galore No More

    Jason Grimsely is the second player to be moved since GM Allard Baird's announcement that he was selling off the team in parts. Grimsely was traded to the Orioles for minor leaguer Denny Bautista, a hard thrower with lots of potential who is only 23 years old (Baseball Prospectus had him listed as 21 with a birthdate of 10/23/82. I'm told he was another Latin player caught lying about his age). Baseball Prospectus liked him when he was thought to be 21, not so sure now (he's also a good friend or cousin of Pedro for what its worth) although he needs to develop some control - 70 walks in 137 innings last year and 33 in 62 2/3 innings this year. I'd put this trade in the win column for Baird.

    On the down side the Royals handling of the release of Curtis Leskanic seemed a bit strange. Although Baird swore to Leskanic it was a baseball and not a financial decision, it seems clear to most everyone (and Leskanic if the story in last Sunday's KC Star is accurate) that it was purely financially motivated since Leskanic was due to start earning roster bonuses that would eventually equal around $1M. In addition, Leskanic was throwing better and it seems like Baird might have been able to make a deal similar to the Grimsley trade if Leskanic could have been showcased and seen to be healthy again. Certainly Leskanic's age works against him in a trade scenario but it seems other teams already have an interest.

    Finally, my brother alerted me to this unusual statistic related to Grimsely. Here are his ground and fly outs and ratio since the stat started being tracked in 1999.

    
    
    Year Team GO FO GO/FO
    1999 New York Yankees 104 52 2.12
    2000 New York Yankees 145 89 1.74
    2001 Kansas City Royals 128 45 3.18
    2002 Kansas City Royals 107 45 2.53
    2003 Kansas City Royals 125 37 3.57
    2004 Kansas City Royals 55 6 9.83


    Grimsely has always been a ground ball pitcher and is therefore valuable in double play situations. His ratio typically ranges between 2 and 3, which of itself is quite high. However, I've never seen a ratio of 9.83. Although the same size is 26 and 2/3 innings, that's still remarkable.

    Monday, June 21, 2004

    Overheated Dell

    Ok, here's a new one. My Dell Inspiron 5100 has recently been acting a bit flaky. I first noticed that at various times one of the USB ports would stop working causing my mouse to fail or my Pocket PC to stop synchronizing. Over the last 5 days the machine has begun to intermiitantly power off completely. Not thinking I would find much I Googled the problem. Lo and behold I found this post on the Dell support site that led me to this site where the problem is fully documented.

    Turns out it's simply dust building up on the "bottom of the computer heatsink". I downloaded the cool little utilty mentioned on the site to monitor the temperature of the CPU and found that mine was running at 69 or 70 degrees Celsius, too high according to the site. I then followed the directions on the site, got out my little can of Endust Duster (compressed air) and blew it into the fan. A little cloud puffed out and I restarted the machine. The CPU temperature now fluctuates between 54 and 59 degrees most of the time. I noticed that the fan goes on high at 62 degrees. Looks like this will have to be done every couple weeks or so from now on...

    Wednesday, June 16, 2004

    Recent Publications

    Just a note on two recent articles in the Access VB*SQL Magazine. In the May issue my article "Get Set for ADO.NET Whidbey" was published. Unfortunately, it was written before the May Community Technology Preview version was released as well as additional information at TechEd. For a more up to date look see my DevEssentials talk.

    The other article is in the June issue and called "The Four Pillars of Smart Clients". Brielfy, this article looks at what you'll need to consider when building smart client applications. Let me know if you read the articles and what you think. All comments welcome.

    Thin Air and Coors Field

    I read an interesting summary of an academic article titled "atmosphere, Weather, and Baseball: How Much Farther Do Baseballs Really Fly at Denver's Coors Field?" in the November 2003 "By The Numbers" newsletter published by SABR. Interestingly, the authors of the article found that average fly ball distance at Coors Field was only 3% greater in the period from 1995-1998 when you take into account the larger dimensions at Coors and the prevailing winds which typically blow in. This is not even as great an advantage as Mark McGwire enjoyed in 1998 in St. Louis.

    As a result, the greater homerun rate per at bat (.044 at Coors from 1995-2002 versus .029 for other NL parks) is attributed to the impact of thin air on breaking pitches and low humidity making the ball harder and therefore more difficult to grip for pitchers.

    So it seems that perhaps the focus on how the ball carries at Coors has been overblown and the effect on pitchers underestimated. This also explains why Coors seems to affect some pitchers more than others.

    Tuesday, June 15, 2004

    Tools for .NET CF Development

    In our book we mentioned several tools such as Hopper that are now available from Microsoft. Generally, these tools help developers when debugging and dealing with devices. Briefly, the tools are:

    Emulator ActiveSync Connection Tool - Allows Activesync to connect to your Emulator session from Visual Studio .NET 2003.

    ActiveSync Remote Display - Display Pocket PC applications on your desktop or laptop without needing any device side configuration.

    CECopy - Command line tool for copying files to the device currently connected to desktop ActiveSync.

    Convert PPC DAT to SP XML - Command line tool for generating Smartphone CABWizSP XML docs from existing Pocket PC CAB files.

    Hopper - User input stress simulator.

    JShell - UI version of the Platform Builder Target Control Window.

    PPC Command Shell - Command shell for the Pocket PC 2003 device.

    RAPI Debug - Displays detailed information about currently running processes.

    RAPI Start - Command line tool to remotely start an application on your Pocket PC from your desktop.

    TypeIt - Send characters/strings to the Smartphone 2003 Emulator via ActiveSync.

    Thursday, June 10, 2004

    At TechEd 2004

    This year I was only at TechEd in San Diego for a little more than 24 hours. I flew in on Thursday morning and met up with Jon Box and Ron Hostetter. We had our picture snapped with .NET guru Noah Coad which he just posted on his blog. Jon and I then met with various Microsoft and publishing folks before working on our presentation. Immediately after the talk I ran for the bus and made it to the airport in time to fly home to KC. Definitely too short and hectic a trip. I won't schedule like that again.

    Reagan and Leadership

    During this week, we've all been bombarded with reflections of President Reagan. Not surprisingly, most of the remembrances have been fond ones. Watching the footage I’ve been struck by how plain spoken his speeches were. If you’re interested in a written portrait of Reagan that is easy to get through at just 260 pages you should check out the excellent book Ronald Reagan: How an Ordinary Man Became an Extraordinary Leader by Dinesh D’Souza published in 1997. I read it back in 2000 and cracked it open again this week.

    D'Souza is a conservative and author of the book The End of Racism published in 1995, which I would also recommend. He was a member of the administration in Reagan’s second term. From his first negative perception of how the White House was run he gradually grew in respect for Reagan and offers an analysis of Reagan’s leadership style and the important events of this presidency.

    In short, D’Souza concludes that Reagan had the three essential characteristics of a leader.

  • Vision. Although we forget, it was Reagan who had the vision to see that totalitarianism was not sustainable and would be placed "on the ash heap of history" and concentrated his policies to that end. D’Souza does a great job of reflecting the tenor of the times and shows how out of step Reagan was with the western intelligentsia who thought the Soviet economy and system were strong (perhaps more so than the west) and the doves who thought we should appease the Soviets with trade. The author also argues that calling for SDI was also an act of moral vision spurred by Reagan’s conviction that an ongoing nuclear arms race was immoral (and certainly MAD) and that the government was failing by not attempting to protect its people. Reagan’s critics refer to him as a man of few ideas and indeed the author shows him as a man unconcerned with details who delegated much authority, which eventually would come back to haunt him in the Iran/Contra scandal of 1987. But overall, it was his vision that kept the ship on course and that the American people responded to. D’Souza would agree with the critics but points out that they were the right ones and that he never wavered from them.


  • Action. Reagan took action in confronting the Soviets with the famous evil empire speech, the military buildup that brought the Soviets to the bargaining table, his tough approach at the table, and finally his cooperation with Gorbachev that led to historic reductions in nuclear weapons and his call for the dismantling of the Berlin wall. His actions in Grenada (the first rollback of communism since the Truman Doctrine was inaugurated) and Central America also flowed directly from his vision of liberty as the current of history. In addition, his decisive action against the air traffic controllers set the tone for his presidency. Although he can be rightly criticized for increasing the national debt he did so in order to win the cold war, a worthy goal and one he accomplished.


  • Consent of the governed. In the era of Clinton government by opinion pole became increasingly popular. Reagan on the other hand used opinion poles to understand how the public might react to his course of action. He then persuaded people to his views through his plain spoken convictions. D’Souza records how on several occasions (his trip to Bitburg cemetery, the air traffic controller’s strike, his refusal to sign a treaty on sea exploration, his bombing of Lybia, among others) Reagan took action despite the public’s likely negative reaction and then eschewed his speech writers preferring to write his remarks to the American people himself and usually bringing them around to his point of view. As many of those interviewed this week testified, D'Souza grounds this ability to communicate effectively in Reagan’s complete comfort with himself and his ideals and the fact that with Reagan, what you saw is what you got.



  • As I watch the funeral ceremony today I’m proud that Reagan was our president and hope that history’s verdict is that Reagan was a true leader in a time where a leader was required.

    Tuesday, June 08, 2004

    Impersonating Users in .NET

    I'm often asked how you impersonate a user in the .NET Framework. In an ASP.NET application it's as simple as setting the impersonate attribute of the identity element in the web.config file to true. In Windows apps its a little harder as you'll need to login as the user using a Win32 API function and then use the WindowsImpersonationContext object. Here's a class in VB .NET that you can use to get the job done.

    
    
    Imports System.Runtime.InteropServices
    Imports System.Security.Principal
    Imports System.Security

    Namespace Atomic.Security

    Public Class Windows

    Private Sub New()
    End Sub

    'Private Const NetworkLogon As Integer = 3
    'Private Const DefaultLogonProvider As Integer = 0

    _
    Shared Function LogonUser(ByVal userName As String, _
    ByVal userDomain As String, ByVal userPassword As String, _
    ByVal logonType As Integer, ByVal logonProvider As Integer, _
    ByRef token As Integer) As Boolean
    End Function

    Public Shared Function Impersonate(ByVal userDomain As String, _
    ByVal userName As String, ByVal userPassword As String) _
    As WindowsImpersonationContext
    Dim token As Integer
    If LogonUser(userName, userDomain, userPassword, 3, 0, token) Then
    Dim impersonatedToken As New IntPtr(token)
    Dim newIdentity As New WindowsIdentity(impersonatedToken)
    Dim impersonationContext As WindowsImpersonationContext = _
    newIdentity.Impersonate()
    Return impersonationContext
    End If
    Return Nothing
    End Function
    End Class
    End Namespace

    To use this code you could do the following:
    
    
    Dim wc As WindowsImpersonationContext = Windows.Impersonate("FoxAtomic", "dfox", "password")

    'Impersonate the user here to open a file
    File.Create("c:\windows\dan.txt")

    wc.Undo() ' Done

    A Single Instance of a Windows Forms App

    I noticed that on the Smart Client developer site on MSDN that Jonathan Wells answered the question regarding ensuring a single instance of a Windows Forms application. Awhile back I wrote a custom ApplicationContext class using ideas I read in an article I can't now locate. Anyway, here is the C# code for that class that allows you to pass a form and a flag to the Run method to disallow multiples. The default behavior is to disallow. This class uses the Mutex object as Jonathan mentions.

    
    
    using System;
    using System.Windows.Forms;
    using System.Diagnostics;
    using System.Threading;
    using System.Runtime.InteropServices;

    namespace AppContext
    {

    public class AppCtx : ApplicationContext
    {
    [DllImport("user32")]
    private static extern bool SetForegroundWindow(IntPtr hwnd);

    private AppCtx()
    {}

    private static Mutex s_Mutex;

    public static void Run(Form mainForm)
    {
    run(mainForm,false);
    }

    public static void Run()
    {
    run(null,false);
    }

    public static void Run(Form mainForm, bool allowMultiples)
    {
    run(mainForm,allowMultiples);
    }

    private static void run(Form mainForm, bool allowMultiples)
    {
    if (!allowMultiples)
    {
    s_Mutex = new Mutex(true, Process.GetCurrentProcess().ProcessName);
    if (s_Mutex.WaitOne(0,false))
    {
    if (mainForm == null)
    Application.Run();
    else
    Application.Run(mainForm);
    }
    else
    {
    Process[] ps = Process.GetProcessesByName(
    Process.GetCurrentProcess().ProcessName);
    for (int i=0; i < ps.Length;i++)
    {
    if (ps[i].Id != Process.GetCurrentProcess().Id)
    {
    SetForegroundWindow(ps[i].MainWindowHandle);
    }
    }
    }
    }
    else
    Application.Run(mainForm);
    }


    public static void Exit()
    {
    Application.Exit();
    }

    }
    }


    The Main method would then look like so to disallow multiple instances of the app. Another great use of a custom app context would be to populate a custom IPrincipal object.
    
    
    using System;

    namespace AppContext
    {
    public class app
    {
    [STAThread]
    static void Main()
    {
    Form1 f = new Form1();
    AppCtx.Run(f,false);
    }
    }
    }

    .NET Tools

    There was a great article in this month's MSDN Magazine that listed some tools .NET developers should be aware of. In case you're looking for the links to those tools, here they are:

    FxCop (Code Analysis Tool)
    NUnit (Unit Testing Framework)
    Snippet Compiler
    Regulator
    CodeSmith
    .NET Reflector
    NDoc
    NAnt

    Sunday, June 06, 2004

    Historical Baseball Abstract

    This weekend I finally bought a copy of the revised version of the Bill James Historical Baseball Abstract. I bought the first version almost 20 years ago and thoroughly enjoyed it. This one is updated to include a complete section on the 1980s and well as the 1990s with new player rankings largely based on the Wins Shares statistic that James developed.

    Not 10 minutes after cracking open the book I ran into an essay that has immediate relevance to the Kansas City Royals. James notes that one of the most obvious truths of sabermetrics is that young pitchers with low strikeout rates don't have long careers. He goes so far as to say that there are no exceptions to this rule and sets the bar at 4.5 strikeouts per 9 innings historically. Further, the greater the rate above the threshold the more proportionally successful the pitcher is. In other words, a higher strikeout rate at a young age gives a pitcher more wiggle room as they age and loose their stuff. The reason this is the case is largely due to the discussion related to DIPS that I blogged about previously.

    This is relevant to the Royals because of their young pitchers Jimmy Gobble and Zack Grienke. Gobble, in 117 innings in the majors has a strikeout rate of 2.3. Grienke, in just 19 innings has struck out 7 (3.3 K/9 in). Obviously, Grienke's sample size is too small to draw any conclusions. Fortunately, his minor league rates were much better and struck out 23 in 28.2 innings at Omaha this year. Gobble, however, has a pretty decent amount of innings under his belt and doesn't look to be increasing his strike out rate over time. In short, I wouldn't look for Gobble to be a mainstay in the rotation for years to come.

    In another note Calvin Pickering at Omaha now has 18 homeruns in 150 at bats and has drawn 32 walks.