Java

Java is a set of computer software and specifications developed by Sun Microsystems, which was later acquired by the Oracle Corporation, that provides a system for developing application software and deploying it in a cross-platform computing environment. Java is used in a wide variety of computing platforms from embedded devices and mobile phones to enterprise servers and supercomputers.

Spring Logo

Spring Framework

The Spring Framework provides a comprehensive programming and configuration model for modern Java-based enterprise applications - on any kind of deployment platform. A key element of Spring is infrastructural support at the application level: Spring focuses on the "plumbing" of enterprise applications so that teams can focus on application-level business logic, without unnecessary ties to specific deployment environments.

Hibernate Logo

Hibernate Framework

Hibernate ORM is an object-relational mapping framework for the Java language. It provides a framework for mapping an object-oriented domain model to a relational database.

Sunday, July 14, 2013

Write a Program to find the longest palindrome in a given String

Write a Program to find the longest palindrome in a given String

Program:
Output:
String: HYTBCABADEFGHABCDEDCBAGHTFYW12345678987654321ZWETYGDE
Longest Palindrome: 12345678987654321

Saturday, July 13, 2013

If given a 15 digit number whats the best way to find the next palindrome?

If given a 15 digit number what is the best way to find the next palindrome? for example what will be the next palindrome of: 134567329807541?

Algorithm:

Step1: Split the number into three parts, head, mid, tail

number = 134567329807541
count = no. of characters = 15
head = number.substring(0, count / 2) = number.substring(0,7) = 1345673
mid = number.substring((count / 2), (count / 2) + 1) = number.substring(7,8) = 2
tail = number.substring((count / 2) + 1) = number.substring(8) = 9807541

head   mid        tail
1345673     2                   9807541
Step2: Reverse head and compare it to tail 3765431
  • If reverse(head) <= tail ( if they are equal the initial input is a palindrome, and you want the next )
    • If mid < 9, increment mid
    • Else increment head part and set mid := 0
     
reverseHead = rev(head) = 3765431
if(reverseHead == tail) {
           if (m <= 9) {
                m++;
            } else {
                m = 0;
                h = h + 1;
            }
}

Step3: Result is head mid reverse(head). 
result = head + mid + rev(head)
           = 1345673+ 3 + reverseHead 
           = 134567333765431

Wednesday, July 10, 2013

Reset forgotten Linux Root Password

Reset forgotten Linux Root Password

Reset forgotten Linux Root Password
Reset forgotten Linux Root Password
Reset forgotten Linux Root Password

How to Setup DNS Server in Linux

 How to Setup DNS Server in Linux


Click Here

Saturday, July 6, 2013

Ten Technologies Every Java Developer Should Know

  1. At least one MVC Framework like JSF, Struts, or Spring MVC
  2. Hibernate or JPA
  3. Dependency Injection (as demonstrated in Spring or Java EE through @Resource)
  4. SOAP based Web Services (JAX-WS)
  5. Some build tool (Ant, Maven, etc.)
  6. JUnit (or other Unit Testing framework)
  7. Version control
  8. JSTL
  9. Application server/container configuration management and application deployment (whether it is WebSphere, Tomcat, JBoss, etc. you need to know where your application runs and how to improve its execution).
  10. AJAX