Thursday, December 30, 2010

Use the CORRECT function

So 2010 is coming to an end and I thought I could go home early today. Since the markets are open tomorrow and it being an year end, I was hoping for no serious issues to come up these two days.

But a logic written in the source code thought otherwise. I was called and they have found a bug:
A very important report does not show data for 2011 ( Problem comes up with T+2 and that +2 being Jan 3 11)

I looked into the source code and there I found it in the SQL stored procedure:
DatePART(dayoftheyear, Targetdate) > DATEPART(dayoftheyear,getdate() ) and
DatePART(year, Targetdate) > DATEPART(year,getdate() )

Assuming the target date is 01/03/2011, This function gives no data for that date:

To explain the Datepart(dayoftheyear) gives (exactly waht it says) : 363 for DEC 30th
and 03 for 01/03/2011

Since the "AND" ensures that this logic returns a false for any date other than 31 DEC 2011 or 31 DEC 2010, a lot of data was not coming up.

I am clueless on why the developer chose to use that (rather complex) logic instead of the DATEDIFF function that is specifically present for this type of calculations.

Finally, I hate to say that this bug takes a back seat and very likely pops up at the end of 2011. The good thing is at least I have it documented this time :)

Friday, October 08, 2010

[Program Name] has encountered a problem and needs to close. We are sorry for the invenience.

A rather strange error message. A real nightmare is when you are doing a production deploy on a server and see the application does not run.

I was deploying a Trading support application on the server yesterday night. The program that runs every where in the environment crashes on the server with the following message:

[Program Name] has encountered a problem and needs to close. We are sorry for the invenience.

If you were in the middle of something, the information you were working might be lost. [CLOSE]

There were no traces of any events errors on the Application event log. since I wrote this application, I knew that there is nothing strange that went in there.

After spending a painful 5 hours to debug, I found the problem. This post is to help others who face the same problem and are looking for any hints or tips to proceed on debugging.

It is very likely that the problem is because of permissions on the server. Since most developers have admin(or power users) status on non production environments, they don't see the problem there.

Here are a series of steps that you can try to isolate the problem:

  • Verify the Service packs and .NET version on the server and compare them with your non production environment.
  • Make a small hello world exe using the same programming env and try running it on the server. It isolates the problem if it is on the machine or if it is specific to your application.Most likely you are going to find that its your program.
  • Scroll through your source code to see any directory being created/accessed. Make sure that directory exists and if not create it.
  • Look at your program once and see if any static variables are created before the actual main/formload/initialize
  • If there is a component initialized then that is more likely be the one causing the problem.
  • Verify if the component is available and is registered.
  • Does your program use MSMQ? If yes is there a queue that is being registered? Then go ahead and check to see if the Queue is created.
  • Check and see for any installation errors prior to your install and see if any thing might be related. In my case, I did re-install .net 2.0 and 3.5sp1 just in case.
Hope these would help you identify the problem quicker. Remember one basic rule of debugging - "Never come to a conclusion about some thing until you see it."

Tuesday, January 12, 2010

The Nexus One experience

Being a Google fan, I was very excited about the rumors that Google would bring out a phone by itself. One thing that kind of confirmed that rumors was the existence of the url

Finally when they announced the phone on the 5th at CES, I checked the URL and it was active and accepting orders. I checked the options listed there:

Unlocked Phone : 529$
With a T Mobile Contract : 179$

My contract with AT&T was up for a renewal and the coverage maps for T mobile were good in my area( as well as the place I work and the places I visit often). So I thought I would take the T Mobile plan and save some money upfront. There was only one T mobile plan offered and it was a 500 any time minutes + 30$ data + 10$ unlimited text.

I thought I would order the phone and worry about contracts later.

T Mobile Plan:
The fact that T mobile offered only one plan kind of put me into an awkward position. None of my friends have T Mobile and that means I would be using more minutes than that. Here is what I checked with T mobile :

