Skip to main content

Tutorials

One topic that I have seen come up a lot over the last couple of years is how to detect internet connectivity in an iOS or macOS application.  This is a topic that really interests me so I thought I would take some time and write a tutorial on how I and Apple recommend that client applications determine network connectivity.  To start, I thought I would provide some context on where this network connectivity model might be applicable.  The main use case is in a traditional client to server communication setting where a client is sending either a GET or POST request to a server, and the serv

Python 3 has an excellent library called asyncio that can be used for writing concurrent code on anything from web-servers, to databases, and even distributed task queues.  Asyncio is created from a non-blocking programming model that provides your program the flexibility to delegate data when it is available as instead to waiting for data to be received.  This prevents code in your program from getting bottle-necked and allows data tasks to be run concurrently to get greater performance and processing from your program's I/O.  On

Opening a Bluetooth connection between two devices is a fast and energy efficient way to communicate data over a short distance.  Bluetooth connections allow for smartphones, computers, cars, and even IoT devices to communicate all over a frequency that operates at ~ 2480 MHz.  In my experience working with Bluetooth, I have seen connections go up fairly easily or be very stubborn and not want to connect at all.  Generally it seems harder to connect two devices that are not from the same manufacturer.  So, what do you do when connections are being stubborn?  Do you try and reconnect and jus

In a recent tutorial I described how to create a binary tree data structure and populate it with numerical data.  Now, in this tutorial, I will explain how to search each level of the binary tree for a specific numeric value.  As previously described in my past tutorial, search and sort operations on binary tree's is a very popular use case because of the efficiency in performing these operations.  For a binary tree with n elements the time complexity in searching the tree is O(log(n)) in the worst case.  W

Tree data structures are a fundamental data structure used in computer science.  Tree's can be used for searching and sorting data hierarchies such as UIView's via tags and custom objects via leveling order.  Binary tree's are also very similar in that they provide an efficient sorting mechanism to quickly search large amounts of data.  A while back I was looking through some of my old Objective-C archives and found a binary tree implementation that was created but never seen the light of day on any project.    To get some use out of this code  and to share my binary tree implementation I t