Skip to content

Instantly share code, notes, and snippets.

View bmnick's full-sized avatar

Ben Nicholas bmnick

View GitHub Profile
puts('Hello World!')
/* mdates.c -- find number of days between 2 dates - mutation version
Mark Ardis, Rose-Hulman Institute
3/19/2006
*/
#include <stdio.h>
#include <string.h>
#define MAXLINE 1000 // maximum input line size
@bmnick
bmnick / se452HW3mkmf.rb
Created January 4, 2011 04:11
Make a makefile to tell you the missing mutants
dependency_line = 'check : '
targets = Array.new
1.upto(65).each do |testnum|
dependency_line << "#{testnum} "
targets << "#{testnum} : \n\t@(./mdates -v -i sampledata.txt | grep \"Killed mutant #{testnum}\" > /dev/null ) || echo \"Missing mutant #{testnum}\""
end
puts dependency_line
puts ''
targets.each do |target|
nesta new <yoursitename> --git
ln -s `pwd`/<yoursitename> /var/www/nesta
cd <yoursitename>
mkdir log
mkdir tmp
mkdir tmp/sockets
mkdir tmp/pids
#include "ruby.h"
VALUE CExt = Qnil;
VALUE method_floatmul(VALUE self);
VALUE method_loop_floatmul(VALUE self);
void Init_CExt() {
CExt = rb_define_module("CExt");
rb_define_singleton_method(CExt, "floatmul", method_floatmul, 0);
@bmnick
bmnick / twss.rb
Created May 2, 2011 02:17
That's what she said autoresponder for iChat
#!/usr/bin/env ruby
require 'rubygems'
require 'twss'
# Read in from command line arguments
input_value = ARGV.shift
# make it more common
TWSS.threshold = 3.0
@bmnick
bmnick / RITBuildingNames.txt
Created September 4, 2011 20:52
RIT Building Numbers to abbreviations
EAS 001 George Eastman Hall
RIA 002 Frank Ritter Arena
CLK 003 George H. Clark Gymnasium
SAU 004 Student Alumni Union
WAL 005 Wallace Library
LBR 006 Liberal Arts Hall
UNI/VIG 007A University Gallery/Vignelli Center for Design Studies
GAN 007B Frank E. Gannett Hall
GOS 008 Thomas Gosnell Hall
GLE 009 James E. Gleason Hall
//////////////////////////////////////////////////////////////////////////////
// Linear Curve Fitting - This program fits a line to the data points in the
// file provided on the command line (one data point per line of text in the
// file).
//////////////////////////////////////////////////////////////////////////////
#include <fstream>
#include <list>
using namespace std;
#include <iostream>
#include "data.h"
/******************************************************************************
* Module (there is no .c file, only this header) to provide timing
* instrumentation macros. The timing instrumentation macros can be
* globally enabled and controlled as using the EN TIME macro. This macro
* can be defined or un-defined within a source code file (even within this
* file). If this is done then the timers cannot be controlled from the
* compiler command line. Since it will often be the case that the
* application would be built with and without the timers it is recommended
* that the EN TIME macro *not* be defined or un-defined directly in the
* source code. Instead, by using the “-D” command line option to gcc (as
@bmnick
bmnick / wc.rb
Created May 16, 2012 19:41
Reimplementing wc for fun in ruby
require 'optparse'
require 'pp'
options = {}
counts = []
def count_stream stream, options
counts = []
if options[:line]