I'VE GOT THE BYTE ON MY SIDE

57005 or alive

Checkin history

Apr 15, 2012 data neat

Inspired by the incredible recent blog post from Stephen Wolfram, and the subsequent release of some of the code used for his plots, I took some time to plot out every code checkin made to my product’s main source code branch.  Our product has been around in some form or another for a long time, so there is a nice long history to look at.

Here’s the plot of all 152,000 checkins:

checkins

Expected return on a Mega Millions ticket

Mar 31, 2012 math

The recent record-breaking Mega Millions lottery drawing got me wondering how much a lotto ticket is really worth.  What are the odds of winning, and based on those odds and the size of the jackpot, what are the expected winnings from a Mega Millions ticket?

The Mega Millions website breaks down the odds, and the different ways you can win.  Let’s look at how those odds play out.

On-prem software

Mar 28, 2012 grammar

When it comes to enterprise software (or any software, really), there is a well-known split between software or services that are run, operated, and managed locally, by a company’s own employees or IT staff, and software or services that run in the cloud, operated and managed by someone else.

This split is frequently referred to as the split between “on-prem” and “cloud” software.  That’s all well and good, but unfortunately many people don’t realize what “prem” is abbreviating.

Break and continue are fixed in Powershell v3 switch statements

Mar 27, 2012 powershell

In Powershell, the switch statement is really just syntactic sugar for a series of if statements (unlike in standard C-family compiled languages).  In order to shortcut evaluation of cases and prevent fallthrough, the break and continue keywords are available, and using them will immediately break execution out of the current switch case or statement.  If you want to prevent additional case evaluations and save precious cycles, it seems like a good practice to break execution as soon as possible.

Unfortunately, in Powershell v1 and v2, the break and continue statements were implemented under the covers by throwing an exception, which was then handled higher up the stack in the runtime in order to send execution to the correct place.  This is functionally just fine, but not very performant.  Exception processing is a very slow way to control flow of execution.  To illustrate this, we can look at the below example.

How to calculate 1 million digits of pi

Mar 20, 2012 C# math

\(\pi\) day (half \(\tau\) day? hmmm) rolled around last week, and it got me wondering - how exactly does one go about calculating large numbers of digits for mathematical constants, \(\pi\) in particular?  One hears about how \(\pi\) , \(e\) , and the like have been calculated out to millions, billions, or even trillions of digits.  I had a vague idea that some series expansion is used in order to build up the value piece by piece.  But is each digit calculated individually, or does the entire value need to be stored in memory at once?  What kind of data types are needed?