Benchmarking a pi calculation for fun

Dotnet Core, Golang, Node, C, Java, Python. This is what I felt like doing on a Tuesday night after seeing yet another article discussing the performance of dotnet core over node.js. As is typical when things like these arise, our team’s slack channel went into the lightest of debates about C# vs Node, compiled speeds vs interpreted languages, and finally back to what we were originally discussing - “Do you think cypress would be faster than selenium?” ...

May 22, 2019 · James D Hughes

Brainteasers - they're important!

48 days ago I signed up for https://www.dailycodingproblem.com/ I haven’t completed all 48 problems however the ones that I have completed, I’ve had a blast with. It bring back a challenge that’s been missing - not that my work and personal life don’t have their own challenges. It brings me back to basics and gets me thinking again on algorithm design and optimization of code. Much of my development work (which is less and less these days) is done using a framework of some sort which puts a layer of ‘magic’ on top of the coding experience. I’ve actually recently gotten a little miffed at just how much ‘magic’ is built into a toolset and have determined that too much ‘magic’ is killing the next generation of developers - but that is a topic for a different day. ...

November 13, 2018 · James D Hughes

Go - Micro-services and Embedded Databases [Part 2]

If you haven’t already, check out Part 1[!] First things first - let’s make these responses something machine readable instead of just some plain text! That’s a nice and easy way to dive back into the code! We are going to create 2 new structs in the router.go file to declare how the app is going to return Errors and Standard responses. package main // ... type ApiErrorResponse struct { Error string `json:"error"` } type ApiStandardResponse struct { Payload interface{} `json:"payload"` } This is menial, but it helps our responses have a bit more structure. The first simply returns an error message as a string value. We will assume that our handlers will set the http response status accordingly. The ApiStandardResponse is pretty well the same except we have an interface{} type on the payload. This is so that we can return any type of data. The response will be dependent on what is being returned by the handler. Next let’s update our WriteError function to use this new struct ...

September 24, 2018 · James D Hughes

Go - Micro-services and Embedded Databases [Part 1]

This is fun! FYI - If you’re looking for Part 2, it’s here[.] I’ve been meaning to learn a few of the things I’m going to go over in this post. Firstly, I want to make an actual useful application using Go. I want it to be run as a microservice with it’s own database. Instead of putting it in a docker container, I want to just use an embedded database that the executable can use. ...

September 19, 2018 · James D Hughes

Learning Go - Morse Code!

I was watching Churchill’s secret agents on Netflix the other day When all of a sudden I got a hit of nostalgia when they got to the portion on morse code. Such an ingenious little method of communcation that I still, to this day, couldn’t follow for the life of me! I took a class on encryption and one of the first concepts they spoke of was morse code. Taking language and transcribing it into a not-so-easy to decipher combination of beeps and blips to send messages over a wire. Some other fun facts for those of you that haven’t taken any introductory encryption classes, morse code is designed very closely following a common english language frequency table. That is, a table that determines the frequency at which a letter appears in the alphabet. Letters that appear frequently are, in morse code, encoded using fewer and shorter . and -’s! I’ve added in a column to the table found at: http://pi.math.cornell.edu/~mec/2003-2004/cryptography/subs/frequencies.html and put in the morse code equilvalent for a quick reference ...

August 15, 2018 · James D Hughes