Skip to content

Instantly share code, notes, and snippets.

View barbeque's full-sized avatar

Mike barbeque

  • Calgary AB Canada
View GitHub Profile
@barbeque
barbeque / resistor_code.py
Created February 28, 2012 03:55 — forked from shilrobot/resistor_code.py
cleaned up keyboard binding
colors = [
(0,0,0),
(150,75,0),
(255,0,0),
(255,165,0),
(255,255,0),
(154,205,50),
(100,149,237),
<kastein> like many children, that truck was a mistake which the owner mostly regrets
<ACE_work> Justification for breeding is often completely insane
<chrisgt> could say the same thing about impulse buying cars on craigslist
<chrisgt> in the long run, the car is cheaper
<ssswitch> at least if you impulse buy a car you can scrap it for base materials
<ssswitch> can't do that with a kid unless romney wins
<ssswitch> also it's a bigger pain to transfer the title on a kid
<chrisgt> and if kids are over 15, you still need a title
<chrisgt> bill of sale isn't good enogh
<ssswitch> and the salvage inspection. jesus
@barbeque
barbeque / gist:4040723
Created November 8, 2012 18:50
Turning C# generic Type back into "C# Type" declaration style.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection.Emit;
using System.Text;
using System.Reflection;
namespace GenericCodeGenerator
{
class Program
@barbeque
barbeque / gist:44a00a1bbaa02509b961
Created March 12, 2015 20:24
Defining custom object and passing it into powershell functions
function NewSteak() {
$steak = New-Object PSObject
$steak | Add-Member -type NoteProperty -Name Doneness -Value "Rare"
$steak | Add-Member -type NoteProperty -Name Juiciness -Value "Low"
return $steak
}
function AuditSteak([PSObject]$steak) {
@barbeque
barbeque / gist:07dbaf74f3cd70a731d3
Created July 11, 2015 17:13
SetSysClock called twice?
Breakpoint 6, SystemInit ()
at /Users/mike/Code/cross-compilers/STM32F0xx_StdPeriph_Lib_V1.5.0/Libraries/CMSIS/Device/ST/STM32F0xx/Source/Templates/system_stm32f0xx.c:162
162 RCC->CR |= (uint32_t)0x00000001;
(gdb) step
160 {
(gdb) step
162 RCC->CR |= (uint32_t)0x00000001;
(gdb) step
166 RCC->CFGR &= (uint32_t)0xF8FFB80C;
(gdb) step
/* Expected exposure is the expected (average) credit exposure conditional on positive market values */
def expectedExposure(marketValues: Seq[Double]): Double = {
val exposures = marketValues.filter(_ > 0f)
if (exposures.size == 0) 0.0
else exposures.sum / exposures.size
}
/* A high percentile (95%) of the distribution of exposures at any particular future date. Also called Peak Exposure (PE) */
def potentialFutureExposure(marketValues: Seq[Double], confidenceLevel: Double): Double = {
val exposures = marketValues.filter(_ > 0)
@barbeque
barbeque / hashtable.rkt
Created July 6, 2017 21:08
Racket Hashtable cheat sheet
> (define myhash #hasheq((name . "bob")))
> (hash-has-key? myhash `name)
#t
> (hash-ref myhash `name)
"bob"
int main(void) {
WindowPtr TheWindow;
InitGraf(&thePort);
InitFonts();
InitWindows();
TheWindow = GetNewWindow(128, 0L, (WindowPtr)-1L);
SetPort(TheWindow);
MoveTo(30, 50);
DrawString("\pHello, World");
@barbeque
barbeque / p88sr.doc
Created October 20, 2018 19:08
partially translated p88sr readme
-------------------------
P88SR.EXE マニュアル
-------------------------
【概要】
PC8801mk-2SR( V2 MODE ,8 MHz ) の機能をエミュレートします。
@barbeque
barbeque / gist:38127addfc43d1eab028d4a4ac3fbcd4
Created November 6, 2018 21:18
m88 linker errors - not too many right?
SuperMactendo:M88p2 mike$ scons
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
g++ -o src/pc88/base src/pc88/base.o src/pc88/beep.o src/pc88/calender.o src/pc88/crtc.o src/pc88/diskmgr.o src/pc88/fdc.o src/pc88/fdu.o src/pc88/floppy.o src/pc88/intc.o src/pc88/ioview.o src/pc88/joypad.o src/pc88/kanjirom.o src/pc88/memory.o src/pc88/memview.o src/pc88/mouse.o src/pc88/opnif.o src/pc88/pc88.o src/pc88/pd8257.o src/pc88/pio.o src/pc88/screen.o src/pc88/sio.o src/pc88/sound.o src/pc88/subsys.o src/pc88/tapemgr.o
Undefined symbols for architecture x86_64:
"DeviceList::Add(IDevice*)", referenced from:
PC88::ConnectDevices() in pc88.o
"DeviceList::Find(unsigned int)", referenced from:
PC88::IsCDSupported() in pc88.o