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.

<dependency>
<groupId>com.squareup.retrofit</groupId>
<artifactId>retrofit</artifactId>
<version>(insert latest version)</version>
</dependency>

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 = "https://api.github.com";
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 {
 @GET("/users/{username}")
 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()
 .setServer(API_URL)
 .build();

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

 System.out.println("UserData=" + userdata.bio + "," + userdata.email + "," + userdata.name +
 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@agilemobiledeveloper.com,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 com.codeborne.selenide.Selectors.by;
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 {
 @Test
 public void userCanLoginByUsername() {
 open("http://google.com/");
 $("title").shouldHave(text("Google"));
 }
}

In Maven pom.xml

<dependency>
<groupId>com.codeborne</groupId>
<artifactId>selenide</artifactId>
<version>2.1</version>
</dependency>

Links du Jour

Echo JS – JavaScript News

dzone.com – BUILD REAL WEATHER APP: JSON, HTTP AND OPENWEATHERMAP

dzone.com – Crossing platforms between iOS and Android with PhoneGap framework. Tutorial

dzone.com – ADB Command Basics and Setup Tutorial

dzone.com – 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

https://github.com/rjohnsondev/java-libpst

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);
 //System.out.println(pstFile.getMessageStore().getDisplayName());
 processFolder(pstFile.getRootFolder());
 } catch (Exception err) {
 err.printStackTrace();
 }
 }
int depth = -1;
/**
 * 
 */
 public void processFolder(PSTFolder folder)
 throws PSTException, java.io.IOException
 {
 depth++;
// 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) {
 processFolder(childFolder);
 }
 }
//System.out.println("Folder Count:" + folder.getContentCount());
// counter += folder.getContentCount();
// and now the emails for this folder
 if (folder.getContentCount() > 0) {
 foldercounter++;
 depth++;
 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) ) {
 counter++;
 }
 email = (PSTMessage)folder.getNextChild();
 }
 depth--;
 }
 depth--;
 }
}



			

Droid Development Links

It’s Hip 2 B Square

Cool Android Tools from Square

Android Testing

http://square.github.io/fest-android/

http://fest.easytesting.org/

http://www.developer.com/open/article.php/10930_3901236_3/Write-More-Understandable-Java-Tests-with-Matcher-Objects-and-FEST-Assert.htm

http://piotrjagielski.com/blog/a-cool-technique-for-object-comparison-in-junit/

http://robolectric.org/

http://corner.squareup.com/2013/04/the-resurrection-of-testing-for-android.html

https://code.google.com/p/robotium/

https://code.google.com/p/mockwebserver/

https://github.com/robolectric/robolectric

http://corner.squareup.com/2013/05/robolectric-two-point-oh.html

http://corner.squareup.com/2012/10/mockito-android.html

https://github.com/octo-online/robospice

https://github.com/octo-online/RoboSpice-samples

 

Small Square Tools

http://corner.squareup.com/2013/05/mimecraft-javawriter-protoparser.html

https://github.com/square/protoparser

https://github.com/square/javawriter

 

Event Bus

http://square.github.io/otto/

 

Square IntelliJ Plugins

http://corner.squareup.com/2013/05/intellij-plugins.html

https://github.com/square/dagger-intellij-plugin

https://github.com/square/otto-intellij-plugin

 

Date from Calendar View for Android

https://github.com/square/android-times-square

http://corner.squareup.com/2013/01/times-square.html

 

HTTP and SPDY Client for Android

http://square.github.io/okhttp/

http://corner.squareup.com/2013/05/announcing-okhttp.html

 

Dagger DI

http://square.github.io/dagger/

http://corner.squareup.com/2013/05/dagger-1.0.html

https://plus.google.com/communities/109244258569782858265/stream/bab12891-7685-4e0c-8dcb-f85cd0ca31c0

http://musingsofaprogrammingaddict.blogspot.com/2012/11/dagger-new-java-dependency-injection.html

http://www.infoq.com/presentations/Dagger

http://blog.patrickbaumann.com/2012/10/di-on-android-without-the-startup-cost-dagger/

https://github.com/patrickbaumann/daggervsroboguice

https://github.com/eburke/presentations/tree/master/strange_loop_2012/samplecode

 

Spoon Android Testing

http://square.github.io/spoon/

 

