Skip to content

Instantly share code, notes, and snippets.

View praeclarum's full-sized avatar

Frank A. Krueger praeclarum

View GitHub Profile
@praeclarum
praeclarum / Rainfall.md
Created April 7, 2021 15:04
Rainfall using Calca

Rainfall in Gallons

I wonder how much water falls on land throughout the year? We can use a [rainfall database][rdb] to find out how much it rains in Seattle and then use Calca's unit conversion support to help us determine that.

land area = 0.25 acre

avg annual precip = 36.15 inch / year

daily rain accumulation

= avg annual precip * land area

@praeclarum
praeclarum / JamesSubsMatrix.ino
Created March 28, 2021 20:17
Arduino code to print James' subscriber count
// ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#include "secrets.h"
const char* ssid = SECRET_SSID; // SSID of local network
const char* password = SECRET_PASSWORD; // Password on network
const long UPDATE_INTERVAL_MILLIS = 10L * 60L * 1000L;
//const long UPDATE_INTERVAL_MILLIS = 1L * 1000L;
@praeclarum
praeclarum / Info.plist
Created October 18, 2020 20:15
Plist for QL thumbnails
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDisplayName</key>
<string>iCircuit Thumbnails</string>
<key>CFBundleName</key>
<string>CircuitThumbs</string>
<key>CFBundleIdentifier</key>
<string>com.kruegersystems.circuit.thumbs</string>
@praeclarum
praeclarum / Migrations.cs
Created August 30, 2020 20:47
Database migrations using Dapper
using System;
using System.Linq;
using Microsoft.Extensions.Logging;
using Dapper;
namespace Data
{
public class Migrations
{
private readonly Database database;
var a = 10;
var b = 200;
Console.WriteLine((a > b) ? a : b);
Console.WriteLine((a > b) ? b : a);
Console.WriteLine(Math.Max(a, b));
Console.WriteLine(Math.Min(a, b));
@praeclarum
praeclarum / DataGridView.swift
Created June 28, 2020 00:37
Data Grid SwiftUI using LazyVGrid
//
// DataGridView.swift
// Predictor
//
// Created by Frank A. Krueger on 6/25/20.
//
import SwiftUI
struct Column: Identifiable {
@praeclarum
praeclarum / MeadowEnclosure.js
Created May 22, 2020 21:02
OpenJSCAD source code for the Meadow Enclosure shown at the Wilderness Labs Dev Camp
var resolution = 50;
var printerError = 0.05;
var xsize = 100;
var ysize = 100;
var height = 20;
@praeclarum
praeclarum / build.sh
Created April 12, 2020 18:38
Ooui.Wasm.Test build script
#!/bin/bash
msbuild ../Ooui.Wasm.Build.Tasks/Ooui.Wasm.Build.Tasks.csproj && cp ../Ooui.Wasm.Build.Tasks/bin/Debug/netstandard2.0/Ooui.Wasm.Build.Tasks.dll ./ && msbuild /t:Restore && msbuild Ooui.Wasm.Test.csproj
@praeclarum
praeclarum / Dark Continuous.json
Created March 6, 2019 17:28
A dark and vibrant color theme for Visual Studio for Mac
{
"name": "Dark Continuous",
"version": "1.0",
"description": "Dark and Vibrant from Continuous for the iPad",
"originator": "Frank A. Krueger",
"palette": [
{ "name": "cont-white", "value": "#F2F2F8" },
{ "name": "cont-selection", "value": "#4B5566" },
{ "name": "cont-background", "value": "#282A2E" },
@praeclarum
praeclarum / PlaidMLFailsDDPG.log
Created July 31, 2018 23:55
Error from PlaidML when running DDPG
$ python ddpg_pendulum.py
/Users/fak/.virtualenvs/control/lib/python2.7/site-packages/gym/__init__.py:15: UserWarning: gym.undo_logger_setup is deprecated. gym no longer modifies the global logging configuration
warnings.warn("gym.undo_logger_setup is deprecated. gym no longer modifies the global logging configuration")
WARN: gym.spaces.Box autodetected dtype as <type 'numpy.float32'>. Please provide explicit dtype.
WARN: gym.spaces.Box autodetected dtype as <type 'numpy.float32'>. Please provide explicit dtype.
INFO:plaidml:Opening device "opencl_amd_amd_radeon_pro_vega_56_compute_engine.0"
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
flatten_1 (Flatten) (None, 3) 0