Skip to content

Instantly share code, notes, and snippets.

@kcuzner
kcuzner / UniFile.cs
Last active August 29, 2015 14:07
UniFile decompilation showing the difference between Read and ReadRecords
using System;
using System.Threading;
namespace IBMU2.UODOTNET
{
public class UniFile : UniRoot
{
//... lots of stuff
/// <summary>
/// Reads the UniVerse record from this file. It uses the record ID established via
@kcuzner
kcuzner / NamespacedXmlMediaTypeFormatter.cs
Created October 20, 2014 22:45
XML Media Type Formatter which handles namespaces
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http.Formatting;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using System.Web;
using System.Xml;
using System.Xml.Serialization;
@kcuzner
kcuzner / 0_reuse_code.js
Last active August 29, 2015 14:22
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@kcuzner
kcuzner / simulate_basic_test.cpp
Created December 27, 2012 20:11
A very very basic test of the simulation engine multiplying two numbers together.
#include "defaultblockfactory.h"
#include "system/systemblocks.h"
#include "model.h"
#include "simpleengine.h"
int main(int argc, char** argv)
{
//create a model using the default block factory
boost::shared_ptr<IModel> model(new Model(DefaultBlockFactory::getInstance()));
//create an engine for that model
@kcuzner
kcuzner / test.cpp
Created February 18, 2013 22:22
Destruction signal testing
#include <set>
#include <iostream>
#include <boost/signals2.hpp>
#include <boost/smart_ptr.hpp>
class Parent;
/**
* The child class has what is essentially a weak pointer
* reference to its parent. When its parent is destroyed,
@kcuzner
kcuzner / AVLTree.cpp
Created March 5, 2013 15:54
An AVL Tree implementation
/**
* Project/Lab 6
*
* AVL Trees
*
* Kevin Cuzner
* CS235
* Section 4
*/
@kcuzner
kcuzner / db.py
Created March 26, 2013 14:59
Relatively simple database abstraction layer. http://kevincuzner.com/?p=261
"""
Database abstraction layer
by Kevin Cuzner
Designed for PEP 249-style cursor objects
Objects:
- Column: Base column descriptor which tracks changes and such for a DbObject.
It also does validation and other things.
@kcuzner
kcuzner / logger.asm
Created April 7, 2013 05:23
A temperature logger written for the PIC16F628A
; A data logger utilizing a DS1631 Temperature Sensor, 24AA256 EEPROM, and a 32.767Khz crystal
;
; Kevin Cuzner
;Serial EEPROM format:
;0: Data length low byte
;1: Data length high byte
;2: RTC start hour
;3: RTC start minute
;4: RTC start second
@kcuzner
kcuzner / puzzle.txt
Last active December 21, 2015 05:49
Quick program to find a string inside a grid of letters as if it were a standard word search where words can only go to the right or downward
DGOODDODGOODDO
ODOOGGGDODGOGG
OGOGDOODGOODDD
DGDOOOGGOOGDGO
OGDGOGDGOGGOGD
DDDGDDODOOGDOO
ODGOGGDOOGGOOD
@kcuzner
kcuzner / AwaitableBasicConsumer.cs
Last active December 27, 2015 01:09
Awaitable basic consumer
using System;
using System.Collections.Generic;
using System.Collections.Concurrent;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Threading;
namespace Common