Android Image Caching and Downloading

http://square.github.io/picasso/

http://corner.squareup.com/2013/05/picasso-one-dot-oh.html

http://square.github.io/pollexor/

https://github.com/globocom/thumbor

https://github.com/globocom/thumbor/wiki

 

Android Shake Detection

https://github.com/square/seismic

 

Android Queues

http://square.github.io/tape/

 

REST Client for Android

http://square.github.io/retrofit/

http://corner.squareup.com/2013/05/retrofit-one-dot-oh.html

 

Square OSS Community

https://plus.google.com/communities/109244258569782858265/stream/47c9b7e4-3c13-4f6f-bc89-ede5f9e58612

 

Squash Notification Tool

http://corner.squareup.com/2013/01/squash.html

 

Android Tips

http://www.curious-creature.org/2012/12/13/android-recipe-2-fun-with-shaders/

 

Facebook SDK for Android

https://github.com/facebook/facebook-android-sdk

 

Sending Photos Easy

http://mobile.tutsplus.com/tutorials/android/android-sdk-sending-pictures-the-easy-way/

 

Growing Android Applications Guided by Tests – using Square Tools

http://www.novoda.com/blog/blog/gaagbt-part-1

https://github.com/frankiesardo/growing-android-applications-guided-by-tests

 

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

http://www.infoq.com/news/2013/05/high-volume-vertx

http://www.slideshare.net/samueltauil/vertx-judcon

http://pmlopes.github.io/yoke/

https://github.com/core9/vertx-yoke-engine-closure

https://github.com/core9/mod-mongo-persistor

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 (vert.io) – an Alternative to node.js | Web Builder Zone

zznate/edge · GitHub

CloudBees-community/vertx-clickstack · GitHub

Vert.x

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

Deploying vert.x Applications to Cloud Foundry | CloudFoundry.com 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 | TechNewsNow.com :: TechnewsNow.com

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

 

Codenvy

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

codeenvy3

 

 

 

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

 

 

https://github.com/priyatam/springmvc-twitterbootstrap-showcase

http://bthurley.wordpress.com/2012/07/25/initialising-datatables-with-twitter-bootstrap-and-spring-mvc-ajax/

http://duckranger.com/2012/07/spring-mvc-and-twitter-bootstrap-customizing-the-input-fields/

http://bthurley.wordpress.com/2012/07/18/spring-mvc-with-restful-datatables/

http://duckranger.com/2012/12/capturing-property-changes-with-spring-jpa-and-hibernate/

https://github.com/eugenp/REST#readme

 

Apache Zookeeper

Apache Zookeeper

replicated synchronization service with eventual consistency

associated with Hadoop
Client

Bag of Links

Links

http://coding.smashingmagazine.com/2013/03/11/responsible-web-design/

http://calendar.perfplanet.com/2012/

http://www.cakesolutions.net/teamblogs/2011/12/19/cake-pattern-in-depth/

http://thoughtforge.net/2051/continuous-delivery-a-maturity-assessment-model/

http://architects.dzone.com/articles/unit-testing-best-practices

http://www.project-management-tools.net/software-development-methodologies/

http://agile.dzone.com/articles/ebays-open-source-agile-test

http://da-data.blogspot.nl/2013/03/optimistic-cuckoo-hashing-for.html

http://javapostsforlearning.blogspot.in/2013/03/serialization-in-java.html

http://www.drmaciver.com/2013/03/a-rewritten-manifesto-for-error-reporting/

 

Templates
http://freemarker.sourceforge.net/

 

Mustache for Java and Android
https://github.com/samskivert/jmustache

https://github.com/spullara/mustache.java

http://www.javarants.com/2010/05/03/the-ideal-web-application-templating-system/

http://mustache.github.com/mustache.5.html

https://github.com/raycmorgan/Mu

https://hacks.mozilla.org/2013/03/shiva-more-than-a-restful-api-to-your-music-collection/

http://java.dzone.com/articles/composite-design-pattern-java-0

http://www.duckout.de/java/json-with-java-jackson/

http://smashinghub.com/33-best-free-html5-tutorials.htm

http://www.catswhocode.com/blog/ultimate-list-of-wordpress-resources

http://skuro.tk/2013/03/11/java-stringbuilder-myth-now-with-content/

