View withblock.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Exiter(): | |
def __enter__(self): | |
print('i am in a block') | |
return self # critical | |
def __exit__(self, type, value, tb): | |
print('goodbye cruel world') | |
def add(self, a, b): | |
return a + b | |
with Exiter() as exiter: |
View D88STRUC.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
D88 (D68/D77/D98) File Structure | |
JPN Translations (http://jpntrans.nobody.jp) | |
-------------------------------------------------- | |
People Involved | |
-------------------------------------------------- | |
Translation, editing, etc.: Tokugawa Corporate Forum's Ashura | |
Hosting: noname345 | |
-------------------------------------------------- |
View gist:38127addfc43d1eab028d4a4ac3fbcd4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
View p88sr.doc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
------------------------- | |
P88SR.EXE マニュアル | |
------------------------- | |
【概要】 | |
PC8801mk-2SR( V2 MODE ,8 MHz ) の機能をエミュレートします。 |
View toolbox-helloworld.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int main(void) { | |
WindowPtr TheWindow; | |
InitGraf(&thePort); | |
InitFonts(); | |
InitWindows(); | |
TheWindow = GetNewWindow(128, 0L, (WindowPtr)-1L); | |
SetPort(TheWindow); | |
MoveTo(30, 50); | |
DrawString("\pHello, World"); |
View hashtable.rkt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> (define myhash #hasheq((name . "bob"))) | |
> (hash-has-key? myhash `name) | |
#t | |
> (hash-ref myhash `name) | |
"bob" |
View Counterparty Credit Risk Metrics
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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) |
View gist:07dbaf74f3cd70a731d3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
View gist:44a00a1bbaa02509b961
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |
View gist:4040723
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Reflection.Emit; | |
using System.Text; | |
using System.Reflection; | |
namespace GenericCodeGenerator | |
{ | |
class Program |
NewerOlder