Efficiency Matters

Efficiency causes the majority of our high standard of living
across most areas of life. We should all be concerned with efficiency.


About Me

I am an entrepreneur, author and software developer focused on efficiency. Analyzing and conveying ideas of efficiency across various domains is what drives me. I want to make people efficient, to write books and articles that teaches efficiently, and to be as efficient as possible in the process.

My Work

My software development tutorial website contains 600+ texts organized into structured trails.

My tutorials are intended to be concise yet comprehensive, to enable readers to learn the topics as efficiently as possible. Too many tutorials on the web are either long but not concise, or short but not comprehensive, effectively making them inefficient for learning.

I have published a few books on software development. As with my tutorials, my books are intended to be as concise yet comprehensive as possible, making them fast to read yet sufficiently educational. My books are cheap too, enabling the readers to spend their money more efficiently.

Software development books from big publishers are often too long and expensive, making them an inefficient investment in terms of the time spent reading them, and the money paid for them.

Open Source 
I have developed a few open source components over time, mostly because I was unsatisfied with what was already out there. Many open source projects tend to bloat over time, rather than reaching a mature state with a good set of core funtionality and staying there.
I am not actively developing these projects anymore, but I am still using them in many of my projects.

Butterfly DI Container
Butterfly Web UI
Butterfly Persistence
Butterfly Scheduling
Butterfly Testing Tools
JSP Prize Tags
Mr Persister ORM

Book Reviews 
From time to time I come across books that are either really good, or really bad. When I do, I may write a book review so that you can avoid the bad books and get directly to the good books. I tend not to write reviews of books that are just plain average. Books that are worth reading, but do no stand out. If you have a book you want me to review, let me know.


The AtomicIntegerArray class in Java represents an int array which can be updated atomically. This tutorial explains how to use the basic functionality of the AtomicIntegerArray.

HTML5 File API Tutorial
The HTML5 file API enables JavaScript inside HTML5 pages to load and process files from the local file system. Via the HTML5 file API it is possible for JavaScript to process a file locally, e.g. compress, encode or encrypt it, or upload the file in smaller chunks.

The Declarative Delusion
This article explains why declarative languages are not better than imperative languages.

Java NIO AsynchronousFileChannel Tutorial
In Java 7 the NIO API had some asynchronous classes added. One of these is the AsynchronousFileChannel which makes it possible to access files asynchronously.

Vert.x Timers Tutorial
Vert.x contains two types of timers that make it easy to create scheduled jobs. This tutorial explains how these two timers work.

Vert.x TCP Client Tutorial
Vert.x comes with an easy to use TCP client class called NetClient. This tutorial explains how you use NetClient.

Vert.x TCP Server Tutorial
Vert.x comes with a TCP server which makes it easy to create TCP servers in your application. This tutorial explains how to work with the Vert.x TCP server.

Vert.x HTTP Client
Vert.x contains a HTTP client that makes it easy to make HTTP requests asynchronously. This tutorial introduces you to the Vert.x HTTP client.

Vert.x HTTP Server
Vert.x makes it easy to create an HTTP server so your application can receive HTTP requests. This tutorial explains how you create and work with the Vert.x HTTP server.

Vert.x Buffers
In Vert.x you often have to work with raw binary data (e.g. a HTTP response). You do so using Vert.x Buffer instances. This tutorial explains how Vert.x buffers work.

Vert.x Verticles
Verticles are the components you deploy to Vert.x which initialize your application. This tutorial explains how to implement, initialize and deploy verticles with Vert.x.

Java NIO Files - updated
I have added a section about how to traverse directory trees using the java.nio.file.Files class with examples showing how to find a file and how to delete a directory with all files and subdirectories recursively.

Vert.x Tutorial Started
Vert.x is an open source, reactive, polyglot toolkit or platform running on the Java Virtual Machine. You can think of Vert.x as an alternative to Java EE, but based on a different philosophy and internal design.

Concurrency Models Tutorial
Concurrent systems can be implemented using different concurrency models. A concurrency model specifies how threads in the the system collaborate to complete the jobs they are are given. This tutorial explains three popular concurrency models in use today.

Java Command Line Argument Parser
This tutorial explains how to parse command line arguments with switches etc. in Java using a class I have released in open source. The class is available in the tutorial or on GitHub.

Don't be a Herdie
Herdies do what the rest of the herd does without questioning it. Don't be a herdie. Think for yourself.

Amdahl's Law
Amdahl's law can be used to calculate how much a computation can be sped up by running part of it in parallel. This tutorial explains the mathematic equation, shows calculation examples and shows a simple, visual explanation too.

Non-blocking Concurrency Algorithms
Non-blocking algorithms are algorithms that do not block the threads involved in them. Non-blocking algorithms can provide better performance and lower latency than blocking algorithms for low to medium contented shared data structures. This tutorial explains the reasoning behind non-blocking algorithm design.