http://www.springsource.org/spring-data/rest

https://github.com/SpringSource/spring-data-rest

http://myfaces.apache.org/

https://github.com/olivergierke/spring-restbucks/blob/master/src/main/java/org/springsource/restbucks/RestbucksWebApplicationInitializer.java#L88

http://static.springsource.org/spring-data/rest/docs/1.1.0.M1/reference/htmlsingle/

http://www.infoworld.com/d/application-development/the-developers-checklist-prepare-the-cloud-213941?page=0,0

http://www.javaworld.com//javaworld/jw-03-2013/130306-introduction-to-design-patterns-part-3.html

http://www.ibm.com/developerworks/agile/library/a-devops8/a-devops8-pdf.pdf

http://www.ibm.com/developerworks/java/library/j-mobileforthemasses1/index.html?ca=drs-

http://www.ibm.com/developerworks/opensource/library/os-test-stafstax/index.html?ca=drs-

http://www.ibm.com/developerworks/java/library/j-jn1/index.html?ca=drs-

http://www.dbunit.org/

http://paulirish.com/2013/webkit-for-developers/

http://html5boilerplate.com/

http://html5doctor.com/html5-forms-input-types/

http://feross.org/fill-disk/

http://www.adobe.com/devnet/html5/articles/book-excerpt-the-definitive-guide-to-html5-websocket.html

http://h5bp.github.com/

http://www.youtube.com/watch?v=4oa9xEn3nos

http://buildnewgames.com/introduction-to-crafty/

http://jdstraughan.com/2013/03/05/html5-snake-with-source-code-walkthrough/

https://www.manymo.com/pages/blog/open-in-android-bookmarklet

http://blog.andyet.com/2013/feb/22/introducing-simplewebrtcjs-and-conversatio/

http://huddle.github.com/Resemble.js/

https://github.com/WebReflection/dom4

http://www.dzone.com/links/r/devref_welcome.html

http://maxlibin.com/practice-sass-now/

http://variadic.me/posts/2013-03-06-solving-problems-data-structures.html

http://edmundkirwan.com/general/junit.html

http://blog.jelastic.com/2013/03/06/why-java-does-not-support-operator-overloading-guest-post/

http://architects.dzone.com/articles/install-mongodb-ubuntu

http://mrbool.com/how-to-create-an-editable-html-table-with-jquery/27425

 

Agile Defacto

http://www.javaworld.com/javaworld/jw-06-2007/jw-06-awci.html

http://www.javaworld.com/cgi-bin/mailto/x_java.cgi?pagetosend=/export/home/httpd/javaworld/javaworld/jw-05-2004/jw-0510-tdd.html&pagename=/javaworld/jw-05-2004/jw-0510-tdd.html&pageurl=http://www.javaworld.com/javaworld/jw-05-2004/jw-0510-tdd.html&site=jw_core

http://xunitpatterns.com/Code%20Refactorings.html

 

Agile

http://www.infoq.com/presentations/Hacking-Culture

 

Top ALM Tools
http://www.infoq.com/research/alm-survey?utm_source=infoqresearch&utm_campaign=rr-topicpages

 

LeanUX
http://www.infoq.com/interviews/lean-ux-explained-jeff-gothelf

http://www.infoq.com/interviews/saddington-agile-scout

 

Refactoring Legacy Applications
http://www.infoq.com/articles/refactoring-legacy-applications

 

Cloud Computing / PAAS

http://www.infoq.com/presentations/CloudStack-Architecture

http://www.infoq.com/interviews/mccallion-enterprise-cloud-hybrid-redshift

 

HTML5 + WebSockets + java
http://www.infoq.com/presentations/JSR-356-HTML5-WebSocket-Java

 

DevOps

http://www.infoq.com/presentations/Facebook-Release-Process

 

HTML5 / CSS / JS / Mobile / Design

http://www.infoq.com/interviews/javascript-performance-stoyan-stefanov

 

WebApp
http://www.infoq.com/presentations/Web-App-Platform

http://www.infoq.com/presentations/JSR-356-HTML5-WebSocket-Java

http://johnpolacek.github.com/stacktable.js/

http://speckyboy.com/2013/03/04/designing-custom-github-demo-pages/

http://mojotech.github.com/stickymojo/

http://24ways.org/2012/how-to-make-your-site-look-half-decent/

