Skip to content

Instantly share code, notes, and snippets.

View KriPet's full-sized avatar

Peter K. KriPet

View GitHub Profile
@KriPet
KriPet / mixed-parameters.cs
Created November 21, 2022 23:26
Mixed required/optional parameters
/*
* Two ways of solving this problem:
*
* MyClass1 has constructor with all required properties. All optional properties are given public init or set accessors.
* Pro:
* - Small constructor
*
* Con:
* - Slightly messier creation of instance
* - Optional properties will not be set at the end of the constructor, so you can't call code that relies on optional properties there.
from functools import lru_cache
from collections import Counter
class BoardState:
def __init__(self, dimension, edges, parent=None, label=None, player1=None):
self.label = label
self.dimension = dimension
if parent is None:
self.turn = 0

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@KriPet
KriPet / exceptioninfo.txt
Created March 1, 2015 13:07
issue 8216 log
Unhandled Exception
Code: 0xC0000005
Call stack info:
0x64616F4C : ?
Dolphin!0x008AF180 : ?
Unhandled Exception
Code: 0xC0000005
Call stack info: