Wednesday, October 24, 2012

Create JavaDoc


Pre-Requisites:
  • jdk1.6.0_11

Installed location:
jdk1.6.0_11                 ->   C:\Program Files\Java\jdk1.6.0_11\

Environment Variables:
Enter Variable name and Variable value which is mentioned below.

Variable name:JAVA_HOME
Variable value:C:\Program Files\Java\jdk1.6.0_11

Overview:
Javadoc is a tool for generating API Documentation in HTML format from doc comments in source code.
Save as CreateJavadocExample.java
  1. /* 
  2.  * @(#)CreateJavadocExample.java 1.0 07/15/09 
  3.  * 
  4.  * Copyright 2009 Java Workspace, Inc. All rights reserved. 
  5.  * JAVA WORKSPACE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. 
  6.  */  
  7.   
  8. package com.javaworkspace.javadoc;  
  9.   
  10. /** 
  11.  * The class <code>CreateJavadocExample</code> includes method for adding two 
  12.  * numbers 
  13.  *  
  14.  * <p> 
  15.  * For additional information on Javadoc, see <a *="" href="http://www.javaworkspace.com/createJavaDoc.do">http://www.javaworkspace.com/createJavaDoc.do</a>. 
  16.  * </p> 
  17.  *  
  18.  * @author www.javaworkspace.com 
  19.  * @version 1.0, 07/15/09 
  20.  * @see java.lang.Object 
  21.  * @since 1.0 
  22.  */  
  23.   
  24. public class CreateJavadocExample {  
  25.   
  26.     /** 
  27.      * @param a 
  28.      *            first number which is to be added 
  29.      * @param b 
  30.      *            second number which is to be added 
  31.      * @return addition of two numbers 
  32.      * @since 1.0 
  33.      */  
  34.   
  35.     public int add(int a, int b) {  
  36.         return a + b;  
  37.     }  
  38. }  

Steps To Create JavaDoc
  1. Copy the above program in the folder com.javaworkspace.javadoc
  2. In command prompt navigate to D:\javadoc\com\javaworkspace\javadoc>
  3. type javadoc CreateJavadocExample.java
  4. this will create html document in the same folder.
  5. Locate index.html and click that.
  6. Browser window will be opened with Class Summary.
  7. Click CreateJavadocExample in top left corner of All Classes pane.
  8. You can see Method Detail,  Detail... etc.
  9. In the above example we have mentioned only some of the javadoc comments.

Mappings of IP addresses to hostnames


(Change localhost to some other name)

Operationg System: 
  • Windows XP
Steps
  • 1. Navigate to
C:\WINDOWS\system32\drivers\etc

Or
start->All Programs->Run-> type 'drivers'  (Without quotes)->etc
  • 2. Open the file host with a text editor and change

127.0.0.1       localhost
To
127.0.0.1       projectname

Change Apache Tomcat default Port 8080 to other Port number



Pre-Requisites:
  • apache-tomcat-6.0.18 (works with previous versions of Tomcat)
Tomcat will run by default on TCP/IP port number 8080.  But there can be situations where there are some other servers running on this same port forcing you to change the port of one of the servers. This article explains how to change the port number from 8080 to some other port number. 

Steps
  • 1. Navigate to
C:\Program Files\Apache Software Foundation\Tomcat 7.0\conf\server.xml
(The place where you have installed tomcat)
  1. <!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 -->  
  2. <connector port="8080" maxthreads="150" minsparethreads="25" maxsparethreads="75" enablelookups="false" redirectport="8443" acceptcount="100" debug="0" connectiontimeout="20000" disableuploadtimeout="true">  
  3. <!-- Note : To disable connection timeouts, set connectionTimeout value to 0 -->  
  4. </connector>  
Or
  1. <connector port="8080" protocol="HTTP/1.1" connectiontimeout="20000" redirectport="8443">  
  2. </connector>  

