Below you will find pages that utilize the taxonomy term “Reminder”
C# enum
How one can get variants’ names and their integer values from enum in C#? Consider the following example:
var variant = TestEnum.Bar;
Console.WriteLine($"{variant}: {(int)variant}");
enum TestEnum
{
Foo,
Bar,
Baz
}
Running this code will produce
Bar: 1
So enum’s ToString()
methods returns the name of the variant, and an enum
member can be cast to integer to get its value.
Mixed Python/Rust project with maturin
This post describes how to create Python project using Rust for time-critical parts. While the steps described below work for me, they are definitely not the only way to do things.
Disclaimer: the instructions are obsolete and probably will not work now.
Prerequisites and setup
Prerequisites
Python
Obviously, you will need Python. I am not going to
cover its installation here. The Python version I am going to use is 3.11.2
.
The command python -c "import sys; print(sys.version)"
will print the version
of the Python interpreter you have installed.
Iocage Jails
This post contains the information I have missed when I have started to use iocage for jails management on FreeBSD.
Disclaimer: I am relatively new to FreeBSD and while what is written below works for me it is most probably not the only (or even a right) way to do things.
Jails
Jails is a killer feature of FreeBSD. One can think about jail as about chroot on steroids, or as about a very light-weight virtual machine. A jail provides an environment isolated from the rest of the system where FreeBSD is running (usually; one can run, for example, Linux in a jail).
How to create links in PowerShell
The purpose of this post is to remind myself how to create links in PowerShell. Nowadays (since mid-August 2016) PowerShell is cross-platform and open-source (with MIT license).
Cmdlets
Commands in PowerShell are called cmdlets. There are two of them to create
links: New-HardLink
for creating hard links and New-Symlink
for creating
symbolic links. Unfortunately, I was not able to get New-Symlink
to work
but see below for workaround.
Hard links
Hard links can be created with New-Hardlink
and work as expected.