All posts by JFeliu

The joy of open-source projects

51 stars and counting 🙂

I often found myself with a lack of motivation when it comes to working on a project. But all that changed after I showed GoPlantUML to the great people at Reddit. This post is about how an open-source project can spark a new passion for work and how I am enjoying every minute of it.

GoPlantUML is open-source software that I wrote as a training exercise. I stumbled by accident with the ast library in Golang, and I discovered that I could quickly parse Golang code. Immediately, I realized I could use it to create a diagram of my projects using PlantUML, and thus GoPlantUML was born.

Continue reading The joy of open-source projects

What’s all the hype about the heap and Stack?

The terms Stack and Heap get thrown around a lot in the programming world. But what does it means? What is the difference between them and why should we care?

Introduction

To start, I would like to make a clarification on a possible misconception. Heap is referred here as a memory allocation technique, not as a data structure. Furthermore, when we speak about Heap as opposed to Stack, we do not mean two types of memory, what we mean is two ways of allocating memory.

When your code compiles (or run if interpreted), the compiler needs to consider how to allocate your variable definitions in memory. To understand this process, let’s first examine the pros and cons of each type of allocation.

Continue reading What’s all the hype about the heap and Stack?

Effortless Class Diagrams for all your golang needs

A picture is worth a thousand words.

If you agree that nothing paints a better picture of your software project like a well maintained UML class diagram, then this post is for you.

Motivation

I have been fascinated with Golang because of the versatility of the language. I wanted to take advantage of the Golang parser and a great software called PlantUML (http://plantuml.com/) to create a program that will translate my Golang code into a neat class diagram.

Continue reading Effortless Class Diagrams for all your golang needs

Using Redis for HTTP Api Inter process Communication

First, solve the problem. Then, write the code.

John Johnson

One of the most exciting aspects of the software development process is experiencing the steps leading to a pleasing solution to your problem. That moment when, after some time of thoroughly brainstorming, everything falls into place. I had such a moment today, and I would like to share my story.

The Problem

This morning I was faced with a simple dilemma. I needed to perform a GET request containing a large payload to the server, but I didn’t want to show it in the URL. The reason for the GET request is that I wanted to give the user the ability to download a file with a click of a button. The purpose of the large payload, the requirements for this file. You see, this file is a zip archive that the service will dynamically construct and deliver to the user. The issue is it can potentially contain thousands of files inside, and I didn’t want to clutter the URL with this payload.

That is when it hit me! I have been using Redis for some time now, and I thought this would be a great use of it. With that in mind, I set up to develop the following idea.

Solve it

Continue reading Using Redis for HTTP Api Inter process Communication

Why I like dictionaries so much?

Complexity in data structures is defined for each of its actions (access, insert, delete, search) and dictionaries shine on three of these operations. Because of this, they become useful in reducing the complexity of many algorithms when you apply a clever use of them. For dictionaries, accessing, deleting and inserting operations could be achieved quickly despite the number of elements they have. So let’s pick up our headset and get to coding while we listen to smooth jazz (hint hint, Kenny G).

Let’s consider the following problem: Write a function that prints a count of how many times all letters appear in a given string.  To simplify the use of dictionaries I will decide to use PHP, but this approach could be seen in almost any language. Continue reading Why I like dictionaries so much?