Thursday, March 10, 2011

Android sdk installation jdk not found error

When there’s a pop up say JDK not found please download and install. First do what it says, than if still same error exists Just press ‘back’ button and then press again ‘next’ button. And you can pass the validation!

Tuesday, December 14, 2010

SLF4J - The Simple Logging Facade for Java

SL4J allows us to use the desired logger mechanism at deployment time. SL4J supports

-Log4j
-java.util.logging
-NOP
-Simple
-JCL

If you want to change the way you log, just change the bridging .jar file and restart the application.

http://www.slf4j.org/index.html

Sunday, August 1, 2010

Ubuntu root password change


~sudo passwd root
~enter your login username password
~Enter your new UNIX Password
~su root
~Enter your new UNIX Password

that is it

Thursday, December 17, 2009

Search a date range using a date range in sql

select count(*) from tablename where (@startDate between startDate and endDate )

or (@endDate between startDate and endDate)

or (@startDate <> endDate )


If this sql returns greater than 0, that means there exists a conflict with your date interval and the db working set.

Saturday, November 14, 2009

Google Go is coming fast :)

Go is …

… simple

package main

import "fmt"

func main() {
fmt.Printf("Hello, 世界\n")
}

… fast

Go compilers produce fast code fast. Typical builds take a fraction of a second yet the resulting programs run nearly as quickly as comparable C or C++ code.

… safe

Go is type safe and memory safe. Go has pointers but no pointer arithmetic. For random access, use slices, which know their limits.

… concurrent

Go promotes writing systems and servers as sets of lightweight communicating processes, called goroutines, with strong support from the language. Run thousands of goroutines if you want—and say good-bye to stack overflows.

… fun

Go has fast builds, clean syntax, garbage collection, methods for any type, and run-time reflection. It feels like a dynamic language but has the speed and safety of a static language. It's a joy to use.

… open source

Go for it.

Thursday, June 18, 2009

Searching a string in another string

 String string = "Madam, I am Adam";

// Starts with
boolean b = string.startsWith("Mad"); // true

// Ends with
b = string.endsWith("dam"); // true

// Anywhere
b = string.indexOf("I am") > 0; // true

// To ignore case, regular expressions must be used

// Starts with
b = string.matches("(?i)mad.*");

// Ends with
b = string.matches("(?i).*adam");

// Anywhere
b = string.matches("(?i).*i am.*");

Thursday, May 28, 2009

Inversion of Control

IOC is a kind of design principle; stands for abstraction of implementations from user. For example there exists a number of implementations of Interface pizzaDelivery().
One of them makes pizza in 20 minutes and the other makes in 50 minutes but both of them makes pizza. We call the interface and never think about the implementation and wait for the process to be completed, may be an example of IOC principle. By using this, we develop our codes by not caring about other peoples code or implementation. And by this we can focus on our active work, and build up a layered architecture.