(You can find something similar to the above snippet in server.xml.  It varies according to tomcat version)
change Connector port="8080" to Connector port="8081" or some other port number. Make sure that the port number in not used by some other application.

Thursday, October 18, 2012

DotNet IDE Visual Studio Shortcut keys



1. Manage Visual Studio 
Ctrl+sSave current file
Ctrl+Shift+sSave all files
Ctrl+Shift+nCreate new project
Ctrl+oOpen file
Ctrl+Shift+oOpen project
Ctrl+Shift+aAdd item to project
EscClose menu or dialog
Ctrl+pPrint
Shift+Alt+EnterToggle full screen mode
Ctrl+f4Close current tab
Ctrl+f6/Ctrl+Shift+f6Go to next / go to previous window
Ctrl+Tab, thenArrow keysPress and hold Ctrl+Tab, then using arrow keysgives a small task manager with all open files and views
2. Bookmarks
For keystrokes with two keys such as Ctrl+k+k, keep holding the Ctrl key until releasing the last key.
Ctrl+k+kToogle bookmark
Ctrl+k+nGoto next bookmark
Ctrl+k+pGoto previous bookmark
Ctrl+Shift+k+nGoto next bookmark in folder
Ctrl+Shift+k+pGoto previous bookmark in folder
Ctrl+k+wPut focus on bookmark window
EscLeave bookmark window and focus on editor
Ctrl+k+hToggle code shortcut at current line*
Ctrl + K + LClear all bookmarks
*if somebody figures out additional shortut keys on how to use code shortcuts, please edit this page and add.

3. Undo, Redo, Copy, Paste
Ctrl+x, Ctrl+x, Ctrl+vCut, copy, paste
Ctrl+Shift+vPastes an item from the Clipboard ring
Ctrl+zUndo
Ctrl+yRedo (or Shift+Alt+Backspace, or Ctrl+Shift+Z)
4.Select Text
Shift+Arrow KeysExtend selection one character/one line
Ctrl+Shift+End/Ctrl+Shift+HomeExtend selection to end / to beginning of document
Ctrl+Shift+]Extend selection to nexst brace
Shift+End/Shift+HomeExtend selection to end / to beginning of line
Shift+Page Down/Shift+Page UpExtends selection down one page / up one page
Ctrl+wSelect current word
EscCancel Selection
Ctrl+Shift+Page Down/Page UpMoves cursor and extend selection to the last line / first line in view.
Ctrl+Shift+Arrow right/arrow leftExtend selection one word to the right / one word to the left
Ctrl+aSelect All
5. Find, Replace, and Goto
Ctrl+fFind and replace dialog box
f3/Shift+f3Find next / find previous
Ctrl+hDisplay Replace options on the quick tab
Shift+f12Find all references for selected symbol
Ctrl+Shift+fFind in files
Alt+F3, sStop current find in files operation
Ctrl+F3/Ctrl+Shift+f3Find next / find previous in selected text
Alt+F12Find symbol
Ctrl+dPut cursor in find/command box of the toolbar. Usectrl+/ in Visual C#
Ctrl+i/Ctrl+Shift+iIncremental search / reverse incremental search
Shift+Alt+f12Quick find symbol
Ctrl+,Display Navigate-To dialog box
Ctrl+gGoto line number
Ctrl+]Go to matching brace in source file
6. Tool Windows
Ctrl+/Put cursor in the find/command box in toolbar
Ctrl+k+bOpen code snippet manager window
Alt+f11Open macro IDE window
Ctrl+k+wOpen bookmark window
Ctrl+Alt+kOpen call hierarchy window
Ctrl+Shift+cOpen class view window
Ctrl+Alt+aOpen Command window
Ctrl+Shift+oOpen Output window
Ctrl+Shift+eOpen Resource view window
Ctrl+Shift+sOpen Server explorer window
Ctrl+Shift+lOpen Solution explorer window
Shift+EscClose Find & Replace Window
7. Build and Debug
f7Build solution (or Ctrl+shift+b)
Ctrl+Alt+f7Rebuild solution
Ctrl+breakCancel build process
Ctrl+\+eShow error list
f9Toggle breakpoint
Ctrl+bInsert new function breakpoint
f5Start debugging
f11Debug / step into
f10Debug / step over
Shift+f11Debug / step out
Ctrl+f10Debug / run to cursor
Ctrl+Alt+qShow Quickwatch window
Ctrl+Shift+f10Set current statement to be the next executed
Alt+* (on numeric keyboard)Show nexst statement
Ctrl+Alt+eShow Exception dialog box
Ctrl+f11Toggle between disassembly and user code view
Shift+f5Stop Debugging
Ctrl+f5Bypass debugger
Ctrl+Alt+pShow attach to process window
Ctrl+Alt+breakBreak all executing threads

