What I'm Thinking

Does this still work?
29 June 2023

I having been thinking about blogging again, but I couldn’t get over my axiety of starting over. After weeks of thinking about it and doing nothing, I decided to try to get my github.io page working. I mean, the site has been up for nearly a decade, but I have not touched it in 5 years, which means I have not built it in 5 years. Hugo has changed. The current version of Hugo cannot build this blog, but, if you scroll through the hugo releases long enough, you can find binaries from 2018 (v0. ... Read More
What is Embedding? The talk given by Sean Kelly on Embedding is the best resource I have found for explaining it. In summary, Embedding, in golang, is the rules governing the ability to place one struct or interface within another struct or interface and, from the outer struct or interface, call the exported fields of the inner struct or interface. In terms of creating a custom file server, why is this important? ... Read More
Background I recently came across a piece of code that checks for the existence of an environment variable. If the environmental variable exists, the code will use the value of that variable. If it does not exist, the code will return a default value. Equivalently, this function could of set the environmental value to it’s default value and then returned the value of the environmental variable. func envValue(env, defaultValue string) (result string, err error) { result = os. ... Read More

How to Test Panics
24 July 2018

Setup Before we can test a panic, we need to have code that panics. package panic func willPanic() { panic("Told you I would panic") } Testing Given that we know the code will panic, we can do the following: package panic import ( "testing" ) func TestWillPanic(t *testing.T) { defer func() { if r := recover(); r == nil { t.Errorf("The code did not panic") } }() //Call func willPanic() } In the above, we try to recover and, if the recovery is equal to nil, we marked the test as failed. ... Read More
Why? Why do such a thing I have no good reason… I was poking around in the golang net/http package one night and came across triv.go. Triv.go (triv is short for trivial) is a file filled with trivial server examples. One of those examples was a file server. When I pointed my browser at that file server, I saw all of my dot files. At the time, I was sharing my home directory, which is filled with dot files. ... Read More
Let’s clear the air You may be thinking? “How can you be lazy AND still build a Christmas gift?” I know. To truly be lazy around Christmas time is to put in as little effort as possible into buying a gift. My issue with that definition of “Lazy” is that you have to have money to buy a gift… Paint the picture I was in China working for the Peace Corps (AKA NO SALARY! ... Read More

Captcha FAIL!
27 October 2017

I am not a ROBOT!!! I am currently in China and I already do not have access to a lot of sites (Thanks China!). Now Google is blocking the few sites that I do have access to with their Captcha interface! I have no access to Google, so I have no way of completing the Captcha! Given that implementing a captcha is standard practice in tech, I just lost access to the rest of the Western World…

Programming Oversight...
18 October 2017

The Problem I have a horrible memory. If I meet 10 people at a party, I might remember 2 of their names. Recently, I started teaching English in China, and I now have 300+ students. In the spirit of facing my memory problem head on, wrote a programmatic solution. Flash Cards App I built my own flashcard app! You can find the project on Github at https://github.com/crazcalm/flash-cards. In summary, I used Golang to build a terminal application that reads a csv file and turns that content into flashcards. ... Read More

Free Windows VMs
14 October 2017

Window VM’s As a linux user, I do not have any Windows machines. However, every couple of years I do need the Windows operating system for either testing browser support, making sure my code runs on Windows, etc. And, even though I have downloaded Windows VMs plenty of times, I always forget which website has them. Thus, this blog. Microsoft’s Developer Website The full url is https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/. This website will allow you to download VMs for different versions of the Windows operating systems. ... Read More
The Issue While in China, I do not have access to Google services, websites, or platforms. In terms of being a Golang user, this is annoying because a ton of Golang projects and packages use the x packages, which are a set of Golang packages that were built by Google. These packages are hosted on a Google server, so I end up seeing a lot of this: $ go get -u github. ... Read More