Welcome to my blog
HTML - Semantic Meaning and the Anchor Element
When I reviewed HTML for my current job, I was concerned about using elements that not only contain style but also meaning, semantics. This is something I saw frequently while studying iOS on my free time and and only later I found out the web also had it, but I never paid attention to it as I was too busy thinking about layout, styles and data. However, using elements with semantics help us convey our intent better and the browser can also help us with common implementations for the element we used....
Solid Parakeet
I have been working with VueJS for a while, but I also have some ReactJS experience. I was curious to see how the framework and ecosystem advanced in the couple years I hadn鈥檛 touched it so I decided to read some docs. I got excited and also created Anki cards for it to sediment my knowledge, but that鈥檚 a topic for another post (let me know if you are interested in knowing more how I do it)....
Unit tests with Vapor and Postgres
Introduction Vapor makes it easy to write unit tests for server-side applications. I particularly find it fantastic that tests can run in memory, not even opening a port. Also, the database can be changed quite easily to use in-memory SQLite: app.databases.use(.sqlite(.memory), as: .sqlite) Doing that would allow a unit test to be quite lightweight. However, I had some issues with that approach. This post is about explaining what that issue was and how I ended up changing my unit tests to use PostgreSQL directly....
Building multi-architecture Docker images: why and how
Docker is quite a famous piece of tech. It solves the problem of making software that runs easily across machines (mostly for Linux servers). I won鈥檛 get into details, but it uses Kernel level functions to isolate containerized programs so that we don鈥檛 need to bother about installing the right dependencies on every machine we want our software to run. Instead, we build a docker image, publish it and whoever has docker in their machine can then run it as well as long as the machine has Docker installed....
A Shell Configuration
I spend a lot of time on the terminal. I started with vanilla terminals on Ubuntu and macOS. Later I learned about terminals with a few "batteries" included like iTerm2 and HyperJS. I have also used tmux extensively before, but ended up switching a few months later to use window splitting from iTerm2 and also profiles, which can login to a shell session automatically. Well, enough of history. This post will introduce you to a basic shell configuration....
How to succeed in the software industry
Continuous improvement. This post's purpose is to help students and professionals in the software industry get better at what they do by continuously improving. I share points that helped me mature as a person in the last few years and that, in my humble opinion, made my software developer mind-set much better than when I started. What I show here is not going to make you a great developer, but helps you have ideas on making a plan to become one....
One Consumer, Multiple Producers in F#
I have been learning F# by reading the Expert F# 4.0 book by Don Syme, Adam Granicz, et al. I am really enjoying the concurrency chapter and decided to take on a small challenge involving agents (MailboxProcessor). I settled on the following requirements: 1 consumer agent with two-way communication accepts arrays of doubles and stores their sum and count internally allows other to fetch the current average 4 producer agents generate arrays of doubles sends them to the consumer agent fetches the current sum and count waits for a specific interval then generates next one Stats and Messages Let's start by defining a Stats type that will store our sum and count:...
Get number of common divisors in OCaml
Hi, everyone! In this challenge I used OCaml sets again. The goal was to get the number of common divisors for each pair of numbers in the test cases. The first function I wrote was to define a limit until when I would be checking if the number was divisible or not: (* Need to check divisors just up to sqrt x *) let max x = Int.of_float (sqrt x) |> (+) 1;; After that, I wrote a function to get the number of common divisors of a single number n....
Dedup chars in a string using OCaml
Hi there! The goal of this challenge is to remove all duplicate chars in a string. The following input/output will explain it by itself: # input abcabczabczabc # output abcz I tried to write the functions to explode and implode from what I remembered, but in the end I had to take another look at their code here. Those were auxiliary functions to help me to write remove_all_dups. open Core.Std (* string -> char list *) let explode str = let len = String....
Mingle strings in OCaml
Hi there! The problem that I solved this time was a little cumbersome initially, cause even though I knew well how to iterate over lists, I had no idea how to iterate over strings. The solution I found was inspired in the functions to explode and implode strings . These functions use the string indices to explode the string, creating a char list, or implode a char list, creating a string....