http://jschr.github.com/textillate/

http://dfcb.github.com/Bedrock/

http://mcpants.github.com/jquery.shapeshift/

http://tenxer.github.com/xcharts/

http://fabien-d.github.com/alertify.js/

http://fatiherikli.github.com/mockup-designer/#document/93a862f6-f82c-2b33-d05b-414dde03c75f

http://jakiestfu.github.com/Behave.js/

http://sundaykofax.github.com/baby-legs/

http://oazabir.github.com/Droptiles/

http://justspamjustin.github.com/junior/#home

http://soulwire.github.com/Makisu/

http://imsky.github.com/holder/

http://benvie.github.com/continuum/

http://thisisdallas.github.com/Simple-Grid/

http://www.webdesignerdepot.com/2013/03/essential-web-design-tips-for-start-ups/

http://tokokoo.github.com/pondasee/

http://jhough10.github.com/Centurion/

http://needim.github.com/noty/

http://oskarkrawczyk.github.com/heyoffline.js/

http://matthewhartman.github.com/base/

http://anasnakawa.github.com/bi-app-less/

http://dfcb.github.com/Responsivator/

http://ckrack.github.com/fbootstrapp/

http://bernii.github.com/gauge.js/

http://laktek.github.com/punch/

http://shopify.github.com/dashing/

http://elclanrs.github.com/jq-idealforms/

http://alexdunphy.github.com/refineslide/

http://soulwire.github.com/sketch.js/

http://sebnitu.github.com/BaseDemo/

http://dfcb.github.com/controldeck.js/

http://oscargodson.github.com/EpicEditor/

http://hpneo.github.com/gmaps/

http://cjdsie.github.com/wirefy/

http://jsantell.github.com/dancer.js/

http://lukaszfiszer.github.com/selectnav.js/

http://xing.github.com/wysihtml5/

http://luis-almeida.github.com/filtrify/

http://luis-almeida.github.com/jPages/

http://eightmedia.github.com/hammer.js/

http://welaika.github.com/wordless/

http://twitter.github.com/typeahead.js/

https://github.com/blog/1081-instantly-beautiful-project-pages

 

Java Patterns

http://javapostsforlearning.blogspot.in/2013/03/template-method-design-pattern-in-java.html
http://javapostsforlearning.blogspot.in/2013/02/observer-design-pattern-in-java.html

 

Hibernate / Spring

http://javapostsforlearning.blogspot.in/2012/08/introduction-to-spring-framework.html

http://javapostsforlearning.blogspot.in/2012/08/dependency-injectionioc-in-spring.html

http://javapostsforlearning.blogspot.in/2012/08/spring-hello-world-example-in-eclipse.html

http://javapostsforlearning.blogspot.in/2012/08/dependency-injection-via-setter-method.html

http://javapostsforlearning.blogspot.in/2012/08/dependency-injection-via-constructor-in.html

http://javapostsforlearning.blogspot.in/2012/08/spring-bean-scopes-with-examples.html

http://javapostsforlearning.blogspot.in/2013/02/hibernate-inheritancetable-per-concrete.html

http://javapostsforlearning.blogspot.in/2013/02/hibernate-inheritancetable-per-subclass.html

http://javapostsforlearning.blogspot.in/2012/08/inheritance-in-spring.html

http://javapostsforlearning.blogspot.in/2012/08/beanpostprocessors-in-spring.html

http://javapostsforlearning.blogspot.in/2012/08/spring-lifetime-callbacks.html

http://javapostsforlearning.blogspot.in/2012/09/annotation-based-configuration-in-spring.html

http://javapostsforlearning.blogspot.in/2012/08/spring-applicationcontext.html

 

Business Framework

http://open-dolphin.org/dolphin_website/Home.html

https://github.com/canoo/DolphinJumpStart

http://open-dolphin.org/download/guide/index.html

 

Agile

http://agile.dzone.com/articles/story-points-considered

http://allankelly.blogspot.co.uk/2013/02/11-agile-myths-and-2-truths.html

 

IBM Heap

https://www.ibm.com/developerworks/community/groups/service/html/communityview?communityUuid=2245aa39-fa5c-4475-b891-14c205f7333c

java -Xmx1100m -jar jca437.jar

open phd files

PHD format heapdumps

