Archive for March, 2006

Useful copy paste technique in DOS shell

A lot of times you might have to get down to the DOS shell in order to check out something. For example you might want to check if a site is up and running or you might want to get the IP address of a site and put into your code. In DOS shell normally you cannot copy selecting text and doing a Ctrl+C. There is a simple way to do a copy paste in the DOS shell.

  1. First create a short cut for DOS prompt on your desktop. Right click on your desktop, select new -> shortcut, for the program location just type cmd, click away next and finish.
  2. Right click on the newly created shortcut and select properties.
  3. Select the options tab and in the Edit options section, check Quick edit mode and Insert mode. Click OK to save and close.

Now you are all set. Double click the shortcut which will open up a DOS prompt. Try executing the command, say for example,

C:/>ping www.google.com

Now just like how you would select a text on any windows application, select the IP address that is displayed using your mouse. Once you have selected, right click your mouse. That’s it, this copies the text you have selected in the clipboard. You can paste this in any of your windows applications. If you want to paste whatever you have copied within the DOS shell, then simply at the prompt right click your mouse and whatever text in the clipboard gets pasted. Try it, you will get addicted to it if you are a person who often visits DOS shell and wants information copy pasted from it.

Blink this Useful copy paste technique in DOS shell at blinklist.com    Bookmark Useful copy paste technique in DOS shell at blogmarks    Bookmark Useful copy paste technique in DOS shell at del.icio.us    Digg Useful copy paste technique in DOS shell at Digg.com    Fark Useful copy paste technique in DOS shell at Fark.com    Bookmark Useful copy paste technique in DOS shell at Furl.net    Bookmark Useful copy paste technique in DOS shell at NewsVine    Bookmark Useful copy paste technique in DOS shell at reddit.com    Bookmark Useful copy paste technique in DOS shell at Simpy.com    Bookmark Useful copy paste technique in DOS shell at Spurl.net    Bookmark Useful copy paste technique in DOS shell with wists    Bookmark Useful copy paste technique in DOS shell at YahooMyWeb

Comments (1)      Cosmos

Troubleshooting - Tip #3 - View Source

The presentation layer developers get into lot of trouble when they work on a web based application. After the advent of dynamic presentation layer technologies (such as JSP, RHTML, ASP etc) HTML components and the language code gets nested with each other. Usually after some time the code becomes messy particularly if you dont have separate code for every layer in the page. But however loosely coupled your code is, the resulting page may not be what you expected and most likely you will miss something not appearing or not appearing the way you want.

I have seen developers trying to probe their dynamic code and trying to locate the problem. But a best place to start would be from your browser and view the source code generated. Here is the reason why. However complex your system is and whatever be the technology that you use for the server side application, everything has to ultimately get transformed into one single HTML file that comes to the browser. So it is better that you study the resulting HTML layout of your program(s). Most of the time you know which part of the HTML is causing the problem, and you would definitely know which program/code generates that section of the HTML.

Blink this Troubleshooting - Tip #3 - View Source at blinklist.com    Bookmark Troubleshooting - Tip #3 - View Source at blogmarks    Bookmark Troubleshooting - Tip #3 - View Source at del.icio.us    Digg Troubleshooting - Tip #3 - View Source at Digg.com    Fark Troubleshooting - Tip #3 - View Source at Fark.com    Bookmark Troubleshooting - Tip #3 - View Source at Furl.net    Bookmark Troubleshooting - Tip #3 - View Source at NewsVine    Bookmark Troubleshooting - Tip #3 - View Source at reddit.com    Bookmark Troubleshooting - Tip #3 - View Source at Simpy.com    Bookmark Troubleshooting - Tip #3 - View Source at Spurl.net    Bookmark Troubleshooting - Tip #3 - View Source with wists    Bookmark Troubleshooting - Tip #3 - View Source at YahooMyWeb

Comments      Cosmos

Object Vs Class

The first question I ask in any interview is what do you think is the difference between Object and Class. Most of the time I get the bookish answer that an object is an instance of class and class is a blueprint. Ofcourse the answer is right, but when I ask the candidate to forget about any programming language or technology and give me an example for a class and corresponding object from the real world, he/she most of the time tells me an example that always fits as example for class.

For example this is a common example that the candidates give. An example for a class would be Car and the corresponding object would be Maruti (an Indian car model). Think about this, how can Maruti be an instance of the Car class when Maruti by itself is a bluprint of a type of Car or in object oriented terms, Maruti inherits Car but is still a class. What really would be an object for the class car would be to really show a car that is running on the street or parked outside. Because that is real instance, that you can feel, get into and drive.

