Skip to content

Instantly share code, notes, and snippets.

View kbob's full-sized avatar

Bob Miller kbob

  • Eugene, Oregon, USA
View GitHub Profile
@kbob
kbob / gist:898702
Created April 1, 2011 19:27
Test whether program compiled with tail call optimization.
#include <stdio.h>
/*
* In a separate compilation unit, save is defined as:
*
* void save(int *p)
* {
* *p = (int)&p;
* }
*/
@kbob
kbob / gist:820127
Created February 10, 2011 08:17
A Mildly Amusing (I hope) Anecdote Involving Ken Olsen, RIP

A Mildly Amusing (I hope) Anecdote Involving Ken Olsen, RIP by Barry Shein on Wednesday, February 9, 2011 at 4:07pm

In the early 1980s I was in charge of the Harvard chemistry computing facility for about a year. We had a Vax 11/780 and a fancy Evans & Sutherland graphics tube (it had its own embedded PDP11/70!), amazing device, and other stuff.

Our 780 had the extra double-wide memory cabinet -- a whopping 8MB total which at the time was a lot. This cabinet was the size of two full-sized refrigerators side by side, just for the extra memory.

The 4MB in that second cabinet wasn't ours. We let a very small company which made 3rd party memory boards for the Vax exercise their new boards in our machine. We got an extra 4MB, they got their memory tested. This arrangement preceded my arrival but it seemed win/win. We got to use what was a lot of memory for the time, probably $50,000 worth of memory, they got their boards tested.

The arrangement meant that every couple of weeks I'd have to meet the guy who basi

// C++
// ref. https://gist.github.com/817504
#include <algorithm>
#include <iterator>
#include <vector>
using namespace std;
class counter {