Articles and information week:

The Mythical 10x programmer.. This was a great writeup and I thoroughly enjoyed reading it as a developer. The discussion of 5% design will go a long way, is so true. I also liked the fact that it nailed some points like knowing data structures and C will help a long way. Talking about data structures, the interview article by programmers Omin from Nigeria was another interesting one.
The problem that I solved from free code camp was a good one. I know my solution was not efficient and elegant.

Problem statement- Diff of two arrays

[“diorite”, “andesite”, “grass”, “dirt”, “pink wool”, “dead shrub”], [“diorite”, “andesite”, “grass”, “dirt”, “dead shrub”] should return [“pink wool”].

Solution

function diffArray(arr1, arr2) {
    var newArr = [];
    var arrHolder = [];
    var savedArr = [];
    var arr1Array = Array.prototype.slice.call(arr1);
    var arr2Array = Array.prototype.slice.call(arr2);
    var neverPopped = 0;
    if (arr1.length > arr2.length) {
        for (var i = 0; i < arr1Array.length; i++) {
            arrHolder.push(arr1Array[i]);
            if (arr2Array.indexOf(arr1Array[i]) >= 0) {
                arrHolder.pop();
                neverPopped++;
            }
        }
        for (var k1 = 0; k1 < arr2Array.length; k1++) {
            if (neverPopped === 0) {
                arrHolder.push(arr2Array[k1]);
            } else {
                if (arr2Array.indexOf(arrHolder[k1]) > 0) {
                    arrHolder.pop();
                }
            }
        }
        newArr = arrHolder;
    }
    if (arr2Array.length > arr1Array.length) {
        for (var j = 0; j < arr2Array.length; j++) {
            arrHolder.push(arr2Array[j]);
            if (arr1Array.indexOf(arr2Array[j]) >= 0) {
                arrHolder.pop();
            }
        }
        for (var k2 = 0; k2 < arr1Array.length; k2++) {
            if (arr1Array.indexOf(arrHolder[k2]) > 0) {
                arrHolder.pop();
            }
        }
        newArr = arrHolder;
    }
    if (arr2.length == arr1.length) {
        for (var k = 0; k < arr2Array.length; k++) {
            arrHolder.push(arr2Array[k]);
            if (arr1Array.indexOf(arr2Array[k]) >= 0) {
                arrHolder.pop();
            }
        }
        for (var k4 = 0; k4 < arr1Array.length; k4++) {
            arrHolder.push(arr1Array[k4]);
            if (arr2Array.indexOf(arr1Array[k4]) >= 0) {
                arrHolder.pop();
            }
        }
        newArr = arrHolder;
    }
    console.log(newArr);
    return newArr;
}

Hidden figures is an amazing read. I do not know much about this Susan fowler write-up but it was viral and definetly not the one that I expected to read after the book. Finally Saturday was #FakeNews day with wiretaps. But there was a theory for the president’s tweets, here is a related opinion.

Author: Sathish Jayapal

Indie programmer and blogger