I hereby claim:
- I am willmtemple on github.
- I am wtemple (https://keybase.io/wtemple) on keybase.
- I have a public key whose fingerprint is 8716 1D51 FFE7 FACF F586 F0A5 FB80 B041 FBEC BF47
To claim this, I am signing this object:
type DemoEnum = Foo | Bar; | |
interface Foo { | |
kind: "Foo", | |
n: number | |
} | |
interface Bar { | |
kind: "Bar", | |
s: string |
const values = [ | |
{ kind: "Foo", n: 10001 }, | |
{ kind: "Bar", s: "Hello world!" } | |
]; | |
function match(value, pattern, discriminant = "kind") { | |
return pattern[value[discriminant]]?.(value); | |
} | |
for (const value of values) { |
// Read: a DemoEnum is either a Foo(i32) or a Bar(String) | |
enum DemoEnum { | |
Foo(i32), | |
Bar(String), | |
} | |
fn main() { | |
let elts: Vec<DemoEnum> = vec![ | |
DemoEnum::Foo(10001), | |
DemoEnum::Bar(String::from("Hello world!")), |
// Notes on how to deal with callbacks in pxexec-runtime | |
/** | |
* In pxexec-runtime, program threads run in actual separate threads called | |
* Fibers. Fibers are concurrent in the same way that Operating System threads | |
* are concurrent: each has its own stack, and they are intermittently switched | |
* to give the appearance of multitasking. In some cases, they may run | |
* simultaneously on different processors. | |
* | |
* At the same time, Node events are processed on the global event-loop. All |
I hereby claim:
To claim this, I am signing this object:
import dbus | |
import os | |
if __name__ == '__main__': | |
bus = dbus.SystemBus() | |
mgr = bus.get_object('org.freedesktop.login1', | |
'/org/freedesktop/login1') | |
mgr_iface = dbus.Interface( | |
mgr, dbus_interface='org.freedesktop.login1.Manager') |