Skip to main content

Posts

Showing posts from November, 2006

Swapping two integer values in C# [Interview Question]

Offlate, many of my friends where talking about this problem. It seems they ask this question frequently in Microsoft Interviews :) I remember asking this question to freshers in 2005! Just thought I would refresh my knowledge also on this :) So here are few samples which I tried for your reference. Method 1: Using intermediate temp variable int intNumOne = 1, intNumTwo = 2; int intTempVariable; //Swapping of numbers starts here intTempVariable = intNumOne; intNumOne = intNumTwo; intNumTwo = intTempVariable; Response.Write("Value of First Variable :: " + intNumOne.ToString() + "<br>"); Response.Write("Value of Second Variable :: " + intNumTwo.ToString() + "<br>"); Method 2: Without using Temp Variable and by using 8th standard Mathematics :) int intNumOne = 11, intNumTwo = 22; //Swapping of numbers starts here intNumOne = intNumOne + intNumTwo; intNumTwo = intNumOne - intNumTwo; intNumOne = intNumOne - intNumTwo; Response.Write(&

Different Types of Partitioning Operations in SQL Server 2005

In this post let me explain about the three different types of Operations one can do with Partitions. They are: 1. Split Partition 2. Merge Partition 3. Switch Partition (Important of the lot) Before reading further, make sure that you have read my earlier posts. That is, this and this . Split Partition For splitting a partition we need to make use of “Alter Partition Function” syntax. So in our existing “Partition function” lets create a new range with boundary value “Jan 01, 1970”. Alter Partition Function PF_DOB_Range() Split Range ('01-01-1970') Now if we execute this code snippet it would throw an error something like this: Msg 7707, Level 16, State 1, Line 1 The associated partition function 'PF_DOB_Range' generates more partitions than there are file groups mentioned in the scheme 'PS_DOB_1'. So the way to split a partition is: Step 1: Create a new Filegroup (if at all already you don’t have an extra filegroup) Step 2: Make use of that Filegroup while al

Example for Creating and using Partitions in SQL Server 2005

Lets assume that we have table which contains records of our company transaction starting from the date when our company was started 15 years ago! Hope you would understand that the table would have hell a lot of data as it would be holding 15 years of data. But effectively we might be using only last 2 months or 1 year data at the max (very frequently). For each query, it would be processing through this huge data. Bottomline as the table grows larger the performance would go for a toss, also scalabiity and managing data would also be difficult. Hope I have made the point clear. With the help of partitioning a table we can achieve a great level of performance; also managing tables easier. In our case, one of the way to increase the performance would be to “Partition” the data on a yearly basis and stored on a different filegroup (SQL 2005 allows you to partition tables based on specific data usage patterns using defined ranges or lists). For further theoritical knowledge on this subje

App_offline.htm – ASP.NET 2.0 new feature

It’s an interesting find. I got few mails asking me suggestions on the way to handle situations where “the application needs to be updated with the latest code base”. I was preparing a blog post something like this: 1. Normally sites are deployed in Web farm scenarios. If your app is also deployed in a web farm then it’s better to bring one server down update the code base there while all the user request would be served by the other servers in the farm. This way the downtime of the application would be almost zero. 2. If at all your application is deployed on a single server then either you need to face the downtime :) or temporarily create another virtual directory with the old code base. This Virtual directory would be functional till the time you update the actual directory with your latest code base. There would be some negligible amount of downtime here. 3. If you can’t create a new virtual directory for some reason! Then create a static page (“SiteDownForMaintanance.htm”) and ba

Time to say, Goodbye to Adobe PDF Reader!

PDF (Portable Document Format) reader is a very important software one needs. As now-a-days most of the product user manual, eBooks, visa application forms etc., are in PDF format. Today’s computers almost always come with Adobe PDF reader installed by default. Till few weeks back I was also using it without much satisfaction!! No doubt Adobe PDF reader is a great product but I hate it for the following points: 1. I feel that Adobe PDF reader software is really bulky. 2. Loading time of PDF document is unnecessary in Adobe reader 3. Installation of Adobe PDF reader takes at least >= 5 minutes. For past few weeks I am fiddling with another PDF reader called “ Foxit Reader 2.0 ”. In my experience with this new reader, I haven’t found any of the above mentioned disadvantages which I have with Adobe PDF reader . Let me explain those 4 points in detail now: i) I feel that Adobe PDF reader software is really bulky. First of all downloading Adobe PDF reader isn’t an easy joke :) it takes

IndiMix '06 -- Webcast

