Go embed for migrations

Introduction In this post we will explore an example of a Go binary that combines features such as Go Embed and Go-Migrate to have a self-contained binary that runs the appropriate migrations before starting any actual work. What is embed? Go Embed was introduced in Go 1.16 as a … | Continue reading


@oscarforner.com | 7 months ago

Image manipulation in the terminal

Introduction Lately I have been in need of cropping some images, the easy thing to do would have been to install Gimp and do it there, but that is not fun. I end up using ImageMagick to do some basic image manipulations. Since it took me few searches to find what I needed I decid … | Continue reading


@oscarforner.com | 3 years ago

No Naked Boolean Parameters

Introduction We all have used naked boolean parameters at some point during our lives, specially when we were starting to learn to program. Other times we add them when refactoring code, or we are just hacking somthing together. However, naked boolean parameters are a code smell … | Continue reading


@oscarforner.com | 4 years ago

Sorting algorithms

Introduction Before we start, I want to define a couple of terms: In place: the algorithm does not require extra space to be executed. In other words, if you have to sort and array of n elements, the algorithm will use only that array of n elements. Stable: if two elements of the … | Continue reading


@oscarforner.com | 4 years ago

Python's for Loop Explained

Continue reading


@oscarforner.com | 4 years ago

Python's for loop explained

Introduction Have you ever thought about how the for loop is implemented in Python? I always thought it would iterate over all elements in the sequence, like it does, but that first it would query the sequence to know its length and then request that many elements. Turns out, it … | Continue reading


@oscarforner.com | 4 years ago

Software development using BASH

Introduction As for any other language I develop with, I like to make use of tools and utilities to help me spot problems as soon as possible. For that reason I like to have three things in all my projects: Formatter Linter (Static Analysis) Unit Test Framework When developing in … | Continue reading


@oscarforner.com | 4 years ago

Interactive curriculum in Rust

Introduction As we all know the process of looking for a job is hard. And you have to stand out from the crowd. Therefore, when I saw s0ulshake’s CV I wanted to do something similar, but with other technologies (you know I do not know JavaScript) and add the ability to move forwa … | Continue reading


@oscarforner.com | 5 years ago

My two cents about Go

Introduction There is plenty of meterials such as talks, tutorials and posts talking about Go, but I want to give my opinion about what I think are the strenghts and weaknesses of Go. Full disclosure: I do not use Go at work. I use Go in my personal projects. Therefore, take my o … | Continue reading


@oscarforner.com | 6 years ago

Boost ASIO basics

Introduction Boost ASIO library is the defacto standard for network and low-level I/O programming. It has a great documentation available online, but there are a lot of methods and classes in the library. Therefore, if it is your first attempt to use it, it can be a bit challengi … | Continue reading


@oscarforner.com | 7 years ago

Thread, Future, and Promise

Introduction In the C++11 standard several concurrency related classes were added. I will talk about thread, future and promise. Yes, I know there are others more useful than these three. However, I think that it is really important to know well the bases to be able to use the mo … | Continue reading


@oscarforner.com | 7 years ago

Clang sanitizers

Introduction Clang is a compiler front end for the C, C++, Objective-C and Objective-C++ programming languages. It uses LLVM as its back end. In this post I talk about some of the sanitizers available in Clang (some are avilable in GCC as well). They help you detect problems at r … | Continue reading


@oscarforner.com | 7 years ago

Lambda comparison C++11/14/17

Introduction In this post I talk about what has been added in the C++ standard regarding lambda expressions since they were introduced in C++11. All the code and configuration files used in this post are available in this repo in GitHub. What is a lambda expression? A lambda expr … | Continue reading


@oscarforner.com | 8 years ago

ARM C Compiler (ACC) II

Introduction I am working on a pet project to create a C compiler for the ARM architecture. You can find more information about this topic in my previous post ARM C Compiler (ACC) - Basic Compiler I. The source code of this project can be found in GitHub. What is the current stat … | Continue reading


@oscarforner.com | 8 years ago

Linux Kernel Rickroll Module

Introduction NOTE: The code used to replace the user’s path with the one provided is BAD, never change user’s pointer content unless he/she is expecting that to happen. Don’t do that at home kids I decided to explain the basics of a Linux Kernel Module with humor. I am not saying … | Continue reading


@oscarforner.com | 8 years ago

Prefix Tree comparison

