Articles in the How-To category

Preserving Git Blame History when Refactoring

By Eric — 3 minute read

I have some big source files in a project I'm working on. Embarrassingly big files -- multiple thousands of lines long. Those files also have years of Git blame history associated with them, and not wanting to lose that history has deterred me from refactoring to break those files into more …

Read more...

When to Give Up - Retrying Failures

By Eric — 4 minute read

When we programmers find an aspect of software that fails intermittently, we sometimes follow the impulse to add retries with a Churchillian insistence that we will "Never give in — never, never, never, never"! But sometimes the right thing is to give up.

One might ask, why retry at all? Didn't …

Read more...

Tips for Your First Month at a New Job

By Eric — 3 minute read

Congratulations on getting your new job as a software engineer! Your employer and team are happy to have you join them. Here are some tips for the first few weeks to help them feel like they made the right choice in hiring you.

Work hours

Learn what the work time …

Read more...

Randomness in Tests

By Eric — 4 minute read

Wouldn't it be cool if a few uses of the random module in your unit tests could discover bugs in your code? Meh.

The problem is that random tests are non-deterministic, meaning they lack the highly desirable property that if they pass in my local development environment, they'll also pass …

Read more...

Time Warp in VirtualBox

By Eric — 1 minute read

Here are a couple of tips for manipulating the clock in Oracle's VirtualBox.

Sometimes you need to tweak a virtual machine's clock for some kind of test or another. With the VirtualBox Guest Additions installed, you'll have trouble because the service will keep the guest's clock synchronized with the host's …

Read more...

Granular Profiling in PyCharm

By Eric — 1 minute read

PyCharm added profiler integration in version 4.5, which I thought was pretty cool. Used as documented, though, it hasn't been terribly useful. Here's a way to improve on that.

In my case, I was interested in profiling a web service -- specifically requests to a particular resource. I started up …

Read more...

Run/Debug as root in PyCharm

By Eric — 4 minute read

I'm working on a Python project that needs to run as root in order to work properly. Previously I've just run the whole PyCharm IDE as root, but this has some down-sides, and I think I have a better approach now.

The biggest hassle with running the IDE as root …

Read more...

Password Management

By Eric — 3 minute read

It's been two years since Wired's Mat Honan declared the age of passwords over, but somehow the successor hasn't yet found its way to the throne. That being the case, this is how I currently manage my passwords.

The challenge with security is that it tends to be in direct …

Read more...

git-flow with Cmder

By Eric

"Git Flow" is a branching model using the Git version control system. There is also a set of extensions for Git that make using Git Flow easier, but there aren't installation instructions specifically for use with the excellent cmder Windows shell replacement. Here's how to do it...

These instructions are …

Read more...

Getting pip into your Python 3 venv

By Eric — 1 minute read

Python 3.3 includes a built-in equivalent to the popular virtualenv tool for creating isolated Python environments. One difference with the built-in venv is that it doesn't automatically install pip as virtualenv does. While I can understand the decision (given Python's volatile packaging situation), it isn't very convenient.

Here's a …

Read more...