Using Square Retrofit REST Client with POJO

Another helpful resource when using Retrofit is JSON to POJO or JSON Schema 2 Pojo Tool.

In your maven pom.xml.

<version>(insert latest version)</version>

package com.agilemobiledeveloper.dataradiator.dao;
import retrofit.http.GET;
import retrofit.http.Path;
import retrofit.RestAdapter;
 * @author spannt
public class TestGitHub {
 static final String API_URL = "";
static class GithubUserData{
 String avatar_url;
 String bio;
 String blog;
 String company;
 String created_at;
 String email;
 String events_url;
 Number followers;
 String followers_url;
 Number following;
 String following_url;
 String gists_url;
 String gravatar_id;
 boolean hireable;
 String html_url;
 Number id;
 String location;
 String login;
 String name;
 String organizations_url;
 Number public_gists;
 Number public_repos;
 String received_events_url;
 String repos_url;
 String starred_url;
 String subscriptions_url;
 String type;
 String updated_at;
 String url;
interface GithubUser {
 GithubUserData user(@Path("username") String username);
 * @param args
 public static void main(String... args) {
 // Create a very simple REST adapter which points the GitHub API endpoint.
 RestAdapter restAdapter = new RestAdapter.Builder()

 // Create an instance of our GitHub API interface.
 GithubUser githubUser = restAdapter.create(GithubUser.class);
 GithubUserData userdata = githubUser.user("nxbdi");

 System.out.println("UserData=" + + "," + + "," + +
 userdata.location + "," + userdata.public_repos + "," + userdata.followers);

The library is really simple to use especially if you create your POJO class with the JSONGen.

Console Output:

UserData=Java, Android, NoSQL, SQL. 20 years experience. MS/BS in Com Sci.,,Tim SpannNew Jersey,205,22

15 Seconds to Selenide

package com.agilemobiledeveloper.dataradiator;
import static org.junit.Assert.*;
import org.junit.Test;
import static com.codeborne.selenide.Selenide.*;
import static com.codeborne.selenide.Condition.text;
import static;
import static com.codeborne.selenide.Selectors.byText;
import static com.codeborne.selenide.Selenide.$;
import static com.codeborne.selenide.Selenide.$$;
import com.codeborne.selenide.SelenideElement;
import org.junit.Test;
import org.openqa.selenium.By;
import static com.codeborne.selenide.Condition.*;
import static com.codeborne.selenide.Selectors.*;
import static com.codeborne.selenide.Selenide.*;
 * @author spannt
public class TestHome {
 public void userCanLoginByUsername() {

In Maven pom.xml


Links du Jour

Echo JS – JavaScript News – BUILD REAL WEATHER APP: JSON, HTTP AND OPENWEATHERMAP – Crossing platforms between iOS and Android with PhoneGap framework. Tutorial – ADB Command Basics and Setup Tutorial – Publishing Android App in Google Play. Things to know ahead!

Code inComplete – Home

Responsive Design Newsletter

The Daily Nerd ☆ Vasilis van Gemert

Status Code: A Weekly Programming Newsletter for Developers and Programmers

Mozilla Hacks Weekly Articles ✩ Mozilla Hacks – the Web developer blog

CSS Weekly — Weekly e-mail roundup of latest CSS articles, tutorials, tools and experiments

Open Web Platform Daily Digest

Smashing Magazine — For Professional Web Designers and Developers

Web Platform Blog | News on the Open Web Platform

Project Euler

aglover/gesticulate · GitHub

Javanotes 6.0, Section 9.2 — Linked Data Structures

Using web workers – Web developer guide | MDN

Quick Example of Searching Your Outlook PST File with Java

import com.pff.*;
import java.util.*;
public class Test {
 private java.sql.Date yesterday;
 public static void main(String[] args)
Test c = new Test("C:\Users\USERID\Documents\Outlook Files\MYEMAIL.pst");
 System.out.println("Mail Count:" + c.counter);
 System.out.println("Folder Count: " + c.foldercounter );
// mail counter
 public int counter = 0;
// folder counter
 public int foldercounter = 0;
 * Constructor for Test.
 * @param filename
 public Test(String filename) {
 try {
 // Get today as a Calendar
 Calendar today = Calendar.getInstance();
 // Subtract 1 day
 today.add(Calendar.DATE, -1);
 // Make an SQL Date out of that
 yesterday = new java.sql.Date(today.getTimeInMillis());
 PSTFile pstFile = new PSTFile(filename);
 } catch (Exception err) {
int depth = -1;
 public void processFolder(PSTFolder folder)
 throws PSTException,
// the root folder doesn't have a display name
 //if (depth > 0) {
 // System.out.println("Folder Name:" + folder.getDisplayName());
// go through the folders...
 if (folder.hasSubfolders()) {
 Vector<PSTFolder> childFolders = folder.getSubFolders();
 for (PSTFolder childFolder : childFolders) {
//System.out.println("Folder Count:" + folder.getContentCount());
// counter += folder.getContentCount();
// and now the emails for this folder
 if (folder.getContentCount() > 0) {
 PSTMessage email = (PSTMessage)folder.getNextChild();
 while (email != null && email.getSubject() !=null) {
 if (email.getSubject().toLowerCase().contains("MY SEARCH TERM") ) {
 System.out.println(folder.getDisplayName() + ":Email: "+email.getSubject());
// count todays
 if ( email.getCreationTime().after(yesterday) ) {
 email = (PSTMessage)folder.getNextChild();


Droid Development Links

It’s Hip 2 B Square

Cool Android Tools from Square

Android Testing


Small Square Tools


Event Bus


Square IntelliJ Plugins


Date from Calendar View for Android


HTTP and SPDY Client for Android


Dagger DI


Spoon Android Testing


Android Image Caching and Downloading


Android Shake Detection


Android Queues


REST Client for Android


Square OSS Community


Squash Notification Tool


Android Tips


Facebook SDK for Android


Sending Photos Easy


Growing Android Applications Guided by Tests – using Square Tools


Vert.x + Yoke (Polyglot Answer to Node.js + Express) + WebSockets on many clouds

Vert.x 2.0 Developing Vert.x with Maven · vert-x/vert.x Wiki

Yoke a middleware framework for Vert.x: Java-Tutorial

zznate/nodej · GitHub

Edge Framework –

Vert.x takes first step towards Eclipse Foundation

cloudfoundry-samples/vertx-vtoons · GitHub

The WebSocket API

Nodyn: Node.JS for the JVM

Vert.x Installation Guide

zznate/intravert-ug · GitHub

Netty: Home

Yoke a middleware framework for Vert.x: Benchmark

Vert.x 2.0 Developing Vert.x with Maven · vert-x/vert.x Wiki

Getting Started With vertx ( – an Alternative to node.js | Web Builder Zone

zznate/edge · GitHub

CloudBees-community/vertx-clickstack · GitHub


Vert.x – the Node.js for Java in the Cloud | OpenShift by Red Hat

Deploying vert.x Applications to Cloud Foundry | Blog

Fun with Scala and Vert.x | Javalobby

sockjs/sockjs-client · GitHub

Reactor pattern – Wikipedia, the free encyclopedia

Vert X Vs Node Js – Latest Technology News | ::

openshift-quickstart/vertx-openshift-quickstart · GitHub

purplefox/openshift-vertx · GitHub

Running a Java Vert.x app on Heroku

Using web workers – Web developer guide | MDN

Asynchronous concurrency with vert.x – part 1 | synyx – Blog

Asynchronous concurrency with vert.x – Part 2 | synyx – Blog

yoke/example/persona at master · pmlopes/yoke · GitHub

yoke/example/kitcms at master · pmlopes/yoke · GitHub



I love this IDE.  It connects to PAAS, easily and without effort.


In my example I easily create a Spring application and could run on their local server and easily deploy to AppFog.    It also works with CloudFoundry, CloudBees, Heroku and OpenShift.  All of which have free versions.

It works with Maven and is similiar to Eclipse.


codeenvy1 codeenvy2





Spring MVC + Modern HTML5

Tobacco tries it’s best to always include the latest release versions of most popular client libraries.

Latest Tobacco 1.0.12 charges you with Spring 3.2.2, Twitter Bootstrap 2.3.1, jQuery 1.9.1 and Backbone.js 1.0.0

Tobacco Maven Architype for building a project


Apache Zookeeper

Apache Zookeeper

replicated synchronization service with eventual consistency

associated with Hadoop

Bag of Links





Mustache for Java and Android,0


Agile Defacto




Top ALM Tools




Refactoring Legacy Applications


Cloud Computing / PAAS


HTML5 + WebSockets + java




HTML5 / CSS / JS / Mobile / Design




Java Patterns


Hibernate / Spring


Business Framework




IBM Heap

java -Xmx1100m -jar jca437.jar

open phd files

PHD format heapdumps

java -jar ga439.jar

java -Xmx1100m -jar jca437.jar

ha444.jar <- heap dump analysis

Note: 64-bit Java runtime environment is needed for processing heap dumps that require more than 4GB of memory

java -Xmx2560m -jar ha444.jar

Run with phd file and redirect output to a file:

java -Xmx1100m -classpath svcdump.jar > heapdump1.txt

java -Xmx1100m -classpath svcdump.jar > domtree.txt

java -Xmx1100m -classpath svcdump.jar domtree.txt


Cool Links of the Day – Build Your First Mobile App with PhoneGap Build

Nullzzz – FRP, Bacon.js and stuff: Bacon.js Tutorial Part I : Hacking With jQuery

raimohanska/bacon.js · GitHub – Synchronising Multithreaded Integration Tests revisited – Task.js Asynchronous Tasks In JavaScript

Understanding Java Garbage Collection and what you can do about it – YouTube – Algorithm of the Week: Shortest Path with Djikstra

MongoDB – Updating Records – CodeProject – Sencha Touch 2 Stores – Editing Model Instances and Reverting Changes – String Utility Classes in Java – 5 Talks To Learn More About Node.js – JPA/JPQL: Intermediate Queries with @NamedQuery – How RESTful Is Your REST?

Native Win32 ports of some GNU utilities

UnxUtils | Free software downloads at


SOAP / WS-Security / IBM / Metro / Apache CXF / Axis2

WS-Security Configuration


<con:entry type=”Username” username=”longcomplicateduser” password=”weirdRandomP@33w4rD!”>
<con:entry type=”Timestamp”>

<wsse:Security soap:mustUnderstand=”true” xmlns:wsse=”” xmlns:wsu=””><wsu:Timestamp wsu:Id=”TS-4″><wsu:Created>2013-05-01T19:52:45.639Z</wsu:Created><wsu:Expires>2013-05-01T19:53:45.639Z</wsu:Expires></wsu:Timestamp><wsse:UsernameToken wsu:Id=”UsernameToken-3″><wsse:Username>longcomplicateduser</wsse:Username><wsse:Password Type=””>weirdRandomP@33w4rD!</wsse:Password><wsse:Nonce EncodingType=””>dfdfdf</wsse:Nonce><wsu:Created>2013-05-01T19:52:45.638Z</wsu:Created></wsse:UsernameToken></wsse:Security>


SET AXIS2_HOME=/axis2-1.6.2
wsdl2java.bat -uri -o JavaPrj -p -d xmlbeans -t -ss -ssi -sd -g -ns2p

System.setProperty(“”, “/data/PkiCertificate/tomcatkeystore.jks”);
System.setProperty (“”, “changeit”);
System.setProperty(“”, “/data/PkiCertificate/clientstore.jks”);
System.setProperty(“”, “changeit”);

setx -m JAVA_HOME “jdk1.7.0_04”

setx -m “/keystore.jks”);
setx -m “passwordislong”);
setx -m “/keystore.jks”);
setx -m “passwordislong”);,trustmanager


Java web services: WS-Security without client certificates

Understanding web services specifications, Part 4: WS-Security

Java Web services: Axis2 WS-Security signing and encryption

Best Practices for Web Services

Java Web services: Axis2 WS-Security basics

Java web services: The high cost of (WS-)Security

Java web services: WS-Trust and WS-SecureConversation

Java web services: WS-Security with CXF

Java Web services: Granular use of WS-Security

Java web services: Modeling and verifying WS-SecurityPolicy

Java Web services: Axis2 WS-Security basics

Metro for Java (Web Services)

Java Web services: Introducing Metro

Apache CXF Security

Security Best Practices

Web Service Security for Java

AXIS2 Security


Java web services: Understanding and modeling WSDL 1.1

JAX-WS Guide

Axis2 Quick Start Guide

Axis2 FAQ


Odd Ball Data Structures and More

Costs for Elements in Different Data Structures

Lesser Known Data Structures

Randomize Algorithms

Probalistic Data Structures





Node.js for Production

Coding Guides

HP Anywhere (Java + JavaScript)

HP Anywhere

Review by Timothy Spann

Basic Usage

1.1           IDE




1.2           NOTE

  • Fix required:  HP Anywhere added to maven.bat


  • Only runs on Windows.  Windows Only Server
  • Only for developing single page applications (SPA) with Java back-end and JS/HTML5/CSS front-end.


1.3           Technology List

  • Eclipse juno
  • jdk 1.7
  • maven
  • tomcat
  • H2
  • jersey
  • enyo js
  • slf4j
  • apache commons
  • xerces
  • json
  • sencha
  • jax-ws
  • ant
  • curl
  • spring 3.0.5
  • jersey
  • junit 4.8
  • JEE
  • JAXB
  • DOM4J
  • Lucene
  • JSTL
  • PhoneGap
  • POI
  • Velocity
  • STAX
  • Xalan
  • Joda Time
  • Hibernate
  • GraniteDS
  • Jackson
  • JTDS
  • JQuery
  • JDOM
  • Sencha Touch
  • Cassandra
  • MS SQL Server

1.4           Links

HP Anywhere: Mobile Apps for the Enterprise


1.5           HP Anywhere Architecture for Developers








Book Review: Testable JavaScript

 Testable JavaScript Book Review

Testable JavaScript

By Mark Ethan Trostler
Publisher: O’Reilly Media
Released: January 2013
Pages: 274


Chapter 1 Testable JavaScript
Chapter 2 Complexity
Chapter 3 Event-Based Architectures
Chapter 4 Unit Tests
Chapter 5 Code Coverage
Chapter 6 Integration, Performance, and Load Testing
Chapter 7 Debugging
Chapter 8 Automation
First off, I want to say this is one of my favorite books. It is a great work on developing with TDD and agile with a focus on JavaScript. I am considering buying a print copy
to keep next to my computer with the GoF, Growing Object Oriented… and Release It! I am big believer in the main aim of the book to keep javascript code simple and
loosely coupled. This is not a book for those who don’t know JavaScript or have some background in Test Driven Development.

The book starts with a nice section on agile, TDD, BDD , the why’s, what’s and how’s of all the best practices for modern development. There is a very thorugh discussion of a
number of great development tools including: JSLInt, JSmeter, JSCheckStyle, YUIDoc and JSDoc. This book is great for Java developers wishing to start doing enterprise level
JavaScript on the client and server and in-between (Meteor / Derby).

I like this book also for it’s thorough coverage of best modern development practices: Code Reuse, Coupling, Metrics, Dependency Injection, auto documenation (think javadoc),
formalized softwtare inspections, coder coverage, fan-out/fan-in nd more agile practices.

One of the other strong topics in the book is Event-Based Architectures / programming. Event-based programming is great for decoupling objects. There is also great information on using and Event-Hub and as well.

Testing Topics from the Book

  • vows
  • isolation
  • scope
  • mock objects
  • positive and negative testing
  • PhantomJS for testing
  • stubs
  • spies
  • asynchronous testing
  • running tests on the client and server side

Cool Tools from the Book

Links from the Book



Cool new stuff

The Movie Database API—by
Apache Kafka
Apache Kafka
Running a Multi-Broker Apache Kafka 0.8 Cluster on a Single Node – Michael G. Noll
Spring with Maven | Java Code Geeks
Apache Kafka
Google Maps example | Examples Java Code Geeks
Google Guava Cache with regular expression patterns | Java Code Geeks
Fault Injection with Byteman and JUnit | Java Code Geeks
XStream – XStreamely easy way to work with XML data in Java | Java Code Geeks
Simulation of time consuming actions in integration tests | Java Code Geeks
Spring MVC – Easy REST-Based JSON Services with @ResponseBody | Java Code Geeks
Spring MVC Session Tutorial | Java Code Geeks
Spring MVC Form Tutorial | Java Code Geeks
Spring MVC + Hibernate + Maven: CRUD operations example | Java Code Geeks