Sharing Our Passion For Technology
& continuous learning
  • Event Sourcing

    Software development teams are responsible for building a wide variety of software to solve a wide variety of problems. Many of these software development projects implement business flows that have defined activities completed by specific parties. An architecture that implements these flows by mixing validation logic with record updates becomes...
  • Tips and Tech to Thrive While Pairing Remotely

    Throughout my eight years at Source Allies, I have had the opportunity to work on several teams at our various projects. Most of the time our teams work in open collaborative spaces, where pair programming is done side-by-side. However, there are occasions where I have paired with developers remotely. As...
  • Node Reference - Conclusion

    Prerequisites This article builds on the prior article: The “Join” Problem. Conclusion In this series, we walked the reader through the considerations of building a production-ready microservice. More important than the tools we used (e.x. NodeJS, AWS) were the questions we asked. You may choose different tools and libraries for...
  • Node Reference - Change Events

    The “Join” Problem Modern applications no longer exist in a silo. They need to integrate with other systems within the organization. In a microservice architecture, this is even more valid since very few business processes can be completed by involving only one service. Let us suppose that our product service...
  • Node Reference - Delete

    Prerequisites This article builds on the prior article: Node Reference - History. Deleting Humans make mistakes. Your users are humans, and sometimes they will create a product by mistake and will need to delete it. For that scenario, we need a DELETE REST endpoint. There are two main classes of...
  • Node Reference - History

    Prerequisites This article builds on the prior article: Patch. Tracking History The way our service is currently built, all modifications (PATCH requests) happen in-place to records in DynamoDB. It is common in most production applications that someone will want to know the history of a record. A business user may...
  • Node Reference - Patch Product

    Prerequisites This article builds on the prior article: Node Reference - Get Product by Id. Supporting Updates Sooner or later, there will be a need to modify a product. Except in the case of immutable data stores, rarely are there entities that are truely “insert only”. In order to support...
  • Node Reference - Get Product by Id

    Prerequisites This article builds on the prior article: Node Reference - Listing. Add Get By Id At this point, we have only one way to get Products. We have to list all products and page through them to find the one we want. However, a lot of the time, a...
  • Node Reference - List Products

    Prerequisites This article builds on the prior article: Node Reference - Monitoring. Add listing Clients of our service will need a way to find products. For that, we need a product listing service. DynamoDB provides an operation for listing the contents of a table called a ‘scan’. (As a table...
  • Node Reference - Introduction

    Summary Most AWS microservice articles only show you the tip of the iceberg. We certainly can’t blame the article authors. For starters, the SAM squirrel mascot is so darned cute! But more importantly, we all know that standing up a production web service involves far more considerations than you could...
  • Build a RESTful Service with .NET Core

    Build an API backend for your application using the newest version of .NET that can be developed anywhere and run everywhere. This tutorial walks through the process to build a production-ready service to perform CRUD operations on a “Pokemon.” Environment Setup Download and Install the .NET Core SDK from https://www.microsoft.com/net/core....
  • TypeScript: a Superset of JavaScript

    Getting Started In this post I will be covering a bit of a strange language, TypeScript. TypeScript is what’s known as a superset language of JavaScript. It allows for the programmer to enforce variable types and provide classes and objects in JavaScript and provides compile time error checking and not...
  • Java 8: Parallel vs Sequential Stream Comparison

    Motivated by the introduction of Lambdas in Java 8, I wrote a couple of examples to see how difficult it would be to follow a functional programming paradigm in real production code. I will demonstrate using some features from Java 8 with a simple and fun example. The application basically...
  • 6 Concerns Before Using an Open Source Library

    During my career, I’ve worked at various organizations that had different stances toward open source frameworks and tools. Some of these organizations absolutely did not want  anything open source near their code base. Others had a small set of “blessed” open source frameworks we were allowed to use. Some of...
  • Java: An Oriented Object Language

    Getting Started Let’s start with the 800lb gorilla in the room, Java. Why Java? Well, let’s start off with the fact that it’s got a ton of community support and documentation everywhere. If you Google a programming problem, chances are within the first three results you will see an example...
  • Neatly Clean Up Your CSS Layout

    Recently I started to use a more minimally-responsive CSS framework called Neat, since I was unhappy with the total offerings of so many others. This article will explain how to start using the basics of Neat in order to better understand how the framework works before using it in projects....
  • How We Improved Our Productivity 500% for $800

    I convinced a partner to upgrade the computers we were using for software development. Maybe this article will help you convince your manager to do the same! Old Computers When I started at the partner, we were using standard issued corporate Dell laptops. Specifically, we had Dell Latitude E6520 laptops....
  • Unlearning jQuery

    Now that you have already learned jQuery, let’s unlearn it and get back to the basics. In this article, we will quickly go over the most common things that jQuery is currently used for and convert them to pure javascript. jQuery is a great tool and contains polyfills that are...
  • Should Developers Learn More Than One Language?

    Why should any developer learn more than one programming language? This is an interesting question. Let’s think of it this way: Does a carpenter only use one type of saw? Does a mechanic only have one type of wrench? No. In short the answer is, as craftsmen of code, we...
  • The Danger of Carrier Objects

    In the everyday world, it’s usually a good thing to have what you need ahead of time, even if there’s a possibility of never using it: I’m going to school, better pack my books; I’m taking a flight this afternoon, better bring some earplugs; I’m going to a meeting, better...
  • Dry Up Your CSS

    As we start to build websites with mobile first in mind, our stylesheets can get messy really quick. In this article, we’ll talk about making your stylesheets more functional and easier to read at the same time. We will take a quick peek into SASS, and the benefits that it...
  • Put the Grunt Work Behind You

    Gulp is quickly becoming the the leading task runner over grunt. If you are currently using Grunt or even worse, an ant task, then I highly recommend this topic for you. In this write up, we will quickly discuss Grunt, Gulp, and Gulp syntax. Grunt When Grunt first came out,...
  • Customizing CSRF Protection in Spring Security

    Starting in Spring Security 3.2, developers gained an easy solution to their Cross-Site Request Forgery problems with Spring’s implementation of the Synchronizer Token Pattern. Spring’s documentation does a great job of explaining Synchronizer Token Pattern and their implementation, so rather than talk about all of that, I’m going to show you...
  • How to Implement the Splitter and Aggregator Patterns with Apache Camel

    I have found that Apache Camel is a good way to load data from log files into a database. Read on to see how I did this using the splitter and aggregator patterns with Apache Camel. Problem We have huge logging files for a project (months of system logging), the...
  • SphinxSearch | Full Text Searching

    This article explains how to use SphinxSE, Sphinx real time indexing, and set up Sphinx in order to improve search query performance.   First some background about issues surrounding full-text search. Why does someone need a full text search engine? A MySql database with over a million records will take...
  • Getting Started with Camel: Error Handling

    Error handling is tricky. Not because it’s especially hard to do, but because everyone (operations, the business team, fellow programmers) seems to have a different idea of how a particular situation should be handled. A web service is down? No problem. You should try again every five seconds, but no...
  • Using Git with Subversion

    If you haven’t heard of Git or don’t understand why you should use it, checkout the talk given by the author to Google (Torvalds, 2007). Git is an excellent version control tool for agile software development. But many of us may not have the luxury of using Git because our company has...
  • Getting Started With Camel: Marshalling

    In my last post on Camel, I spent some time introducing you two of its biggest players, the Context and the Route, by means of a simple problem - processing data coming in via file. If all we had to do was move the file, we could call our job...
  • IRC Reporter

    Recently I was asked to make a bot for a local user group. The bot would simply report new events into the topic of an IRC channel. After the bot was created I decided to write an article about it and publish the code. The code and article  can be found here: http://www.dsmwebgeeks.com/2012/09/creating-an-irc-bot-stephen-dunn/ Basically the bot...
  • Getting Started with Camel, Java, and Spring

    At home and at work, I find that the things that I have to do over and over are the most painful. At home, it’s the dishes; at work, it reading data out of a file or doing Hibernate mappings. No matter what I do, I can’t seem to escape...
  • Iterators, Functors and Predicates

    In this post I am sharing different ways to create ‘Custom Iterators’ and how to control the behavior of that Iterator. Also part of this article focuses on how to apply different operations on a selected elements within a custom iterator. The way to do this is to implement a...
  • Multi-Step Forms in Django

    Forms in Django seem to be a relatively advanced topic if you want to do anything outside of models.  Case in point: I had to develop a multi-step form in django that would spit out a certain result.  There were only two forms that the user needed to fill out,...
  • Injecting Spring Beans into Java Servlets

    If you are working in a Java Web Application and you are using Spring IoC Container in your application, there is a chance that you might have to inject Spring Beans into a Java Servlet. Since there is not a direct way to inject Spring Beans into a Java Servlet,...
  • Static Caching in Drupal

    If you’re a PHP veteran, then you know static caching is a relatively simple thing to do in PHP, but it can result in inconsistent behavior and sloppy code, such as adding an extra parameter to a function for the sole purpose of resetting that function’s internal cache. Drupal’s static...
  • Hibernate Logging

    Through the years I’ve encountered a recurring requirement. Partners need to log changes to the database for auditing and legal purposes. To satisfy this requirement you could add logging to every save/update/delete call in your code. Or better yet, you could create an aspect that wraps these calls. While these...
  • Back to Basics: hashCode() & equals()

    So we all know that if we implement equals() we must override hashCode() too. But why? The best explanation of this commandment can be found in Effective Java (2nd Edition) starting on page 45. ... Failure to do so will result in a violation of the general contract for Object.hashCode,...
  • Learning a new Language

    I attended a No Fluff Just Stuff Symposium a few weeks ago. One of the main emphasis during the weekend was learning new languages that are available on the JVM. While there are a variety of reasons that we need to take time to learn new programming languages, one of...
  • Spring Injection with @Resource, @Autowired and @Inject

    Overview I’ve been asked several times to explain the difference between injecting Spring beans with ‘@Resource’, ‘@Autowired’, and ‘@Inject’. While I received a few opinions from colleagues and read a couple of posts on this topic I didn’t feel like I had a complete picture. Annotations Annotation Package Source @Resource...
  • Debugging memory leaks with VisualVM

    At work I had run into a memory leak when scrolling through large result sets returned from Hibernate. I thought I had fixed it by performing a evict()/clear()/flush() in the HibernateTemplate that I was using but suddenly the leak was back. I was using VisualVm to monitor the heap so...
  • Creating an Open Source Project

    Open Sourcing Software I’ve been using open source software for many years, but I’ve never open sourced my own project. This blog is a record of my experience as I start this journey. The resulting project can be found at http://beanoh.org. Where First I had to decide where to store...
  • Maven 3 Tutorial - Project Setup

    Overview What is Maven? Plugins Why not Ant and Ivy? But It Downloads the Internet Getting Started Install What is a POM? Convention over Configuration New Project Project Management Parent POM Local Maven Repository Multiple Artifacts from a Single Source Release Plugin Aggregate POM Dependency Management Distribution Zip Conclusions Overview...
  • Selenium IDE - Part II

    In Part I we covered Setting Up Recording Tests Playing Back Tests Saving Test Cases Resuming Recording Saving Test Suites All examples will use the sample site https://sites.google.com/site/example4selenium/. Store Value There are two ways to store values. First, you can define custom variables Second you can use the drop-down 'storeText'...
  • Selenium IDE - Part I

    Selenium IDE is a free Firefox plugin that leverages javascript to record automated test scripts. In this first tutorial we will install Selenium IDE and create a basic test script. The next tutorial will cover more advanced topics. I primarily use Selenium IDE in three areas: Defect - I ask...
  • Greasemonkey

    Greasemonkey is an extension for Firefox that leverages javascript to modify the look and functionality of a page. At first glance this tool looks like a neat toy. However, this tool came in quite handy at one of our partners recently. Our partner was tracking their daily status on a...
  • Javascript functions for creating a read-only view

    I’m sure you’ve all been there before. After months of creating page after page of crud screens, you’re now asked to create a read-only view of everything. I usually see this implemented with setting the readOnly attribute on every field to a variable that indicates whether or not the screen...
  • Exploring Design Patterns in the JDK

    Design Patterns are software design solutions that can be applied in our daily software development to help us develop code that is flexible, resilient to change and easily understood (when you are familiar with the pattern). The JDK APIs employ patterns in several areas. So even if you aren’t familiar...
  • Aggregate MyBatis.NET SqlMaps from Multiple C# Projects

    Summary This blog post describes an approach for integrating Spring.NET and MyBatis.NET in a way that lets iBATIS aggregate SqlMap config files from multiple assemblies (a.k.a. assembly scanning) prior to handing out ISqlMapper instances. Teams setting up new MyBatis.NET/Spring.NET tech stacks might find this useful. The Problem Your typical enterprise...
  • Avoid merge hell when committing from Git to a Subversion repository

    Previously (I sound like an episode of desperate housewives!) we saw how we can easily commit an existing Git repository into Subversion. That was great and we can commit changes to our git repository and execute git svn dcommit all day long to send the changes up to Subversion. Now...
  • How to commit an existing git project into Subversion

    In my last post I mentioned how Git’s stash feature finally convinced me that it made sense in my subversion world. Well, once I was well underway on my new project, I’d reached the point where I was ready to commit version 0.1 to subversion. Googling for how to commit...
  • First Glance at PowerShell

    A couple days ago I had the surprisingly excellent opportunity to learn and use Windows PowerShell… What? Don’t look at me like that. I disapprove of Microsoft just as much as the next Linux fanboy, but seriously, this was cool. Just give me a chance to explain. I swear, I...
  • Incrementing Oracle Sequences Without Permissions

    If you are ever working with a database where data is consistently being imported, dropped, and/or restored; sooner or later you will find yourself in the situation where the primary key of a table is no longer synchronized with the sequence used to generate it. If you have the appropriate...
  • Google Analytics Data Export API

    When Google exposed its Data Export API, it endeared itself closer to developers and to customers of Google Analytics. Data Export API allows us to develop client applications to retrieve data from existing analytics profiles of authorized users. How does it work? The Data Export API provides read-only access to...
  • MySQL Master/Slave configuration with EJB3 and JPA

    Well this turned out to be quite an exercise. The goal: scalable reads with MySQL in master-slave configuration, writing to the master, and reading from N slaves, load balanced in round-robin fashion (or something). The problem: using JPA (Java Persistence API) instead of direct JDBC calls. Turns out the MySQL...
  • Rendering Global t:messages After Redirect

    A common problem when working with JSF is getting global info messages  via <t:messages globalOnly="true"> or <f:messages globalOnly="true"> to display messages set in the previous request when you have a <redirect/> in your faces-config for a particular page You will not see your <t:messages> that are set on the previous...
  • Developing a multithreaded test harness

    You can’t ignore the fact that web servers are multithreaded. We can hide as much as we want, but sooner or later you’ll find yourself in the situation where your application works fine during development and testing; but once it hits production you start hearing about “funny” things happening. While...
  • Simple Subversion Branching and Merging

    Branching and merging in Subversion is a great way to work on large new features without disrupting mainline development on trunk.  However, it has a reputation for being so difficult that many developers never take advantage of it.  In this post I’ll show just how easy it really is thanks...
  • Environment Specific Properties in Spring

    On many occasions I want to be able to inject environment specific property values into my Spring managed beans. These may be things like web service endpoints, database URLs, etc. Values I know for each environment at build time, but I want to use the same WAR/EAR file in each...
  • Java EE 6 and Scala

    Last weekend while pondering the question “Is Scala ready for the enterprise?” I decided to write a simple Java EE 6 app entirely in Scala, without using any Java. I had three main reasons for doing this: one was just to see how easy/difficult it would be to write everything...
  • Replacing and Patching Java Application and Core classes

    Why would you ever need that? Say you get a jar file. After using the jar for a while you realize that there is a bug in a class in the jar file. Unfortunately you also find out that the jar is no longer supported and there is no way...
  • IP Addresses in PHP/MySQL

    I’ve been working on a web-based tool that stores, among other network-related things, IP addresses. When I first started I stored each IP address as four TINYINTS (0-255 for each octet): mysql&gt; desc ipaddresses; +----------+---------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +----------+---------------------+------+-----+---------+----------------+ |...
  • Taking Advantage of Spring MVC's Default Behavior

    Over the last several months I have worked on several content heavy websites for one of our partners. When I say “content heavy”, I mean that 80%-90% of the pages in the application are static, or at least mostly static, a customer name, membership number, etc may need to be...
  • Magento Customization

    Magento is an e-commerce framework that is used as an online shopping cart. I am going to talk a little bit about Magento extensions and why they are useful when wanting to customize your shopping cart. Magento extensions allow you to change functionality of the shopping cart while modifying little...
  • Automating the Web with WWW::Mechanize

    And yes, the double colon does mean Perl. However, I know that Python also has the same class modeled after the Perl module. So even if py- is your favorite prefix, this should still be useful. WWW::Mechanize gives you basic access to a “web browser” from your Perl scripts. It...
  • Hibernate Embeddable Objects

    Hibernate Embeddable Objects are a really neat way to organize your data model.  Especially, if you have the same few columns in a number of different tables, that all pertain to the same thing. The example commonly used is Addresses.  You may have a number of tables that each have...
  • Is trying to learn a new language every year worth it?

    While spending time recently looking for something new to learn that looked interesting, and it still being so close to new years, I was reminded of a bit of advice from the book “The Pragmatic Programmer,” learn a new language every year. But is learning a new language every year...
  • Keep your dataTable clean with a custom popup

    The basic idea is to output some data to a user in a table and allow them to take an action on each row individually. A fairly straightforward solution is to create a separate page to link to, passing the necessary row information along. If the action is simple enough,...
  • Building Perl modules on OpenSolaris

    Anyone that’s worked with Perl is probably familiar with CPAN.pm. CPAN.pm is the bundled module that handles downloading and installing modules from the CPAN repository. It usually works flawlessly but I’ve noticed that on OpenSolaris the process can be a bit more spotty. Let’s try installing Mason as an example:...
  • Spring's refreshable beans

    A couple of days ago I found out about a really nice feature in Spring, called ‘refreshable bean’. Spring’s vision a refreshable bean is a dynamic-language-backed bean that monitors changes to its source code and then reloads itself when changes occur. And it is all this is done without restarting/re-deploying...
  • YUI3 Lets You Call Webservices With No Server Required

    I like YUI3, mostly because I can use it to fill in the gaps between HTML4 and HTML5, and also because a single line of code can make a button zoom around the page: var myAnim = new YAHOO.util.Anim('testButton', { width: { to: 400 } }, 1, YAHOO.util.Easing.easeOut); Also, I...
  • ColdFusion for Rapid Application Development

    I’m helping to write a tool to edit simple database information in a browser. ColdFusion is meant for rapid application development and is perfect for this or any small scale data project because it’s very easy to quickly make pages and is designed for use with a database. One of...
  • Spring Roo Sample App Tutorial

    In this blog, I will start creating a web application used to organize bookmarks. Because only certain bookmarks are of interest to specific groups of people, I will use groups in our LDAP server to control which users see which groups of bookmarks. The entire blog will be released in...
  • Building Multi-Criteria Search Queries in Hibernate

    In this post I am going to show how to write queries multi-criteria search screens. There are two approaches for making this possible. HQL for building the Query Building Query using Criteria API HQL for building the Query Here I am going to show 2 approaches to building the HQL...
  • Word Counts Example in Ruby and Scala

    A while ago I was asked, as a pre-interview task for another company, to write some code in any language that counted word frequencies in these newsgroup articles. I recently came across the Ruby and Scala scripts I wrote and thought it would be fun to post them. First, here...
  • Vim splits, an introduction.

    First off, lets get some test files: for i in foo bar cat dog ; do echo $i &gt; $i ; done; This creates 4 files named  foo, bar, cat and dog. Each file has a single line that contains the file’s own name. Let’s open the first file: vim...
  • PL/SQL Variables and Connection Pooling

    I recently had to implement a common feature across multiple applications and app servers, all of which point to the same Oracle database. For reasons unrelated, I chose to implement this feature using PL/SQL. You can all stop laughing now. I ended up with something resembling: create or replace package...
  • Sorting your Beans

    Need to sort a list of custom objects? Instead of coding up a custom implementation of your favorite sorting algorithm, you can simply use the tools provided in the Collections class (Collections framework) paired with the BeanComparator class (Apache project). Simple example: you have a List of Person objects and...
  • Add some "magic" to PHP apps: Dynamic properties

    There are no doubts that PHP made a huge impact on Web development industry. Because of it’s flexibility, PHP finds it’s usage in many areas, starting from simple Web sites and ending with complex Web applications (i.e. frameworks, shopping carts, etc…). So, today I’d like to share with you how...
  • Spring LDAP Group Authorization Tip

    The folks at Spring have made it extremely easy to allow your application authenticate and authorize users with Spring LDAP. This blog entry explains how to check your directory structure and use some sparsely documented Spring LDAP parameters ({0} and {1}) to get everything working. In your Spring Security configuration,...
  • Strict Quote Escaping in Tomcat

    I just started here at Source Allies (loving it here so far, btw!) and inherited an aging code base to resurrect. It was originally deployed on Tomcat 5 and one of the issues I encountered upgrading to Tomcat 6 was strict quote escaping. The code base has lots of JSPs with...
  • Nutch and Solr for Open source “Google-like” search??

    This is a follow-up blog to Matt’s earlier post on Open Source Enterprise Search We all love Google don’t we? Right from searching the web or the company intranet to searching internal source code, we just “google” everything. Now, won’t it be more fun to do by yourself what Google...
  • Solr – features and configuration details

    Solr is a standalone enterprise search server with a web-services like API. You put documents in it (called “indexing”) via XML over HTTP. You query it via HTTP GET and receive XML results. Some of the main features of Solr are: Advanced Full-Text Search Capabilities Facilitates Faceted browsing: Narrowing down...
  • Nutch - features and configuration details

    Nutch is a framework for building web-scale crawlers and search applications. It is free and Open Source and uses Lucene for the search and index component. Nutch is built on top of Lucene adding functionality to efficiently crawl the web or intranet. Now the most obvious question is “Why Nutch...
  • Hibernate Criteria trick

    So here’s the situation. Let’s say I have this query here: SELECT * FROM employees WHERE employee_id NOT IN ( 1234 , 3456 , 5678 ); How do we do that with the Hibernate Criteria object with a Restriction? You would think that the Restrictions API would have a “not...
  • Image Processing Using ImageMagick and JMagick

    Introduction to ImageMagick ImageMagick® is a software suite to create, edit, and compose bitmap images. It can read, convert and write images in a variety of formats (over 100) including DPX, EXR, GIF, JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript, SVG, and TIFF. Use ImageMagick to translate, flip, mirror, rotate, scale,...
  • Regarding JPA - is the EntityManager a DAO...

    Do we really need ServiceInterface, ServiceImpl, DaoInterface, and DaoImpl? Or can we just say the EntityManager is the DAO, and blow away a generally unnecessary layer? On CRUD apps, 9x out of 10, the service layer is merely a pass-through to the DAO. Is there time to be saved here?...