Sunday, 22 March 2015

Laws, JUnit, and Hamcrest

Came across a couple of different laws this week, 

The robustness principal / Postel's law, interesting idea on how it can be used within software construction although originally for use in networking. 

Be conservative in what you do, be liberal in what you accept from others (often reworded as "Be conservative in what you send, be liberal in what you accept").

Command query separation (CQS), the idea for what I write would be a function or method should return a value for query and for command which would change the system's state in some way should return void.

Installing JUnit for IntelliJ 14, although IntelliJ does come with JUnit installed and a test runner, JUnit has a dependency on Hamcrest. It was not entirely clear where what and how was going wrong, so...

  1. Hamcrest at Google code.
  2. IntelliJ -> File -> project structure
  3. Modules -> Dependencies -> + icon top right
  4. Point to hamcrest, YAY!
Book cover with white text and hands using a tool on wood


Book read this month, The software craftsman, has some good ideas, I did like the whole job searching and what to look for, generally that a dev would have written the job description and more concerned about what the dev can deliver. I often see degree only, 10 or more years experience.

Sunday, 15 March 2015

Back to learning Java

Little things from podcasts and bits online, 

Strangler pattern, interesting idea, by taking the shape of current system you strangle the older system in the same way ivy does. 

Conway's law, the idea that systems being developed mirror the social structure of the company creating it.

UK Business insider with an article about rates of pay and different technologies and skill sets. 

Trying to get up to speed with Java doing basic coding challenges, very different to how intuitive I found visual studio.

Intellij using the darcula theme with a second window showing a black triangle
Challenge 203, display a black triangle
 
Challenge 202 convert binary to English

public class Main {

    public static void main(String[] args) {
        String input "010010000110010101101100011011000

11011110010000001010111011011
11011100100110110001100100";
        char[] inputs = input.toCharArray();
        List<String> inputsAsWords = new ArrayList<String>();

        int wordLength = 8;
        int wordLettersinInput = input.length() / wordLength;
        int counter = 0;
        for (int i = 0; i < wordLettersinInput; i++)
        {
            String Word = "";
            counter += wordLength;
            for (int k = i*wordLength; k < counter; k++  )
            {
                Word = Word + inputs[k];
            }

            inputsAsWords.add(Word);
        }

        for (String word: inputsAsWords)
        {
            System.out.print((char) Integer.parseInt(word, 2));
        }
    }
}


Long graphics card with a large looking gpu on a desk

More kit going to the recycling, this time it was a broken card, folding at home is hard on cards, removed the cooler for other projects. I did find whilst throwing rubbish out my old TIM-clean. TIM-clean, citrus based solvent that is actually friendly compared to isopropyl alcohol and effective.

Sunday, 8 March 2015

Recycling

Recycling old kit, you will be missed, go now to silicon heaven with all the old calculators. 



Also frustrating and rewarding the app inventor, had to do some bits for uni. I am old so programming in this way is quite strange.