Skip to content

Instantly share code, notes, and snippets.

@michaelbartnett
michaelbartnett / com.bartnett.itermonlogin.plist
Created April 19, 2011 04:36
Start iTerm if not started, close first window that pops up
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.bartnett.itermonlogin</string>
<key>RunAtLoad</key>
<true/>
<key>ProgramArguments</key>
<array>
@michaelbartnett
michaelbartnett / clockwise_size_t_pointers.txt
Created April 24, 2011 08:38
Clockwise spiral for malloc lab
+-------------------+
| +----------+ |
| | +-+ | |
| ^ ^ | | |
*(size_t *)p = size;| |
^ ^ ^ | | |
| | +---+ | |
| +-----------------+ |
+---------------------+
@michaelbartnett
michaelbartnett / pythonstartup.py
Created May 1, 2011 22:18
My PYTHONSTARTUP file
# Michael's PYTHONSTARTUP file
def dofile(filename):
import subprocess
import sys
process = subprocess.Popen([sys.executable, filename], stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.STDOUT)
out, err = process.communicate()
print out
void SoundEventEntity::Serialize(VArchive &ar)
{
VisBaseEntity_cl::Serialize(ar);
char iLocalVersion = 0;
if (ar.IsLoading())
{
ar >> iLocalVersion;
VASSERT(iLocalVersion==0 && "Invalid version number");
ar.Read(EventName, sizeof(EventName));
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
@michaelbartnett
michaelbartnett / FirstLevel.cs
Created June 20, 2011 06:00
File for bootstrapping IntermediateSerializer to spit out my entity and aspect classes in in XNA
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace ProjectDaHooch
{
public static class FirstLevel
{
public static int PlayerID = 0;
public static int backdropID = 0;
var oldItemQuery = from i in Items
where (json["response"]["inbox"].FirstOrDefault(
(target) => target["meta"]["group_id"].Value<string>() == i.ID)
) == null
select i;
@michaelbartnett
michaelbartnett / siggen.m
Created October 15, 2011 01:29
Generates a signal of the specified type and writes it to a wav file.
% Michael Bartnett
% mrb402
% Friday October 14, 2011
% siggen.m
%
% Function siggen
%
% Generates a signal of the specified type and writes it to a wav file.
%
% Usage: siggen(sampleRate, duration, frequency, numberOfOvertones, signalType, outputFilename)
@michaelbartnett
michaelbartnett / spectrumAnalyzer.m
Created November 9, 2011 21:57
spectrumAnalyzer function for DST (Matlab)
% Michael Bartnett
% mrb402
% Friday November 4, 2011
% spectrumAnalyzer.m
%
% Function spectrumAnalyzer
%
% Reads a wav file and generates a STFT
%
% Usage: spectrumAnalyzer(filename, winLength, overlapLength, winType[, fftLength])
@michaelbartnett
michaelbartnett / convolver.m
Created November 21, 2011 19:16
convolver function for DST (Matlab)
% Michael Bartnett
% mrb402
% Monday November 21, 2011
% convolver.m
%
% Function convolver
%
% Convolves two audio files, a signal and an impulse response
%
% Usage: convolver(IRfilename, SIGfilename, OUTfile, convMethod[, chunkLength])