Eclipse (Juno) is not initializing suddenly!


My Eclipse (Juno) was working fine till yesterday, it’s not initializing today. It doesn’t even showing any error message! Splash screen coming and GONE!

Solution:

Step 1: Delete YOUR_WORKSPACE\.metadata\.plugins\org.eclipse.core.resources\.snap

If your problem is not solved yet

STEP 2: DELETE
YOUR_WORKSPACE\.metadata\.plugins\org.eclipse.e4.workbench\workbench.xmi

You are DONE!

Eclipse Debugging


JAVA Debugging in Eclips

JAVA Debugging in Eclips

This article describes how to debug a Java application in Eclipse.

This article is based on Eclipse 4.2 (Eclipse Juno).


1.1. What is debugging?

Debugging allows you to run the program interactively and to watch the source code and the variables during this execution. Continue reading

Hints for writing secure code


Secure Coding

Secure Coding

Security and data protection are becoming now more and more popular topics. We are coming into the world where too much information is transfered/used/processed by computer systems and any leak of that information can cause a big trouble. Thus, it is very important for application to protect customer information as much as it can and do not allow it to spread out.There are many aspects of application security and these cover processes, architecture, infrastructure, code, etc. The whole topic is extremely big and versatile and there are some books written to cover all its possible verges. I will touch just a small piece which is related to something which is in area of developer’s responsibility – code and application architecture. Also, I assume that that reader mostly works on web applications implemented on Java or similar platform.

I disagree that creation of secure code is hard work; I would say it’s just a question of some knowledge and discipline. Here are several guidelines which developer has to follow to cover the most of application security vulnerabilities. Of course list is not complete and mostly covers just protection of customer’s data. Continue reading

Insert line breaks into a long string to fit a length : Minimizing the risk of cutting a word unexpectedly


import java.util.Calendar;
import java.util.Date;
 
 
public class test {
  public static void main(String[] argv) {
	  String s = "Here, startIndex specifies the beginning index, and endIndex specifies the stopping point. The string returned contains all the characters from the beginning index, up to, but not including, the ending index. The following program uses substring( ) to replace all instances of one substring with another within a string:";// used to insert any string or character at the specified position in the given string."; 	  
      int charsPerLine = 10;
      System.out.println(insertLinebreaks(s, charsPerLine));	     
  }
  
  public static String insertLinebreaks(String s, int charsPerLine){	  
      String[] tokens = s.split(" ");
      String temp="";
      String retS = "";
      int maxRightPadding = 5; // Increasing the value'll minimize the risk of cutting a word unexpectedly, but woun't give good performance to break continuous string(without space/br). 
	  
      for (int i=0; i charsPerLine){
	      if((charsPerLine - temp.length()) <= maxRightPadding){
		  retS = retS+temp+ "\n";				  
		  for(int o=0; o<= (tokens[i].length()/charsPerLine); o++){
		      if(o< tokens[i].length()/charsPerLine){						  
			  retS = retS + tokens[i].substring((o*charsPerLine), ((o*charsPerLine) + charsPerLine))+"\n";
		      }
						  
		      if(o == tokens[i].length()/charsPerLine){						  
			  temp = tokens[i].substring(o*charsPerLine);							  						 				 
		      }						  
		  }
	     }else{
		  retS = retS+temp+ "\n";
		  temp = tokens[i];				  				 
	     }
	 }else{
	     if((temp.length() + tokens[i].length()) <= charsPerLine){				  
		 temp = temp+" "+tokens[i];				 
	     }
	     else{				 
		 retS = retS+ temp + "\n";				 
		 temp = tokens[i];
	     }
         }		  		 		  
     }
     retS = retS +temp+ "\n";
     return retS;	  
  }  
}

Introduction to Spring Web MVC


This document shows you how to construct a simple web MVC application using the Spring Framework. The application enables a user to enter her name in a text field, and upon clicking OK, the name is returned and displayed on a second page with a welcome greeting.

The Spring Framework is a popular open source application framework that can make Java EE development easier. It consists of a container, a framework for managing components, and a set of snap-in services for web user interfaces, transactions, and persistence. A part of the Spring Framework is Spring Web MVC, an extensible MVC framework for creating web applications. Continue reading

RMI নির্ভেজাল উদাহরণ


RMI হচ্ছে সোজা কথায় আলাদা JVM -এর মাঝে অবজেক্ট ফাংশন কল করার জন্য একটা উপায়। এক মেশিনে হয়ত একটা JVM আছে RMI use করে আমরা আলাদা কোনো মেশিনে থাকা JVM-এর কোনো অবজেক্ট-এর ফাংশন কল করতে পারি।
This is a powerful feature!
আমার কাছে খুব বেশি কাজের মনে হয়নি, কারন হিসেবে বলতে পারি আমি এর ব্যবহার নিয়ে খুব বেশি পড়াশোনা করিনি। হয়ত সত্যিই This is a powerful feature! তবে ব্যপারটা খুব-ই interesting and exiting, এবং মজারও বটে।
তো বঝাই জাচ্ছে RMI নিয়ে আমার জ্ঞন খুবিই সামান্য। তাই আমি এর theory নিয়ে এর চেয়ে বেশি বলছিনা। তবে introductory এখানে দেখা যেতে পারেwww.javacoffeebreak.com
আজ আমি RMI -এর implementation নিয়ে লিখব। কেননা google করে আমার পাওয়া সব help ছিল command দিয়ে এটা সেটা করে এগুনো…
আমরা যারা একটু অলস/NetBeans dependent তাদের জন্য usefull কোনো help খুজে পাইনি।
মূল technology আমার দেয়া উপরের link -থেকে দেখে নেয়া যেতে পারে আমি একটা example code নিচে দিয়ে দিলাম।

Continue reading