http://www-01.ibm.com/support/docview.wss?uid=swg21190476
http://www-01.ibm.com/support/docview.wss?uid=swg21196223

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 com.ibm.jvm.ras.findroots.PrintHeapdump with phd file and redirect output to a file:

java -Xmx1100m -classpath svcdump.jar com.ibm.jvm.ras.findroots.PrintHeapdump heapdump.20130503.055912.16777398.0001.phd > heapdump1.txt

java -Xmx1100m -classpath svcdump.jar com.ibm.jvm.ras.findroots.PrintDomTree heapdump.20130503.055912.16777398.0001.phd > domtree.txt

java -Xmx1100m -classpath svcdump.jar com.ibm.jvm.ras.findroots.TreeViewer domtree.txt

 

Cool Links of the Day

dzone.com – 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

dzone.com – Synchronising Multithreaded Integration Tests revisited

dzone.com – Task.js Asynchronous Tasks In JavaScript

Understanding Java Garbage Collection and what you can do about it – YouTube

dzone.com – Algorithm of the Week: Shortest Path with Djikstra

MongoDB – Updating Records – CodeProject

dzone.com – Sencha Touch 2 Stores – Editing Model Instances and Reverting Changes

dzone.com – String Utility Classes in Java

dzone.com – 5 Talks To Learn More About Node.js

dzone.com – JPA/JPQL: Intermediate Queries with @NamedQuery

dzone.com – How RESTful Is Your REST?

Native Win32 ports of some GNU utilities

UnxUtils | Free software downloads at SourceForge.net

 

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

WS-Security Configuration

<con:wssContainer>

<con:crypto>
<con:source>keystore.jks</con:source>
<con:password>mypasswordiscool</con:password>
<con:type>KEYSTORE</con:type>
</con:crypto>
<con:outgoing>
<con:name>Outgoing</con:name>
<con:entry type=”Username” username=”longcomplicateduser” password=”weirdRandomP@33w4rD!”>
<con:configuration>
<addCreated>true</addCreated>
<addNonce>true</addNonce>
<passwordType>PasswordDigest</passwordType>
</con:configuration>
</con:entry>
<con:entry type=”Timestamp”>
<con:configuration>
<timeToLive>60</timeToLive>
<strictTimestamp>true</strictTimestamp>
</con:configuration>
</con:entry>
</con:outgoing>
</con:wssContainer>

<soap:Header>
<wsse:Security soap:mustUnderstand=”true” xmlns:wsse=”http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd” xmlns:wsu=”http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd”><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=”http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest”>weirdRandomP@33w4rD!</wsse:Password><wsse:Nonce EncodingType=”http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary”>dfdfdf</wsse:Nonce><wsu:Created>2013-05-01T19:52:45.638Z</wsu:Created></wsse:UsernameToken></wsse:Security>
</soap:Header>

 

http://techdiary.bitourea.com/2007/03/step-by-step-tutorial-to-use-rampart.html

http://www.coderanch.com/t/422683/Web-Services/java/SOAP-Header-missing-Rampart-Axis

http://stackoverflow.com/questions/11794223/rampart-doesnt-add-necessary-headers-to-soap-envelope

 

SET AXIS2_HOME=/axis2-1.6.2
wsdl2java.bat -uri https://X.com?wsdl -o JavaPrj -p mypackage.is.cool -d xmlbeans -t -ss -ssi -sd -g -ns2p

System.setProperty(“javax.net.ssl.keyStore”, “/data/PkiCertificate/tomcatkeystore.jks”);
System.setProperty (“javax.net.ssl.keyStorePassword”, “changeit”);
System.setProperty(“javax.net.ssl.trustStore”, “/data/PkiCertificate/clientstore.jks”);
System.setProperty(“javax.net.ssl.trustStorePassword”, “changeit”);

setx -m JAVA_HOME “jdk1.7.0_04”

setx -m javax.net.ssl.keyStore “/keystore.jks”);
setx -m javax.net.ssl.keyStorePassword “passwordislong”);
setx -m javax.net.ssl.trustStore “/keystore.jks”);
setx -m javax.net.ssl.trustStorePassword “passwordislong”);


http://stackoverflow.com/questions/3803581/setting-a-system-environment-variable-from-a-windows-batch-file

