Docker 1.6

  docker
Docker 1.6 is out and I’m here to give you a highlighted tour of some of its features, as well as some features from previous versions which I want to make sure we are familiar with. Container and Image Labels Labels are used as metadata for containers and images. Logging Driver This is a driver API which will forward container logs to other systems. The supported systems at this time are: json-file, syslog, and none.

B-Trees

  theory
While you may not frequently need to write a B-Tree, as a programmer you often interact with them on a day to day basis. Many flavors of SQL use B-Trees as the data structure to index data because B-Trees allow the computer to find and retrieve data with minimal reads to disk. A B-Tree is a generalized version of the binary tree which allows each node to contain collection of data points.

NES Graphics: Tiles

  emulation, nes
Each tile within a PPU pattern table is 16 bytes in length, and represents an 8x8 region on screen. Furthermore, every 8x1 row within that tile is represented by a pair of 2 bytes. Each bit in the byte represents a single pixel, and a value for that pixel’s color. The right-most bit is the left-most pixel. By itself a single byte in the pattern table doesn’t tell us a whole lot.

NES Graphics: Pattern Tables

  emulation, nes
The NES PPU had it’s own 16kb region of memory (VRAM) for storing all of it’s graphical data. At face value, this memory is just a garbled mess of binary. Fortunately this memory was organized in such a way that is much more easily understood with a picture: VRAM is broken down into several distinct regions: the pattern tables, name tables, and palettes. Details about the name tables and palettes are for a later post, but for now let’s see what the data looks like at it’s lowest level: the pattern tables.

Left Joins: Something Useful

  sql
Last week we covered the basics of what a LEFT JOIN does. This week we look a common scenario where you could use one to write a better query. Consider the following example tables: users: id email 1 one@test.com 2 two@test.com shipping_addresses: id user_id address 100 1 123 Main St. Using these tables, let’s say we wanted to return a set of users that have no shipping address.

Left Joins: The Basics

  sql
The LEFT JOIN is commonly used, but often misunderstood by folks that are just getting started writing SQL. To begin, let’s take a look at how it differs from the INNER JOIN. In a following post we will see how to use this difference to your advantage in certain scenarios. Consider the following example tables: users: id email 1 one@test.com 2 two@test.

What's in a Goroutine?

  go
How is it that Go let’s us fire off 100,000+ goroutines, all running concurrently on a single CPU, and still avoid context switching overhead? Goroutines conceptually borrow from single-threaded IO loops (frameworks like Node.js and Tornado do this) and traditional OS threads. By default any goroutines you start (including the one that calls main()) run in a single thread. This eliminates the overhead of continually creating new OS threads. The Go runtime handles switching between which goroutine is currently executing.

SSH: The Absolute Basics

  ssh
Here at Vokal, the preferred tool for remotely accessing one of your servers is RDP (Remote Desktop Protocol)… Just kidding. It’s not your day to wake up in Hell just yet. You probably have another 40 to 50 years left if you’re lucky, but I digress… Anyway, for connecting to a remote server we use SSH (Secure Shell). Chances are most of us are already familiar with SSH. However, for the benefit of those that may not be, it never hurts to take a step back and cover some seriously basic stuff.

Readers and Writers in Go

  go
It’s fairly common knowledge that concurrency is the bread and butter of Go, but what’s less commonly understood is the role that buffers play in the overall standard library and why the io package is so prevalent. In the io package you will find two interfaces: type Reader interface { Read(p []byte) (n int, err error) } type Writer interface { Write(p []byte) (n int, err error) } Each interface is very simple.