No More Versions for Windows

So recently Microsoft made it public news that they are not going to be creating another full version of Windows past Windows 10.  They are instead going take a “progressive enhancement” approach where they will continually improve upon what the new OS adding new features and fixing bugs along the way.  I actually think this is going to be a good move on Microsoft’s part and I look forward to seeing how they work this into their business as a whole.

Windows 10 will be the last version of the operating system to be numbered, says Microsoft executive.

Source: Microsoft to stop producing Windows versions – BBC News

TopCoder SRM 659 Div 2 Easy

This was my first SRM from an actual weekly competition! Checkout the problem statement.

So this problem asks us to take a list of positions, and a number that let’s us know how far we can jump.  We have to figure out how many positions we can reach within the array based of of the number given.  So, for instance, if we are given the positions array [1, 2, 3, 7, 9] and the number 1 for our max jump distance, we would be able to reach 1, 2, and 3 but not 7 and 9 as there are no numbers within 1 of these.  So here was my first attempt which took around 40 minutes (This is the one that I submitted):

public static int countReachableIslands(int[] positions, int L) {
       // first attempt
       int islands = 0;
       boolean[] canReach = new boolean[positions.length];

       canReach[0] = true;
       for (int i = 0; i < positions.length - 1; ++i)
           for (int j = i + 1; j < positions.length; ++j)
               if (Math.abs(positions[i] - positions[j]) <= L) {
                   canReach[i] = true;
                   canReach[j] = true;
               }

       for (boolean reachable : canReach ) {
           if (reachable) ++islands;
       }

       return islands;
}

Here’s my second attempt, which took about 20 minutes:

    // second attempt
    public static int countReachableIslands(int[] positions, int L) {
       int islands = 0;

       boolean[] canReach = new boolean[positions.length];
       canReach[0] = true;
       for (int i = 0; i < positions.length - 1; ++i)
           for (int j = i + 1; j < positions.length; ++j)
               if (Math.abs(positions[i] - positions[j]) <= L) {
                   canReach[i] = true;
                   canReach[j] = true;
               }

       for (boolean reachable : canReach)
           if (reachable)
               ++islands;
       return islands;
   }

And the last attempt, 2 minutes:

    // third attempt
    public static int countReachableIslands(int[] positions, int L) {
        if (positions == null || positions.length == 0) return 0;

        int islands = 0;

        boolean[] canReach = new boolean[positions.length];
        canReach[0] = true;
        for (int i = 0; i < positions.length - 1; ++i)
            for (int j = i + 1; j < positions.length; ++j)
                if (Math.abs(positions[i] - positions[j]) <= L) {
                    canReach[i] = true;
                    canReach[j] = true;
                }

        for (boolean reachable : canReach)
            if (reachable)
                ++islands;
        return islands;
    }

As you can see, all the attempts were just about the same! I really thought I had found the optimal solution to the problem this time on the first go round, and it did indeed pass all the test cases that came with the problem. However this solution was challenged in the challenge phase and I lost all my points. I couldn’t find out how to view the challenge parameters either so I am stuck not knowing what the fail case was. I will update this post once the match editorial is released in the next few days. In any case, it was fun taking a stab at the SRM challenge and I am looking forward to the next one! I can’t wait to dig further into my Algorithms book as well so that I can start getting into the harder problems.

GitHub Large File Storage Extension

GitHub has started the early phases of rolling out a solution for git repositories that contain large files.  It looks pretty interesting and takes git one step closer to being a more attractive solution for companies that track huge files or even binaries that can’t be diff’d.  This would be especially useful for game assets.   I look forward to keeping track of the progress!

Git Large File Storage (LFS) replaces large files such as audio samples, videos, datasets, and graphics with text pointers inside Git, while storing the file contents on a remote server like GitHub.com or GitHub Enterprise.

Source: Git Large File Storage