Introduction In this post I talk about three data structures I implemented to compare their performance in different scenarios. The three data structures are Trie, Ternary Search Tree and Radix Tree. All the code for the data structures as well as the tested scenarios are availab … | Continue reading


@oscarforner.com | 8 years ago

FFF a mocking framework for C

Introduction This post is a continuation from a previous post called Unity; unit test for C, but in this post we are going to use FFF. FFF is one of the available mocking frameworks for C. In this example I will use CMake to configure the project and build it. All the code and co … | Continue reading


@oscarforner.com | 8 years ago

ARM C Compiler (ACC) I

Introduction Why do you want to create your own compiler? To answer this question I have to give you some background. For Christmas I got a BeagleBone Black, perfect to learn ARM assembly. After a few weeks of doing the usual stuff I decided I wanted a bigger project to improve m … | Continue reading


@oscarforner.com | 8 years ago

Unity: unit test for C

Introduction Unity is one of the available frameworks to create unit tests for C. In this example, I will use CMake to configure the project and build. All the code and configuration files used in this post are available in this repo in GitHub. Can you do unit test in C? And what … | Continue reading


@oscarforner.com | 8 years ago

Google Mock for C++ testing

Introduction This post is a continuation from a previous post called Unit test with Google Test for C++, but in this post we are going to use Google Mock, that extends the functionality of Google Test. Google Mock is one of the available frameworks for C++ to mock objects in unit … | Continue reading


@oscarforner.com | 8 years ago

Clang tools

Introduction Clang is a compiler front end for the C, C++, Objective-C and Objective-C++ programming languages. It uses LLVM as its back end. There are also several awesome tools build on top of Clang and I am going to show the three of them I use the most. As usual, I am working … | Continue reading


@oscarforner.com | 8 years ago

rr debugger, an improvement over GDB

Introduction rr is a debugging tool from Mozilla that enhances the behaviour of GDB. It can be found in GitHub, but my recomendation is to go first to the website of the project. In the website you can find really useful information and documentation. As usual, I am working from … | Continue reading


@oscarforner.com | 8 years ago

Cling a C++ interpreter

Introduction Cling is an interactive C++ interpreter, built on top of Clang and LLVM compiler infrastructure. It can be found in GitHub (Note: Lately there has not been that much development on it). Since I use Arch Linux I am lucky to have cling in the AUR repository (cling-git) … | Continue reading


@oscarforner.com | 8 years ago

LD_PRELOAD to fix unsecure libraries

Introduction I have seen LD_PRELOAD used in several cases. From using it to allow programs that link to a newer version of the libstdc++, to cracks for applications that hijack some calls and provide the expected result to tell the application they have a valid license. The aim o … | Continue reading


@oscarforner.com | 8 years ago

Google Test for C++ testing

Introduction Google Test is one of the available Frameworks to create unit test for C++. In this example I will use CMake to configure the project and build. Furthermore, for the dependency manager I will use the new and shiny conan. Before starting, why use a dependency manager … | Continue reading


@oscarforner.com | 8 years ago

Prefix Tree Comparison

Trie, Ternary Search Tree (TST) and Radix Tree is aimed to compare the performance of these three data structures. The three data structure are an implementation of the abstract data type dictionary, but they are enhanced with an extra method called “keys”. That method returns th … | Continue reading


@oscarforner.com | 2024 years ago

ARM C Compiler (ACC)

ACC is a pet project with the purpose of improving my knowledge of three topics. The C language, compilers and the ARM assembly. I think this is a good exercise to go deep into both topics. The ACC is a LALR(1) parser, that means it is a Look-Ahead Left-to-Right parser. The curre … | Continue reading


@oscarforner.com | 2024 years ago

Yaus, Yet Another URL Shortener

YAUS, Yet Another URL Shortener, was first written in Python3 using the Flask web framework, and deployed in Heroku: https://yaus.dev. The code of that version can be seen here: https://github.com/maitesin/yaus/tree/e938b0d218849f50df7ab5a4a46923faf235762b. However, the project h … | Continue reading


@oscarforner.com | 2024 years ago

Resume Application

This resume is an interactive application written in Rust and it can be found in https://github.com/maitesin/rust-cv/. The idea for this project was inspired by S0ulshake’s CV, however, I preferred to use other technologies, since I do not know JavaScript. The Rust library I used … | Continue reading


@oscarforner.com | 2024 years ago