In continuation to my previous post on IndiMix I got registered to the webcast couple of days back. I have gone through the agenda of the seminar and was interested only in these two sessions. 1. The Genesis of Creativity and Innovation – The Next Web Now (10:15 AM to 11:15 AM) Speaker: Steve Ballmer , CEO, Microsoft Corporation. 2. Designing for the Next Web Now – Experiences and Expressions that Capture the Imagination (2 PM to 3:15 PM). Speaker: i) Leon Brown , Regional Designer and User Experience Lead, Microsoft Corporation APAC (Singapore) ii) Pandurang Nayak , Developer Evangelist, Microsoft Corporation India iii) Deepak Gulati , Developer Evangelist, Microsoft Corporation India iv) Dax Pandhi , CEO, Nukeation Studios Not that I wasn't interested in the other sessions. Since that I am in vacation and browsing from home, I wanted to keep my broadband usage to the minimum :) Today Morning, when i tried accessing the URL (which they have sent me in the registration confirmatio

I am one of the Microsoft BlogStar Winner :)

Wow I am really excited to know that i am one among the Top 20 Microsoft India BlogStar winners :) Check out http://www.microsoft.com/india/blogstars/winners.aspx On the flipside, I am bit disappointed that I didn't make it to the Top 5 :( Because the Top 5 guys gets a chance to meet Steve Ballmer in Mumbai tomorrow. But overall this Month seems to be a really good one to me :) Because starting from November 1st, 2006 till date i have got 3 awards/gifts (including this) from various technology related sites. The other two are: 1. I have won the first prize in community-credit website this month. 2. I have won the " Best Member Award " in dotnetspider. Technorati tags: Microsoft , Steve Ballmer

Visual Studio 2005 Tools for Office Second Edition

Visual Studio 2005 Tools for the 2007 Microsoft Office System (Visual Studio 2005 Tools for Office Second Edition or VSTO 2005 SE for short) is a free add-on to Visual Studio 2005 that empowers developers to build applications targeting the 2007 Office system. Developers can now harness the benefits of the 2007 Office system platform and create Office-based solutions using the professional development environment of Visual Studio 2005. Go through http://msdn.microsoft.com/office/tool/vsto/2005SE/default.aspx to know about the "Feature List", "Download links", "Demos - Video" and "Artiles" on this product.

SQL Server Health and History Tool

The Microsoft SQL Server Health and History Tool (SQLH2) allows you to collect information from instances of SQL Server, store this information, and run reports against the data in order to determine how SQL Server is being used. This version of SQLH2 supports SQL Server 2005 RTM collection.SQLH2 collects four main types of information: 1. Feature Usage – What services/features are installed, running and level of workload on the service. 2. Configuration Settings – Machine, OS and SQL configuration settings, SQL instance and database metadata. 3. Uptime of the SQL Server service 4. Performance Counters (optional) – Used to determine performance trends You can download this tool here Technorati tags: SQL Server 2005

SQL Server Hosting Toolkit Launched

The Database Publishing Wizard enables the deployment of SQL Server 2005 databases into a hosted environment on either a SQL Server 2000 or 2005 server. It generates a SQL script file which can be used to recreate the database in shared hosting environments where the only connectivity to a server is through a web-based control panel with a scripting window. The Database Publishing Wizard is currently a command line tool, though future releases will add a graphical user interface. 1. Current Release 2. Command Line Interface 3. Supported Objects & Types 4. Known Issues 5. Roadmap for Future Releases 6. FAQ 7. Tutorial: Upload the TimeTracker ASP.NET starter kit to your hosted account Source: codeplex Technorati tags: SQL Server 2005

Won a prize (Best Member Award) in dotnetspider.com

Below is the extract of the mail which I got from Tony John of dotnetspider.com couple of days back. Vadivel Mohanakrishnan, We are glad to inform you that you are selected as the RapTier Gift winner for the month of October 2006 for your valuable contributions to dotnetspider.com . We are looking forward to see more contributions from you in future. Winners list is here :: http://www.dotnetspider.com/gifts/Winners.aspx Gift which I would be getting is called "RapTier Software" . RapTier is a template-based ASP.NET, C#, VB.NET and SQL code generator that creates robust database driven applications for a wide range of database. Features: ASP.NET, C#, VB.NET and SQL code generation; DataSet and Typed Data Transfer Object support; Stored Procedure and Dynamic SQL support; Existing stored procedure wrapping; Support of many database engines; Template-based design, WebForm UI generation, Database documentation generation To know more about it, check this out http://www.sharppower.

Won the first prize in community credit ...

I am glad that few minutes back i came to know that I have won the 1st prize in Community-credit for the month of October 2006. Below is the extract from the mail which I received from David (Admin of Community-credit site). Hello Vadivel, Congratulations. You won 1st Prize in the October 2006 Contest. As you may know, a lot of people competed, but only a few won. Nicely done! Please also keep in mind that your prize is not just a stupid, geeky gift, but it's also a symbol to represent your contributions to the development community. When folks ask you how you won, you can tell them that it was by helping out other geeks. Be proud and brag. Check out this page to know about the Prize I got :: http://www.community-credit.com/CommunityCreditPrizePage.aspx and choose October 2006 in the dropdown.