Tag Archives: programming tips

Eclipse - Best ide for java

best IDE (Integrated Development Environment) for Java

Java is one of the most popular programming languages mostly used in developing desktop applications, web applications and Enterprise/Complex business applications, probably due to it’s platform independency as .class files can be executed by JVM running on any operating system (GNU/Linux or Mac or Windows).

A lot of good open source frameworks (A framework is a set of libraries and programs/environment that allows developers to build real world applications very quickly in most efficient and productive way; Now a days,  MVC (Model View Controller) frameworks are very popular in web Apps development e.g struts, Play, Spring etc.) and IDE’s (Integrated Development Environment, e.g Eclipse, BlueJ, NetBeans, etc) are available for java programmers at $0 (free).

The problem is – a lot of options i.e if you are a beginner java programmer (Actually little more than a beginner because if you are an absolute beginner then better go with a simple source code editor like gedit or notepad++ or Emacs), then you may feel difficulty in selecting an IDE for coding. That’s why in this post I’ll explain about a free and open source IDE that I think is the best ide for Java programming. If you are not agree, then don’t forget to put your opinion here, through comment.

Best IDE for Java : Eclipse

Eclipse is one of the most popular IDE for java developers because it has a lot of sophisticated features with simple, cool and easy to use GUI(Graphical User Interface). Some people may not agree on the the point that ‘Eclipse is very simple to use’, they aren’t just wrong; the learning curve for the java programmers those who uses Eclipse is very steep in beginning but decreases continuously with time, although this trend is not not uncommon because Java itself follow this trend specifically if we use Java in web apps development (of course for server side processing because Java on client side (web browser), in the form of Applets has been a complete failure).

Eclipse - Best ide for java

Although eclipse has very flexible plugin architecture and it supports a lot of programming languages besides Java, such as C, C++, PHP, JavaScript etc, but it’s most popular as a Java IDE (and specifically optimized for JEE Applications) it’s platform independent (available for GNU/Linux, Windows and Mac).

Download Eclipse

There are some other IDE that you can try for Java e.g BlueJ (Interactive Java IDE specially built for students), Netbeans (another popular JAVA IDE, vs 7.0 released few weeks ago). You might feel more comfortable with any of these IDE’s because sometimes it depends on the type of project and sometimes it’s personal. Since it’s open source and free to use, I would recommend to try most of them.

Download BlueJ

Download NetBeans

string reverse in java

Java is one of the most popular programming language used today in developing real world applications (specifically in dynamic and sophisticated web Applications development). Java is strongly typed,object oriented, and multi-platform(even platform independent in general) programming languages. Learning curve with Java is very steep, in beginning ,but it’s very easy when you go ahead, so just relax and move on, solve some problems and write code, That’s the only way you can learn any programming language.

String is considered as an object data type in java. String is immutable (it means you can create and destroy strings but it’s content(characters) can’t can not be altered ) in Java. In this post you will learn, how to reverse a given string in Java. There are lot of ways to reverse a string in Java – the simplest and easy way is to use library methods/functions; but if you are a beginner then better try to do it in different ways because in that way you will learn more.

How to Reverse a String in Java without Using StringBuffer

Here is a program(save it as StringReverse.java and compiler=>execute) to get the reverse string – The code is very simple and comments are written, so no explanation is required,if you have any problem or question or you have any better solution then reply through comment.

import java.util.*;

public class StringReverse {
public static void main(String []args) {
//Get the string to be reversed
System.out.println("Enter the String to reverse");
Scanner scan=new Scanner(System.in);
String str=scan.nextLine();
// Test  System.out.println("The Given String was :"+str);
int stringLength = str.length();
// Test  System.out.println("The Length of the String is : "+stringLength);
char rawData[] =new char[50];
for(int k=0;k<50;k++)
rawData[k]=0;
// Using a for loop to iterate over the characters in string
for(int i=0,j=stringLength-1;i<stringLength;i++,j--) {
rawData[i]=str.charAt(j);
}
String reversedString=new String(rawData);
reversedString=reversedString.substring(0,stringLength);
System.out.println("The Reversed String is : "+reversedString);
//int sLength = reversedString.length();
//System.out.println("The Length of the String is : "+sLength);
}
}

If you are looking for the easiest method to reverse a string in Java, then use StringBuffer class and reverse() method, here is the code for that –

import java.util.*;
public class ReverseTheString {
public static void main(String []args) {
Scanner sc=new Scanner(System.in);
System.out.println("Enter the String");
String str=sc.nextLine();
str = new StringBuffer(str).reverse().toString();
System.out.println("Reversed String : "+str);
}
}
Eclipse IDE on Ubuntu 11.04

