A complete review from component selection to software configuration for a Chia cryptocurrency farming (mining) system.

Introduction

Chia is a new cryptocurrency that aims at achieving decentralized consensus with lower energy consumption per transaction than its peers. This is achieved via a proof of space algorithm instead of proof of work.

While proof of work relies on continuously computing a math problem (usually hashes such as SHA256) in an attempt to find results that match a desired pattern, Chia instead relies on checking for the existence of certain properties in unique pre-generated files called plots.

This is done in a two…


We will review the results from CPU mining Monero with the XMRIG miner on different AWS EC2 instance types.

Photo by Dominik Vanyi

Introduction

Cryptocurrency mining can be thought of as the execution of work by an agent that contributes to the confirmation of transactions. Since a large number of ideally decentralized miners are required in order to secure the blockchain (no double spending, etc), there is an incentive to benefit mining via common hardware (CPU) versus specialized hardware (GPU, FPGA, ASIC).

To achieve this goal, the cryptocurrency Monero makes use of the RandomX algorithm. This algorithm benefits from two properties of CPUs: The ability…


Six months ago, I invested in over 30 different investment platforms across asset classes. Here, I will review the performance of each during this period.

Photo by Maxim Hopman

Disclaimer: This article is not investment, tax, or legal advice, nor is it a solicitation for investment. I may have an affiliate relationship with some of the companies listed below. Furthermore, I am not a financial expert and offer this only as a way to share my experiences.

Introduction

Approximately six months ago I decided to embark on a journey to learn more about the different platforms available for investing by non-accredited investors. …


We will review a simple deployment of a collaborative filter for content recommendation using Python’s Surprise Library.

Image by Juliana Bernal

Introduction

It is a common requirement in eCommerce, social media and other applications to need to match a subset of the total content with specific users as to maximize conversion, time in-app or other desired metrics.

A possible approach to determine what content to recommend to a given user is to recommend items that were well rated by peers that exhibit a tendency to rate content similarly. This approach is known as Collaborative Filtering. There are several different ways to calculate the similarity between user’s ratings of different items (videos, products or other content that is to be recommended). …


A simple approach to creating an AWS Lambda layer for Python’s OpenCV wrapper

Coding desk setup
Photo by Farzad on Unsplash.

Lambda is a serverless offering by AWS that enables running scalable code without needing to configure servers. Each Lambda environment (corresponding to different versions of the compatible languages) comes with a selection of packages pre-installed.

However, what happens when we require a package that is not provided? There are a few approaches to addressing this shortcoming, one of which is the use of a Lambda layer.

In the next section, we will go over a programmatic solution to create a Lambda layer for a Python 3.7 application that requires OpenCV.

1. Install the Library in a Compatible OS

Lambda functions run on Amazon Linux (AMI). Therefore, to ensure…


As a society, we laud the work of generalists but our processes simply are not meant to recognize them.

Photo by Mika Baumeister on Unsplash. Featuring the Mona Lisa by Leonardo Da Vinci an engineer, philosopher and artist.

What is a Generalist?

Engineering and our educational systems as a whole are designed towards specialization.

At elementary school everyone learns the basics on which further knowledge will be built. In middle school, the division of knowledge into subjects starts to appear. As students are allocated individual time blocks to learn math, sciences, social studies and others. Up to this point, despite the already visible division of subjects, all students are still expected to learn the same subjects and to the same level of depth.


For when .includes is not enough.

Photo by Paul Smith on Unsplash

Basic Rails Associations

Rails’ ActiveRecord associations permits relating one model to another. Take the example below:

class Post < ApplicationRecord
has_many :comments
end
class Comment < ApplicationRecord
belongs_to :post
end

A Post has many Comments. This allows us to call Post.first.comments to get all the comments associated with a post! ActiveRecord internally generates our required SQL queries:

SELECT "posts".* FROM "posts" WHERE "posts".id = 1
SELECT "comments".* FROM "comments" WHERE "comments".post_id

N+1 Queries and .includes

However, imagine we are serializing this data to return as part of a controller for the /posts index. In that case, instead of getting the comments…


The same curiosity that drove us to spread across our planet now drives us to reach out towards the stars.

These 6 incredible missions are teaching us more about our neighboring planets and sun while pushing our engineering capabilities to the limit.

1. Chang’e 4 — Lunar Lander and Rover

Panoramic Photo from Lander

Objectives

The Chang’e 4 lander and rover are part of the Chinese Lunar Exploration Program which aims to develop the required technologies in preparation for crewed missions to the moon in the 2030's.

Mission Updates

The current lander and rover are part of phase 2 of the program and demonstrated the ability to successfully land and navigate on the lunar surface.


A simple setup to programmatically enqueue jobs in a SLURM cluster.

Titan 3 Supercomputer Image from Pixabay

Introduction

For those that have worked with a super computer cluster before, you know that scheduling batches of jobs where each job may not only have different settings (Ex: Hyper-parameters) but also different code can be a cumbersome task. Moreover, keeping track of all the different versions of code when analyzing the results can be tricky and a simple note taking error can result in many hours rerunning jobs.

Here, I demonstrate how to setup a Github Actions based approach to deploying jobs to a supercomputing cluster managed by SLURM


I finally got around to implementing my first Forex trading robot!

Photo by Clemens Van Lay on Unsplash

Introduction

For years, I have fantasized about building a Forex trading robot that would slowly and consistently increase its account balance. However, I was never really sure where to start. What company to use? How do I access the APIs? Is it safe?

Recently, I blocked off some time to learn what would be needed to develop such a system and it culminated in a very simple to implement python script. In the remainder of this article, I will detail how it works.

Disclosure: This article is not investment, tax…

Paulo Carvalho

A curious minded 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