# Shaun Abram

Java and Technology weblog

## Git revert a merged branch

The article discusses how to revert changes that have already been pushed to your remote git branch, particularly reverting the changes that come from a branch merge.

Tags: git, github, gitpr, gitreset, gitrevert

## Don’t use “kill -9”

In the past, any time I wanted to stop an errant process on unix, I just used “kill -9”. By default. Without thinking about it much.

Then a colleague commented to me that you should *never* use kill -9. It terminates the process with no chance to shutdown in an orderly manner, and so can leave things in a bad state, such as corrupting files. “But what else am I supposed to do!?” I naively asked.

There are of course many other options for the kill command (see links below), but here are some alternatives you can try, in the order you may want to try them.

Tags: bash, commandline, kill, unix

## Creating a Maven multi module project

There is no easy way, or simple archetype, to create a maven multi module project. The approach below is the best way I’ve found so far.

## Switched to HTTPS

I recently switched the WordPress and domain name hosting for this blog from Bluehost to SiteGround, and enabled https in the process.

Tags: hosting, https, ssl, tls, wordpress

## Continuous integration / Continuous Delivery / Continuous Deployment

The terms Continuous Integration, Continuous Delivery and Continuous Deployment can still confuse. Even Jez Humble, author of the book Continuous Delivery commented that there is “confusion around the terms continuous delivery versus continuous deployment and my own thinking and definitions have changed”.(1)

This is my attempt to distinguish, based on the sources listed below.

Tags: ci, continuousdelivery, continuousdeployment, continuousintegration, devops

## What is a Development Manager?

In a previous posting on Agile, I discussed the 3 main roles in Scrum: Scrum Master, Product Owner and the dev team. However, there is also an additional role that is not always considered core, but which is increasingly an integral part of Agile, and that is the Development Manager.

Tags: agile, developmentmanager, devmanager, management, phb, scrum, scrummaster

## What Is Agile?

Agile software development is an approach to developing and delivering working software into production in incremental, iterative work cadences, known as sprints.

Being ‘agile’ is more of a philosophy than a set of rules. It is a mindset to continually improve; to embrace new ideas and implement the best ones, testing in the wild all the while to find what really works. Collaboration, feedback and iteration are key.

In this post, I will briefly touch on the Agile Manifesto where it all started, before looking at some basic concepts (feedback) and alternatives (waterfall), before the main bulk of the article, which is the flavors of Agile, including XP, Kanban and, primarily, Scrum.

Tags: agile, extremeprogramming, kanban, methodology, scrum, scrummaster, xp

## Where is the Diagonal key?!

I try to use keyboard shortcuts wherever I can, but struggled recently to find the ‘Diagonal’ key. This post shows how to find it, and any other hidden keys, using Apple’s Keyboard Viewer app.

Tags: ergonomics, keyboard, keyboardshortcuts, productivity, shortcuts

## Project Euler: Problem 3 in Ruby

Problem 3 in Project Euler is as follows:

The prime factors of 13195 are 5, 7, 13 and 29.

What is the largest prime factor of the number 600851475143 ?

I had previously solved this in Groovy/Java. Here is my Ruby solution…

Read my solution below

## Project Euler: Problem 2 in Ruby

Problem 2 in Project Euler is as follows:

Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:

1, 2, 3, 5, 8, 13, 21, 34, 55, 89, …

By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.

I had previously solved this in Groovy/Java. Here is my Ruby solution…

Read my solution below

## Project Euler: Problem 1 in Ruby

In the process of trying to enhance my Ruby Skills, I am revisiting some of the Project Euler problems. I previously did problem 1 in Groovy/Java. Here is my Ruby solution.

Read my solution below

## Immutability

Immutable classes are inherently thread safe, and can only ever be in a single state. A class can be made immutable by:

- all fields being final and private
- no mutator (setter) methods
- class can’t be extended (e.g. make final) to avoid subclasses making things mutable
- provide exclusive access to any mutable components (e.g. getters provide defensive copies of collections)

See Item 15:Minimize mutability in Effective Java for more details.

Tags: effectivejava, immutable

## Steve Jobs quote

Came across this quote from Steve Jobs today. Love it.

Life can be much broader, once you discover one simple fact, and that is that everything around you that you call life was made up by people that were no smarter than you. And you can change it, you can influence it, you can build your own things that other people can use. Once you learn that, you’ll never be the same again.

## Project Euler: Problem 6 (in Java)

Problem 6 in Project Euler is as follows:

The sum of the squares of the first ten natural numbers is,

1^(2) + 2^(2) + … + 10^(2) = 385The square of the sum of the first ten natural numbers is,

(1 + 2 + … + 10)^(2) = 55^(2) = 3025Hence the difference between the sum of the squares of the first ten natural numbers and the square of the sum is 3025 − 385 = 2640.

Find the difference between the sum of the squares of the first one hundred natural numbers and the square of the sum.

Tags: euler

## Project Euler: Problem 5 (in Java)

Problem 5 in Project Euler is as follows:

2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.

What is the smallest number that is evenly divisible by all of the numbers from 1 to 20?

Tags: euler