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
#nim.cfg | |
#-d:release | |
#-d:danger | |
#-d:samplerate=44100 | |
# Result (12th Gen Intel(R) Core(TM) i9-12900 2.40 GHz): | |
# | |
# GSinOsc : (seconds: 0, nanosecond: 516204700) | |
# RVSinOsc : (seconds: 1, nanosecond: 672888300) | |
# STDSinOsc: (seconds: 5, nanosecond: 908334300) |
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
import random, math, times | |
#randomize() | |
type | |
TransitionMatrix* = object | |
order: int | |
tMatrix: seq[seq[float]] | |
multiplier: seq[int] |
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
import std/[os, asyncdispatch, asyncstreams, strutils, oids, tables, options] | |
type | |
PSBusException* = object of Defect | |
Topic* = string | |
MsgDist* = enum | |
mtPS, #pub/sub | |
mtRR, #public request(/reply) |
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
import sequtils | |
import vmath | |
export vmath | |
#[ | |
Spline and curve interpolation for many variants. | |
Based upon the works of Steve H. Noskowicz. | |
http://web.archive.org/web/20151002232205/http://home.comcast.net/~k9dci/site/?/page/Piecewise_Polynomial_Interpolation/ |
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
import asyncdispatch, asynchttpserver, asyncnet, nativesockets, net | |
import logging, oids, strformat, strutils, tables, times | |
#import sse_db | |
type SSEClient = object | |
fs: FutureStream[string] | |
clientClosed: int | |
req: Request | |
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
import streams | |
from strutils import parseInt, Whitespace | |
#from os import getFileSize | |
type | |
PGMError* = object of Defect | |
proc pgmRead(strm: FileStream, filePos: int=0): auto= | |
var data: char | |
strm.setPosition(filePos) |
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
sox -c2 -t waveaudio 0 terst_pinknoise_6dB_bandpass.wav synth 2 pinknoise fade 0.05 2 0.05 bandpass 19.686 4.558555717707598 : synth 2 pinknoise fade 0.05 2 0.05 bandpass 24.803 5.743465278182541 : synth 2 pinknoise fade 0.05 2 0.05 bandpass 31.25 7.236354067782308 : synth 2 pinknoise fade 0.05 2 0.05 bandpass 39.373 9.117342998745364 : synth 2 pinknoise fade 0.05 2 0.05 bandpass 49.606 11.486930556365081 : synth 2 pinknoise fade 0.05 2 0.05 bandpass 62.5 14.472708135564616 : synth 2 pinknoise fade 0.05 2 0.05 bandpass 78.745 18.23445443416057 : synth 2 pinknoise fade 0.05 2 0.05 bandpass 99.213 22.974092676060337 : synth 2 pinknoise fade 0.05 2 0.05 bandpass 125.0 28.945416271129233 : synth 2 pinknoise fade 0.05 2 0.05 bandpass 157.49 36.46890886832114 : synth 2 pinknoise fade 0.05 2 0.05 bandpass 198.425 45.94795378879053 : synth 2 pinknoise fade 0.05 2 0.05 bandpass 250.0 57.890832542258465 : synth 2 pinknoise fade 0.05 2 0.05 bandpass 314.98 72.93781773664227 : synth 2 pinknoise fade 0.05 2 0 |
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
``` | |
import os | |
import cherrypy | |
app_dir = os.path.dirname(__file__) | |
@cherrypy.expose | |
class Thing(object): | |
def __init__(self): | |
self.app_name = 'thing' # |
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
#https://stackoverflow.com/questions/26270681/can-an-asyncio-event-loop-run-in-the-background-without-suspending-the-python-in | |
import asyncio | |
import threading | |
import cherrypy | |
from cherrypy.process import plugins | |
from hbmqtt.client import MQTTClient, ClientException | |
from hbmqtt.mqtt.constants import QOS_1, QOS_2 | |
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
import threading | |
import pgpubsub | |
import cherrypy | |
from cherrypy.process import plugins | |
class PGrepub(plugins.SimplePlugin): | |
""" | |
Plugin that listens to Postresql notification channels and publishes | |
the payload unmodified to a channel on the CherryPy bus. | |
NewerOlder