Thursday, October 30, 2008

Bank that credits your account each morning with Rs 86,400

Imagine there is a bank that credits your account each morning with Rs 86,400. It carries over no balance from day to day; allows you to keep no cash balance; every night deletes whatever part of the balance you failed to use during the day. What would you do with such an account Draw out every penny, of course!!!


Every one of us has such a ‘bank’. Its name is TIME. Every morning it credits you with 86,400 seconds. Every night it writes off as lost whatever of this you have failed to invest to good purpose. It carries over no balance. It allows no overdraft.

 

Each day it opens a new account for you. Each night it burns the records of the day. If you fail to use the day’s deposits, the loss is yours. There is no going back. There is no drawing against tomorrow. You must live in the present -on today’s deposits. Invest it so as to get from it the utmost in health, happiness and success!

 

The clock is running. Make the most of today!! And make it a great week ahead!!

Thursday, October 23, 2008

Visual Studio Tips & Tricks that Every Developer Should Know

Tips & Tricks that Every Developer Should Know

In this blog entry, I list the essential tips and tricks that every developer who uses Visual Studio 2008 should know. I wanted to keep this list brief. I also wanted to focus on only those tips and tricks that I use on a daily basis. Almost all of these tips and tricks are just as useful regardless of whether you are building an ASP.NET Web Forms or ASP.NET MVC application.

Tip #1 – You don’t need to select a line to copy or delete it

I always cringe whenever I see someone select an entire line of code in the Visual Studio code editor before copying the line or deleting the line (see Figure 1). You don’t need to do this.

Figure 1

clip_image002

If you want to copy a line of code then you can simply press CTRL-c to copy the line and press CTRL-v to paste the line. If you want to delete a line, don’t select it first, just press CTRL-x. You’ll be surprised how much time this one tip will save you.

Tip #2 – You can add a namespace automatically by pressing CTRL-.

In the old days, before Visual Studio 2008, if you used a class in your code that was not a member of any of the existing namespaces imported in your code then you had no choice but to look up the class in the documentation and enter a using statement to import the new namespace.

Visual Studio 2008 is smart enough to import namespaces for you automatically. If you type the name of a class that inhabits a namespace that has not been imported then Visual Studio displays a red bar beneath the class in the editor (see Figure 2). You can press CTRL-. to display a dialog box for picking the right namespace to import. Finally, just press the ENTER key to select a namespace (see Figure 3).

Figure 2

clip_image004

Figure 3

clip_image006

Tip #3 – Never create properties by hand

Never type property declarations by hand. It takes forever! Instead, just type prop + TAB + TAB. When you type prop + TAB + TAB, you get a code snippet (template) for entering a property. Use TAB to move between the template parameters. Press the ENTER key when you are finished creating the property (see Figure 4). This tip has saved me from many days of tedious property typing.

Figure 4

clip_image008

Tip #4 – You can remove and sort unnecessary using statements

Whenever I finish creating a class, I always clean up the list of using statements that appear at the top of the class file. I like to remove any unused using statements to reduce the amount of visual clutter in my classes. You can remove using statements that are not required by your code by right-clicking the top of your code file, selecting the menu option Organize Usings, and select Remove and Sort.

Figure 5

clip_image010

Tip #5 – Use CTRL-k+c to comment out code

If you need to temporarily disable a block of code, or a section of an ASP.NET page, then you can comment out the region by pressing CTRL-k+c. I always do this when I want to rewrite an existing section of code, but I am afraid to delete the old code before writing the new code.

For example, Figure 6 illustrates commented out code in the code editor.

Figure 6

clip_image012

You can use the very same key combination to comment out code almost anywhere. For example, you can comment out code in ASP.NET pages, web.config files, and JavaScript files (see Figure 7).

Figure 7

clip_image014

You can perform the opposite operation, and uncomment out code, by using the keyboard combination CTRL-k+u.

Tip #6 – You can close all documents except the current one

After working in Visual Studio for an extended period of time, I end up with a lot of open documents. I like to quickly switch between open documents by hitting the keyboard combination CTRL-TAB (you can also use CTRL-TAB to shift focus to different tool windows). If you have too many documents open, using CTRL-TAB becomes more difficult because you must hunt through the set of open documents.

