Wednesday, March 21, 2007

Why MaskedTextBox is Bad

In Visual Studio 2005 Microsoft included a Mask control called MaskedTextBox. This control acted like a text box control, but allowed at design time or runtime the ability to add a mask to help the user input proper data.

This conception this is a great idea. The implementation however is not very good. There are a few problems.

The control does not know how to shift characters. An example would be if the mask was $##,###.00 and we had the amount of 100 saved in the data base and we tried to fill the control with that amount the result displayed would be $10,0__.__ where _ is the prompt character. The same problem occurs when the user tried to enter the data. Lets use a format for time like ##:##. When the form loads, the control will look something like this __:__ again using _ as the prompt character. the cursor will be on the left most space so if a user is not careful, the time of 9:30 can be enter like 93:0_. If the user corrects the mistake and saves the value 9:30 the control will load 09:30.

Since most of things that require mask are numbers and things of that nature, it makes this control pretty mush useless.

I found a few posts on the web that discuss this problem and how they solved it.
http://www.adduxis.com/blogs/blogs/sven/archive/2006/06/21/18.aspx
http://www.dotnetheaven.com/Uploadfile/mgold/MaskedCurrencyTextBox02252006005553AM/MaskedCurrencyTextBox.aspx

Monday, March 19, 2007

Jury Duty

Last week I served jury duty. I never have been called for jury duty before and I really didn't want to go.

So how it works is all the people chosen for duty show up at a predefined time and are checked into the system. I think there were about 150 people or so. Then we are shown a video that talks about the importance of jury duty and some rules of being on a jury.

After that you sit in a room waiting to hear your name called. The process is completely random. A computer picks names of people there and they are the ones assigned to a court room once it is determined a jury is needed. There is no guarantee you will even see the inside of a courtroom due to last minute plea bargains and what not. So I was lucky I only had to sit there for about 30 minutes before my name was called.

Once we were brought to the court room the judge gave us some information about the case and he then asked all 25 potential jurors some basic questions. Things like name, married or single, do you have kids, and where do you work. He then asked us if we knew any of the lawyers, or the defendant or plaintiff, or if we were involved in anyway with any part of the court case.

Then the plaintiff's lawyer asked us questions followed by the defendants lawyer. All the questions were to the entire group. Things like Have you ever filed a personal injury lawsuit, or have you ever worked for a law firm, that sort of thing.

Once this was completed somehow the two lawyers dwindled the 25 possible jurors down to twelve. I was one of the lucky 12.

Once the trial proceeded we were told by the judge some more details of the case and what is evidence and what was not evidence. We were not told however any laws or what we would be ruling on specifically. Also us jurors were not able to talk to each other about the case until we deliberated. We were told we would be determining damages but that was it. So far it was nothing like I had seen on TV or in the movies.

So once the judge was done we heard opening arguments of both sides. This is when the plaintiff sets up their case and explains why they are suing. In this case they were saying that a simple accident to a 90 year old women 2 years ago started a downward spiral of her health. Then the defense attorney explained why the defendant should only be liable for the accident and not the new ailments not caused by the accident.

Then we got to listen to the testimony(evidence) in the case. In this case we had three people in the court, and we had three other people with taped dispositions. It was actually a little boring since this case had very few facts and a lot of guesses. Because there were so few fact wrapped up in educated guesses this case was not very black and white.

Once both sides were done showing evidence, the judge then told us what we would be deliberating on. What laws pertained to this case and what damages we need to figure out. Then both sides gave closing arguments, and we were sent to deliberate. The first thing we were told is not to talk about the case when jurors were not present. Also we were told not to leave the juror's room for any reason other than bathroom. Food and beverages were sent to us. Also all the exhibits in the case were in the room.

Then the jury elects a leader and that person gets things rolling. It took us about two and a half hours to deliberate. We all agreed right away that the accident did not cause the additional health problems, but we had to figure out what damages were appropriate for the initial accident. We finally all agreed to use some simple formulas to determine damages.

In the end I am glad I served on a case. I learned a lot about the judicial process. Plus I think sitting in the room all day would have driven me insane.

Tuesday, February 27, 2007

Random Thoughts.

Fun website
I know I have already blogged about http://www.upupdowndownleftrightleftrightbabastart.com/ before, but it has just undergone a re-design and format change. Please check it out. It really made me laugh and the web host says content would be updated frequently.

Wisconsin Badgers
My Badgers have hit a small little road bump here the last week. Two tough losses, one at Michigan State and one at Ohio state. In both games they played really poorly. To make matters worse it seems Brian Butch will be lost four to six weeks. I have full faith in Bo Ryan and the rest of the team to pick up the pace and finish the season strong.

Work
Things on my current project are progressing nicely. We are going to deliver phase one in a few weeks. The Client seems very happy with our results. I will blog more about the project once I can. As of now I am not able to talk about the project in any general terms.

Jury Duty
I have been summand for Jury Duty. I have never done this before, and so I have a chance to learn about the court system. The timing is not great since it will be in mid March. I plan on blogging about all my experiences after I am done. My guess is I wont even get picked.

Thursday, February 22, 2007

Bars going High Tech? Sooner Than You Think.

I went to visit some friends and we went out to a bar/pub in their area.

It was a new place. The bar had lots of flat screen TVs on the wall along with a nice internet jukebox, and some gaming machines. Behind the bar were fancy touch screen registers and some top shelf alcohol. I noticed on the bottles there were some weird pour caps, nothing I had seen before.

When I asked the bartender about them he explained they had little computer chips in them that talked to the cash registers. The chips would only allow the bottle to pour if the register said it was OK. The chip would also limit the amount of alcohol that was poured to the perfect shot. I did not believe him until he took out a full bottle and tipped it upside down and nothing came out. He then went over to the touch screen and put in my order and then tipped the same bottle and this time the rum came out. To prove his point, after the pour he tipped the bottle over again and nothing came out again.

The bar itself was a solid dark wood nothing to surprising, but all the tables at the place had a little built in touch screen. I was curious about it so I went over to a table where I saw some people using one and asked them about it. They told me, from the screen they could place drink orders or call over a waitress. Also they could use the screens for trivia, games, TV, internet, or even a little text chat with the people at another table. they even said these touch screen were spill proof. Although I did not test this feature for the pubs sake I hope it is true.

OK, so this place does not exist yet, but all these concepts are coming soon.

In England some computer science kids who were tired of waiting for a waitress at a busy pub and did not like standing up at the bar and waiting, thought it would be cool if they could just place and order from there table. They came up with the idea of the touch screens and the ability to do all sorts of things including ordering drinks for other tables, and yes even chatting. Currently the students have one system running at a pub in England where it is being product tested.

Here in the US I have come across the dreaded one pour shot pourer's. We all have a bartender who mixes drinks a little strong or gives out free ones to their buddies. Well with a new RFID system, bar operators can control how much alcohol gets poured. The system I ran into was the worst were they could only pour with money in the till. Some of these systems will actually allow you to pour without cash in the system, but it sends a signal to update a database with pour volume, and other tracking data. The manager then can compare the bar receipts with the amount of alcohol poured out. The best part is that employees can also be have an RFID tag on them so manger can see who poured well and who did not. Since the system tracks amount of alcohol served it can also help managers with inventory, or billing of special parties and banquettes.

So are the days of free drinks gone? Who knows, but somebody has to pay for all these improvements.