Java NIO Files
The Java NIO Files class provides an easy way to perform common file system operations like creating directories, copying, moving and deleting files etc. The Java NIO Files class is new in NIO 2 (Java 7).

Java NIO Path
The Java NIO Path class provides an easier way to work with file system paths. You can work with absolute paths, reletive paths, make modifications to paths, and obtain information about them. The Path class in new in NIO 2 (Java 7).

Java Math Operators and Math Class
I have started a text about math in Java. It covers both the basic Java math operators as well as the Java Math class. It does not yet cover all of the Java Math class, but I will update the tutorial from time to time until it covers all the interesting parts.

Java Inheritance - Updated
I have updated my Java inheritance tutorial to include information about how inheritance works in relation to constructors and nested classes, and to explain the instanceof instruction too.

Java Nested Classes - Updated
I have updated my Java nested class tutorial. Did you know that Java had 4 different types of nested classes, of which "inner classes" is only one of them?

Java for each Loops
I have updated my Java for loop tutorial with a section on the Java for each loop that was added in Java 5.

Java do while loops
I have updated my Java while loop tutorial to include a section on the less known do-while variation of the while loop.

Java Arrays
Everything you have ever wanted to know about Java arrays, including how to declare, instantiate, iterate, copy, fill, sort, search etc. Java arrays.

Java Fork and Join
This new tutorial explains how to use the ForkJoinPool in Java 7 to use the fork and join recursive work break down technique, for parallizing task execution.

jQuery - Creating an Expandable Tree
This tutorial explains how to turn a ul element into an expandable tree with jQuery.

jQuery - Generating a Table of Contents
This tutorial shows how to use jQuery to generate a table of contents inside an HTML page, based on the headlines in the HTML page (the h1 to h3 elements).

jQuery Selectors Tutorial Updated
I have made several rounds of updates to my jQuery selectors tutorial. It is now a whole lot more complete.

Android Buttons
Android buttons are used to activate actions in your Android apps. This Android button tutorial explains how to insert text and image buttons in your Android apps.

Java Memory Model Tutorial
The Java memory model specifies how the Java virtual machine and Java programs work with the memory in the computer your Java programs run on. This tutorial explains the Java memory model.

Android TextView Tutorial
The Android TextView component can display text in your Android app's GUI. You can display either regular text or simple HTML. This tutorial explains the basics of using TextView in your Android apps.

Android Web App Tutorial
This tutorial explains everything you need to know about making Android web apps - apps where part of the GUI is rendered by a WebView using web technologies (HTML, CSS, JavaScript, SVG). The tutorial covers loading content from a remote server, intercepting HTTP requests, embedding web resources inside the app, and much, much more.

Java's AtomicLong
I have expanded my tutorial on the built-in Java concurrency utilities with a text on the AtomicLong class which provided atomic operations on a long variable.

Android Layout
This new tutorial explains how layout works in Android with layout XML files, ViewGroups and Views.

AngularJS $timeout and $interval Timing Services
The AngularJS $timeout and $interval services can schedule a function for execution later. This tutorial explain how these services work.

Android Toast Tutorial
Android Toasts are small messages that can be displayed on the screen for a short time period, similar to a tool tip, popup notification etc. This tutorial explains you how to create and show Toasts in your Android apps.

Android Fragment Tutorial
Android fragments are components which can be reused across different Android activities. You can add, replace and remove fragments from activities at runtime, making fragments a very flexible way to create dynamic subviews in your Android apps.

Your First Android App
This tutorial takes you through creating your first Android app with Android Studio, including running the app on your Android device.

Android Project Overview
This tutorial gives you an overview of the files and directories an Android Studio project contains.

Android Core Concepts
This text explains the core concepts in Android you need to know if you want to develop Android apps.

Android Development Tutorial Started
I have finally started my Android development tutorial. It's not yet so extensive, but it will get there!

Installing Android Studio
This tutorial explains shortly how to install Android Studio which you use to develop Android apps in.

CSS Box Shadow
CSS box shadow can be used to add shadows to HTML elements so they look elevated above the page, like in 3 dimensions.

CSS Transitions
Text no. 29 in my CSS tutorial is about CSS transitions which enable you to animate changes to CSS properties. Thus, you can increase the width of an element gradually instead of immediately. This can create some nice effects in your web page.

CSS 2D Transformations
This latest CSS tutorial explains how to perform 2D transformations on HTML elements with CSS 3.0.

Java's AtomicInteger
Java's AtomicInteger provides atomic (thread safe) operations on an int variable. For instance, get(), set() and compareAndSet(). This is useful if you have multiple threads with access to the same int value.

Java's AtomicReference
Java's AtomicReference provides atomic (thread safe) operations on an object reference. For instance, get(), set() and compareAndSet(). This is useful if you have multiple threads with access to the same object reference.

Java IO: FileWriter fixed
The Java IO FileWriter tutorial was by accident replaced with the FilterWriter tutorial. I have now restored the FileWriter tutorial!