Skip to content

Instantly share code, notes, and snippets.

@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
@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 / 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 / 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 / AVLTree.cpp
Created March 5, 2013 15:54
An AVL Tree implementation
/**
* Project/Lab 6
*
* AVL Trees
*
* Kevin Cuzner
* CS235
* Section 4
*/
@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 / 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 / archive.sh
Created October 31, 2012 20:36
Multi-process folder archiving
#!/bin/bash
# purpose: to compress my home folder
#output folder for the files
OUTPUTDIR="/media/My Book/HomeFolderBackup/"
#number of compressing process
NPROC=6