24 setembro 2013

Web Article - Connect SQLite Database with a Remote Shell

In this article see:
  • How to connect to a sqlite database existing on Android devices from your PC?
  • How to interact with Android sqlite database from remote shell?

Full article in HMKCode

21 setembro 2013

Web Article - Questions about Java Strings

1. How to compare strings? Use “==” or use equals()?

2. Why is char[] preferred over String for security sensitive information?

3. Can we use string for switch statement?
// java 7 only!
switch (str.toLowerCase()) {
      case "a":
           value = 1;
           break;
      case "b":
           value = 2;
           break;
}

4. How to convert string to int?
int n = Integer.parseInt("10");

5. How to split a string with white space characters?
String[] strArray = aString.split("\\s+");

6. Does substring() method create a new string?
str.substring(m, n) + ""

7. String vs StringBuilder vs StringBuffer 

8. How to repeat a string?
String str = "abcd";
String repeated = StringUtils.repeat(str,3);
//abcdabcdabcd

9. How to convert string to date?
String str = "Sep 17, 2013";
Date date = new SimpleDateFormat("MMMM d, yy", Locale.ENGLISH).parse(str);
System.out.println(date);
//Tue Sep 17 00:00:00 EDT 2013

10. How to count # of occurrences of a character in a string?
int n = StringUtils.countMatches("11112222", "1");
System.out.println(n);

A method to detect if string contains only uppercase letter in Java
public static boolean testAllUpperCase(String str){
  for(int i=0; i < str.length(); i++){
   char c = str.charAt(i);
   if(c >= 97 && c <= 122) {
    return false;
   }
  }
  //str.charAt(index)
  return true;
 }
Source: http://www.programcreek.com/

20 setembro 2013

Web Article - OmniFaces goes CDI





"Finally, OmniFaces 1.6 has been released! With this release, OmniFaces features for the first time CDI-related features:


Full article in The Balusc Code

13 setembro 2013

Web Article - Build offline with maven


"Sometimes I work at home and sometimes I’ve no VPN connection to my company. Sometimes I sit in a hotel without any internet connection. But I want to compile my projects with maven."

Full article here.

12 setembro 2013

Web Article - Some Interview Questions to Hire a Java EE Developer

"Some examples of interview questions that check the knowledge of the candidate based on his/her experience. The questions were formulated to verify whether the candidate is capable of fulfilling the role of a Java enterprise applications developer." 


Questions:
1. Can you give some examples of improvements in the Java EE5/6 specification in comparison to the J2EE specification?
2. Considering two enterprise systems developed in different platforms, which good options do you propose to exchange data between them?
3. What do you suggest to implement asynchronous code in Java EE?
4. Can you illustrate the use of Stateless Session Bean, Stateful Session Bean and Singleton Session Bean?
5. What is the difference between queue and topic in a message queuing system?
6. Which strategies do you consider to import and export XML content?
7. Can you list some differences between a relational model and an object model?
8. What is the difference between XML Schema, XSLT, WSDL and SOAP?
9. How would you configure an environment to maximize productivity of a development team?

Full article here.

11 setembro 2013

Revista Programar - 42ª Edição - Setembro 2013



Nesta edição como artigo de capa, um artigo sobre Web Persistente: Local Storage de Telmo Marques. Nesta 42ª edição pode ainda encontrar os seguintes artigos:
  • Debug de Aplicações em C (António Pedro Cunha)
  • Arduino: Accionamento e Controlo de Servos Via Teclado (Nuno Santos)
  • Introdução ao Web2py (António Santos)
  • Listas Simplesmente Ligadas e Exemplo de Implementação em C (Cristiano Ramos)
  • Pascal - Tipos de Dados Variant e Tipos Genéricos (Igor Nunes)
  • Visual(not)Basic - Eventos e handlers (Sérgio Ribeiro)
  • Windows Server 2012 - Curso Completo (Nelson Belo Lima)
  • Redes de Computadores - Curso Completo (António Santos)
  • Implementando publicidade usando Nokia NAX em aplicações Windows Phone (Sara Silva)
  • Navicat Premium 11 (Nelson Belo Lima)
  • Dispositivo Android: Ser ou Ser reconhecido pela Google (Rita Peres)

08 setembro 2013

Web Article - How Maven find dependency JARs while building Java Project

"One of the most attractive feature of Apache Maven framework it to manage dependency JARs, but do you know, How Maven finds dependency JAR while building Java project?"

Read more here