There are two ways that you can close open documents. You can use the menu option Window, Close All Documents. Better yet, you can right click a tab that corresponds to an open document and select the menu option Close All But This. Selecting this latter option closes all open documents except the document corresponding to the tab (see Figure 8).

Figure 8

clip_image016

Tip #7 – You can open a database by double-clicking the database file in App_Data

After you add a user instance of a SQL Express database to a project (a RANU database), you can quickly connect to the database by double-clicking the .mdf file in the App_Data folder. Double-clicking the database opens the Server Explorer/Database Explorer window and expands the objects in the database automatically.

Tip #8 – You can copy a file or folder into a project by dragging and dropping

I’m always composing new Visual Studio projects from bits and pieces of previous Visual Studio projects. For example, I might need to add a folder from a previous project or a set of files. You can add existing files to Visual Studio by right-clicking in the Solution Explorer window and selecting the menu option Add, Existing Item. But, this method of adding files is slow. Furthermore, you can’t add folders using this method.

The best method of adding files and folders to Visual Studio project is to just drag the files or folder into the Solution Explorer window (or copy and paste the files or folder). For example, I am constantly adding my MoviesDB.mdf movies SQL Express database to new projects. I keep this file on my desktop and drag it into the App_Data folder whenever I need the database in a new Visual Studio project.

Tip #9 – Use CTRL-SPACE to perform statement completion

This tip is particularly relevant for developers who build applications by using test-driven development. When doing test-driven development, you write a unit test first and then write code that satisfies the unit test. When writing the unit test, you often have to fight with statement auto-completion.

There is an easy solution to this problem. Disable automatic statement completion by selecting Tools, Options, Text Editor, All Languages and uncheck the Auto list members checkbox (see Figure 9).

Figure 9

clip_image018

After you disable auto list members, you can still display suggestions for statement completion by using the keyboard combination CTRL-SPACE.

Tip #10 – Add new items by pressing CTRL-N or CTRL-SHIFT+A

In general, using the mouse to perform an action in Visual Studio is slower than entering a keyboard combination. The fastest way to add a new item into a Visual Studio project is to hit the keyboard combination CTRL-n or the keyboard combination CTRL-SHIFT+A. The first keyboard combination works in ASP.NET Websites and the second keyboard combination works in both Website and ASP.NET MVC Web Application projects.

This keyboard combination opens the Add New Item dialog box (see Figure 10).

Figure 10

clip_image020

You can use the TAB and arrow keys to select an item from the dialog box and navigate to the Open button. Press the ENTER key to invoke the Open button.

Tip #11 – You don’t need to type file extensions when adding a file

This tip is related to the previous one. After using the TAB key to navigate to the Name textbox in the Add New Item dialog box, you can enter the name of the new item. When typing the name of a new item, you don’t need to include the file extension. Visual Studio can determine the file extension from the selected template.

For example, when adding a new Web Form named MyPage.aspx, you can simply type MyPage. When adding a new Master Page named Site.master, you can simply type Site.

You might think that avoiding typing a couple of characters would not matter. But, if you add dozens of files to a Visual Studio project, the number of characters that you can avoid typing quickly adds up.


Source: Stephen Walther(ASP.Net)

Tuesday, October 21, 2008

CTRL+ C Hack Be Careful

Checkout the Shocking news about  the Ctrl+C (Shortcut to copy)
In the Day today  life the most used shortcut is this.But when you are using this on the web
It is true, text you last copied for pasting (copy & paste) can be stolen when you visit web sites using a combination of JavaScript and ASP to write your possible sensitive data to a db on another server. Hopefully you haven't copied a credit card number recently before surfing! 
see what happens......
Try to copy any text content by Ctrl+C
The Clipboard hack is done by the following Source Code: 

Script Language="JavaScript" var content = clipboardData.getData("Text"); alert(content);

 To avoid do the following:

  1. Go to internet  options->security
  2. Press custom level
  3. In the security settings, select disable under Allow paste operations via script.
Now the contents of your clipboard are safe. :)

source: http://www.sourcecodesworld.com/special/clipboard.asp

Thursday, October 16, 2008

About Me

Hi All,

I am Balaji working as a Junior software Engineer in a MNC. 

I have started this blog just to share the Knowledge....

Share it! Let’s grow together!

My intrest of programming are C#,ASP,Javascript....

I learn a lot from My Guru 




he never says no will give whatever i ask him.


Stay in Touch