Category: General Development
Waiting For A Loop Of Async Functions To Finish In Node.js
At the moment Node.js is my web development language of choice, but occasionally I come across something that really grinds my gears. I sometimes find that I’ve fallen into an async hell that screws up a lot of things. For example, maybe I’ve designed an API endpoint that makes a few requests to external services. Before returning data to the client (user), manipulations must be done on the external service data requested. How do we do all this?
Let’s take a look how we would cover these scenarios.
Read MoreUse RegEx To Analyze Credit Card Numbers In JavaScript
RegEx is a powerful beast. Previously I wrote how to test password strength using JavaScript and regular expressions. This time we’ll take a look at how to check credit card providers based on the credit card number entered. No, this won’t test if a credit card number is legitimate, but it will test if it was entered correctly.
Read MoreUse RegEx To Test Password Strength In JavaScript
Recently one of my Twitter followers asked me how they might validate password strength using regular expressions (RegEx) in their code.
Regular expressions via Wikipedia:
A sequence of characters that forms a search pattern, mainly for use in pattern matching with strings, or string matching.
RegEx is nice because you can accomplish a whole lot with very little. In this case we are going to check various aspects of a string and see if it meets our requirements, being a strong or medium strength password.
Read MoreAll About Java Modifier Keywords
I’ve been a Java programmer for a while now, however, recently someone asked me a question regarding one of Java modifier keywords and I had no clue what it was. This made it obvious to me that I needed to brush up on some Java that goes beyond actual coding and algorithms.
After a few Google searches, I got bits and pieces on the topic, but never really the full story, so I’m using this post as a way to document the subject. This is a great interview question to test your computer science book-smarts.
Read MoreSort An Integer Array Using Bubble Sort With Java
Previously you saw an implementation of Quicksort, one of the better sorting algorithms. This time we’re going to look at a much inferior sorting algorithm which generally makes its appearance in introduction to computer science type courses. I’m talking about the Bubble Sort algorithm.
Bubble Sort via Wikipedia:
Bubble sort, sometimes referred to as sinking sort, is a simple sorting algorithm that repeatedly steps through the list to be sorted, compares each pair of adjacent items and swaps them if they are in the wrong order.
The Bubble Sort algorithm is sub-par because of the outrageous time-complexity that it has for all sorting calls and we’re going to see why.
Read MoreSort An Integer Array With the Quicksort Algorithm And Java
Circling back to data structures and algorithms, we’re now going to take a look at the efficient sorting algorithm known as Quicksort.
Quicksort via Wikipedia:
Sometimes called partition-exchange sort, is an efficient sorting algorithm, serving as a systematic method for placing the elements of an array in order.
The idea behind Quicksort is to take a large array of values and divide it into two smaller arrays, doing this recursively, and swapping elements.
This is one of the fundamental algorithms you’ll learn in any computer science course. It is also a very good question that could be asked in a job interview for an engineering type position. I’m going to help you through it using Java.
Read MoreVarious Graph Search Algorithms Using Java
If you’ve been keeping up with my blog, I’ve made a topic regarding Binary Search Trees, but another very important topic in computer science and software engineering is in regards to Graphs.
Graphs via Wikipedia:
A graph data structure consists of a finite (and possibly mutable) set of nodes or vertices, together with a set of ordered pairs of these nodes (or, in some cases, a set of unordered pairs). These pairs are known as edges or arcs.
When interviewing for a new programming or software engineering position, it is incredibly likely that you are asked a question on this topic. Because of this, I figured it would be a good idea to go over a few of the Graph search algorithms.
Read More