javascript editor for ubuntu

javascript programming ubuntu

Javascript is a client side scripting language,used in creating dynamic websites or web applications.If you are either an expert or a beginner javascript programmer && working on linux based operating system like Ubuntu,then surely you would like to have interactive IDE or Editor.This post will introduce you with an interactive IDE && an editor for javascript programmer.

Editor for Javascript

gedit,the default text editor for GNOME Desktop(The Default Desktop of Ubuntu) is a versatile editor,because it has syntax coloring support for all the commonly used programming languages,scripting language,..etc.That’s why gedit is your basic source editor for javascript,but if you want more advanced features then I would recommend to go with an javascript IDE(Interactive Development Environment).[see below if you want javascript IDE]

IDE for Javascript Programmers

Eclipse is recommended IDE for Javascript.Actually Eclipse is mostly known as a java IDE but it has different versions of IDE for different stuffs,and the functionality can be easily extended by means of plugins.Eclipse is open source and available FREE.So if you want to have fun with javascript,I strongly recommend to download and install dedicated version of Eclipse IDE for javascript web developers.
Download Eclipse IDE for javascript

first program in perl with ubuntu 10.04

Perl Programming on Ubuntu 10.04

first program in perl with ubuntu 10.04

Perl interpreter is actually installed from beginning on ubuntu 10.04(Lucid Lynx).So just start writing programs.If perl is not installed on ubuntu then go to synaptic package manager and search for perl;then install the latest version of perl.Perl is a script type programming language.Perl has very wide application in web development.Usually perl code use very less space and time in compare to other higher level programming languages like C.

Run.. First Perl program on Ubuntu 10.04

1. Open Gedit and write a small program given below to begin.

print “Welcome!\nEnter the two numbers… to add\n”;

print “First Number\t”;

$num1=<>;

chomp($num1);

print “Second Number\t”;

$num2=<>;

chomp($num2);

$sum=$num1+$num2;

print”sum of the two given numbers = $sum\n”;

2.Save it as sum.pl or any file name ending with .pl.
3.Open Ubuntu terminal CTRL+ALT+T or Applications->Accessories->Terminal.
4.Change the directory(Use cd command) to the destination of file(sum.pl).
5.Type the command ..in terminal
$ perl sum.pl
6.Then your program will be executed(if no error is present) and it will ask you to enter the two numbers and it will calculate the sum.
7.That’s All..If you find any problem ..then you may like to notify me through comment.

c and c++ programming in ubuntu 10.04

c and C plus plus programming on Ubuntu-linux

When it comes to programming(C/C++ or other ),Ubuntu 10.04 or any distribution of Linux is far better than Windows NT based Operating system(windows XP or Vista or 7).In general people uses TurboC++ on windows but in Ubuntu 10.04 advanced and much efficient compiler are available for compiling C or C++ programs.Some people or students think that programing in Linux is very tough(Actually they feel scary due to the shell Commands) but I assure you that it is nothing but a misconception.But now,I think the misconceptions are decreasing and they are becoming familiar with Ubuntu/linux environment.

Text Editor in Ubuntu 10.04
Since Ubuntu 10.04 uses GNOME as their default desktop so there is no need to worry about text editor because Gedit text editor is installed by default.It has many advanced features like Syntax coloring so it is well suited for programming.Another KDE based version is also available Kwrite,similar to gedit with lot of features.

C Compiler for Ubuntu 10.04

For C program there is a modern compiler GCC(GNU Compiler Collection) which you can use to compile C programs.To install gcc type following command at command line.(It may be installed already)
sudo apt-get install gcc

Compiling C program in Ubuntu 10.04
user1004@user1004-desktop:~/Desktop$ gcc abc.c
user1004@user1004-desktop:~/Desktop$ ./a.out

*********Hello! Mr.X it’s working Enjoy!!******
user1004@user1004-desktop:~/Desktop$

C++ Compiler for Ubuntu
For C++ programs you can use G++ compiler an advanced compiler with lot of features.To install G++ type following command at command line.
sudo apt-get install g++

Compiling C++ program in Ubuntu 10.04
user1004@user1004-desktop:~/Desktop$ g++ decbin2.cpp
user1004@user1004-desktop:~/Desktop$ ./a.out

Enter the decimal number to be converted
23
The Equivalent binary number is     010111
user1004@user1004-desktop:~/Desktop$

IDE(Integrated Developement Environment) for programming in C and C++
For programming in c++ these are the most widely used IDE’s

  • Kdevelop
  • Eclipse
  • Frama C
  • Anjuta

More details on available IDE on Ubuntu-Linux