1. You can cancel the contract with in 20 days and not pay the ETF( Early Termination Fee)
2. You can change to the unlimited plan ( Even more plus plan - which is cheaper by 10$ in total) and you will pay full price to google for the phone.
3. You can return the phone with in 3 weeks and not incur any charges (other than any shipping charges)

The Order:
Google didnot update the status of the order until that evening and at which point, they sent an email saying it was shipped. Fed-ex 's website said, I can expect the phone the next day and It came the next day.

I checked the forums and it is usually the next day for most US locations.

So Finally the phone arrived. I opened the box, popped the battery in and switched it on.

Look and Feel : The phone looked very good to hold, it was almost the same size as the I Phone.
The display is fantastic. It is a 480 X 800 px AMOLED Screen
(480 x 800 px, 3.7 in (94 mm), 252.15 ppi, 3:5 aspect ratio, WVGA, AMOLED with 100,000:1 contrast ratio and 1 ms response rate )
I was really impressed with the display and the touch screen.

Since the phone was not activated, I called T Mobile ( Calll 611 from your cell phone) which was a valid call from that cell phone and does not need activation. This was my test for the call quality. T Mobile said the number should be ported some time in the next 24 hours and i had to hang on to both phones until then.

Call Quality : The call quality was good initially.

I used the WiFi connection to get to the internet and browsed through the phone and the response was fantastic. At this point, I have decided to keep the phone no matter what I have to do with T- Mobile.

T-Mobile Plan options: When I logged onto T Mobile website, I was asked to choose the phone I am using and they dont have Nexus One listed in there. I picked the suggested phone( HTC) and it allowed me to change the plan online. So I figured that its a matter of time before that happens. I called TMobile and they told me the same. There is only one plan when you activate but after that you can move to another plan(with more minutess) as long as you keep the Data and Text messaging functionalities.

The Experience:
Some time during that night, the phone was activated. I had charged it completely and took it out the next day.

I travel from Palatine , IL to Chicago in a train for about 40 mins. I surfed the net with the phone during that time and the speed was good. I watched a couple of youtube videos in Hi-def and they loaded fairly quickly. The 3G icon on the top of the phone stayed up most of the time and during two short periods, it showed E(Edge). I made a call from the train and that was good too.

So I was very happy with the call quality and connectivity. I had to look at the other features of the phone.

I know that the phone was capable of multi touch but I was not enabled. I was not convinced with that explanation but I knew that when I ordered the phone so no cribbing.

Display and wall papers: The live wall papers were very attractive.This single feature with the bright display would make you feel that the device you are holding is good. I was able to quickly connect with the picasa online album and get my favorite picture as the wall paper. Bright , beautiful and quick.

Camera : I have read in the forums that there is a pink camera issue. Most users reported that the pictures in the middle was pink colored. I took some pictures and adjusted the white balance and I dont see any problem. I think that is setting specific. The interface to upload pictures to picasa/gmail/facebook and email was very simple.

Here are some of the pictures and I am satisfied with the camera.

Keyboard: There is no physical key board and that means the touch screen keyboard should be very good. I tried the Droid and the Iphone before this phone and surprisingly, i felt that this keyboard is much more accurate and faster. One thing i liked is that its dictionary is updated with the names from your contacts making it easy to type names. I was able to type fairly accurately by holding the phone upright. If I put it horizontally, it is even faster. This keyboard is very good and I dont have thin fingers.

Voice Mail: I had a google voice account and I had set that up to accept my voice mails. This integrates perfectly with the phone. Voice sends an email when you have a voice mail and it even transcribes for you to read. So voice mails are handled through VOIP and saves me some minutes there.

Voice Recognition : The phone recognizes the voice commands very well. I tried directions and names and it was accurate most of the times. You can dictate an email but I think you need to do it in small parts and wait for it to recognize. I think there is some more time before this becomes useful.

Apps: I have downloaded File browser and PDF viewer applications other than some news and finance apps. All the apps I had downloaded were free and were fine.

