Plurrrr

a tumblelog
week 49, 2019

Moving from Vim to Emacs

I’ve been a staunch Vim user for a long time now, and recently switched over to Emacs. Time to fight the other side of the war!

I’ve got years worth of muscle memory tied up to Vim Key Bindings, so it’s unlikely that I’d have considered this change if it weren’t for evil-mode.

Source: Moving from Vim to Emacs, an article by Paul Kuruvilla.

Iteration without for, foreach or while

Iteration is part of the bread and butter of any programming language, and this is the case in functional programming just as much as in imperative programming, but how is it possible to iterate without for, foreach or while?

Source: Iteration without for, foreach or while, an article by Simen Endsjø.

Do Butterflies Challenge the Meaning of Species?

What is a species? It’s a question that has agonized scientists since well before Darwin. With some exceptions, the thinking has landed on an evidently firm reproductive barrier: Members of different species don’t mate. If they do, their offspring are sterile and can’t contribute to future generations. The reproductive barrier has thus created a useful demarcation of “what is a species”—until a deep dive into butterflies showed otherwise.

Source: Do Butterflies Challenge the Meaning of Species?, an article by Mary Ellen Hannibal.

Simple Go Mocks

Go‘s interfaces and “duck typing” makes it very easy to create simple mock or stub implementations of a dependency for testing. This has not dissuaded a number of people from writing generalized mocking libraries such as gomock and testify/mock, among others.

Here I want to describe a simple alternative pattern I frequently use when writing tests for an interface, that I think is generally applicable to many use cases.

Source: Simple Go Mocks, an article by Jonathan Hall.

Set up tab completion for ssh and scp

Tab completion is a ubiqutious time-saver, and I use it everywhere I can. Here’s how I set it up to autocomplete hostnames when I use the ssh or scp commands.

Source: Set up tab completion for ssh and scp, an article by Andy Lester.

Why is Learning Functional Programming So Damned Hard?

My Functional Programming journey was filled with dead ends, false starts, failed attempts and frustration. And I suspect that I’m not alone in this struggle. So why is this a common problem and what can be done about it? And how can you avoid the these same pitfalls?

Source: Why is Learning Functional Programming So Damned Hard?, an article by Charles Scalfani.

There Is No "Right" Way: Git Rebase vs Merge

In honor of my new license plate, I decided I wanted to do a quick, little post on rebase vs merge, how each one works, and how I choose to use each one. Let's first look at how each one works.

Source: There Is No "Right" Way: Git Rebase vs Merge, an article by Molly Struve.

Building DSLs in Swift

A DSL, short for Domain Specific Language, can be explained as a special kind of API that focuses on providing a simple syntax that's tailored to working within a specific domain. Rather than being complete stand-alone languages - like Swift is - DSLs are often hosted in other languages, and as such, need to use a grammar that's also perfectly valid in their host language.

Source: Building DSLs in Swift, an article by John Sundell.

Principal Components Analysis (PCA) – Better Explained

Principal Components Analysis (PCA) is an algorithm to transform the columns of a dataset into a new set of features called Principal Components. By doing this, a large chunk of the information across the full dataset is effectively compressed in fewer feature columns. This enables dimensionality reduction and ability to visualize the separation of classes or clusters if any.

In this tutorial, I will first implement PCA with scikit-learn, then, I will discuss the step-by-step implementation with code and the complete concept behind the PCA algorithm in an easy to understand manner.

Source: Principal Components Analysis (PCA) - Better Explained. A recommended read.

2019-12-02 What is Functional Programming? and Property Wrappers in Swift 5

What is Functional Programming?

Functional Programming is, like Object Oriented Programming (OOP), a programming paradigm. There isn't a formal agreed-upon definition of what FP entails, but there are two core concepts most people would agree are central to the paradigm:

  1. Avoiding mutating state and side-effects
  2. Using functions as the central building block of programs

Lets discuss each of these in turn.

Source: What is Functional Programming?, an article written by Kjetil Valle.

The Complete Guide to Property Wrappers in Swift 5

Property wrapper is the Swift language feature that allows us to define a custom type, that implements behavior from get and set methods, and reuse it everywhere.

Source: The Complete Guide to Property Wrappers in Swift 5, an article by Vadim Bulavin.