Prem's views on life, .net and software development (everything contained in one strongly typed weblog).
Friday, February 20, 2009
Difference between C# delegates vs Events
In a nutshell, the article summarizes the main differences between delegates vs events.
1. Events can be used inside an interface while a delegate cannot be.
2. Event can be invoked only from within the class in which it has been declared, while a delegate can be invoked even from the class that is creating the object.
3. Event has a pair of customizable accessors (add and remove)
4. Event signature can only be type foo(object source, EventArgs e)
Tuesday, November 25, 2008
Running SchemaSpy for database tables in SQL Server 2005
I was looking for a tool to generate the schema diagram from my SQL Server 2005 development database. After some research I found the open source tool SchemaSpy which meet my needs, it also had decent reviews in few blogs. But I had problem running the tool to generate the Html documents for my schema.
After playing around with the option parameters, I was finally able to get it to generate the documentation needed. Couple of things to ensure before running schemaspy to generate documentation for SQL Server 2005 schema.
- Download Microsoft JDBC driver for SQL Server 2005
- Download Graphviz
Make sure the Graphviz installation is added to your system PATH variable. Run the following command
java -jar schemaSpy.jar -t mssql05 -db <name of the database> -host <Ip address/hostname> -s dbo -port 1433 -u <username of the database> -p <Password for the userId> -o library
Saturday, November 01, 2008
Difference between Static and Singleton Pattern
I wanted to blog about this for a while, b'cos I found many folks not being able to answer this question during the interview process. Few differences worth mentioning are
- Singletons can implement interfaces and inherit from other classes (while static classes cannot).
- Singletons can be extended (used as a subclass) while static classes cannot.
- There is only one instance in case of Singletons but there is none in case of Static classes.
- Singletons can be passed around as a parameter to function calls but you can't do that with a Static class.
Saturday, October 18, 2008
Stella's Restaurant in Alexandria Closed?
While chatting with my good friend Nick, I came to know that Stella's (a nice restaurant in Duke Street, Alexandria) has been closed for more than couple of years now. It is a nice, cosy restaurant that we used to go for lunch when we were working in Lumenos. I certainly have quite a lot of sweet memories there especially going for chipotle chicken on thursdays and happy hour(even though i don't drink.... just to have my root BEER/Diet Coke !!!).. The outdoor dining area in Stella's is a real nice place to have lunch/dinner.
It would have been a great trip down the memory lane if I could have had a chiptole chicken with some good old friends when I do go to USA for a business trip.. Probably have to be happy eating my foot long roasted chicken in Hearty Italian made fresh in the Subway across the Road !!
Friday, October 17, 2008
Lookout crashes in Vista if Microsoft Outlook connector is Installed
In my office desktop, I have lookout installed to speed up searches in Outlook 2003. Lookout started crashing frequently for the last couple of days, I was not sure what the reason was and I tried to find the solution online.
After trial and error, I found out that I have recently installed Outlook connector as part of Windows Live package (I wanted to install only Livewriter but mistakenly installed outlook live connector). Once I uninstalled Live connector everything is fine and lookout is able to index my mails without any issues.
I hope this post will be of help to someone who runs into the same issue.
Thursday, October 16, 2008
Nissan Around View Monitor
Check out the Nissan Around View Monitor mentioned in the top 10 most brilliant Gadgets of the Year. I think this revolutionizes the way we would park our car. It gives the bird's eye view on the navigation screen. Check out this video to see the technology in action.
Friday, October 10, 2008
Use DiffMerge for Compare/Merge in StarTeam
One of the best thing StarTeam offers is the ability to integrate third party file comparison/merge tools to be used from within StarTeam. I have been using Winmerge for some time as the choice of tool for Merge/Difference comparison. Refer to Jon Galloway's blog for good reference on Integrating WinMerge with StarTeam.
I have recently started using DiffMerge as the tool of choice for doing Comparison/Merging from within StarTeam. Please follow the steps mentioned below to use DiffMerge for comparison/merge from within StarTeam.
1. GoTo "Tools" Menu -> "Personal Options" SubMenu
2. GoTo "File" Tab
3. Click on "Alternate Applications"
4. Setting DiffMerge as External Application for Merge
a. In Merge Utility -> Give the name of the path where DiffMerge.Exe is located.
b. Options -> /r=$resultfile $usertip $basefile $branchtip /t1="Local Version" /t2="Merged File" /t3="StarTeam Version"
5. Setting DiffMerge as External Application for Comparison
a. In Comparison Utility -> Give the name of the path where DiffMerge.Exe is located.
b. Options -> $file1 $file2 /t1="StarTeam Version" /t2="Local Version"
Now you can start using DiffMerge from within StarTeam
Tuesday, October 07, 2008
Got my own Next Generation Console
When I decided to buy a next generation console, I started with Wii since I have been reading very good reviews about the controller, but I could not find it in stock in any of the shops (Best Buy, Circuit City), so I decided to go with PS3. Hope it would turn out to be a good choice over wii and xbox 360.
Upgraded my iphone firmware to v2.1
I am very impressed with App Store and the list of applications users can currently download. Altast, I have been able to get my hands on Kai Pond, which is a well thought out application for iphone.
Tuesday, April 15, 2008
Upgraded iphone to 1.1.4 using Ziphone
So that day i decided that I wont be jailbreaking my iphone for any future versions until I know that it will work for sure. So when my friend offered his iphone to be jailbroken to 1.1.4 ( I guess he believed more in my abilities to break his iphone safely more than I belived myself). To my surprise the ziphone hacking method (detailed in lifehacker) was so easy that I was done jailbreaking the1.1.4 version in less than a minute.
Assuming that it will be a smooth operation, I used the same method to upgrade my iphone as well, but I was unlucky power went off in the middle of the operation and my computer went down( Even though i have a laptop the battery has drained completely and now I cannot use it even for a minute without connecting it directly to power outlet). When the power came back I could not shutdown/start my iphone, it was giving wierd error message that the "BSD root error". Luckily I was able to restore my iphone after holding down the power and home buttons, running ziphone again did the trick for me. But I should say I was really fortunate not to have bricked my iphone in the process.
I would highly recommend anyone to use ziphone to jailbreak thier iphone.