http://nl.globalsign.com/en/support/ssl+certificates/java/java+based+webserver/keytool+commands/

 

-Djavax.net.debug=ssl,trustmanager


http://docs.oracle.com/javaee/1.4/tutorial/doc/Security7.html

http://broadsign.com/docs/9-2-1/appendix/apache-axis2/

http://web.archiveorange.com/archive/v/fNNSSwpIzBWqt1TcJdT4

http://stackoverflow.com/questions/5871279/java-ssl-and-cert-keystore

http://javarevisited.blogspot.com/2012/09/difference-between-truststore-vs-keyStore-Java-SSL.html

PasswordDigest
http://www.ibm.com/developerworks/training/kp/j-kp-wssecurity/

http://ianso.blogspot.com/2009/12/building-ws-security-enabled-soap.html

Java web services: WS-Security without client certificates

http://www.ibm.com/developerworks/java/library/j-jws17/index.html

Understanding web services specifications, Part 4: WS-Security
http://www.ibm.com/developerworks/webservices/tutorials/ws-understand-web-services4/

Java Web services: Axis2 WS-Security signing and encryption
http://www.ibm.com/developerworks/java/library/j-jws5/index.html

Best Practices for Web Services
http://www.ibm.com/developerworks/library/ws-best11/

Java Web services: Axis2 WS-Security basics
http://www.ibm.com/developerworks/webservices/library/j-jws4/index.html

Java web services: The high cost of (WS-)Security
http://www.ibm.com/developerworks/java/library/j-jws6/index.html

Java web services: WS-Trust and WS-SecureConversation
http://www.ibm.com/developerworks/java/library/j-jws15/index.html

Java web services: WS-Security with CXF
http://www.ibm.com/developerworks/java/library/j-jws13/index.html

Java Web services: Granular use of WS-Security
http://www.ibm.com/developerworks/java/library/j-jws7/index.html

Java web services: Modeling and verifying WS-SecurityPolicy
http://www.ibm.com/developerworks/java/library/j-jws21/index.html

Java Web services: Axis2 WS-Security basics
http://www.ibm.com/developerworks/java/library/j-jws4/

http://blog.sweetxml.org/2007/12/rampart-basic-examples-how-you-add-ws.html

http://www.javaranch.com/journal/200709/web-services-authentication-axis2.html

http://stackoverflow.com/questions/14266237/adding-ws-security-to-wsdl2java-generated-classes

http://wso2.org/library/3190

http://wso2.org/library/3415#step_1

http://ws.apache.org/tcpmon/index.html

Metro for Java (Web Services)

Java Web services: Introducing Metro
http://www.ibm.com/developerworks/java/library/j-jws9/index.html

http://www.bouncycastle.org/java.html

Apache CXF Security
http://cxf.apache.org/docs/ws-security.html

Security Best Practices
http://ws.apache.org/wss4j/best_practice.html

Web Service Security for Java
http://ws.apache.org/wss4j/index.html

AXIS2 Security
http://axis.apache.org/axis2/java/rampart/index.html

CXF
http://www.ibm.com/developerworks/java/library/j-jws12/index.html

Java web services: Understanding and modeling WSDL 1.1
http://www.ibm.com/developerworks/java/library/j-jws20/index.html

JAX-WS Guide
http://axis.apache.org/axis2/java/core/docs/jaxws-guide.html

Axis2 Quick Start Guide
http://axis.apache.org/axis2/java/core/docs/quickstartguide.html

Axis2 FAQ
http://axis.apache.org/axis2/java/core/faq.html

 

Odd Ball Data Structures and More

Costs for Elements in Different Data Structures

https://code.google.com/p/memory-measurer/wiki/ElementCostInDataStructures

Lesser Known Data Structures

http://stackoverflow.com/questions/500607/what-are-the-lesser-known-but-useful-data-structures

Randomize Algorithms

http://en.wikipedia.org/wiki/Randomized_algorithm

Probalistic Data Structures

http://en.wikipedia.org/wiki/Skip_list

Other

http://en.wikipedia.org/wiki/Dancing_Links

http://en.wikipedia.org/wiki/Binary_decision_diagram

http://cr.yp.to/critbit.html

http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.96.2143

http://ejohn.org/blog/revised-javascript-dictionary-search/

