Quick Sort

Divide and Conquer

The Quick Sort algorithm uses a Divide and Conquer strategy for sorting an array of items. Divide and Conquer is a technique that can be divided into the following three parts:

  1. Conquer the sub-problems by calling recursively until all the sub-problems are solved
  2. Combine the solutions to the sub-problems are then combined to give a solution to the original problem.

Here is the plan for a quick sort implementation in JavaScript.

First, pick a pivot element in the array. The pivot element should be…


Part 3: PostGIS, AWS, React and Mapbox

In this post we will complete the circle back to the Geographic Daydream post from a few weeks back.

In that post, we were focused on finding the best location for a brand new state of the art Animal Hospital. We used a dataset of existing animal hospitals along with 2019 county population data for all the counties in the United States.

The number of people in the county, divided by the existing hospital count, gives the person_per_hospital count for the county. The higher the count, the more people (and their pets) are…


Part 2: Serverless, AWS API Gateway, Lambda and Mapbox

Quick Recap

In part 1, we completed the back end for an AWS microservice, comprised of a PostGreSQL relational database with the PostGIS geospatial extension enabled. The PostGIS extension allows the new cloud database to store geographic data and the ability perform geographic SQL queries.

Remember, vector based geographic data can be stored in the database as points, lines and polygons.


Part 1: The PostgreSQL, PostGIS and AWS Cloud back end

PostGreSQL + PostGIS + Serverless + AWS

The idea of Microservices

Traditional monolithic web applications are hard to scale. As the code base ages and becomes more complex, adding new features or new technologies becomes increasingly difficult.

Within a microservices architecture, each application component runs as its own service and communicates with other services that drive the application through API calls, not directly. Each service performs a single function and is self contained, unaffected by other processes or changes in other processes. The idea is to break down a monolithic structure with smaller independent ones, thereby increasing resiliency of the application.


Bubble Sort

Bubbles, bubbles, bubbles

Bubble sorting is based on the idea of repeatedly comparing pairs of adjacent values and then swapping their positions when the values are out of order. It is an intuitive sorting method because it’s logic is based on the comparison of values, one at a time. The downside is that this method is inefficient and time consuming when compared to other sorting methods.

Here is an implementation of Bubble Sort in JavaScript.

const bubbleSort = (sortMe) => {
sortMe.forEach((item, pass) => {
console.log('pass:', pass)
sortMe.forEach((item, j) => {…


How hackers can peer into insecure web connected databases

Hacker + Injection + Database = Problems

A Persistent Problem

SQL injection attacks are not new. They have been around since when websites first became connected to databases. Misbehaving hackers figured out that they could sometimes manipulate a website’s URL and access data that was not intended for them. Or, if they worked at it, they could find clever ways to destroy data in a database that is connected to to a website simply by passing a bit of SQL in the query string. …


Let’s imagine a new reality.

POOF! At the wave of Alex’s hand, we magically discover that we now inhabit the body of a completely new person…

…one that has just graduated from the College of Veterinary Medicine at Purdue University, in the state of Indiana of all things. Amazing!


Using Big O Analysis to write efficient code

In outer space, there are billions of stars

What is Big O Analysis?

A programmer’s main task is to write code that executes series of actions designed to produce some desired output. As every new chunk of code is written, the programmer likely must evaluate different ways to solve a particular problem through code.

So, if there are many different ways to write code that produces the desired result, how can we determine objectively if a chunk of code, or block, is better than another? This is where Big O analysis comes in.

Big O analysis is about objectively comparing different code blocks that produce…


Creating a ‘Medium’ slice

RSS + proxy + React

This post will explore a method of displaying recent Medium blog posts within my web development portfolio site. Specifically, on the left hand side, we want to get this listing dynamically (outlined in red in the image below). We would like to display the last 5 blog posts that have a title, subtitle, url, pubDate, and imgUrl.


Community Building using React Native and Firebase noSQL

Firebase + Aliens + React Native

Inspiration

The inspiration for this experimental project came from discovering the Class Dojo app for web, iOS and Android. In short, the ClassDojo app helps teachers and parents build community in a classroom. By providing a fun and simple social network with many useful features, it allows for student and parent interaction and engagement. With the emergence of COVID-19, tools like these have become more important. My favorite aspect of CD is it’s simplicity and accessibility to younger children.

Will Carter

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store