C# KeyValuePair Tip: where are my keys again...

I had a small crazy issue today with a web app that I'm working on dealing with looking up keys and values in a C# KeyValuePair<string, Guid> generic object.

I was using it to look in a Dictionary<string, Guid> of users. Makes sense to populate dropdowns with on the server, and use as a callback in cache to not have to look at the database every page load right ?

For some reason it was not finding some Keys, or users in my case, and finding others. I narrowed it down to when you log in, what you type might not match the case that the system has for you.

And sure enough when I logged in with mcbeev it was not finding Mcbeev. That's pretty strange I thought, SQL isn't case sensitive. Ah but the default Dictionary<T, T> uses whatever the default comparison operator for string is.

I was using the following

Dictionary<string, Guid> dict = new Dictionary<string, Guid>();

And after switching to

Dictionary<string, Guid> dict = new Dictionary<string, Guid>(StringComparer.CurrentCultureIgnoreCase);

Viola! it worked. I had never bothered looking at the other constructors for Dictionary<T,T>. One of them allows you to pass whatever kind of comparer your heart desires.



Categories: Code

Currently rated 4.0 by 1 people

  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Audrey Dancing

 

This is a fun little video. It seems that liking Eye of the Tiger runs in the family...



Categories: Audrey | Family

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

A Stormy Drive Home

stormIt was a normal day today, that is until it was about time to go home from work. I was in Zeeland as usual. I also happened to be the last one to leave my client's place today, and boy did I pick the wrong day to stay a little late. I knew I was going to be in for some fun when I could barely see my car in the parking lot from the window of the building that I was in.

It was pouring, I mean pourrrrring rain. It was pitch black, and for around 5pm on July day, that just isn't normal. So after complaining to someone else at the door who was also not ready to brave the rain either, I bolted for it. My car was only about 5 spots away, but the parking lot was pretty much flooded so I was soaked from splashing through it to get to the door. I didn't even really know that it was flooded at the time because it's not like I could see the pavement.

I started driving out to the sound of wind and thunder and switched on the AM radio to find out how bad it was. It was bad. Almost all the highways around GR were at a stand still. Standing water on most roads and interstates they said. And they were right. Not only that, the lightning was terrible.

For the first time in my life I can honestly say that I was scared driving out there, and remember people I've lived in Michigan my whole life and driven through numerous snow and rain storms. But I can tell you this, I have never seen anything like what I saw today. The lighting was just plain out of control, it was hitting the ground very close to me in every direction, and I'm talking bolts of lighting that made the radio go out for a few seconds, big big bolts. Every one of them made me jump. And for the first 20 mins or so I could swear that they were zeroing in on me.

Then the hail started.

Yes hail. Forget seeing anything at this point. We crawled along the highway at about 15 miles per hour. And it did not slow down at all until I got all the way to Grandville. I had now made it almost halfway and started to feel a little better about it.

But when I got to the off-ramp all traffic was stopped. About that time the radio was talking about there being multiple instances of trees and power-lines being down and 75 mph winds, and that the state police are recommending people to not drive if they don't have to. ....Thanks state police, way to be on top of things...

I was stopped for quite awhile and finally made it Wilson ave. Where there proceeded to be a nice traffic jam, with a cop standing in the middle of the road detouring all traffic down Butterworth, towards Johnson Park. Which is the complete opposite direction that I need to be going. Awesome. At this point I think I hit an hour into the drive.

This is where the fun started. The weather had calmed down a little, however, like they said, trees and power lines were down everywhere. I had to then follow the mass of road rage down small side streets around Butterworth just to get around things. Most of Johnson Park's parking lot was completely under water. Giant trees lay on the ground in millions of splinters. Some people we using chain saws to clear the trees away in thier driveways. I probably just should have went to Carmer's house and stayed there until they cleared the debris because I was on Riverbend twice. It was nuts, and everyone was pissed in the long line of cars that were everywhere, on every road possible with almost no way around.

I finally got through on Maynard to Lake Michigan Dr and home safe. Total time about 1 hour 30 mins. And unlike a lot of unlucky people we still have power...for now. It's starting to thunder again right now as I type this.



Categories: Work

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

It's about damn time: Big Ten and Comcast reach agreement

As reported here: http://bizurl.net?u=4t. This makes me happy very happy. Maybe now I will be able to enjoy all the MSU football and basketball I want in High Def baby! I'm still skeptical that somehow someway Comcast will find a way to screw this all up.

Categories: Sports

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Audrey in her Kitchen


audrey6.09.08 023
Originally uploaded by mcbeev03

Yeah she finally crawled through it for the first time. There are more pics of her in the flickr set that show her progress. Now that she is crawling things are starting to get interesting. The gate upstairs is definitely up.

Plus I think she looks really cute in this picture. We took it while Maggie was sleeping, so she had all the toys downstairs to herself.



Tags:
Categories: Family

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Saturday: a day to spend money

After a couple of weeks hemming and hawing about what to do for a swing set for the kids, we finally broke down and bought a swing set at Menards. Wednesday we should be a proud owner of this: http://www.playstarinc.com/ps/legend-fv.asp. I also got a new pair of running shoes. Im too lazy to put pics up, but Im really hoping that they can cure my knee pain. The guy at Gazzelles thinks it's tendonitis...awesome.

