Skip to content

Instantly share code, notes, and snippets.

@borogove
borogove / gist:540dfaebb49cd48862607ed5ee3c3a7e
Created February 8, 2023 03:39
Struggling to get ChatGPT to produce the Boobies Number
What's 664751 * 8?
> 5298008
Are you sure? What's 664751 times 8?
> Yes, 664751 times 8 is 5298008.
Multiply 8 by 664751.
> 5298008.
What's 2 times 664751?
hey my mastodon is https://sfba.social/@borogove
// Weirdolope - a minimal one-control envelope generator
// (c) 2022 Russell Borogove
// Use at your own risk
// This envelope generator uses floating point math;
// if your MCU doesn't have floating-point hardware
// support you're gonna have a bad time.
// Call updateEnvelope() periodically at a rate >= 1000 Hz
import random
import datetime
def d6():
return random.randint(1,6)
def d12():
return random.randint(1,12)
def d16():
@borogove
borogove / gist:40059894d1b35b7c6e1ce8f94edd579e
Last active March 6, 2018 19:45
Arduino MIDI in handling
byte currentData[3];
byte currentCommand = 0;
byte commandChannel = 0;
byte currentNote = 255;
short length = 0;
bool midiFlicker = false;
Abondo
Amalia
Amy
Arnetta
Aztek
Ba
Balls
Bar
Barker
Beanbag
/* Random number with Gaussian distribution.
Translated from Python's library random module to C#
by Russell Borogove.
*/
const double NO_VALUE = -1e6f;
const double TAU = Math.PI*2.0;
static double gaussNext = NO_VALUE;
public static double Gaussian( double mu, double sigma )
+PART[engineLargeSkipper_125m]:FOR[Navy2K]
{
@name = SuperDraco_Single
%RSSROConfig = True
!MODULE[TweakScale]
{
}
!mesh = DEL
!MODEL {}
MODEL
@borogove
borogove / engines.cfg
Created January 7, 2016 21:49
KSP Engine Configs for dasbin
+PART[Size3AdvancedEngine]:FOR[dasbin]
{
@name = Sea_Dragon_Stage_I
%RSSROConfig = True
!MODULE[TweakScale]
{
}
!mesh = DEL
!MODEL {}
MODEL
>>> class A(object):
... def __init__(self):
... pass
...
>>> class B(A):
... x = 1
...
>>> g = B()
>>> g.__dict__
{}