state["phase"] = (in["phase"] or 0) + in["frequency"]
state["phase"] = state["phase"] + in["frequency"]
out["out"] = sin(state["phase"])
This file contains hidden or 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
| def show_map() -> Iterable[str]: | |
| yield f"The map has {len(bat_map)} rooms." | |
| if not current_room: | |
| return | |
| yield f"Current room: {current_room.title}" | |
| links = bat_links.get(current_room.room_id) | |
| if links: | |
| inc = len(links.incoming) |
Sample barcode reader I made to learn JavaScript
Resources:
- JS barcode scanner library: https://github.com/serratus/quaggaJS
- Live examples: https://serratus.github.io/quaggaJS/examples/
- Sample code:
This file contains hidden or 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
| # From: https://wiki.tcl-lang.org/page/TemplaTcl%3A+a+Tcl+template+engine | |
| source tt.tcl | |
| set template { | |
| <element><%= $myvar %></element> | |
| } | |
| # Create template engine | |
| TemplaTcl::create tt |
This file contains hidden or 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
| ;; This is an operating system configuration generated | |
| ;; by the graphical installer. | |
| #!curly-infix | |
| {use-modules(gnu())} | |
| {use-service-modules(desktop networking ssh xorg)} | |
| {operating-system( | |
| locale("en_US.utf8") |
This file contains hidden or 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
| From fce8a3045a4ef921f749d9e42fffe5075c6ddedc Mon Sep 17 00:00:00 2001 | |
| From: Peter da Silva <peter.dasilva@flightaware.com> | |
| Date: Thu, 14 Jul 2022 18:46:46 +0000 | |
| Subject: [PATCH 5/5] Update version number. | |
| --- | |
| configure.in | 2 +- | |
| 1 file changed, 1 insertion(+), 1 deletion(-) | |
| diff --git a/configure.in b/configure.in |
Demi Cluster:
- A cluster of two halves
- There is no master or slave; both demi hosts are masters
- Security through isolation:
- All web services (HTTP, DNS) run inside Demi VMs
- Demi VMs may not access anything on the LAN, or on their host
- Demi VMs may access each other
- Security through minimalism:
- The Demi VMs run on minimal Demi bare metal hosts
Demi Nix:
- build1 + build2 vms
- Reduce bare-metal code to something very small, perhaps just vagrant
- That probably means no vagrant for demi1 + demi2
- Reduce bare-metal code to something very small, perhaps just vagrant
- Build the whole VM with nix
- Split the VM image/OS build, and the Demi build
- Perhaps split the VM image build and OS build as well, somehow
- E.g. build grub/initrd into the image, but the rootfs outside
- Perhaps split the VM image build and OS build as well, somehow
- This will allow rebuilding Demi stuff without rebuilding the OS
This file contains hidden or 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
| use core::fmt::Debug; | |
| use std::str::FromStr; | |
| trait ArgsFromSource { | |
| const ARG_COUNT: usize; | |
| fn from_source(source: &Source) -> Self; | |
| } | |
| trait ArgFromSource { | |
| fn from_source(source: &Source, index: usize) -> Self; |
OlderNewer