The following notes contain recipes to various programming questions and development tasks. They have been documented to serve as a reference for those who need to get things done quickly, and as reading material for the curious.
This recipe shows how to install Apache Kafka on Ubuntu 20.04 LTS. The installation will allow for the publishing and subscribing of Avro messages, ingesting data from a database to a Kafka topic, and exporting messages from a Kafka topic to a database.
This recipe shows how to install Mysql 8.0 via Docker on Ubuntu 20.04 LTS. These instructions are performed on a fresh Ubuntu Desktop/Server installation.
This recipe shows how to install Mysql 8.0 on Ubuntu 20.04 LTS. These instructions are performed on a fresh Ubuntu Desktop/Server installation.
This recipe shows how to install MariaDB 10.5 via Docker on Ubuntu 20.04 LTS. These instructions are performed on a fresh Ubuntu Desktop/Server installation.
This recipe shows how to install MariaDB 10.5 on Ubuntu 20.04 LTS. These instructions are performed on a fresh Ubuntu Desktop/Server installation.
This recipe shows how to install Java (JRE/JDK) on Ubuntu 20.04 LTS. These instructions are performed on a fresh Ubuntu Desktop/Server installation.
This recipe shows how to install Docker on Ubuntu 20.04 LTS. These instructions are performed on a fresh Ubuntu Desktop/Server installation.
This recipe shows how to implement the Singleton design pattern. This design pattern can be used when you need to restrict the instantiation of a class to a single instance, such as when implementing logging, caching, thread pooling, configuration, etc.
This recipe shows how to implement the Decorator design pattern. This design pattern can be used when you need to add additional functionality to an individual object as opposed to a class of objects. It is especially useful when dealing with requirements that involve the composition of objects from a large set of options. With the Decorator design pattern, these compositions can be done dynamically in real-time.
This recipe shows how to implement the Builder design pattern. This design pattern separates the construction of a complex object from its representation. By doing so, the same construction process can create different representations.
This recipe shows how to use bounded wildcards (Java Generics) to implement a concat() method which will append the elements from list2 to the end of list1. The type of elements contained in list1 and list2 are of different types, but both types are subclasses of the elements contained in the combined list.
This recipe shows how to correctly override the equals() and hashCode() methods in Java.
This recipe shows how to implement Comparable objects in Java for multi-field comparison.
This recipe shows how to implement Comparable objects using Comparator in Java for multi-field comparison.
This recipe shows how to implement a symbol table using a binary search tree (BST). We will use the symbol table to keep track of the frequency that strings repeat in an unsorted array.
This recipe shows how to reverse a string. We will explore three different approaches to implementing the solution.
This recipe shows how to implement merge sort.
This recipe shows how to implement linear (or sequential) search.
This recipe shows how to implement insertion sort.
This recipe shows how to implement binary search. We will explore two different approaches to implementing the solution.
This recipe shows how to generate all possible permutations of a given sequence of integers. We will demonstrate two implementations using Heap’s algorithm.
This recipe shows how to find the shortest path between all pairs of vertices in a weighted graph. This implementation uses the Floyd-Warshall algorithm.
This recipe shows how to find the shortest path between a single source vertex and all other vertices in a weighted graph. This implementation uses Dijkstra’s algorithm, also known as Dijkstra’s Shortest Path First (SPF) algorithm.
This recipe shows how to find the shortest path between a single source vertex and all other vertices in a weighted graph. This implementation uses the Bellman-Ford algorithm.
This recipe shows how to find the nth Fibonacci number in the Fibonacci sequence. We will demonstrate two different approaches to implementing the solution.
This recipe shows how to find the longest repeated substring in a string.
This recipe shows how to find the longest common prefix between two strings.
This recipe shows how to find the longest common prefix among all strings.
This recipe shows how to check if a given string is a palindrome. We will demonstrate three different approaches to implementing the solution.
This recipe shows how to check if a given number is prime. We will demonstrate two different approaches to implementing the solution.