RSSAmplifier

Blog

HectorCorrea.com

HectorCorrea.com

hectorcorrea.comRSS feed ↗79 posts

Latest posts

A career in software development

*Posted on 2026-01-12* This post is a short description of what my career as a software developer has been, followed by a few observations and recommendations for those starting a career in software development. I wrote this piece based solely on my experience as a software developer and my recollection of thirty years in the field, it is therefore a very selective story (that's how memories work)…

Displaying the Git branch on the Bash prompt

*Posted on 2026-01-05* A few days ago I updated my Bash initialization script to display the current Git branch on the prompt. As it turns out there several ways to achieve this and after trying a few of them I settled on creating a very small Bash function to return the current branch if I am on on a Git project (empty otherwise) and stick this value to the `PS1` variable which is what Bash uses…

Go executables and machine architecture

*Posted on 2025-11-11* One of my favorite features of the Go programming language is that it can produce executables that I can copy to another machine and run without having to worry about dependencies on the target machine. To make things even better I can build executables for other operating systems, like Linux or Windows, from my Mac. For example, to build the executable for one of my…

US-RSE-24

*Posted on 2024-11-04* Last month (October/2024) I attended the [US Research Software Engineering 2024](https://us-rse.org/usrse24/) conference that took place in Albuquerque, NM. This post is a summary of what I learned during this event. Although I am not a Research Software Engineer (RSE) per-se, most of the projects I am involved at work are related to developing infrastructure to support…

Computer Museum (Valencia)

*Posted on 2024-09-12* Earlier this month I visited the [Museum of Informatics of the School of Informatics of the Universitat Politècnica de València](https://museo.inf.upv.es/en/el-museo/) which has a nice collection of older computer equiment including mainframes from the 60s, microcomputers from the 70s, early personal computers from the late 70s and 80s, and a few other interesting exhibits…

fixie

*Posted on 2023-10-18* A few weeks ago I wrote a little program called (`fixie`) to help me migrate my personal website to be served via statically generated pages. `Fixie` is similar to other static site generators like [Hugo](https://gohugo.io/) or [Jekyll](https://jekyllrb.com/): you give it a bunch of Markdown files and it produces the HTML pages with the content on those Markdown files. But…

Static Generated Site

*Posted on 2023-10-17* Earlier this month I migrated my personal site at [https://hectorcorrea.com](https://hectorcorrea.com) to be hosted as a statically generated set of HTML pages hosted on GitHub pages. This post elaborates on why and how I did it. Recently I have been interested in how much we can achieve on the web with just the basics (HTML + CSS + JavaScript) and in keeping with the…

Migrating to Mastodon

*Posted on 2022-11-12* Mastodon is an open source project with the goal of providing a platform to create decentralized social networks. The goal of creating a decentralized social media platform is something that aligns with my idea of the web, but my previous two attempts at joining Mastodon were disappointing since I had a hard time finding people to follow - the site felt like an empty…

I can't believe it can sort - visualized

*Posted on 2022-08-30* A few months ago I came across a paper titled [Is this the simplest (and most surprising) sorting algorithm ever?](https://arxiv.org/abs/2110.01111) by Stanley P. Y. Fung in which he presents an incredibly simple sorting algorithm, the entire code is just 4 lines of code: That's it, that's the entire algorithm. As Fung indicates on the paper, at first glance it looks like…

Log4Shell and Solr

Last week the disclosure of the [Log4Shell vulnerability](https://www.lunasec.io/docs/blog/log4j-zero-day/) took many of us Solr users by surprise. When I first heard about it I didn't pay much attention to it since I figured that the problem was that somebody had found how to leak information *into the Solr log files*, something that is bad but that has limited exposure. However, one of my…

Solr debugQuery

`debugQuery` is a parameter that we can pass to Solr when submitting a query, with this parameter Solr will include extra information in the response that is useful to troubleshoot a variety of issues in Solr queries. The information returned is helpful to diagnose: The `debugQuery` parameter is available in the Solr Admin screen ![Solr Admin](https://hectorcorrea.com/images/solr_debug_query.jpg)

String encoding in Ruby and JSON.generate()

Last week at work we ran into an interesting string encoding issue. The gist of the problem is that we had a string that was valid in Ruby but Ruby threw an exception when we used it in a call to `JSON.generate()`. Below is a simplified version of this scenario: Notice how Ruby accepts the string and that I am able to use it in a hash, but then `JSON.generate()` throws an exception when it tries…

document body innerHTML woes

Today I ran into an issue setting the value of `document.body.innerHTML` that caught me by surprise. I have always known that I can set an HTML fragment to `document.body.innerHTML` and the rendering engine (the browser usually) does the right thing and renders it correctly. You can even pass a *malformed HTML* and the rendering engine usually makes pretty good guesses and parses it correctly. But…

Tiny Container

A few weeks ago I read the book [Linux Containers and Virtualization - A Kernel Perspective](https://www.apress.com/gp/book/9781484262825) by Shashank Mohan Jain and I was fascinated by the example that he provides on how to build your own container from scratch in Go. In this blog post I replicate a part of the code that Mr. Jain presents but I tweaked it to run its own shell (rather than having…

My (strange) journey to becoming a Ruby developer

Five years ago (in 2014), after being a C# developer for many years I took my first job as a Ruby developer. Transitioning from one technology stack to another is not uncommon among software developers, most of us have jumped from one tech to another more than once in our lifetime (e.g. from DOS to Windows, from Desktop to web, from single user to client-server), but each transition is different,…

Linux mv and file patterns

Last week I ran into an interesting issue renaming a bunch of files in my machine. The command I ran was: I was expecting this command to rename all `.jpeg` files to `.jpg` but instead the command returned At first I thought I had a typo in my command but the reality is that this is not a valid `mv` command.

MySQL UTF-8 issues

A few months ago I upgraded the machine where this website runs from a machine with Ubuntu 14 to one running Ubuntu 19. Because I was coming from a very old version of Ubuntu I decided to create a brand new virtual machine with Ubuntu 19 and move the content myself rather than letting Ubuntu attempt to migrate my stuff. This was a good idea because a lot has changed from Ubuntu 14 to Ubuntu 19,…

Goodbye Gmail

One of the advantages of owning my web domain is that I can host my website and email anywhere I like. This allows me to switch web or mail providers without having to change my domain or email address. This week I *moved my email from being hosted at Gmail to be hosted at a different provider* and deleted my Google account entirely. This blog post elaborates on why I did and I how I went about…

Installing Ruby with ruby-install and chruby

*Posted on 2018-09-22, updated on 2024-02-07* When I started writing code on Ruby I learned there were many ways to download and install Ruby on a Mac. Initially I was comfortable with the version of Ruby that comes installed on OS X by default or using the installer available at [ruby-lang.org](https://www.ruby-lang.org/en/downloads/) to install the latest version. As my needs evolved I needed to…

Build your own software

This blog post is an extended version of the notes that I used for my talk titled [Build your own software, yes, build it](http://2017.code4lib.org/talks/Build-your-own-software-yes-build-it) at Code4Lib in Los Angeles, California on March 7th, 2017. You can also watch the [recording of the presentation](https://youtu.be/eUArNAG-CY4?t=2h57m30s), it's about 20 minutes long. This post, like the…

Migrating my site from Node.js to Go

*Posted on: 2017-01-18, Updated on: 2024-09-17* Over the years I have written the code to power my website (hectorcorrea.com) in a variety of programming languages and platforms. The last version of the site was a Node.js application using MongoDB to store the data, the version before that was a C# ASP.NET MVC application with a SQL Server backend. One of the things that I liked the most about…

Bundle, grep, and Rails Applications

When I first started programming in Ruby and Ruby on Rails one of the things that I struggled the most was finding *where a particular piece of code (a method, a class, a string) was defined*. This was particularly difficult when the code that I was looking for was defined in a gem and not in the code of my application. A couple of years ago [Mike Giarlo](https://github.com/mjgiarlo) showed me a…

Introduction to LDP

[Linked Data Platform](http://www.w3.org/TR/ldp/) (LDP) is a W3C recommendation that defines a set of rules to provide an architecture for read-write Linked Data on the web. This blog post is an introduction to the concept of Linked Data and how to get started with the Linked Data Platform. If we are going to talk about the Linked Data Platform we should start by talking about Linked Data (if you…

Code4Lib 2015

[Code4Lib](http://code4lib.org) is an annual conference that brings together a mix of people that work at libraries and/or develop software for libraries. Given that I am a newcomer to the library domain, this was my first time attending and I learned a lot. Among the things that I found interesting is that Code4Lib is a single-track conference. This means that all 400+ attendees are on the same…

Learning JavaScript Data Structures and Algorithms

The folks at Packt Publishing asked me to review one of their newest books [Learning JavaScript Data Structures and Algorithms](https://www.packtpub.com/application-development/learning-javascript-data-structures-and-algorithms) by Loiane Groner.<sup>[1]</sup> As a fan of data structures and algorithms I am glad to see a book on the subject targeted at JavaScript developers. The publication of…

Practical Object-Oriented Design in Ruby

<img style= float:left; src= https://hectorcorrea.com/images/poodr.jpg /> Anyone that has done a decent amount of programming in Ruby is bound hear about the book [Practical Object-Oriented Design in Ruby](http://www.poodr.com/) <sup>[1]</sup> by Sandi Metz. When I started programming on Ruby I was no exception to this and kept hearing people talk about it. Having read a fair share of books on…

Hydra Connect 2

![Hydra Connect ballroom](https://hectorcorrea.com/images/hydraconnect2.jpg) This is my first time attending a [Hydra Connect](https://wiki.duraspace.org/display/hydra/Hydra+Connect+2+-+Fall+2014) and I was very impressed with the overall experience. From what I understand there were about 150 attendees representing 47 different institutions. The event had a good mix of workshops, lightning talks,…

Connection handling with Node.js and MongoDB

One of the things that trips most newcomers to Node.js and MongoDB is how different the process to connect to databases from Node.js is compared to other programming environments. For example, the pseudo-code below is a typical example of how database connection is handled in most programming environments: The general concept **in most programming environments** is to connect to the database only…

Running a Node.js web site in production (part 2)

Last year I blogged about my [first experiences hosting a Node.js website in production](https://hectorcorrea.com/blog/running-a-node-js-web-site-in-production-a-beginners-guide/49). In this post I detail what I have learned in the last 12 months about hosting Node.js applications. The first thing that I learned is that there are still **no cheap web hosting providers for Node.js** like there are…

Introduction to Node.js

[Node.js](http://nodejs.org) is a JavaScript interpreter that runs in a server environment and gives us the ability to run JavaScript code directly on the server (i.e. outside of a browser) just like we can run server side code in other languages like PHP, Python, Ruby, C#, or Java. Node.js is based on the JavaScript engine that Google wrote and uses for the Chrome browser. The author of Node.js,…

Running a Node.js web site in production (a beginners guide)

In this post I describe my experiences taking my first Node.js website to production, running it on port 80, and hosting it outside my local box so that it's available to the world wide web. The site in question is the site where you are reading this post and it can be described as a typical low-traffic website that uses Node.js, Express.js, and CoffeeScript. Although I have deployed to production…

Using SSH without a password

This blog post describes the steps that I used to configure my OS X machine to SSH to a remote Linux machine without having to enter my password every time. Although there are many web sites that describe this process in detail I found that most of them assume that you know your way around a Linux machine. Since that's really not the case for me, I decided to write the steps from a Linux-newbie…

Using layouts with EJS in Express 3.x

Over the last couple of months I've been meaning to update [my sample Express.js application](https://github.com/hectorcorrea/simple-blog) from Express 2.x to Express 3.x but the fact that support for layouts was removed from Express 3.x was holding me back. In Express 2.x the framework itself supported the concept of layouts and both template engines, Jade and EJS, worked nicely with it. In…

A Decaf Introduction to CoffeeScript

Below are the links to the slides and code samples that I used during my presentation **A Decaf Introduction to CoffeeScript** that I gave earlier this month. The slides are pretty bare since I spent most of the time showing code samples. Feel free to contact me if you have any questions as you go through them. You can find a detailed explanation of the Binary Tree sample that showed during the…

Compiling CoffeeScript from Sublime Text 2

A few days ago I configured Sublime Text 2 editor to use three different hotkeys for compiling and running CoffeeScript files. I am new to Sublime so I consider somewhat of an achievement that I was able to pull this off with help from the interwebz and a bit of luck. The first hotkey that I configured runs a CoffeeScript file and displays its output to the Sublime’s console window. This is useful…

Drawing a Binary Tree in CoffeeScript

![Binary Tree](https://hectorcorrea.com/images/binarytreecoffee.png) A few months ago I wrote a small **CoffeeScript program to draw binary search trees on a web page page** using the HTML 5 Canvas element and was very pleased with clarity and structure of the resulting code. This blog post elaborates on the code structure and how it compares to previous implementations of the same idea that I…

JavaScript Async Programming for Sync Heads

As I start learning Node.js one of the things that have puzzled me the most is having to write JavaScript code to run in an asynchronous fashion. Since Node.js uses an event-driven, non-blocking I/O model pretty much everything has to be written to run asynchronously. For somebody like me, that has always written code to be executed synchronously, the asynchronous paradigm takes a while to get…

Web Development on the Mac OS X (part II)

Last year I blogged about [my first impressions using a Mac for web development](https://hectorcorrea.com/blog/ruby-development-on-the-mac-os-x/15) from the point of view of somebody with a strong Windows/C# background. This blog post is a long overdue continuation to that post. I bought a Mac Air a year and a half ago with the intention of experiencing what is like to develop web applications in…

Functional Asynchronicity Explained

Over at the Pragmatic Bookshelf Trevor Burnham has a great post titled [A CoffeeScript Intervention](http://pragprog.com/magazines/2011-05/a-coffeescript-intervention) in which he shows several code snippets that demonstrate how CoffeeScript code is typically smaller and cleaner than the equivalent JavaScript code. In particular I love the example under the **Functional Asynchronicity** section.…

Sliding-in a Full Page Panel with CSS and jQuery

In this blog post I show how to use CSS and jQuery to slide-in a panel full page on top of another and then slide back in the original content. You can see a running version of the code presented in this blog post [here](https://hectorcorrea.com/demos/slide-in-panel-sample.html). This demo page starts with a panel showing some part of the Lorem Ipsum text. When you click on the text a new panel…

Future Directions for C# and Visual Basic

These are my notes from Anders Hejlsberg session on Future Directions for C# and Visual Basic. It's been more than 10 years since managed code was introduced back in PDC 2000. Every new release of C# has had one or two major themes: The two major themes in the next release (version 5) are support for **WinRT**in Windows 8 and **asynchronous programming**.

8 Traits of Great Metro Style Apps

These are my notes from [Jensen Harris](http://blogs.msdn.com/b/jensenh/about.aspx) session at Build Windows conference on Tuesday September 13th, 2011. Jensen is the Director of Program Management for the Microsoft Windows User Experience Team.

Simple Branching Strategies for Team Foundation Server

In this blog post I describe some branching strategies that I've found useful when using traditional source control systems like Team Foundation Server (TFS). Team Foundation Server has very good branching and merging capabilities that can help teams manage source code in a team environment. However, despite the fact that TFS provides excellent branching and merging capabilities, I usually…

Running Visual Studio inside Mac OS X

Lookie here...I am running Microsoft Visual Web Developer Express on my MacAir! When I bought [my MacAir last year](https://hectorcorrea.com/blog/ruby-development-on-the-mac-os-x/15) to start learning Ruby and Ruby on Rails I wasn't sure how much I was going to really use it. Overtime, I've gotten familiar with it and little by little it has become my main machine at home to do pretty much…

Finder Error -36 on a NAS

Ever since I got my [MacAir late last year](https://hectorcorrea.com/blog/ruby-development-on-the-mac-os-x/15) I've been having **issues copying files from my Mac to my external storage device**. My external storage device is a Buffalo HD-CELU2 DriveStation that can be accessed as a standard USB drive or as network attached storage (NAS.) I've been using this device as a NAS from my Windows…

Drawing a Binary Tree in Ruby

<img src= https://hectorcorrea.com/images/binarytree_simple.png alt= git align= left />When I started learning Ruby last year I decided to implement a **binary search tree** and some of its basic operations (insert, delete, walk, and search) just to get my feet wet on the language. Binary search trees are a good exercise because you need to use several features of the language like conditional…

Git Basics

This blog post is a beginners' guide (written by a git beginner) on how to perform **basic version control operations with git** including initializing a repository, adding files to it, and using branches. The goal of this post is to describe how to use git *in your local machine* for version control. In a future post I'll cover the basics of using git and github for collaboration with other…

Ruby Development on the Mac OS X

A little more than a month ago I got myself a MacAir. Even though I’ve own computers since the mid 80s this is the first time that I buy a Machintosh. The reason I bough a Mac rather than a PC is because I wanted to **start experimenting with the web development tools that exist for non-Windows environments**. Although I’ve been a software developer for more than 15 years all my experience is with…

Returning HTTP 404 in ASP.NET MVC

A few weeks ago I noticed that when users of my site request a blog topic that does not exist although I was displaying a user friendly message indicating that the topic does not exist **I was not returning the proper HTTP status code (404) to indicate to the user that the page was not found**. This approach is typically not a problem if the user visiting my site is a human (users don’t really…

Log4net Thread-Safe but not Process-Safe

A few days ago I was struggling with a problem with [log4net](http://logging.apache.org/log4net/index.html) in a web application. I have used log4net in many applications before with little or no problem but in this case even with a single user hitting the web site I was seeing strange logging behaviors. In my case **some of the log entries were being logged but others were not**. The application…