That’s Object Thinking foundation #1.

Blink this Object Vs Class at blinklist.com    Bookmark Object Vs Class at blogmarks    Bookmark Object Vs Class at del.icio.us    Digg Object Vs Class at Digg.com    Fark Object Vs Class at Fark.com    Bookmark Object Vs Class at Furl.net    Bookmark Object Vs Class at NewsVine    Bookmark Object Vs Class at reddit.com    Bookmark Object Vs Class at Simpy.com    Bookmark Object Vs Class at Spurl.net    Bookmark Object Vs Class with wists    Bookmark Object Vs Class at YahooMyWeb

Comments (1)      Cosmos

Troubleshooting Tip #2 - Searching for a solution in the net

The troubleshooting of a problem ends once you exactly locate where the problem is. If you know what the problem is then it is a matter of finding out list of solutions available and picking one that best solves the problem, or it could be taking a different course of action. Most of the time people tend to lose focus and look at outside of the real problem area. Most of the times the solution to a problem is already available over the net, people have faced it and experts have answered the solution or they would have suggested the alternative. The following is the list of ways to effectively use the net for troubleshooting.

  1. Use the right phrases when you search in the search engine. The best way to get the right phrase is to look at your problem very carefully. Probably what you see as problem may not be the root cause of the problem. It could be something else that is triggering the chain of reaction. Study the trace carefully and try various error messages that form the trace.
  2. Use the search engine effectively. Most of the times we do not get into the advanced search, where you can filter the search result and narrow it down to the core area of the problem. This will save a lot of time by not going through a lot of links that are irrelevant.
  3. Search in the groups. This is where most of the solutions will be available.
  4. Nowadays, blog is where lot of people post their problems and solutions. Use a blog tracker and blog search site like Technorati.

I am sure every one of us would have tried one or the other of above options, but not a combination of them, so it is best to mix and match the above options in various ways to be more productive.

Blink this Troubleshooting Tip #2 - Searching for a solution in the net at blinklist.com    Bookmark Troubleshooting Tip #2 - Searching for a solution in the net at blogmarks    Bookmark Troubleshooting Tip #2 - Searching for a solution in the net at del.icio.us    Digg Troubleshooting Tip #2 - Searching for a solution in the net at Digg.com    Fark Troubleshooting Tip #2 - Searching for a solution in the net at Fark.com    Bookmark Troubleshooting Tip #2 - Searching for a solution in the net at Furl.net    Bookmark Troubleshooting Tip #2 - Searching for a solution in the net at NewsVine    Bookmark Troubleshooting Tip #2 - Searching for a solution in the net at reddit.com    Bookmark Troubleshooting Tip #2 - Searching for a solution in the net at Simpy.com    Bookmark Troubleshooting Tip #2 - Searching for a solution in the net at Spurl.net    Bookmark Troubleshooting Tip #2 - Searching for a solution in the net with wists    Bookmark Troubleshooting Tip #2 - Searching for a solution in the net at YahooMyWeb

Comments      Cosmos

Troubleshooting tip #1 - Understand this skill is very important

Troubleshooting is an important skill that any developer should build from the beginning without fail. It is an important skill that can save a lot of time if you just know where to look for the problem. When do you find out that you have to troubleshoot something? This is my definition of troubleshooting. When you are into a trouble, and you know that it is not a syntax error that is causing the problem, you know that it is not the logic that is causing the problem, and you start to sratch your head or keep your hands on your head and start thinking, why is my machine acting weird, then you are in trouble and you have to shoot it. Be aware though, sometimes you think too much while you actually made a careless mistake and a typo that is causing the program to misbehave. I am not talking about this type either. What I am talking about is a problem where the solution is not around quickly and you need help, either from experts around or from experts over the net in the form of forums, groups and blogs.

I had been grooming fresh college students into IT professionals over last 7 years and this is what I tell them. The most important skill that you have to hone yourself so that you can start climbing the ladder faster is the troubleshooting skill. Think about this, when you are working on solving a problem, you dont start working with the intention that you want to run into hell lot of problems and not complete it. Everybody wants verything to be working perfectly the first time. And we know that practically its not the case most of the time. Even experts get into a mess and have to struggle a lot to get out of the problem. While you cannot avoid problems, but you can keep a watch over yourself to make sure that you are cutting the time that you spend on finding where the problem is. Here is a neat exercise that I suggest to the new folks.

Create a word document that contains a table, similar to below.