http://en.wikipedia.org/wiki/Rope_%28data_structure%29

http://en.wikipedia.org/wiki/Gap_buffer

http://en.wikipedia.org/wiki/Spatial_index#Spatial_index

http://en.wikipedia.org/wiki/R-tree

http://en.wikipedia.org/wiki/Kd-tree

http://en.wikipedia.org/wiki/Bit_array

http://www.haskell.org/haskellwiki/Zipper

http://en.wikipedia.org/wiki/Suffix_trie#Functionality

http://en.wikipedia.org/wiki/Splay_tree#Performance_theorems

http://www.cl.cam.ac.uk/research/srg/netos/lock-free/

http://www.boyet.com/Articles/LockfreeStack.html

http://cellperformance.beyond3d.com/articles/index.html

http://en.wikipedia.org/wiki/Disjoint-set_data_structure

http://en.wikipedia.org/wiki/Fibonacci_heap

http://en.wikipedia.org/wiki/Binary_space_partitioning

http://en.wikipedia.org/wiki/Huffman_coding

http://en.wikipedia.org/wiki/Finger_trees

http://en.wikipedia.org/wiki/Circular_buffer

http://en.wikibooks.org/wiki/Haskell/Other_data_structures

http://opendatastructures.org/ods-java.pdf

http://en.wikipedia.org/wiki/Hash_tree

http://www.slideshare.net/koolhits/java-performance-threading-and-concurrent-data-structures

http://labs.carrotsearch.com/hppc.html

http://labs.carrotsearch.com/junit-benchmarks.html

http://developer.android.com/reference/android/util/SparseArray.html

http://commons.apache.org/proper/commons-collections/

https://code.google.com/p/guava-libraries/wiki/NewCollectionTypesExplained

https://code.google.com/p/guava-libraries/wiki/ImmutableCollectionsExplained

https://code.google.com/p/guava-libraries/wiki/CachesExplained

https://code.google.com/p/guava-libraries/wiki/HashingExplained

http://opendatastructures.org/ods-java/

http://en.wikipedia.org/wiki/Book:Fundamental_Data_Structures

http://en.wikipedia.org/wiki/Tango_tree

http://www.codecommit.com/blog/scala/scala-collections-for-the-easily-bored-part-1

http://en.wikipedia.org/wiki/Book:Data_structures

http://en.wikipedia.org/wiki/Rope_(computer_science)

http://en.wikibooks.org/wiki/Data_Structures

http://www.cs.uiuc.edu/~jeffe/teaching/algorithms/

http://en.wikipedia.org/wiki/Cuckoo_hashing

http://cg.scs.carleton.ca/~morin/teaching/5408/refs/minmax.pdf

http://blogs.msdn.com/b/devdev/archive/2007/06/12/cache-oblivious-data-structures.aspx

http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.48.973

http://donar.umiacs.umd.edu/quadtree/rectangles/cifquad.html

http://en.wikipedia.org/wiki/Hash_array_mapped_trie

http://en.wikipedia.org/wiki/Inverted_index

http://en.wikipedia.org/wiki/Van_Emde_Boas_tree

http://en.wikipedia.org/wiki/Nested_set_model

http://www.flipcode.com/archives/The_Half-Edge_Data_Structure.shtml

http://www.cs.middlebury.edu/~schar/courses/cs201-s13/js/js.pdf

http://www.theparticle.com/javadata2.html

http://192.9.162.55/docs/books/performance/1st_edition/html/JPAlgorithms.fm.html

http://www.cs.berkeley.edu/~hilfingr/cs61b/f2002/public_html/data-structures.pdf

 

 

 

Node.js for Production

Coding Guides

HP Anywhere (Java + JavaScript)

HP Anywhere

Review by Timothy Spann

Basic Usage

1.1           IDE

Eclipse

eclipse

 

1.2           NOTE

  • Fix required:  HP Anywhere added to maven.bat

SET MAVEN_OPTS=-Djava.net.preferIPv4Stack=true

  • 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

(see: http://developer.hpanywhere.com/wp-content/uploads/2013/03/HP_Anywhere_Architecture_for_Developers.pdf)

 

 

 

container

overview

 

Book Review: Testable JavaScript

 Testable JavaScript Book Review

Testable JavaScript

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

Chapters:

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 socket.io 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 apiary.io
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