Home


.Net, SQL and softball. Musings of a software developer with a softball problem

Tuesday, September 30, 2008

Got Skillz Round 2

I am happy to report that we got to play Got Skillz this weekend. I was starting to worry on Saturday when it started pouring down rain. But the skies cleared and it was a pretty good day for softball. Well, other than the fact that our field was covered in kitty litter to help soak up some puddles that were left on the field from Saturday.

Got Skillz, as you may remember, was the team we were supposed to play the very first week, but they got their dates mixed up. And I am kinda sad to report that; yes...yes they do got skillz.

So as I mentioned the field conditions left a little to be desired, but we slogged through the mud and played some good defense the first game. We were even ahead for most of it (all but the last 1:30 to be exact). I bought a new bat last week and I'm still breaking her in, and she is a beauty. I bought a DeMarini White Steel. It is a single-wall steel (duh) bat, that just screams. I hit a great ball to deep center that I though I could have at least got a triple off of....but their center fielder is a beast and caught the fly ball. We couldn't get anything past him either game.

So, back to the game, we are up 2 runs in the penultimate inning and they being the home team, get to bat last. There is 5 minutes left and if we just hold them in this inning they wouldn't get another chance to bat and we win. But we got them out with 1:30 left on the clock which means we both get to bat once more in the final inning. Of course we didn't score that inning, and all they need to do is score 3 this inning. They load the bases and just our luck a power hitter comes up and crushes one to the outfield...and the rest, as they say, is history.

The second game we don't fair any better; one or two boneheaded plays on our part, including my sliding into the litter laden second base and twisting my ankle. Mud doesn't slide as well as the dry clay we're used to, just as an FYI. Another, what's the word, interesting play came from our left fielder. He hit a great ball to the deep outfield, and he gets to the third, and comes a little off the bag, which is fine, the ball is at home...he is just running aggressively trying to push it where he can. Fine. No big deal. My issue with the play was he ignored the 3rd base coach and started running for home. Their pitcher has the ball at home plate. There is no way he is going to juke her and tag home, but he tries it and I don't have to tell you that he doesn't make it and gets tagged out. I forgot the score book at home this week so I don't have the exact score of either game, but what I can tell you about the last game was we get trounced.

Tune in next week when we play Sheetz Softball. I hope they bring some snacks...

Labels:

posted by Tom Becker at | 0 Comments

Tuesday, September 23, 2008

The Green Hornets

So this was the first softball game for me in a while, both on Sunday or my Wednesday league. Was gone last weekend for my sister's baby shower and had dinner with some family on Wednesday. Hence no softball posts in a week or so.

This week we played the Green Hornets, which is essentially the same team as the Tornadoes from last season. They have some new players, but the same core people and they still have the same great skill of being so darn consistent. They don't have many power hitters (they have a few mind you but they are in the minority) but almost every one will get on base, letting the few power hitters send them round the bases.

We ended up losing both games, but I think we played very well. The first game in particular. We only lost by a few runs. Our defense was what hindered us this game. We had a few errors that the capitalized on, but we did very well over all. Our offence was very good for us. Even some of our weaker hitters got on base. I really liked our line up; I think we will stick with it.

There was nothing that really stuck out in this series that was really note-worthy; just good fundamentals. Next week we play 'Got Skills?' at 2pm.

Labels:

posted by Tom Becker at | 0 Comments

Tuesday, September 16, 2008

A Goodbye to a Good Friend

So I sold my motorcycle. It is a sad day. I loved that bike. It was the one I learned to ride on, I put a decent number of miles on the old girl, and she was solid, a damn good bike. I am sad to see her go.

I will not have anything to ride this Fall, but it is for the best. I will be getting a bike in the spring, but for right now I am back to only one vehicle.

A Haiku in memorium a my good friend

Honda six-fifty custom
My motorcycle
Cool, crisp fall air fades away

Labels:

posted by Tom Becker at | 0 Comments

Thursday, September 11, 2008

Multiple Exit Statements, The Great Debate

A coworker asked me about a function he was working on that lent itself to multiple exit points, and I tried to push him in the direction of having a single exit point at the end of the function, and using a local var to hold the return value.

I suggested that by doing so he increased style and readability. And after I told him that I kinda thought that my response lacked any sort of real substance. It was kinda just saying, 'because I said so'. But who am I to say what style is? So I thought back to my programming classes and how we always did it that way, without any real reasons why. I guess you could say I was what this article called a 'structured programming purist.' Sure I may have slipped a few return statements into one function here and there, but it always felt that I was cheating.

So I went looking for a article that could explain why exactly one return statement should rule them all (very proud of myself for working in a LOTR reference). I came across a plethora of articles that all pretty much said the same thing.

There was a time when multiple returns were not good because of memory management. Since you had a single exit point you knew were all of your objects were getting cleaned up and you would miss anything as explained here. But in the newer programming languages with managed memory this isn't an issue. Especially not with try/finally blocks and using statements. The same article had another link to an interesting experiment dealing with monkeys.

It basically says that monkeys will do things because that is that is the way that it has always been done, even if they have no idea why things are being done. So I'm through being a monkey, Multiple exit statements are OK in my book; just don't tell my old professors.



PS. Best article I've written...LOTR and monkeys? awesome

Labels:

posted by Tom Becker at | 0 Comments

Tuesday, September 9, 2008

Viewstate thoughts

ASP.Net has had the ViewState around since it came around and it is a nice way of keeping around persistant variables across postbacks. It stores any object you may put in there as well as any control you have on that specific page. It is pretty useful, except when people misuse it or it just gets to darn big.


One of the biggest concerns about using viewstate would be storing secure data in it. If you view source on a page anyone can see the data. Yes it is "encrypted" in base-64 char array, but it is pretty easy to decrypt this and view it.


The reason I bring this up is there was an blog post from one of the Microsoft developers about how to identify pages with high viewstates. I was reading through it and she has a link to Fritz Onion's ViewState Decoder. So I downloaded it and was taking a peak around in my viewstate, and I never realized how easy it was to find things in there.  See below for part of my decrypted viewstate.   But as you can see the variable "ReportSelectedIndex" is something I have stored in viewstate and it was able to be exposed very easily.  Now in this case it isn't sensative or anything, but it could have been.

viewstate decoded

So just a word to the wise and be careful of what you put in your viewstate, or at the very least encrypt what you put in there.


Labels:

posted by Tom Becker at | 0 Comments