🌲 Invert a binary tree! 🌲
Except with 3 catches:
- It must invert the keys ("bit-reversal permutation")
- It must be a dependency-free, pure recursive function
- It must have type
Bit -> Tree -> Tree
(i.e., a direct recursion with max 1 bit state)
/* Numerically solve for the time-dependent Schrodinger equation in 2D, | |
using the split operator method. To build and run, type: | |
rustc qm2d_split_op.rs | |
./qm2d_split_op | |
This will output a series of bmp images which show each frame of the | |
simulation. | |
References: |
I want Microsoft to do better, want Windows to be a decent development platform-and yet, I constantly see Microsoft playing the open source game: advertising how open-source and developer friendly they are - only to crush developers under the heel of the corporate behemoth's boot.
The people who work at Microsoft are amazing, kind, talented individuals. This is aimed at the company's leadership, who I feel has on many occassions crushed myself and other developers under. It's a plea for help.
You probably haven't heard of it before, but if you've ever used win32 API bindings in C#, C++, Rust, or other languages, odds are they were generated from a repository called microsoft/win32metadata.
# inspired by https://gist.github.com/rjnienaber/af47fccb8410926ba7ea35f96c3b87fd | |
# remove bundled ImageMagick | |
sudo apt remove imagemagick -y | |
# install base dependencies | |
sudo apt-get install -y \ | |
build-essential \ | |
git \ | |
libde265-dev \ |
// Made with Amplify Shader Editor | |
// Available at the Unity Asset Store - http://u3d.as/y3X | |
Shader "Unlit/Directional Tint" | |
{ | |
Properties | |
{ | |
_MainTex("MainTex", 2D) = "white" {} | |
_Color("Color", Color) = (1,1,1,1) | |
_ColorA("ColorA", Color) = (1,1,1,1) | |
_ColorB("ColorB", Color) = (1,1,1,1) |
WSL2 uses Hyper-V for networking. The WSL2 network settings are ephemeral and configured on demand when any WSL2 instance is first started in a Windows session. The configuration is reset on each Windows restart and the IP addresses change each time. The Windows host creates a hidden switch named "WSL" and a network adapter named "WSL" (appears as "vEthernet (WSL)" in the "Network Connections" panel). The Ubuntu instance creates a corresponding network interface named "eth0".
Assigning static IP addresses to the network interfaces on the Windows host or the WSL2 Ubuntu instance enables support for the following scenarios:
section | |
parameters {α : Type} | |
variable [ a_dec : decidable_eq α] | |
include a_dec | |
open nat | |
definition replicate (a : α) : ℕ → list α | |
| 0 := [] | |
| (succ n) := a :: replicate n |
Short write up on using REPL when developing UIs in ClojureScript.
Everyone's standard approach to hot-reloading is to use a tool (Figwheel or shadow-cljs) that reloads changed namespaces automatically. This works really well: you change the code, the tool picks up changed files, compiles namespaces and dependants, notifies REPL client which then pulls in compiled changes, and re-runs a function that re-renders UI.
The other approach is to use ClojureScript's REPL directly and rely only on eval from the editor. This more or less matches Clojure style workflow. This approach might be useful when you don't want tools overhead or hot-reloading becomes slow for you or you just used to this style of interactions. Also changing code doesn't always mean that you want to reload all the changes. On the other hand it is very easy to change a couple of top-level forms and forget to eval one of them.
@Shnatsel wrote...
The following code is unsound:
This uses Rc::as_ref()
to obtain a reference to the underlying data, which does not guarantee uniqueness. It is possible to obtain several mutable references to the same memory location by calling this function repeatedly:
let mycell = Cell::new(vec![1,2,3]);