RSS Feed Subscribe to RSS Feed

 

Post Production Debugging

Monitoring and Observing Your App Post Release

Pre-release tests are essential, but the ability to debug, monitor and observe your application suite post-release is what allows you to detect, and quickly fix, the production problems that will inevitably rise.

(more…)

Tags: , , , , , , , , , ,

AWS S3 SLAs

According to the AWS S3 docs, S3 is designed for 99.99% availability over a given year, but their SLA compensates you when availability drops below 99.9% monthly uptime. That is, you will receive some level of refund (up to 25%) if there is more than 43 minutes of downtime per month.

(more…)

Tags: , , ,

Copy & Paste buffer

Why be only limited to have a single item in your Copy & Paste buffer?! There are several tools out there that can do this, but my favorite (on the mac at least) is Butler.

(more…)

Tags: ,

A brief introduction to SAML

 

SAML, or Security Assertion Markup Language, is an protocol used to exchange authentication and authorization data. It is XML based and allows the sharing of identity between multiple organizations and applications.

SAML is one of the fundamental cloud identity security standards.

The primary use case of SAML is Internet Single Sign On (SSO).

(more…)

Tags: , , , , , ,

Getting rid of IntelliJ warning: Local variable is redundant

When dealing with a piece of code like this

    String id = "abc";
    return id;

IntelliJ may give a warning message:

    Local variable 'id' is redundant

I can see IntelliJ’s point. The code could be rewritten as follows:

    return "abc";

However, sometimes it can be useful to use a variable name as a form of documentation.
Also, and more often, I don’t want to see this warning pop up for other people’s code! If they wish to use a “redundant” variable, who am I to argue? I certainly don’t want to be warned about it every time I do a commit.

To disable this warning, deselect the following:

Preferences -> Editor -> Inspections (-> Java) -> Data flow issues -> Redundant local variable -> Ignore immediately returned or thrown variables

Or you can setup custom handling for tests (e.g. weak warnings) under Severity by Scope.
(Based on IntelliJ 15)

Tags:

Chrome Keyboard Shortcuts

I typically use Chrome as my browser of choice, and it comes with a plethora of keyboard shortcuts that I find incredibly useful and use constantly. However there are ways to add to those shortcuts too, including a tool called Vimium…

(more…)

Tags: , , ,

Running tests in IntelliJ for a multi module maven project

This post shows how to run all the tests in IntelliJ for a multi module maven project.

(more…)

Tags: , , ,

Docker talk at SVCC’15

Some short notes from a talk from Ted Young on the Docker ecosystem. Slides available here.

BusyBox – a number of use linux tools packaged up in to a single file. “The Swiss Army knife of Embedded Linux”

CoreOS and Red Hat’s Atomic are particularly suited for running containers, work well with (and I think even come preinstalled with) Docker.

VM vs Container. VMs ofter have multiple apps running in them (e.g. a tomcat with multiple apps running it int). With containers it is typically 1 app per container. Containers typically run within a VM (although can run on “raw metal” too). Multiple containers per VM? – I’m not so clear on!

Cgroups may be used to limit and control resource usage.

12 Factor apps – Good practices for building “cloud native” or software-as-a-service apps.

 

Tags: , , , ,

Using Butler shortcuts to enter commonly used text

Is there a piece of text that you find yourself typing again and again? Want a keyboard shortcut to enter it? For example, pressing Alt-E to enter your email address anywhere.

The solution I use is Butler. It is an extremely versatile tool.

  • With Butler running, go to Configuration
  • Right click on Hidden Items
  • Smart Item -> Text (in the most recent version, it seems to be Smart Item -> Clipboard -> Plain Text)
  • Under Triggers, specify your ‘Hot Key’ keyboard shortcut
  • Under Text, specify your frequently entered text e.g. email address

Done! The next time you press Alt-E anywhere, your email address will show up.

Notes:

  • You are probably wise to choose a more obscure shortcut the Alt-E to avoid clashes with other apps, but the principle remains.
  • I use LastPass to automate filling in entire forms (name, address, email), but the approach I describe here can be used anywhere (in a document, IM window, whatever).

 

Tags: , , ,

Getting rid of IntelliJ warning: Value ‘yourVariable’ is always ‘null’

IntelliJ was giving me a warning message like this:

Value ‘yourVariable’ is always ‘null’

I often set values to be null for tests (e.g. checking a method can deal with a null parameter), so I wanted to disable this warning.

To do so, deselect the following:

Preferences -> Editor -> Inspections -> Probable bugs -> Constant conditions and exceptions -> Warn when reading a value guaranteed to be constant.

Or you can setup custom handling for tests (e.g. weak warnings) under Severity by Scope.

(Based on IntelliJ 14)

Tags:

Keyboard shortcuts in Mac finder

Following on from my IntelliJ shortcuts, here are some useful Mac finder shortcuts…

(more…)

Tags: , , ,

Keyboard shortcuts in IntelliJ

I attended a talk by Hadi Hariri at JavaOne last week. He introduced a whole bunch of IntelliJ keyboard shortcuts I was not aware of. Very useful talk. I have listed some of the most useful ones below. Or see the official reference card.

(more…)

Tags: ,

Web frameworks

There is no right answer to the question of what is the best Java web framework. Still I end up asking it to myself every time a new project crops up.  I did a post on a related talk I saw at JavaOne last year, which provoked a lot of debate and some really interesting responses. More recently, this report from Zero Turnaround is useful and this comparison from Matt Raible is also well written.

I have also been swayed in the past by the Thoughtworks technology radar in which component based frameworks (which, I think, in the Java world includes JSF, Wicket and Tapestry) get a thumbs down e.g. see the May 2013 radar.  GWT has also in the past (see July 2011 radar) been singled out as something to avoid.  Presumably Vaadin falls in to the same ‘hold’ category.  Full disclosure, I’ve had limited exposure to these types of frameworks personally though.

My own preference remains Spring MVC. It is relatively easy to setup (especially with Spring Boot), provides decent testing support, and obviously integrates well with the rest of the Spring ecosystem.  I am admittedly biased due to already knowing Spring core, but so be it.

My recent, albeit limited, experience with Struts2 is that I have been fairly pleasantly surprised.  It wasn’t as bad I was expecting! The Action classes, which are instantiated for each request, and hence threadsafe, are fairly easy to use and test.  I am not so fond of the xml mappings and the variable passing that gets done there though.  It seems kind of clunky, although there may be a better way I am not aware off.

Still, I am not likely to start using Struts by choice on my own projects anytime soon. Spring MVC remains my go-to web framework.

 

 

 

Tags: , , ,

Setting up a macro in Word to paste unformatted text

As a developer, I frequently need to copy and paste code into Microsoft Word documents, but often want to remove the formatting in the process.

This post explains how to set up a macro, and associate it with a keyboard shortcut, to do the equivalent of Edit -> Paste Special -> Unformatted Text. I have tested it on Word: Mac 2011.

(more…)

Tags: , , , , ,

Live Templates in IntelliJ

As described here, IntelliJ’s live templates let you easily insert predefined code fragments into your source code.
I have posted some of my most used templates below, a link to my complete list of template files on GitHub (as a reference for myself when I setup new IntelliJ environments) and the steps I took to add the IntelliJ settings file to GitHub.
(more…)

Tags: , , , , , ,