Photo by Element5 Digital on Unsplash

The internet was established nearly forty years ago. With it came the promise of empowering democracy. However, to this point we have not make significant steps in this direction. In 2020, the ability to vote online should exist and be proven out in a solid, transparent, objective way. Here are some of my thoughts of how a secure online voting process might work.

High Level Overview

  • At the time of voting, the citizen goes online to vote, signing their selections with their voting tokens.


Photo by Tatiana Rodriguez on Unsplash

I’ve been wondering for years what the fundamental difference between democrats and republicans is. There are a number of differences in policy, of course, but I’ve always wondered if there was something more fundamental than those surface policies. A good portion of people who are democrat will vote that way and stay that way their whole life. A good portion of people who are republican will vote that way stay that way their whole life. We’re in the midst of an election where it is definitely the case that people are unlikely to sway one way or the other. …


How fast is a 2.5 GHz computer and what does that mean?

Photo by Christian Wiediger on Unsplash

The term “gigahertz” is composed of two parts, “giga” and “hertz”. To understand “gigahertz” we’ll dive into what each of these parts mean separately, and then apply this understanding to what in relation to a computer, and more specifically a computer’s CPU.

Let’s start with the “hertz” part of “gigahertz.”

Hertz (Hz) and Frequency

Frequency is a word we use to describe how often something happens. It is a measure of the “oftenness” of things.

For example,

  • How often (frequently) do you go to the store? Once a week.
  • How often do you brush your teeth? Twice a day.
  • How often do you grab…


Reduce cognitive load with a consistent approach

Photo by Kelly Sikkema on Unsplash

Intro

There are many ways to loop over collections, objects and arrays. Many of them are great for specific use cases. We’ll discuss a “nice” way to iterate over the items of collections, which will cover most use cases.

What is “Nice”?

Before I talk about the method of looping over collections, let me define “nice.”

A “nice” way to iterate over a collection would consistently:

  • Support both objects and array
  • Would NOT iterate over all properties in the prototype chain
  • Allow async/await to be used
  • Allow the break keyword to be used, or another way of ending a loop early
  • Allow the continue


Using mongodump with mongorestore

Photo by Dino Reichmuth on Unsplash

The exercise here is to move the records of a Mongo collection from one Mongo server to another. One use case for this is to copy a collection, or part of a collection, from a production environment into a development environment.

Our Setup

In our example, we’ll have two database servers that are hosted remotely. We’ll access them using a connection string. Each database server will have the same databases and collections within them.

Mongo Server A

Connection string: mongodb+srv://user_a:password_a@database_a.mongodb.net/db_1?ssl=true&authSource=adminDatabases: db_1, db_2
Collections: collection_a, collection_b, collection_c

We’ll say that all collections are in db1, except for collection_c which is in db2.

Mongo Server B

Server B is…


How to get the data inside the data

Photo by Sean Whelan on Unsplash

Javascript Destructuring Assignment

Modern JavaScript allows us to define variables quickly from existing collections, objects, and arrays, or values. This shorthand is called destructuring assignment, or destructuring for short. If a collection contains other collections as elements, those collections can also be destructured.

Simple Object Destructuring

Here we have a simple object obj from which we are pulling out values from obj keys b and d and assigning to new const variables of the same name, b and d. The other keys a, c, and e are not destructured and so are not assigned to variables of the same name.

Object Destructuring with “Rest” Syntax

If we want to pull…


Helpful shorthands for modern JavaScript

Photo by Claudel Rheault on Unsplash

Enter Javascript Ellipses (…)

Modern JavaScript allows us to use three dots, , also known as an ellipsis, to perform certain transformations and shorthand methods. The use of ellipses falls into two categories: rest syntax and spread syntax. I’ll explain each of these in turn.

Rest Syntax

Rest syntax allows a programmer to retrieve the remaining items — the rest of the items — in a collection that the programmer has not used, such as objects, arrays, or function arguments.

Let’s take a look at a few examples.

Rest syntax with object deconstruction

Modern JavaScript allows us to deconstruct objects. That is to say, we can define variables and assign values…


Tips for the beginner Vim user

Photo by Roozbeh Eslami on Unsplash

What Is Vim?

Vim is the de facto text editor for Linux. It can be thought of as the equivalent of Notepad for Windows or TextEdit for Mac. While some developers use Vim regularly for development, most will use it as a utility to make small changes to text files on a remote server.

If Vim Is Just a Text Editor, Why Does It Need an Introduction?

Yes, Vim is a text editor, but the user experience of it is very different than modern text editors, and as such it requires a bit of training to get started. In fact, most new users to Vim will not even intuitively know how to exit the application!

I’ll…


The first things to pick up when learning a new programming language

Photo by Max Duzij on Unsplash

At some point, all engineers will have to pick up a new language. Here’s how I go about my first approach of a language.

Avoidance of Syntactic Sugar

In my first round, I avoid anything that makes the language nice. What I want to do is identify the parts of the language that overlap with every other language.

For example, not every language has a C-style for loops (Rust does not) but all languages have some form of a while. So when looking to identify how to loop in a language, I’ll initially identify how a while loop is defined.

The goal/hope is to…


Hint: It isn’t to make sure new code works

Photo by Moritz Mentges on Unsplash

The Common Reasons

Here are some reasons commonly cited in support of writing tests:

  • To make sure new code works
  • To find bugs before they happen
  • To document your code

If you’re an attentive engineer, most of the time when you’re finished with your code it will work, have minimal bugs, and be maintainable enough to be understood. That being said, of course it is great to have tests that confirm that it works, help you identify bugs, and exist in a way that documents your code. …

Patrick Divine

Software engineer.

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