Technical Tips

Getting Circular With SDL Audio

(Image Wikipedia Commons) Recently I’ve been having a lot of fun following along with Casey Muratori’s Handmade Hero project. As far as I know this is the first time a seasoned game industry vet like Casey has graciously decided to share the step-by-step creation of a professional-quality game. Amazingly, he’s also been including videos detailing every line of code and every major architectural decision. However, following along with the code examples can be tough if you’re not on a Windows…

Technical Tips

C++: Storing A shared_ptr As Lua Userdata

Recently I’ve been working on a game engine in C++. I’ve always wanted to participate in a Ludum Dare compo, and this work is in preparation for the December 1st compo. A big piece of the design of my engine is using Lua for scripting and providing novel Lua objects from C++ for this purpose. Yesterday I was attempting to embed provide a C++ object to Lua scripts. This object’s lifetime and ownership were managed using a reference counted shared_ptr,…

Misc Opinion

Software Process From First Principles

“New software processes do not just emerge out of thin air; they evolve in response to a palpable need” Software Architecture In Practice, Third Edition 1. Preliminary Throat Clearing Is there something wrong with the way we think about software process? Traditional software processes are often couched in dichotomies: heavy vs agile, bureaucratic vs lightweight, corporate-y vs start-up-y, oppressive vs liberating. Yet dichotomies have and always will obscure gradations of difference and damage our ability for nuanced thinking. Because there…

Misc Technical

Applying Thompson Sampling To The Interview Process

(Image by Macoto Murayama) NOTE: This post is not necessarily advocating for this approach. I think it’s an interesting idea so I’m putting it out there. This approach, as is, does not account for subjective biases, but it could provide the data to measure and compensate for them. One of the problems I’ve observed with interviews candidates across several companies is their informality. It often feels more like reading tea leaves than finding the best person. While many companies attempt to make this more rigorous, they…

Misc Opinion Uncategorized

Skepticism and Discursive Machines

Skepticism emerges as a reaction wherever a certain, commonly held notion of truth begins to unravel. Operating with this notion of truth, we can try to slip out of the grasp of skepticism, but inevitably we trace the same maddening circle right back into its clutches. Can we model this worldview as a machine? Factual Discourse Machines The Classical Factual Discourse Machine We take as our starting point the most naive view of factual discourse possible. All factual discourse involves acts of demonstration. I present…

Technical

Let’s Write An Ethereum Virtual Machine Disassembler

In this article we’ll discuss writing a disassembler for the Ethereum Virtual Machine (EVM). While writing disassemblers doesn’t necessarily require much knowledge of the machine the instructions are for, it’s actually quite a fun way to get your feet wet. During this tutorial we’ll be using the D programming language. Why D? Honestly there’s no great reason. It’s mostly because I think it’s clearer and simpler than the alternatives for this kind of low-level code. Let’s get started. Introduction When writing…

Ben Laposky, Oscilon
Technical Tips

Simple Software Verification, Part 3: Karnaugh Maps

(Image by Ben Laposky) Series Parts Part 1 – Execution Tables Part 2 – Trace Tables Part 3 – Karnaugh Maps Welcome to the third and final article in this mini-series on software validation. In this article we’re going to discuss state machines, what desirable properties they should possess, and then I’ll demonstrate a simple tool for verifying them called Karnaugh Maps. Identifying State Machines As a general rule of thumb, you can identify a program that is a potential…

Technical Tips

Simple Software Verification, Part 2: Trace Tables

(Image by Leonardo Solaas) Series Parts Part 1 – Execution Tables Part 2 – Trace Tables Part 3 – Karnaugh Maps Welcome back! In the previous article I explained why you might be interested in software verification techniques and then showed you how to use Execution Tables to verify your software for specific cases. In this article, we’ll generalize Execution Tables into a format that will allows us to create simple inductive proofs about our loops. Trace Tables To demonstrate this…

Technical Tips

Simple Software Verification, Part 1: Execution Tables

Series Parts Part 1 – Execution Tables Part 2 – Trace Tables Part 3 – Karnaugh Maps (Image by Manfred Mohr) Introduction If you’re a software developer, and you work somewhere even remotely sane, then chances are good you employ some form of automated testing in your day-to-day practice. Automated testing is a wonderful and extremely valuable tool, but there is nevertheless something slightly fanatical and suspicious about the claims of those who prescribe it as the strategy for managing software quality. Namely, experience teaches us that…

Technical

Fixing Python’s title Function

Python’s title function has some weird side-effects when you’re titlizing a string like, for example, a street name: >>> “62nd”.title() “62Nd” >>> “West 62nd st.”.title() “West 62Nd St.” 1 2 3 4 >>> “62nd”.title() “62Nd” >>> “West 62nd st.”.title() “West 62Nd St.” Here’s how you can fix this: import re def fixed_title(input_string): parts = re.split(r’\s’, input_string) for idx, value in enumerate(parts): if re.match(r'[A-Za-z]’, value[0]): parts[idx] = value[0].upper() + value[1:] return ‘ ‘.join(parts) 1 2 3 4 5 6 7 8…