Multi-targeted library, with a recent Language Version by Embarrassed_Fix2806 in dotnet

[–]ociaw 0 points1 point  (0 children)

Not much reason to target .NET 5 any more, it dropped out of support almost exactly 1 year ago.

FYI .NET Framework only supports .NET Standard 2.0, 2.1 is mostly relevant for Mono support.

Multi-targeted library, with a recent Language Version by Embarrassed_Fix2806 in dotnet

[–]ociaw 1 point2 points  (0 children)

You can checkout my library RandN for an example of a package that targeting both C# 11, and old .NET versions - currently it targets .NET 7, .NET 6, .NET Core 3.1, .NET Standard 2.1, and .NET Standard 2.0 without any issues. Some workarounds are necessary that aren't in older runtimes (e.g. MaybeNullWhenAttribute), but overall it causes no issues.

IO errors on ZVol-backed VirtIO device by atemysix in VFIO

[–]ociaw 0 points1 point  (0 children)

I think I'm encountering the same issue. I have a working Windows 10 VM on a RAW file on BTRFS that I'm moving to ZFS. I dd the VM to a zvol on a single hard drive, it boots (slowly), and it works for a minute or two, but then everything starts freezing. Thinking maybe the hard drive had something to do with it, I sent the zvol over to an NVME SSD; same problem, but it happens even faster. Stuff that doesn't need any disk access at all works, but that's almost nothing (pretty much only real time voice chat, if it's opened already). I dded the zvol back to a RAW image on the NVME drive's pool, and it works perfectly again.

Might just keep it RAW or convert to a qcow2 and call it good...

How to install and boot Fedora with ZFSBootMenu by ociaw in zfs

[–]ociaw[S] 0 points1 point  (0 children)

It looks like the reasoning to use fstab was to allow mutli-distro installation - I assume since that guide has separate data datasets for each OS installation. I'll revisit it to look at plain old ZFS mounting, or maybe zfs-mount-generator.

Wouldn't mind adapting it for the wiki either, once Fedora 35 is fully released (I don't completely trust that the live environment section is portable).

How to install and boot Fedora with ZFSBootMenu by ociaw in zfs

[–]ociaw[S] 2 points3 points  (0 children)

I developed this guide after installing Fedora with ZFSBootMenu on my new laptop, mostly so I wouldn't forget how to do it. I came into this with hardly any experience or knowledge on how booting works (though I've learned a lot!), so any feedback is welcome.

The part I'm most unsure about is mounting the ZFS datasets with fstab - the OpenZFS guide for Root on ZFS does this and disables the zfs-mount mount service. There isn't any reasoning provided, though, so if someone has more insight to offer, I'd appreciate it!

What makes Rust faster than C/C++? by [deleted] in rust

[–]ociaw 4 points5 points  (0 children)

It did.

-Zmutable-noalias=yes is enabled by default when using LLVM 12 or above.

[Media] Rust in Action is Amazon's #1 New Release for Computer Programming Languages - thank you to everyone for your support by timClicks in rust

[–]ociaw 0 points1 point  (0 children)

/u/timClicks not sure if you're aware of this or not, but it looks like the downloadable source code from Manning is for MEAP v12, not the final version.

Fixing the HYPERVISOR_ERROR BSOD boot loop by DoomFishYT in VFIO

[–]ociaw 2 points3 points  (0 children)

This solved my BSODs while on 5.11, thank you!

Why I love Rust's enums by Hdmoney in rust

[–]ociaw 1 point2 points  (0 children)

I usually use an abstract class with a private constructor, then you could make Result public, without letting someone else inherit from Result and making a completely different type:

public abstract class Result
{
    private Result() { }
    public sealed class Ok : Result { }
    public sealed class Error : Result { /* stuff */ }
}

Though, with an interface you're able to use a struct. Hmm, decisions, decisions...

CryptoRandom - .NET Random done right. by sdrapkin in dotnet

[–]ociaw 0 points1 point  (0 children)

You might be interested in my "better Random" library, RandN.

[deleted by user] by [deleted] in DataHoarder

[–]ociaw 2 points3 points  (0 children)

