Eclipse Ganymede J2EE plugins
Google AppEngine:
Google AppEngine - Eclipse Ganymede Installation
- Verify installation of Eclipse Ganymede IDE for J2EE development
- open Help -> Software Updates ...
- add new site http://dl.google.com/eclipse/plugin/3.4
Google project hosting
You can host your projects using code.google.com SVN repository.
- sign up to your google account
- go to http://code.google.com/hosting/
- click "Create a new project"
- go to "Source" Tab
- check out the code using command line SVN, or Eclipse SVN plugin (tigris)
- add your files (when you copy from previous SVN project remove all .SVN folders )
- commit
Java String parser
To split a String into words (tokens) where delimiter is white space...
String delims = "[ ]+";
String[] tokens = someLongString.split(delims);
Now you can look thru the tokens and do comparisons, etc.
CSS: centering DIV
<body><div class="background">The centered content is here
CSS background
background-image: url("images/map_bg.png");
background-repeat: no-repeat;
height: 900px;
width: 860px;
margin-left: auto;
margin-right: auto;
}
Using Composite Class
Interactive Map Implementation
Function To Censor String
public String censorString(String originalString)
{
StringBuffer orig = new StringBuffer(originalString);
Pattern p = Pattern.compile("[0-9/A-Z/a-z]+");
Matcher m = p.matcher(orig);
StringBuffer censor = new StringBuffer();
boolean result = m.find();
while (result)
{
String match = originalString.substring(m.start(), m.end());
if(match.equals("badword"))
m.appendReplacement(censor, "[censored]");
result = m.find();
}
m.appendTail(censor);
return censor.toString();
}
Adding maven and SVN plugin to Eclipse 2.4.2
GWT Client Side Date / Calculate Age
Date today = new Date();
Integer currentYear = new Integer(DateTimeFormat.getFormat("yyyy").format(today));
Integer currentMonth = new Integer(DateTimeFormat.getFormat("M").format(today));
Integer currentDay = new Integer(DateTimeFormat.getFormat("d").format(today));
Age calculating function:
public static int calculateAge(Date dob)
{
Date today = new Date();
Integer currentYear = new Integer(DateTimeFormat.getFormat("yyyy").format(today));
Integer currentMonth = new Integer(DateTimeFormat.getFormat("M").format(today));
Integer currentDay = new Integer(DateTimeFormat.getFormat("d").format(today));
Integer dobYear = new Integer(DateTimeFormat.getFormat("yyyy").format(dob));
Integer dobMonth = new Integer(DateTimeFormat.getFormat("M").format(dob));
Integer dobDay = new Integer(DateTimeFormat.getFormat("d").format(dob));
int age = currentYear - dobYear;
if((dobMonth > currentMonth) || (currentMonth == dobMonth && dobDay > currentDay))
age--;
return age;
}
GWT: using Timer as in Tread sleep()
My favorite quotations..
“A man should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.” by Robert A. Heinlein
"We are but habits and memories we chose to carry along." ~ Uki D. Lucas
Recommended pages
Popular Recent Articles
-
O'REILLY 201 0011 031 10110100180 000110111 01100041 001100010010000 5011011001010 1101110011 000100000 00000 10 1000012 Escaping the Bu...
-
I have noticed a very unsettling statistic on my blog. This prompted a fascinating question about AI, blogs' future, and maybe even the...
-
Installation of Java on Pi is easy, you can ssh to your Pi remotely and just execute: pi@raspberrypi ~ $ sudo apt-get update && su...
-
Epiphany is one of these interesting words that can mean so much. For me it means the crossroad where I chose the road less travelled. The r...
-
I progressively cut my hair shorter and shorter. Now, I just came back from the swimming pool with Lili, so it is a mess.
-
Done working with your Beagle? You don't want to to just yank on the cord, you can shutdown your BBB in couple ways: 1) press "powe...
-
In this tutorial we will discuss upgrading Maven on Mac OS X. While trying building with Maven I was getting errors related to version numbe...
-
Unix time date format is used in many applications, including Yahoo finance. using Dates, Printf unix_date = @sprintf("%.0f", Date...
-
Creating HTML anchor tab for email with subject: <a href="mailto:YourName@me.com?subject=Hi" >email link </a>