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

Image for post
Image for post
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.

In high school, specialization starts to take place. Teenagers with only a superficial knowledge of different subjects are expected to choose the ones they want to further specialize in. …


For when .includes is not enough.

Image for post
Image for post
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 for just one post, we would get it for multiple posts: Post.all.each { |p| puts p.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

Image for post
Image for post
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.

Landing took place on January 3rd 2019 in the Von Kármán crater being the first to make a soft landing on the far side of the moon. …


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

Image for post
Image for post
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!

Image for post
Image for post
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, or legal advice, nor is it a solicitation for investment. Furthermore, I am not a financial expert and offer this only as a way to share my experiences. …


Let’s face it, working at a startup is inherently different than working at a large company. However, what exactly is different and how can you work to increase the chances of your startup succeeding?

Image for post
Image for post
Photo by ThisisEngineering RAEng on Unsplash

Introduction

We often hear the tales of the great entrepreneurs that with minimal resources managed to displace a behemoth incumbent with nothing but a clever idea. However, what is often unheard is the years of hard (and effective) work put in by the founding team to make their story a reality.

In the next section, we will go over key points that can often differentiate a great startup engineer. …


Quickly start sending Slack messages from your Ruby on Rails backend without the need for any third party libraries!

Image for post
Image for post
Photo by Scott Webb on Unsplash

Introduction

Slack provides several ways to integrate with the platform. Among these integration options are the Slack Workflows. In this article, we will go over setting up one of these workflows and use it to provide a Ruby on Rails backend a way to post messages to Slack.

Methods

Setup the Workflow in Slack

  1. From the Slack Desktop client click on your workspace name, select tools and then “Workflow Builder”.
  2. Click “Create” on the top right corner.
  3. Type a name for your workflow such as: “My First Workflow”. This name will appear as the title of messages created by the workflow. …


Quickly create serverless microservices using Lambdas

A scenic mountainside view
A scenic mountainside view
Photo by Philipp Lehmann on Unsplash

By using Amazon API Gateway, it’s possible to quickly create serverless microservices backed by Lambda. We’ll review one such deployment and use the AWS Serverless Application Model (SAM) to deploy it.

Introduction

With ever-growing cloud systems, many companies have opted to move away from monoliths into a distributed architecture composed of microservices. AWS allows the development of such services without the need to manage the underlying server infrastructure.

We’ll go over an infrastructure-as-code (IaC) approach to deploying one such service using SAM. The deployment will assume that a virtual private cluster (VPC) is already in place and that only VMs on specific subnets within the cluster should be able to access the private service. …


“Be fearful when others are greedy and greedy when others are fearful.” — Warren Buffet

Image for post
Image for post

Disclosure: 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

As the global pandemic brought an uncertain climate and a volatile market, I decided to further my knowledge of alternative asset classes.

To this end, I allocated a small sum in over 30 different investment platforms featuring different assets. …


Image for post
Image for post

With 133,000+ Ruby Gems in the wild, the Rails community has a library to suit most project’s needs out of the box. However, the wide breadth of options can also make choosing which gems to include a time consuming task. Here are 5 must have gems for Rails projects.

1. Bullet

The Bullet gem helps optimize the performance of your application. It can warn you during development about N+1 queries (see part 1 here), when a model is eager loaded unnecessarily and when a counter_cache would increase your application performance.

2. Rubocop

Standardizing styling of a codebase across multiple developers can be tricky especially as new members are onboarded to the team. Rubocop is a linter for Ruby that can help automatically clean up the code to conform to accepted standards or be tuned to your specific needs. …

About

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