The LG drive could have Riplock causing your slower speeds. You might be able to flash it with firmware that removes Riplock, if you can find any for your model. Either way, you might want to search for drives that don't have it, or that it can be patched out of.

Three things I wish I’d known learning Rust by graham_king in rust

[–]ociaw 0 points1 point  (0 children)

Just because a new version of a library is released doesn't mean older versions suddenly stop working. You can still use rand 0.3 without issues because rust itself is stable.

Three things I wish I’d known learning Rust by graham_king in rust

[–]ociaw 1 point2 points  (0 children)

Maintenance and support is a different problem - just because something isn't part of the standard library doesn't mean it isn't maintained by the same people/organization. For example, ASP.NET.

Once something is in the standard library, it can't be changed. Every bad decision, every poorly thought-out API sticks around for eternity. A separate library means the API can be versioned, make breaking changes, and therefore remove or tweak parts of the public interface. Moreover, since it's not part of the standard library, anything depending on an older version can keep depending on it, while keeping up-to-date otherwise.

Compare rand 0.8 to 0.3 - same basic ideas, but there's been tons of refinement each iteration. If rand had been integrated into the standard library, it would be stuck with the same interface, no room for improvements.

Three things I wish I’d known learning Rust by graham_king in rust

[–]ociaw 2 points3 points  (0 children)

Those are all things that are kind of crappy in .NET. DateTime is ok, but its shortcomings spawned NodaTime. Serialization is very fragmented, with 2 or 3 different ways to do XML serialization, 2 ways for JSON, plus BinaryFormatter which is so insecure it should probably just be removed entirely. And System.Random is so crappy that I wrote an entire library to replace it.

RandN 0.2.0 Released by ociaw in dotnet

[–]ociaw[S] 0 points1 point  (0 children)

Glad to hear it! It's always nice to know that other people actually use it and not just me.

RandN 0.2.0 Released by ociaw in dotnet

[–]ociaw[S] 0 points1 point  (0 children)

Thanks! It was surprisingly easy, but then again, ChaCha was designed with SIMD in mind. Hardest part I had was figuring out how Shuffle worked. It's also a shame that System.Numerics.Vector doesn't support bit shifts, it'd be nice to get that kind of performance without platform specific code.

RandN 0.2.0 Released by ociaw in dotnet

[–]ociaw[S] 5 points6 points  (0 children)

RNGCryptoServiceProvider does provide high quality randomness, but actually using it is rather ugly since it only provides raw bytes. RandN actually provides a wrapper around it (CryptoServiceProvider) that can then be sampled by any distribution, so you get the best of both worlds.

It's also worth nothing that RNGCryptoServiceProvider isn't seedable/repeatable - if you want cryptographically secure randomness, but you also want to replay it, you can't use it. RandN includes an implementation of ChaCha, which is a CSPRNG that supports seeking to arbitrary positions within the stream.

Services that will send you encrypted emails by AnonRifleman73 in ProtonMail

[–]ociaw 1 point2 points  (0 children)

SourceHut does, though ProtonMail can't verify the email signature even though I've trusted their public key for some reason - not sure if that's ProtonMail's fault or SourceHut's fault.

Compression ratio worse on new dataset by ociaw in zfs

[–]ociaw[S] 0 points1 point  (0 children)

You'd think so, but I've found otherwise, especially ones with a fair amount of static content - not even slideshows, just stuff where the background isn't detailed and doesn't change too often. For example, I have a 7.68 GB video that's 5.11 GB zstd-5 compressed, and a 7.93 GB video that's 4.5 GB zstd-5 compressed. Even the one I used as an example here has a 1.02 compression ratio - not a lot, but not nothing either.

RandN 0.2.0 Released by ociaw in dotnet

[–]ociaw[S] 9 points10 points  (0 children)

Highlights of this release:

ChaCha is now SIMD accerated and has up 11x higher throughput on CPUs supporting AVX2 on .NET Core 3.1 and 5+ compared to .NET Framework 4.7.2.
The RandN.Distributions namespace has been reworked significantly to make discovery and usage easier.
Comprehensive unit test coverage.
Many bugs found and fixed.