Articles

The shape of structured data

Extracting the structure of structured data from #JSON and #YAML data files separately from their data is a powerful tool for data analysis, data manipulation and data migration. The process of extracting the structure of structured data is also known as “scaffolding” or “skeletonizing” the data. In this technical blog post, we will discuss how […]

0 comments

Writing very small executable

Many years ago I took part in a contest to create a small linux binary that output a specific string Unfortunately the original contest page no longer exists but the Intenet Archive still holds a copy. The original rules were quite simple: Is a valid ELF image. Runs successfully. Uses a stack-based approach (Preferably no […]

0 comments

The challenge of type asserting []interface{} to string slices.

 When working with JSON data it can be easy to silently miss converting data, if one is not doing the typical unmarshalling into a well defined struct but instead into a generic map[string]interface{}. Given the following data block: We can unmarshal it via If we then try and extract the data element and convert it […]

0 comments

Serializing/Deserializing a complex GO struct to store externally (i.e. in a database, redis, or text file)

Sometimes one needs to serialize data to store outside of a go application. One common approach is to save it as a JSON blob which can have it’s own challenges when retrieving it. In this article I will show you how to make use of GOB to serialize a complex struct into textual data than […]

0 comments

Fun with golang, Google Maps api, and proxying requests

I admire published api code that is thoroughly thought through. Recently I have been working with the Google Maps API in golang and have found that they set it up to allow one to pass in an net/http/client variable which means that it is possible to create a http client which sends the requests via […]

0 comments

Recursive common table expressions (CTE) for arbitrary depth hierarchies

The challenge of storing an arbitrary depth hierarchy isn’t so much with the storing of it as it is with the querying it and rendering it in a useful fashion. Given a simple hierarchy stored in a table that has a self-referential parent_id such as: With some sample data: We can extract the data: Which […]

0 comments