tag:blogger.com,1999:blog-37002387372811727852024-02-08T03:22:23.853-08:00Technical JournalAll about Genaral Technical information, Code Samples, Process, Languages etcSubrahmanyamhttp://www.blogger.com/profile/10897771386112799417noreply@blogger.comBlogger21125tag:blogger.com,1999:blog-3700238737281172785.post-80619928728489875132011-06-01T11:55:00.001-07:002011-06-01T12:09:16.897-07:00How to create user defined javascript objectAs all the computer languages are moving towards the Object Oriented approach. Javascript is also having one of the most powerful feature of creating objects in javascript. I came across many developers who say javascript is just about the validation, but in my view , this is one the main component of developing web based application. I am not sure why this language is termed as validation Subrahmanyamhttp://www.blogger.com/profile/10897771386112799417noreply@blogger.com0tag:blogger.com,1999:blog-3700238737281172785.post-5205677530019873932009-10-06T12:33:00.001-07:002009-10-09T12:48:26.555-07:00What is HTML ?The full name of HTML is Hyper Text Markup Language, majorly used in static developing Web Pages. Static web pages means pages where the content of the page is fixed means any article, definition etc, In other words, non-interactive data. This HTML code is merged with some other client side scripting such as php,  javascript, vb script etc and generated dynamic content to web pages. Sample Subrahmanyamhttp://www.blogger.com/profile/10897771386112799417noreply@blogger.com0tag:blogger.com,1999:blog-3700238737281172785.post-15267141153045867042009-03-08T06:04:00.000-07:002009-03-08T06:23:51.679-07:00Java example to list all the items from the Folder/LocationAs i always believe, Java is very powerfull language, providing us many different ways to use a specific task, here is one of the ways to list all the files or folders within the Folder location through the java program.FolderFileList.java--------------------/* File : FolderFileList.java Purpose: Dumps all the Files and Folders from the location providedAuthor : Anaparthi SubrahmanyamPublished: Subrahmanyamhttp://www.blogger.com/profile/10897771386112799417noreply@blogger.com0tag:blogger.com,1999:blog-3700238737281172785.post-14974941084890109452009-02-16T06:55:00.000-08:002009-02-16T07:05:27.400-08:00How to verify, input location is a File or Directory in JavaJava provides a Class called File, which is under the package java.io , contains all the sufficient methods(functions), which can be used to extract almost all the important properties of the Directory or a File. In the below example LocationVerification.java as well, i have used java.io.File class to know whether the input provided by the user is a File or Folder i.e. Subrahmanyamhttp://www.blogger.com/profile/10897771386112799417noreply@blogger.com0tag:blogger.com,1999:blog-3700238737281172785.post-75520065572840787332009-02-15T05:55:00.000-08:002009-02-15T06:10:47.435-08:00How to pass file as input in java program and parsing it.There are different ways we can pass the file path as a parameter to a java file and can be parsed. One of the very good class provided by Sun is java.util.Scanner class. This class provides sufficient methods to accpet file as an input parameter and also provides methods to parse it.Here I am demonstrating you two different ways of passing file to a java program as well as parsing it.# Subrahmanyamhttp://www.blogger.com/profile/10897771386112799417noreply@blogger.com0tag:blogger.com,1999:blog-3700238737281172785.post-75166234668441155152009-01-12T23:17:00.001-08:002009-01-13T06:08:39.183-08:00How to accept inputs from user while running java programThere are different waysm through which we can pass input value while java program is running.In the below example, i have used java.util.Scanner class for the same.One of the main reason for using Scanner class is, it actually allows user to pass primitive data types such as integers etc.Here you dont have to pass the argument while call the java class file, here user will be asked to enter Subrahmanyamhttp://www.blogger.com/profile/10897771386112799417noreply@blogger.com0tag:blogger.com,1999:blog-3700238737281172785.post-35759403655386438202009-01-04T21:14:00.000-08:002009-01-08T21:19:50.416-08:00Tips for String comparison in JavaWhenever we compare two strings objects in java, we normally consider both string arguments with qual importance and ignorance.I like to suggest one tip here which may be helpful for you in avoiding to generate a silly error, which looks terrible :)I have two String objects as Str1 and Str2Now i will compare two strings mentioned above for comparison, both may contain same value or may be having Subrahmanyamhttp://www.blogger.com/profile/10897771386112799417noreply@blogger.com0tag:blogger.com,1999:blog-3700238737281172785.post-87578443692994215842008-12-27T06:25:00.000-08:002008-12-27T07:01:17.091-08:00how to create user defined Objects in JavascriptI am really a fan of javascript as it is quite easy as well as complex. Here is the example of how to create objects in javascript i.e. User defined objects which is very usefull in handling large amount of data from the inout forms controls quite nicely.Subrahmanyamhttp://www.blogger.com/profile/10897771386112799417noreply@blogger.com0tag:blogger.com,1999:blog-3700238737281172785.post-42346235484803748422008-12-27T02:59:00.000-08:002009-01-08T05:41:20.399-08:00How to retrieve System Properties in JavaHere is the example of retrieving the System Properties through Java Code. In this program I have retrieved and displayed few System Properties.The primary method which actually retrieves the property is System.getProperty(), and it takes key info as a parameter.For details of all the System Properties and how it can be retrieved, you can visit my earlier post about How to retrieve System Subrahmanyamhttp://www.blogger.com/profile/10897771386112799417noreply@blogger.com0tag:blogger.com,1999:blog-3700238737281172785.post-15544287349921180982008-12-27T00:03:00.000-08:002008-12-27T02:37:29.851-08:00How do I retrieve the System Properties on Windows Machine using JavaThere are different ways to get the System properties of a System or Machine using Java Program. The following code first create a file called SystemProperties.xml and then retrieves all the System Property using Java's own function called getProperties() of Properties class and finally dumps it to the the created XML File.SystemProperties.java--------------------------------------------import Subrahmanyamhttp://www.blogger.com/profile/10897771386112799417noreply@blogger.com0tag:blogger.com,1999:blog-3700238737281172785.post-79305660280730359242008-12-26T02:19:00.001-08:002008-12-26T02:22:11.927-08:00Details about installing java on different Operating Systems Sun Microsystems has provided a very nice page providing all the details about steps and links for How to Install Java and also provided links of different JDK’s for various operating systems. Here is the Link : http://www.java.com/en/download/manual.jsp Subrahmanyamhttp://www.blogger.com/profile/10897771386112799417noreply@blogger.com0tag:blogger.com,1999:blog-3700238737281172785.post-65821691033933720082008-12-26T00:51:00.000-08:002008-12-26T01:02:23.205-08:00How do i verify whether an URL is active or not through JavaThere are different ways in java through which we can verify whether any specific URL is active or not.Here is the Java Program which displays success message if the URL is active and Failed message if URL is not active/dead.URLVerification ----------------import java.net.*;import java.io.*;public class URLVerification { public static void main(String[] args) throws Exception { URL Subrahmanyamhttp://www.blogger.com/profile/10897771386112799417noreply@blogger.com0tag:blogger.com,1999:blog-3700238737281172785.post-87973620668879283022008-12-25T20:27:00.000-08:002008-12-25T20:39:04.138-08:00How do I pass numeric value as command line argument to JavaHere is the example to pass numeric value as a command line argument is Java Class.CommandLineNumExample.java---------------------------------public class CommandLineNumExample{ public static void main(String[] args) { int i = Integer.parseInt(args[0]); double d = Double.parseDouble(args[0]); // multiplying the value of i i.e command line argument with 2 System.out.println("The Subrahmanyamhttp://www.blogger.com/profile/10897771386112799417noreply@blogger.com3tag:blogger.com,1999:blog-3700238737281172785.post-69866463428830653182008-12-25T19:37:00.000-08:002008-12-25T20:22:09.266-08:00How do i pass command line arguments in JavaHere is the example of how to pass command line arguments to a java file.In the below example, one argument will be passed with the java command, and later within the the progrm it is retrieved as a String. Few other details, whenever we execute a java command, the main method is called, and in the below example you can see a main method defined and accepts array of String as parameters.This Subrahmanyamhttp://www.blogger.com/profile/10897771386112799417noreply@blogger.com0tag:blogger.com,1999:blog-3700238737281172785.post-4788235740442839082008-12-24T05:54:00.001-08:002008-12-24T06:06:47.960-08:00How to do I sum and print two numbers in Java ProgramHere is the sample program , which will print two number sum in different ways:public class SumNumbers{ /* Create a java file as SumNumbers.java Save this code in it. */ public static void main(String[] args) { /* defining two variables. 1. int x 2. int y Variable x and y are prefixed by keyword called int. 'int' means integer datatype can contain any integer Subrahmanyamhttp://www.blogger.com/profile/10897771386112799417noreply@blogger.com0tag:blogger.com,1999:blog-3700238737281172785.post-63397007519812128932008-12-23T10:19:00.000-08:002008-12-23T20:23:32.736-08:00Storing java command output to text file.Its quite simple to store Java command output of the console window of MS Windows i.e command prompt to store in a text file. The need for this is when we have huge text as an output on executing a java program, sometimes we face problem in searching specific text.The command is:commandprompt>java GenerateLog >> UserFile.txthere in the above example, java GenerateLog is the command to execute Subrahmanyamhttp://www.blogger.com/profile/10897771386112799417noreply@blogger.com0tag:blogger.com,1999:blog-3700238737281172785.post-31056615568794335252008-12-23T06:33:00.000-08:002009-01-06T06:15:15.685-08:00How do I configure User tools in editplus to compile and run java fileI would like to demonstrate how easy it is to configure java environment in editplus.1.Open your installed editplus editor2.Go to Menu -> Tools -> Configure User Tools3. A Preferrences titled window will be opened on your desktop.4.Find Add Tools button under the section Groups and tools item: section on the right side of the window.5. Click the button Add Tools -> Program6. It will create an Subrahmanyamhttp://www.blogger.com/profile/10897771386112799417noreply@blogger.com8tag:blogger.com,1999:blog-3700238737281172785.post-47868943599113911782008-12-23T06:06:00.000-08:002008-12-23T20:17:27.680-08:00First Java Program ExampleHello All,The Java prorgam looks like as follows:HelloWorld.java-----------------public class HelloWorld{ public static void main(String [] args) { System.out.println(" Hi. to all"); }}--------------------Things to note:1. Java file name must be same as the class name (in above example its HelloWorld) which is defined as public and having main method. This is in case of a stand alone program Subrahmanyamhttp://www.blogger.com/profile/10897771386112799417noreply@blogger.com0tag:blogger.com,1999:blog-3700238737281172785.post-66045785244234607522008-12-18T19:54:00.001-08:002008-12-18T21:35:39.728-08:00Example to setup first JMX MBean in WebSphere Application ServerI struggled very hard to land on this page. I am using WAS 6.1, and on the net, its quite difficult to get documentation on 6.1, But on WAS 5.1 , good amount of documentation is available. One of the documentation from WAS 5.1 I used to setup JMX MBeanServer as well configuring MBean on WAS 6.1, and i was able to do it successfull.Sharing with you all for your help, the link which provides Subrahmanyamhttp://www.blogger.com/profile/10897771386112799417noreply@blogger.com0tag:blogger.com,1999:blog-3700238737281172785.post-25139827282888927492008-12-18T09:29:00.000-08:002008-12-23T20:14:54.823-08:00How to set Java Path to run Java ProgramPlease read my earlier post about How to install Java before setting the Java Path to compile java file.Once you are done with Java Installation,Right click on the My Computer Icon of your desktop or if you dont have My Computer icon on your desktop then right click on the My Computer in File Explorer.-> Select the Properties Item-> Select the Advanced Tab-> Click Envirnment Variables Button-> Subrahmanyamhttp://www.blogger.com/profile/10897771386112799417noreply@blogger.com0tag:blogger.com,1999:blog-3700238737281172785.post-11426639546235310582008-12-18T09:23:00.000-08:002008-12-19T06:18:14.729-08:00How to install Java on my machineBefore running any Java program you need to have the Java installed on your machine. Normally beginners gets confused with different terminologies used in Java such as jdk,j2se,jre,jvm etc..JDK - Java Development Kit/ J2SE( Java 2 Standard Edition) JRE - Java Runtime EnvrionmentJVM - Java Virtual MachineAll the above three are different , but if you install JDK, you will get JRE and JVM, if you Subrahmanyamhttp://www.blogger.com/profile/10897771386112799417noreply@blogger.com0