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.
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. …
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.”
Frequency is a word we use to describe how often something happens. It is a measure of the “oftenness” of things.
For example,
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.
Before I talk about the method of looping over collections, let me define “nice.”
A “nice” way to iterate over a collection would consistently:
async/await
to be usedbreak
keyword to be used, or another way of ending a loop earlycontinue
…mongodump
with mongorestore
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.
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.
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
.
Server B is…
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.
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.
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 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.
Modern JavaScript allows us to deconstruct objects. That is to say, we can define variables and assign values…
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.
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…
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.
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
Here are some reasons commonly cited in support of writing tests:
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. …
Software engineer.