S.no Problem statement Date and Time (A) Estimated time to complete (B) Actual Date and Time to complete (C) Troublshooting scale (C-A) - B Solution

Keep this document open every day and start adding the details as and when you start troubleshooting something. This document helps in two ways,

  1. It helps you keep track of how effective you are in troubleshooting. If there are more negative values in the troubleshooting scale then you are improving in your skill.
  2. You are not just recording the time, but also recording the problem and solution, this becomes a valuable respository and can help save a lot of time in the future not only for you, but for your team as well as the company

Ofcourse this exercise will need some discipline, you have to keep setting benchmarks and compete with yourself to be effective.

Blink this Troubleshooting tip #1 - Understand this skill is very important at blinklist.com    Bookmark Troubleshooting tip #1 - Understand this skill is very important at blogmarks    Bookmark Troubleshooting tip #1 - Understand this skill is very important at del.icio.us    Digg Troubleshooting tip #1 - Understand this skill is very important at Digg.com    Fark Troubleshooting tip #1 - Understand this skill is very important at Fark.com    Bookmark Troubleshooting tip #1 - Understand this skill is very important at Furl.net    Bookmark Troubleshooting tip #1 - Understand this skill is very important at NewsVine    Bookmark Troubleshooting tip #1 - Understand this skill is very important at reddit.com    Bookmark Troubleshooting tip #1 - Understand this skill is very important at Simpy.com    Bookmark Troubleshooting tip #1 - Understand this skill is very important at Spurl.net    Bookmark Troubleshooting tip #1 - Understand this skill is very important with wists    Bookmark Troubleshooting tip #1 - Understand this skill is very important at YahooMyWeb

Comments      Cosmos

CON folder rumor

I have received the following mail so many times including an sms about it on my mobile. This is what it says,

“An Indian discovered that nobody can create a FOLDER anywhere on the computer which can be named as CON. This is something pretty cool…and unbelievable… At Microsoft the whole Team couldn’t answer why this happened!
TRY IT NOW, IT WILL NOT CREATE CON FOLDER.”

Here is the justification why a folder named “CON” cannot be created. Windows has been inherited from MS DOS which again was inherited from an operating system called QDOS (Quick and Dirty Operating System). Till today all the MS operating systems including the servers still have the kernel shell functions of MS DOS. DOS was a text console based OS. CON is a reserved word which meant console or the visual display unit. So anything when redirected to CON went to the display device which is the monitor. Since it is a reserved word DOS restricted that word to be used elsewhere like creating file named CON or creating a directory named CON. Here is a sample test. Go to DOS prompt. Type this command,

c:\> copy con Hello

Keep entering text as many lines as you want and when you are done press (Ctrl key + Z). Give Dir command and you can see that a file named Hello was created. What that command essentially does is create a file whatever that is typed and displayed onto the console. Lets try another example. Try this command

c:\> copy con

Enter some text and press the enter key. What do you see? DOS will echo whatever you have typed. press Ctrl + Z to come out of it.
There is no other reason other than CON being a reserved word and to retain the functionality of DOS shell, that Windows does not allow a folder to be created with the name CON. So you must be wondering if there are any other reserved words and you cannot create a folder with that word. Here is the list. If you create these folders in windows explorer it will create them but internally it is represented differently. To really test it is not possible, go to DOS prompt and try creating a directory (using mkdir command) with the below names.

PRN - refers printer
NIL - refers void (DOS will fool you that it created a directory but it wont be there)
AUX - refers to the auxilary device
COM1 - COM 1 port
COM2 - COM 2 port
COM3 - COM 3 port
COM4 - COM 4 port
LPT1 - LPT 1 port
LPT2 - LPT 2 port
LPT3 - LPT 3 port
And this is only in DOS and Windows systems, it will work pretty cool on a Unix system. Sometimes we get so excited by such mails that we are focused only in forwarding them, rather than trying to find out if the claim is valid.

Blink this CON folder rumor at blinklist.com    Bookmark CON folder rumor at blogmarks    Bookmark CON folder rumor at del.icio.us    Digg CON folder rumor at Digg.com    Fark CON folder rumor at Fark.com    Bookmark CON folder rumor at Furl.net    Bookmark CON folder rumor at NewsVine    Bookmark CON folder rumor at reddit.com    Bookmark CON folder rumor at Simpy.com    Bookmark CON folder rumor at Spurl.net    Bookmark CON folder rumor with wists    Bookmark CON folder rumor at YahooMyWeb

Comments      Cosmos

Next entries » ·

Creative Commons License  This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.