Sunday, October 14, 2012

Download Ebooks From Google Books For Free


Although I’m not a book worm, it’s always my dream to download all latest technology books and keep them in my catalog. I can’t buy all of the books so I prefer having free ebooks rather than having to pay for them. Google Books is one place where I can find most of the books I’m looking for and I can atleast read some of the book’s contents without paying. But I want the book to be offline so that I may be able to read the books when I’m offline.
Today I found Google Book Downloader which is a solution to my problem. Google BooksDownloader is a free software which downloads full ebooks from Google Books and save them to your local system as a PDF file which can later be opened with your PDF reader.
It’s basic usage is as follows:
  • Run application.
  • Go to Google Books and find the book you want to download.
  • Find the code of the book (in the URL)
    Example: This is the URL of Windows Vista for Dummies. You can find the book code highlighted in the URL:
    http://books.google.com/books?id=UeyMCeXM8BIC&printsec=frontcover&dq=vista
  • Paste the book code of the book you want to download in Google Book Downloader.
  • Press “Check” button. Book will be checked and all available pages will be retrieved.
  • Press “Download entire book” button. All available pages will be downloaded. It can take a while.
  • Press “Save entire book as…” button. All downloaded pages will be saved. It can take a while.
Homepage:
http://www.codeplex.com/GoogleBookDownloader
Download:
http://www.codeplex.com/GoogleBookDownloader

Download Android Apps (.APK Files) from Google Play on PC


Android Market (Now, Google Play) has plenty of Applications both Paid and Free which add Fun and Simplicity to your Android experience. However, downloading Applications on Phone can be a real trouble, specially if you have a slow data connection.
There is no way provided by Google to download applications on the Computer. But, a simple trick can do the Job. You’ll be able to download Apps. from Google Play directly to your computer and then transfer to your phone. Just follow the following steps to do the job:
You need Chrome browser to do the trick. If you don’t already have it, download and install it from here.
  1. Open Chrome browser and install the APK Downloader Extension (Latest stable version is 1.2.1 which supports the new Google Play).
  2. Right click on the Google Chrome icon on your desktop and Choose Properties.
  3. Choose Shortcuts tab and add  --ignore-certificate-errors --allow-running-insecure-content at the end  of Target box and click OK/Apply. Note that you need to leave a space after chrome.exe(See Fig. Below)
    Chrome ignore certificate errors
  4. Close Chrome and Restart using the shortcut at the desktop.
  5. Open the Extension’s options page and fill up all the details. You will need the Device ID app. to find your Android device ID.
  6. Now, go to Google Play and further to the Application page of the App. you want to Download.
  7. Click the APK icon in your Address Bar to start downloading the application to your PC (See Fig. Below).
    Android APK download PC
Please note that you can only download Free Apps using the Extension. It won’t show the download link for Paid Apps. You can find more info on how to use the Extension at the APK Downloader Extension’sOfficial Post.


Note: Please try at Your own risk i am not responsible to any problems