→ 10 to 1 Rule

Similarly, the ratio of “code churn” to “lines of code” in mature and non-trivial software is also at least 10:1. Keep this in mind the next time a manager or customer asks you for a time estimate! To build a 10,000 line app, expect to write roughly 100,000 lines.

Random UAC permissions for C# applications notes:

Rubber Ducky Moments: 'Completely unrelated []interface{}!!!'

I mentioned on Twitter earlier today that very often when I get really stuck on something and finally decide to ask for help on a forum, the answer suddenly hits me as I finish writing my post. Most of the time the problem is something really silly that I just kept completely overlooking, and the answer feels painfully obvious once it clicks. Despite the fact that these might be a little embarrassing to post, I figured rather than letting my entire would-be forum post go to total waste once I finally get what’s happening (and so never end up clicking the “Post” button), it might be nice to post the issue on my blog, if nothing else as a reminder of my own facepalm moments.

Continue Reading »

IJCAI Session Notes: Rebel Agents

What follows is a set of notes I took during two of the IJCAI Goal Reasoning workshop talks, about rebel agents. Both talks were presented by the same speaker and both focused on rebel agents. These talks were quite short and the speaker had to go fast, so I feel like I missed out on a lot of the information I wanted to record. As a result some parts are obviously omitted and more than usual are written from memory today, increasing potential inaccuracies or misinterpretations.

Continue Reading »

IJCAI Session Notes: Learning Common Sense

Below is another set of IJCAI session notes. This was the first invited talk in a day-long workshop called Architectures and Evaluation for Generality, Autonomy & Progress in AI (AEGAP). The speaker, Oren Etzioni, talked about some of the work the Allen Institute is doing to drive the creation of common sense in AI. He focused especially on a need for a concrete benchmark to measure results when it comes to implementing common sense.

Continue Reading »

IJCAI Session Notes: Verifying Agent Based Autonomous Systems

For the past couple of days I’ve been at IJCAI - the International Joint Conference on Artificial Intelligence. It’s been a three-day whirlwind of workshops and tutorials. I took a lot of notes, and as with ECAL last year I figured organizing them into blog posts would be a good way to review some of the takeaways. Note that the intended audience here is future-me, and I could very well have made mistakes or misinterpretations in my own notes.

Continue Reading »

go-sql-driver and MySQL 8

I should know better than to use a latest tag in a Docker image. I’d never do this at work, so why did I do it in my hobby project? I blame Go’s nature of dealing with package versioning (that is, the lack thereof) for putting me in the “let’s use latest!” mindset (and yes I know they’re working on it). Anyway, I should know better, but here we are, writing this post.

Continue Reading »

Some SnailLife Go client testing notes

I’ve started working on client tests, which have been getting very neglected compared to the server. I figured I’d write some quick notes on what I’ve done so far before continuing, before I forget. The first thing I’m choosing to focus on testing is interaction with the server. I’m already testing my API on the server side, but I also want to make sure I’m sending correct requests and handling responses correctly from the client.

Continue Reading »

Testing SnailLife Go repositories

Every SnailLife model struct has a repository struct to go with it. Since all repos are implementing the same Repository interface I wanted to reuse most of the code for testing them, but also allow for custom repo-specific tests. For example,OwnerRepo does some stuff that StableRepo does not - like optionally retrieving stables belonging to an owner. For now I am going about it as follows, but any feedback or suggestions for a better way are more than welcome.

Continue Reading »

Excluding mocks from coverage reports

I noticed that my coverage reports were including mock packages. To get rid of this instead of running go test like this: go test -race -coverpkg=./... -coverprofile allcoverage1.10rc.out ./... I am now running it like this: CVPKG=$(go list ./... | grep -v mocks | tr '\n' ',') go test -race -coverpkg $CVPKG -coverprofile allcoverage1.10rc.out ./... go list ./... lists all packages in my project; we pipe that through grep -v mocks to exclude mocks; we then pipe that output to tr '\n' ',' to replace newlines (each package is listed on a new line) with commas.

Continue Reading »