Connected Cells in a Grid

I received a message from HackerRank to give the Connected Cells in a Grid challenge a try. If interested, please take a look at the requirements and see if we agree with the approach I took to solve the challenge. Continue reading “Connected Cells in a Grid”

Single Element in a Sorted Array

Ventured into LeetCode and randomly selected the Single Element in a Sorted Array challenge. The requirements are very straight forward. Make sure you pay attention to the following Note: Your solution should run in O(log n) time and O(1) space. Continue reading “Single Element in a Sorted Array”

Testing With Dependency Inversion

Earlier this week I was talking with a system architect. He mentioned what I consider a sensitive and interesting question. How do you use Dependency Inversion (DI) to test software? If you are interested in this question please stop reading and allow yourself a few minutes thinking about the question and associated answer. Continue reading “Testing With Dependency Inversion”

Missing Numbers

I received a message to solve the Missing Numbers challenge from HackerRank. The approach is to read the first list (A) to a HashMap so we would be able to get a count for each key. The process repeats with the second list (B). At that point we can iterate over list A (smaller) and update (subtract) or delete the matching keys from list B (larger). What is left in B is what is needed. Continue reading “Missing Numbers”

Modified Kaprekar Numbers

I received a message from HackerRank to solve the Modified Kaprekar Numbers challenge. Had to look up on-line what a Kaprekar number is.

My first goal was to generate the actual Kaprekar numbers. Once I was done with that I went after the actual requirements for the challenge. Continue reading “Modified Kaprekar Numbers”

Threads – Part III

This post continues the series on threads. To take a look at the previous post please click on the following link: Threads – Part II. Just to recap, on the previous post we implemented an approach that did not work with Java. In this post we will address the issue with a design that seems to work well. It still has at least one issue which we will deal with on the next post. Continue reading “Threads – Part III”

Threads – Part II

In my previous post on this series Threads – Part I we ended up with a fully sequential program. In this post we will modify it to add two threads and a queue. The main program will create a queue and a receiver and a processor threads. The threads will be started. The receiver thread will generate requests and the processor thread will work fulfilling them. Simple approach but contains some issues. Such issues will be addressed in following post. Continue reading “Threads – Part II”

Threads – Part I

Because I am an ACM member, earlier today I received a routine email message titled “ACM TechNews, Friday, March 24, 2017”. Most (if not all) articles are typically interesting. This time it was no exception. Sequential Programming Considered Harmful? from IEEE Spectrum by Russ Miller called my attention. If you have not read it yet, please take the time and you will understand my motivation to write this post which will be a part of a short sequence on the subject of threads. Continue reading “Threads – Part I”

cURL – Part I

Yesterday afternoon a software developer and I were talking about some issues that came up earlier yesterday morning as a result of some updates done by a web hosting company where his software is deployed. By the time we were chatting, the hosting company had backed out from the update and he had addressed the side effects. All was back to normal.  What called my attention was a comment he made regarding cURL. For some reason the update had affected the operation of cURL. Apparently his software is heavily dependent on cURL. Continue reading “cURL – Part I”