Outlook : I can synch my work email. It does not synch the calandar and other things but it is able to do email which is fine by me.

Widgets: The power management widget is good. I like the five screen home display which lets me move things around and keep the main screen clean.

Lock Pattern: You can enable the lock pattern on the phone. The problem how ever is that this security feature is not enough because some one can figure out what you are drawing. you can choose to hide patter when you are unlocking but i think this is not a great lock for the phone. I wish there was a number lock provided alternately.

Some Tips : ( For the first time Android users)
1. If you touch and icon and hold, it becomes active and you can move it between screens. The recycle bin at the botton gets enabled and you can drop the icon into that if you want to delete.
2. All the icons and widgets can be deleted and be re-added.
3. Once you connect the phone to a computer, you need to select the usb icon on the phone and from the menu select mount.
4. Holding the Home icon on the phone would pop the few icons that are considered frequently used like the phone, mail , talk etc.

Other questions: I had one question when I got the phone. I noticed at the bottom next to the USB slot, three are four small holes. Three of them had gold pins and I was worried that one of them is missing a pin. I know there would be a docking station at some point of time and my phone might have a problem. I emailed Google about this and later got a response that my phone is not missing any thing. I had figured out that this is indeed the micro phone.

Support : Google does not have a phone support ( They dont have a phone support for any thing I use so I expected this. ) I wrote to them with one question about the phone and got the response with in a day and I am ok with it. If you expect phone support when you have a problem then Google is not for you. At least for now.

Battery : A single charge would get me over 14 hours. I used the phone to play around for 2-3 hours and made some 70-80 minute calls . I am satisfied with the battery performance. How ever there is no utility that says how long the battery runs from the current charge on phone only. I think this would be helpful.

Charger: The Micro USB is some thing I like. I know this is now a standard and hopefully in the future, I dont have to carry the charger where ever i go.

Things I am not happy about:

There is no Tethering support. Google said, it was more a business decision rather than a technical flaw. I would think an unlocked phone should be unlocked no restrictions.

Alarm clock, there is not much customization on how long the default snooze should be and so on.

Lock Pattern : I think there is a number lock that activates the phone other than the draw pattern. This is how ever a personal opinion.

Finally : I liked the phone. At 179$ ( 212$ if you are in cook county) this seems a good buy.
Google says there is no fine if you cancel the contract after 120 days. So if you cancel the T mobile phone after 120 days, you pay 200$ for the ETF and move to what ever plan you want to move. In this case, moving to the even more plus plans might save you some money and the cost of the phone would be 379$ after 4 months.

Tuesday, July 03, 2007

Reasons for not buying the iPhone right now.

1. The battery in the iPhone is not removable. Apple says the one in the iPhone is good for upto 400 recharges.

2.Its not yet ready for 3g networks. The features like browsing are slow..

3. Cost obviously. I guess it would have to reach the price range of 300$ to become more popular like the iPod.

4.Does not have removable media.

Saying all these, the cute little thing would become a must have in the near future.

Google acquires Grand Central

Here is a link to the post in their official blog. : Official Google Blog: All aboard

The question is now how is Google going to use Grand central to generate revenue?
(How much is grand central making now and what are their existing revenue plans? )

1. Google already has the following features that are related to phone based services :

a. Google Maps' local search would allow you to call the merchants via by clicking the link.
b. Google's 411 Service beats the directory service of most providers even though its in beta.
c. Latest acquisition of Grand Central

2. Google believes that having users who visit their site is merely enough to create revenues. Unlike Yahoo and other webbased companies , Google does not talk about money when visitors come to their site.
For Example : Yahoo advertises that the paid email is much better than the free email that they offer. For a new user, that would be a concern and he looks elsewhere for a solution and its not tough to find.

Looking at these, its easy to say google would want more and more people to register all their phones with google. How will that generate revenue? we will have to wait and see.

Tuesday, June 05, 2007

