When you go get a package, Go is designed to build and install the package without running any code from it. The intent is that you can safely get, build, and even install Go packages without trusting them at all. In theory, it seems like this should be a simple feat for the Go toolchain, but in actuality, it's a real challenge. go get does a lot under the hood, including invoking third-party tools like git and clang in ways that are heavily influenced by package configurations. …


Each year, the matchups for professional football leagues such as the CFL are decided deterministically based on a rotating schedule. With the matchups decided, these leagues are then faced with a combinatorial optimization problem: They have to schedule the games across a number of weeks such that they meet several constraints and optimize for secondary goals such as broadcast deals. This is a variation of the , and it’s . Some leagues approach this problem using . In the future, they might be able to replace those computers with a quantum annealer.

Image for post
Image for post

What is Quantum Annealing?

Quantum annealing (QA) is a for finding the of a given over a given set of candidate solutions (candidate states), by a process using (in other words, a meta-procedure for finding a procedure that finds an absolute minimum size/length/cost/distance from within a possibly very large, but nonetheless finite set of possible solutions using quantum fluctuation-based computation instead of classical computation).


One of Rust’s greatest strengths is its guarantee that if it compiles, it’s free of data races and thread-safety violations. However, all bets are off if you use unsafe code, for example, to integrate with a C library. To use unsafe and maintain the above guarantee, you need to make especially sure that your unsafe code is wrapped by code that perfectly defines the contracts under which it can be used.

Image for post
Image for post

A Completely Unsafe API

Let’s say we want to create safe bindings for a library that has no thread-safety guarantees whatsoever:

/// The "sys" module is a hypothetical C API or "sys" crate that is
/// intended to be used from only one thread.
mod sys {
pub unsafe fn foo() {
// maybe this implementation modifies some sort of global state
}
pub unsafe fn bar() {
// maybe this implementation modifies some sort of global state
}…


Understanding what Git is at a fundamental level helps both new and experienced users work with Git more effectively.

Image for post
Image for post

If you’re on a team that uses Git, you have to create these things called “commits” to make changes to the codebase. To make things more complicated, you have to create “branches” so you can open “pull requests” before “merging” your code. For those that are new to Git, you might find your working directory or pull requests getting into weird, inexplicable states while attempting to do some of these things. …


Image for post
Image for post

Go is a bit infamous for not supporting generics, but lately generics have come much closer to becoming a reality. There’s a that seems to be relatively stable and is gaining traction in the form of a implemented by the Go team. Here’s what the latest design looks like and how you can try out generics yourself.

Examples

LIFO Stack

Let’s say you want to create a last-in, first-out stack. Without generics, you would probably implement it like this:

type Stack []interface{}

func (s Stack) Peek() interface{} {
return s[len(s)-1]
}

func (s *Stack) Pop() {
*s = (*s)[:len(*s)-1]
}

func (s *Stack) Push(value interface{}) {
*s = append(*s, value)…


At Tempus Ex, our cloud infrastructure is built within AWS, so when we collect data at sporting events around the country we have to get it into the cloud somehow. We do that by shipping drives to a data center, where their contents get sent over a Direct Connect VIF to an S3 bucket before they get shipped out to the next event.

Image for post
Image for post
A disk being imported to S3

Why not upload from the event venues?

Venues have limited bandwidth, and more importantly, we have limited time in them. We can’t afford to sit around for hours after games for data to upload.

Why not upload from the office?

We could get a Direct Connect to the office and upload from there, but there are several downsides to…

About

Chris Brown

Staff Engineer at Tempux Ex

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store