I was also scheduled to go on a bike ride with Mark and Cory today, but I didnt make it. The buying process at Menards took over 45 mins because the people that work there are morons and cant tell directions. It was only the first of many set backs. I did try to get our bikes out and took them to the gas station to blow up the tires. Well that was a bad idea. The air machine must have been to strong or something, it almost instantly popped both tires. Yes I tried both, what can I say Im an Idiot.



Categories: Family

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

A picture is worth a thousand words

We are still working on that whole getting dressed thing...



Tags:
Categories: Family | Maggie

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Memorial Day Weekend 08

Well BizStream had the Friday off before the weekend so Memorial Day weekend turned into a 4 day mini vacation for us all. It was very nice to just sort of un-plug from work and not think about crazy client requests for a couple days.

We didnt do a whole lot. I spent a lot of time with the kids and MrsMcbeev on Friday. We went to the P-A-R-K as Maggie calls it, which was nice because most of the time I'm working when MrsMcbeev takes them. We were going to have my sister over for dinner but she moved it to Monday.

Saturday we had fun getting the Van fixed. 470 bucks to fix the front and back breaks. I'm not exactly thrilled with having an extended manufactures warranty that doesn't do crap. After we picked it up I organized a bunch of junk laying around in the garage.

Sunday my parents were nice enough to come over and babysit for us. The reason we needed babysitters is because MrsMcbeev finally agreed to go see Iron Man. And yeah it rocked.

I did watch a ton of sports too the whole weekend. Go Wings and go Pistons! I predict a sweep by the Wings and the Pistons to win in 7.

As an extra special treat, I will leave you all with this video of Maggie.



Categories: Family

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Wii Fit: Another Workout Motivator

This morning I got my lazy butt out of bed and made it to Meijer at about 7:10 am. Now normally for me to get up early there has to be a damn good reason. Well today there is one. The US release of the Wii Fit.

I got there and there were signs posted that read "Line starts here for Wii Fit. We have 40 units available starting at 12:01 am". Now no one was in the line and when I checked the Nintendo case there were no units there. Ahh the horror, ahh the pain of getting up early for no reason. I tried to calm down and sought out a Meijer employee. Luckily she was only an aisle over from me.

She spoke the greatest words possible to me. "Yes they are bringing them out now for today..." Rejoice!!!  wiifit

I got one and got the hell out there, with a stop for a Non-fat, no-water Chai Tee for MrsMcbeev, and a coffee for myself.

I got home at about 7:45 am and set it up.

My first impressions is are as follows:

  • It is a nicely designed unit, heavy duty plastic all around
  • The instructions describe how to set it up well
  • The intro video is kinda boring when you are creating your Mii profile
  • The first strength conditioning exercise I did was tough!

More to come later.



Tags:
Categories: Wii

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Mcbeev.com Blog Upgrade

You get to point to where you've written so many apps from the ground up that you just get lazy.

I used to take pride in writing my own home page / blog. It was exciting, a good training exercise, and I enjoyed doing it. That is, when I had the time to do it. And now with my wonderful family taking up most of my time I have finally given up on my own projects and decided to start using other people's work. Open Source of course.

This blog is now operated on the blogengine.net blogging engine. I am really impressed with it so far. I started out playing around with it last night about about 7pm. And here I am launching my own domain with a customized version of it that integrates with Twitter, Flickr, and Last.fm, not bad.

There is also a big benefit of being able to post easier (so long community server!). Well let me stop a second there, I still really like community server, however, over the years it has gotten really really bloated, and my site is more of a blog than a forums anyway. Another big benefit is the comment system, it actually works now, so please feel free to drop me a note at the end of this and let me know what you think about my new blog.



Categories: General

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Maggie playing Wii





Tags:
Categories: Family | Maggie

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Biggest Loser Recipe

So MrsMcbeev and I really enjoy watching the Biggest Loser on TV. The last one we watched had some really good healthy looking recipes. This one I really want to try: Pepper Steak Im posting it here I so I dont forget.

Tags:
Categories: Recipe

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Ultimate Picks of Integrity

Here they are. My Picks for this year's NCAA tourny. These are the real winners people, please try not to copy my ultimateness. Actually I'd bet that if I did them tomorrow, they would be totally different Laughing

Tags:
Categories:

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Happy St Patty's Day!

And to celebrate I had a couple beers at home with dinner. Yep I'm old and boring.

On a much more exciting note, March Madness is upon us. Jay has the brackets ready again on  his site http://www.jasoncarmer.net/ncaa/. Head on over and join the fun.

This year I am really thinking that MSU is out in first round.. I just don't think they have what it takes to win besides Neitzel.  Their only chance is if the big men play well and dont foul again like they did against Wisconsin.


Tags:
Categories:

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Flow chart of my work

or lack of....




I think it has to be modified to fit my current habbit as well...

  • Play WoW
  • Check Auctions
  • Check InGame Mail
  • Move to parked location
  • Play WoW
  • Screw this dumb quest lets PvP
...

I could go on...


Tags:
Categories: Work

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5