Home |  Lands End to John O Groats Unsupported |  Services |  Side Projects |  Posts (archive) |  Miles Davenport |  Career
lambda |  algorithms |  good devops |  bad devops |  boris and hector :)
i'm so glad I chose this career |  the Konkan railway “Engineer message” |  Knowledge |  avoid |  RSS

I'm happier on a bicycle :)

Enjoying the simple things in life :)

It’s a wonderfully sunny day out there, and after some revision this morning, it was time for me to do my weekly shop.

For the vast majority of you, this probably involves using a car of some description.

I own a car, but to be honest, I find them a right nuisance. It takes ages to get out of town, caused by other cars, or lorries, or something else creating congestion.

Driving in the South East of the UK is not much fun, because there are far too many cars…

miles davenport

Boris the Brompton helps fix that. Over the last year, I have switched to using a bicycle for most of my local travelling (sometimes further afield).

Why do I do this. Fitness, changing attitude, saving money. All of these.

But the main reason is enjoyment.

I love cycling, and today was no different. I cycled into Chesham, stopped off at the market, got the weeks provisions, and then returned home.

I was able to wheel my bicycle straight up to the market stalls, and buy exactly what I wanted.

The simplicity of cycling, and knowing that I am not driving a car for a local (ten mile) trip.

Being outside in the sunshine, and being aware and involved in the bigger picture.

Yes I do smile, because i’m happier on a bicyle.

There was the most amazing cheese at the market, and it was imperative to re-supply with cheese :D

I had bought some crusty bread, on my return journey, stopped for lunch.

A nice cup of tea, Somerset blue cheese, crusty cheese, by the river Chess, in the sunshine.

»


Bad Design

Good design makes people want to use something

….or at the very least, is gives intuition the best chance of succeeding.

In other words, the phone rings, you know “what to do”, you pick it.

An old telephone had a single main function - to make and receive telephone calls :)

Fast-forward to today, and you have a versatile, rich, highly developed technology eco-system.

If you are a geek, male, and you live and breath technology, you are well catered for.

The fun starts when you don’t fall into this category.

Say you are an older person, and you feel that technology has passed you by.

Do you have any idea what sort of up-hill battle it will be to get that individual to “engage” (with technology)?

No, let’s stick with the young consumers. Oldies can wait. But hang on, wait a minute…

We will all be old some day, and I don’t want to be trapped by technology.

I want to be able to use technology in a familiar way, just like answering the telephone.

Let me ask you a question - how many older people (do you think) are lonely? Quite alot.

It would be amazing to do something about this. One major step would be to make tech easier to use.

It would allow people to use something like Skype easily. This is not my experience of a smart / mobile phone.

You are deluged by app updates. The user interface is over-complicated. The result is something which is not intuitive to an older person.

Technology does exist to help older people. But it often patronises, or makes “wrong” assumptions.

Technology should not assume the worst. An older person is not a child. The design of technology should not cater for the worst possible scenario.

The worst possible scenario is when you get an old persons alarm installed in your house…

And it’s red, and it has to be located in your lounge. The problems are numerous, but include the colour, yes it’s red, and it shouts “I am a red alarm in your lounge.”

The person (and this is important) doesn’t want to have a sodding red alarm in their front room.

Why can modern technology not learn about good design, usability, kiss (keep it simple….).

If we started adopting these principles, then the hill, I mentioned previously, would be less of a climb, and the lonely people may not be as lonely.

Imagine what it would be like to have smart technology which is easy to use, benefitting, not patronising, but helping people.

It would be amazing.

To make this happen, it’s time that reliability, design, function, and simplicity were applied to technology.

I want this to happen.

»


The "Out of Order Bathroom, and Why You Should Care, "regardless......"

That’s fine….. Why should I….. It’s got nothing to do with me…..

Or has it….got something to do with you?

Today has been really frustrating. I had a great afternoon with friends, but the return journey home on the train was not great.

To put it bluntly, I had eaten something which hadn’t agreed with me, and I needed the bathroom badly :(

I arrived at Stevenage station, and the bathrooms were all out of order. A twenty minute wait for the train, and I was uncomfortable.

The train toilet was out of order. I had to wait in agony.

Thirty minutes later, I managed to end the discomfort, and started to feel better.

This got me thinking.

There is the most basic human need to be able to use a clean bathroom. It would appear that the UK national rail operator doesn’t understand this basic need.

It doesn’t stop there. I am a healthy male in his forties, who was uncomfortable. What about if you are a mother, with children, or an elderly gentleman?

don't care

There is an acceptance, where people do just that - accept it. I have always disliked apathy, and the associated “it’s got nothing to do with me.”

Well, it has got something to do with you. Because if we all didn’t bother, where would we be?

“Yes you heard. You should care.”

I’m not just referring to bathrooms, but anything.

It’s not fashionable to care. It’s far easier to say “nothing to do with me”.

But regardless of what you do, you should care.

Because the smallest change is worth it.

Try it:

Improving things is infectious

Sharing knowledge

Self-service and self-sufficiency

Look for solutions

Includes impromptu plumbing :)

It’s important that people do care, and take responsibility.

»


Debugging Java 8 Streams

The peek() method is useful for debugging Java 8 stream(s).

This example doesn’t need an explicit peek(), but it shows how useful the peek method is for debugging:

package com.chocksaway;

import java.util.List;
import java.util.stream.Collectors;

/**
 * Author milesd on 31/12/2017.
 */
public class FilterNumbers {
    private List<Integer> numberList;

    public FilterNumbers(List<Integer> numberList) {
        this.numberList = numberList;
    }

    public List<Integer> process() {
        return numberList.stream()
            .filter(each -> each > 15)

            // peek for the first filter
            .peek(each -> System.out.println("Debug 001:\t " + each))

            .filter(each -> each % 3 == 0)

            // peek for the second filter
            .peek(each -> System.out.println("Debug 002:\t " + each))

            .collect(Collectors.toList());
    }
}
Corresponding Unit Test:
import com.chocksaway.FilterNumbers;
import org.junit.Test;

import java.util.ArrayList;
import java.util.List;

import static junit.framework.TestCase.assertTrue;

/**
 * Author milesd on 31/12/2017.
 */
public class TestFilterNumbers {
    @Test
    public void peekAtLambda() {
        List<Integer> numbers = new ArrayList<>(List.of(12, 13, 14, 15, 20, 21, 24));
        FilterNumbers filterGreaterFifteenDivisibleByThree = new FilterNumbers(numbers);

        List<Integer> result = filterGreaterFifteenDivisibleByThree.process();

        assertTrue(result.contains(21));
        assertTrue(result.contains(24));
    }
}
Running the Unit Test

The debug output:

Debug 001:	 20
Debug 001:	 21
Debug 002:	 21
Debug 001:	 24
Debug 002:	 24

peek() shows the Debug 001, and Debug 002 for the first and second filter second statements.

»