More null than null

// no value which is more null than null in this case.

A comment in my code just now. I highly enjoy implying degrees of things which have no degrees. Binaries. It is now more perfect code with this comment in there.

https://twitter.com/jasontconnell/status/989926649465638912

Go and Sitecore Interlude

I've integrated Go heavily into tools to make development of Sitecore much more easier. Replacing Team Development for Sitecore has been hugely beneficial. Part of making it easier to use involved writing a method using Go's reflection to join multiple JSON configurations together to get the final configuration.

Read more at Go and Sitecore Interlude

Go and Sitecore, Part 3

I've integrated Go heavily into tools to make development of Sitecore much more easier. Replacing Team Development for Sitecore has been hugely beneficial. This is part 3, which involves deserializing the serialized Sitecore data back into the database.

Read more at Go and Sitecore, Part 3

Go and Sitecore, Part 2

I've integrated Go heavily into tools to make development of Sitecore much more easier. Replacing Team Development for Sitecore has been hugely beneficial. This is part 2, which covers serialization of Sitecore data.

Read more at Go and Sitecore, Part 2

Go and Sitecore, Part 1

I've integrated Go heavily into tools to make development of Sitecore much more easier. Replacing Team Development for Sitecore has been hugely beneficial. This is part 1 of that thought process.

Read more at Go and Sitecore, Part 1

Advent of Code 2016

Advent of Code 2016 involves a white elephant gift exchange with 3 million elves :P

Read more at Advent of Code 2016

Transactional Data from Investment Account

I had to go through all of my historical data from ShareBuilder (later CapitalOne Investing) to figure out how many shares I had in my investment account at a certain date. They provide all of the historical data that I needed, I just need to parse it, then figure out what the securities were worth at that date.

Read more at Transactional Data from Investment Account

Advent Of Code - Day 22

Advent of Code has pretty much not topped 2015 Day 22. I had a ton of fun writing the solution.

Read more at Advent Of Code - Day 22

Advent of Code - Day 15

More Advent of Code, solving math problems :D Day 15 in 2015 involved permutations, but probably more so resembling combinations.

Read more at Advent of Code - Day 15

Sorry, I gave Rust a try

At the time of this writing, the up and coming programming language Rust wasn't for me. But I never say never.

Read more at Sorry, I gave Rust a try

.NET Concurrency Model

Go's concurrency model is way ahead of .NET's (Go is way ahead of .NET). But I have been doing a lot of Go concurrency and try to write comparable code in C#.

Read more at .NET Concurrency Model

Software Design and Go

Designing a folder comparer the Go way. (I am adding these blurbs in February 2021, I still love Go and will probably use it until I'm no longer writing software)

Read more at Software Design and Go

Nerdier

My Linux days have me typing "man [help topic]" to bring up the manual. It has carried over into Googling.

Read more at Nerdier

Technology Inventory for Fantasy Golf

A technology inventory for my Fantasy Golf application. It is no longer in production. Plus the PGA Tour site protects their leaderboards now!

Read more at Technology Inventory for Fantasy Golf

Golang Rewrite of Fantasy Golf Tracker

Go is fucking fun #golang

— Jason Connell (@jasontconnell) December 19, 2014

Favorited by Google's own @bradfitz. Watch the videos people! Particularly about Go's http2 server. Guess who wrote it? Brad Fitzpatrick.

Anyway, now tha tthat is over. Last year I was tasked with doing the group's Fantasy Golf tournament tallying for a weekend. It was prevoiusly done through Excel. I got it for one weekend and found out that the pgatour.com site offers all of the data for free. So I was determined to see if I could write an app that keeps track of the scores and the season scoreboard, the tournament scorecard, etc. I could, apparently. Read about the node.js implementation.

So that was last year. This year I'm playing with Golang, and I'm catching on with it quite quickly. It's fun. It makes programming fun and new. It's interesting. I'm learning new concepts, and new ways of doing things.  So I started writing the site in Go last week at some time, and I finished it up today. The main cause of speed was that the database structure was already figured out, and all of the AngularJS code I wrote only need very minor tweaks, to be updated to some new ways I did things to streamline some processes, and how data is ushered between the client and server.

Here is example code to get the current tournament in node.js. The current tournament was either the last one, or if there's one starting in the next 4 days. Pretty simple.

this.getCurrentTournament = function(db, callback){
    var upcoming = new Date().addDays(4);
    var past = new Date();

    dbhelp.find(db, "tournaments", { "$or": 
            [ 
                { "startDate": { "$lt": upcoming } },
                { "inProgress": true }
            ]     
        }, null, { startDate: -1 }, function(tournaments){
        if (tournaments != null && tournaments.length > 0){ return callback(tournaments[0]); }
        else return callback(null);
    });
}

And here's Go code:

func (repo *FantasyGolfRepository) GetCurrentTournament() Tournament {
    upcoming := time.Now().Add(time.Hour * 96) // 4 days
    list := []Tournament{}
    var tournament Tournament

    query := bson.M {
        "$or": []interface{}{
            bson.M{ "startDate": bson.M{ "$lt": upcoming } },
            bson.M{ "inProgress": true },
        },
    }

    repo.OpenCollection(Tournaments).Find(query).Sort("-startDate").All(&list)

    if len(list) > 0 { 
        tournament = list[0] 
    }
    return tournament
}

The thing I like most about Go is that it feels safe. It's all typed, you're not accidentally stuffing a string inside a date field, or passing integer ID to the bson.ObjectId field. The main thing I like is that I feel safe putting this code out there in production, and when I go back to it in a year, it will make sense, it will work, it will compile. My database won't be in shambles by some mistyped keystroke.

I have written two web applications in Go, and they're pretty solid. And I've written a bunch of little utility programs. They vary. One program read xml and used the `xml:"element > subelement"` property attribute syntax. Some deal with JSON, others deal with making thousands of web calls.

Shit, I had a lot more written but I accidentally hit the wrong button in the browser and it's all gone now... 

You can view the site at fantasygolf.jasontconnell.com