Google Street View - Comments

Google street view is very much in the news for the wrong reasons. There are numerous discussion groups on the internet which are exchaning the book marks of various street views of people.
Whats funny about people? you might ask. Well to name one : There are pictures of people coming out of strip clubs etc.

Well Google says that any one can request the pictures be blurred by clicking a link but I dont think many people do get to find their picture and then request Google to get that blurred ;)

For the people who are interested, Google actually got the list of sensitive places from a government agency and then was careful when putting up the pictures of those locations. So the chances of them getting into troubles like are very low.

The idea behind this blog was not about invasion of privacy. That would be an entirely differrent topic. I was thinking about the possible ways of generating money out of it. After all, it boils down to how to make money out of this? Here is what I think:

1. Google could put up a serivice for the advertisers that allows them to turn up bright or highlighted when some one is taking a look at that street view. For example, If you are looking at the street view in Las Vegas, [Which is one of the five cities that are present on the street view map.] A particular Casino might pay to be very visible in the Street view of all the casinos and thus making an impression on the people who actually want to go to Vegas.

2.Imagine google changing all the billboards in street views where ever there is a chance of people browsing more time and start charging for them

3. There would be embedded images like a Pizza hut logo when some one searches for Pizza at a location.

And if I were to make a technical guess, Google would let you download the street view onto you phone or PDF in the future as a part of the GPS navigation system and make things easy.

The bottom line is, they would try their level best to get us to use that service and the more we use it, the more money they get out of it.

Go Google !

Wednesday, May 09, 2007

Sun debuts JavaFx

News is out that Sun Microsystems has come up with JavaFx as an answer to the popular Ajax and Microsoft's SilverLight.

AJAX, which stands for Asynchronous Javascript And XML , has been the buzz word over the past few days. It gives the State-Full ness feeling to the web applications and thus made applications look more interactive.

Microsoft's Silverlight is a cross-browser/ cross-platform plug-in for delivering the next generation of media experiences and rich interactive applications (RIAs) for the Web. An answer to Adobe Flash player and Apple's Quick time player.

We will have to wait and see how Sun's JavaFx does. Sun claims that JAvaFx would let us build applications that are cross browser and cross platform (and mobile device compatible).

Traditionally, any new programming language or scripting language which fails to blend with the existing systems is not a success. The reason why Microsoft implemented Jscript and J++. If JavaFX fails to blend with the existing systems then it would be interesting to see how the market accepts it.

Monday, May 07, 2007

News Review

Looks like we are heading for another huge merger. If you guys are thinking what it is, it is the Microsoft's request to Yahoo! to come back to the negotiations table. Surely, this is one huge step to counter Google's prolonged honey moon phase (as Bill Gates preferred to call it in one of his interviews).

Clearly, Yahoo! is next to Google in the internet arena. There are very few areas where Yahoo! might actually be leading.

Google has been proving with almost all its products that, if clubbed with excellent usability,any old application can be a revenue generating killer application. email/chat etc which were once considered applications that are not so profitable, were picked by Google and they now are generating a lot of revenue for Google.

Lets discuss two of the newer features that Google is trying to push to the users :

If you guys ever noticed the "Call" feature in the Google local search, you would know I am trying to prove here. The call service,obviously, lets you talk to the service provider. Yes in google maps, click local, enter the service provider(lets say Olive Garden) and enter your zip code. Once the results are out, click the call link next to any of the links to talk to the restaurant/business to get the required info. Cool is it not?

Directions on Phone: Goog-411
This is much better. Call "800 GOOG 411" and see the service.

Initially, these services look as if its too much of money being spent by Google for the users. With respect to the first call service, Google calls the user and the business entity to make a call connection. Look deeper, with this free service, Google is slowly capturing the market of phone based search market.

Neither Microsoft nor Yahoo! have shown a similar intent.I am sure Microsoft would try to come up with such a service after Google starts generating revenue out of it and then they are too late.