Home

Reset expired root MySQL password

Reset expired root MySQL password

MySQL – “Your password has expired. To log in you must change it using a client that supports expired passwords” What a hugely frustrating problem, to one day try to connect to your local MySQL instance only to find the password expired. I guess if it wasn’t my local instance […]

Angular 2 Production-Ready Webpack Seed Starter

Angular 2 Production-Ready Webpack Seed Starter

This is an Angular 2 seed started project which is simple yet production ready. The code and documentation is here: simple-pro-ready-angular2-webpack-seed Feel free to post any questions here.  

Angular2 Interfacing with External JS E.g. PouchDB

Angular2 Interfacing with External JS E.g. PouchDB

Introduction This blog demonstrates how to interface Angular2 TypeScript with JavaScript. PouchDB is used as an example JavaScript library. How to setup a PouchDB in JavaScript How to setup PouchDB in general is simple as explained here: https://pouchdb.com/ Add PouchDB to index.html <script src="https://cdn.jsdelivr.net/pouchdb/6.0.5/pouchdb.min.js"></script> This one line of code sets up […]

Deploying a  NinjaFramework Application on OpenShift

Deploying a NinjaFramework Application on OpenShift

Deploy a fat jar to OpenShift… Hmmmmm A NinjaFramework application is built and deployed as a fat jar by default. Given this fact, I popped this question on StackOverflow. I figured that one would need to be some kind of Maven guru in order to build some kind of configuration […]

JQuery-Mobile with AngularJS and Angular-Route (ngRoute)

JQuery-Mobile with AngularJS and Angular-Route (ngRoute)

Introduction The following details how JQuery-Mobile and AngularJS can play together seamlessly. Angular-Route (ngRoute) is used for navigation. A simple Angular directive invokes JQuery-Mobile styling and enhancements as each page is loaded. This includes pages loaded via  ng-include A working example is available here as a Plunker http://plnkr.co/edit/RPbJfWX84XkzWlvPFMvX?p=info

JSON Web Token (JWT) with CORS Stateless REST Service with Facebook Authentication

JSON Web Token (JWT) with CORS Stateless REST Service with Facebook Authentication

Introduction This blog will demonstrate how to authenticate a REST(ish) service with Facebook authentication, using a JSON Web Token (JWT). This blog is follows on from previous blogs: Cross-Origin-Resource-Sharing (CORS) is detailed here http://outbottle.com/understanding-cross-origin-resource-sharing-cors-by-example/. Creating the REST Service and HTML5 Client is detailed here http://outbottle.com/cors-stateless-rest-service-with-detached-html5-client/. Adding authentication using Facebook is […]

Spring 4 Web MVC with AngularJS

Spring 4 Web MVC with AngularJS

Introduction The project downloadable below is an answer to a question repeated in this blog (Spring 3 MVC – Adding Objects to a List element on the fly at form submit – (Generic method)) “How can I submit nested lists of objects?” The answer is AJAX and JSON. A very good […]

CORS Stateless REST Service with Facebook Authentication

CORS Stateless REST Service with Facebook Authentication

Introduction This blog will demonstrate one way to enable authentication with Facebook on a Stateless CORS enabled REST service. The CORS REST service will be created using the Ninja Framework. Facebook authentication is via the Facebook JavaScript API. RestFB is used to consolidate the authentication with the REST Service. This […]

Spring 4 Web MVC – JSON Handling

Spring 4 Web MVC – JSON Handling

Introduction This blog demonstrates how to process JSON using Spring 4 Web MVC. The JavaScript AJAX call is described in terms of request headers and request data formatting. Spring uses Jackson for JSON parsing. Jackson is configured to ignore extra JSON properties that do not match properties of the bean […]

A brief note on the merits of using generic types over contextual types

A brief note on the merits of using generic types over contextual types

Introduction Generic types can reduce the class count in any project thus allowing easier maintenance, less mapping and more consistency. It promotes code reuse in a big way.

AngularJS – Radio Buttons – Three Scenarios

AngularJS – Radio Buttons – Three Scenarios

Introduction This post will detail how to AngularJS can enhance the usage and functionality of Radio Buttons. Three scenarios are covered. Each radio button represents an object. For example, there may be a radio button for each element of an array. When one of the radio buttons is selected, a […]

AngularJS – isolate scope – ‘&’ (function reference)

AngularJS – isolate scope – ‘&’ (function reference)

Introduction This blog demonstrates how to pass a reference to a function to an angular directive/template. The way in which the child directive/template calls the parent is also demonstrated. The example is available as a working JSFiddle here. This tutorial details creating directive/templates in general (without an isolated scope). This […]

CORS Stateless REST Service with detached HTML5 client

CORS Stateless REST Service with detached HTML5 client

Introduction This blog will detail in precise steps how to create a stateless REST service that is consumed by a HTML5 client on another domain. The HTML5 client could easily be a Cordova or Phonegap app. The HTML5 client is simple and basic just for demonstration purposes. It shows the […]

Understanding Cross-Origin-Resource-Sharing (CORS) by example

Understanding Cross-Origin-Resource-Sharing (CORS) by example

If you’re here because you’re struggling with this: The solution can be summarized in the following steps:

AngularJS – isolate scope – ‘=’ (pass by reference)

AngularJS – isolate scope – ‘=’ (pass by reference)

Introduction This blog will explore the concept of passing object to angularJS directives / templates using by reference. When an object is passed by reference both the parent (controller or parent directive) and the child directive/template have access to the object. The relationship is bidirectional. This tutorial details creating directive/templates […]

AngularJS – isolate scope – ‘@’ (pass by value)

AngularJS – isolate scope – ‘@’ (pass by value)

Introduction Objects can be passed into an angularJS directive in any one of the following ways: By value using ‘@’ By reference using ‘=’ As a reference to a function in the parent controller using ‘&’ The next few blogs will detail each of these techniques. This blog will detail the […]

Spring 4 Web MVC – Hello World using Annotation and Java configuration with Netbeans

Spring 4 Web MVC – Hello World using Annotation and Java configuration with Netbeans

This blog will go through the steps required to setup a basic Spring 4 MVC web application using Netbeans and Maven. The Spring 4 project will be configured using annotations and plain Java rather than XML. It is a step by step guide to getting up and running quickly. There […]

Rounding a number up to it’s nearest order of ten

Rounding a number up to it’s nearest order of ten

I’m hopeless at math, this is just for future reference as it really bugged me. How to round a number up to it’s upper order of 10. Not a simple as it may seem. Examples: 800 -> 1000 125 -> 1000 80 -> 100 43 -> 100 8 -> 10 9 […]

Using templates with AngularJs

Using templates with AngularJs

The purpose of this blog is to demonstrate how to use templates in AngularJS. A fully worked example is provided via jsFiddle. The example is simple and easy to follow. A detailed but succinct explanation of the code is provided. The template is “complex html” that we’ll want to reuse. […]

AngularJS – Permitting AngularJS templates in IE8

AngularJS – Permitting AngularJS templates in IE8

So, you’ve got something like this:

But you find that in IE8 the directive that populates the <mytemplate/> element is not working at all in IE8. IE8 will not initialise the controller and hence your $scope is null.