Very basic linuxbrew installer for general use-case
I've done this in a podman container as root with success; should work in a native environment
Not tried yet in regular user/sudo mode.
// Small allocation-less experiment. | |
// For sure, there are ways to not allocate at all: passing stack memory locations down. | |
// This does mean everything needs to be defined higher up where it is ultimately consumed fully | |
const std = @import("std"); | |
const Person = struct { | |
name: []const u8 = "", | |
age: u8 = 0, | |
}; |
A little experiment to demonstrate Python's use of threads is indeed concurrency and NOT parallelism
The script is designed such that a bunch of random numbers are processed - this is an attempt at avoiding chances of the execution runtime trying to optimize out some values. The final value is also printed - not because it's interesting, but so that there is no chance the runtime optimizes for the fact that a variable remains unused.
When running the experiment and displaying htop
in another screen, it is visible that multi-processing is happening in procs
mode (all CPUs blaze a short while),
whilst when I use threads
mode, the processing offers just some blips here and there as the main python process gets scheduled wherever it can.
I also did an implementation in Go which uses goroutines, and observing the behaviour in htop indicates that these are doing some level of leveraging either multiprocessing or OS threads somehow, as go run gorun.go 10
clearly has all processes firing on all cylinder
Copyright (C) Tai Kedzierski | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | |
documentation files (the “Software”), to deal in the Software without restriction, including without limitation | |
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, | |
and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO |
These are notes for a Zig-inspired strongly-typed GC language, taking some aspects from Python, and retaining some smiilar simplicity as promised by Go.
Zig brings so several great ideas to the table, but a variant of its apporoach for application-space would be very welcome, so it would provide a similar experience to Zig with many of its characteristics:
""" Utility to behave like "tee" | |
Similar to the system "tee" program, attempts to write the same output to two different channels | |
In this present case, attempts to write to stdout/stderr , as well as retain for retrieval as string. | |
To do this, we wrap the pipe, direct the system pipe to write data to an interim temp file, and we read | |
that file content back into memory and write it through to the wrapped pipe ourselves. | |
""" | |
A sched.scheduler
wrapper to run continuously as a "service", to queue up one-time operations.
A PeriodicOperation
based on native threading.Timer
, runs as a "service".
Both can be stopped.
Timer
could have been used in lieu of the scheduler, but the latter stands to have more precision.
This is a quick script to see the chances of outcome of rolling Fudge/FATE dice against opposition.
Mainly, I am interested in rolling at Good skill against Good opposition , and seeing what happens.
Adding a +1
skill modifier is akin to being +1
shift above the Good opposition (skill Great).
from argparse import ArgumentParser | |
import json | |
from typing import List | |
OPERATIONS = { | |
"starts": lambda value, data: data.startswith(value), | |
"!starts": lambda value, data: not data.startswith(value), | |
"ends": lambda value, data: data.endswith(value), |