Spyke

Replies

Comment on

Cars are hazardous for the environment!

Reply in thread

It seems to be even higher, several studies suggest it's closer to 50%:

https://pubs.acs.org/doi/10.1021/acs.est.3c05002

Three different studies predicted emitted tire wear proportions (TWP and TRWP) of total emitted MP [microplastic] loads in the environment (both aquatic and terrestrial) for around 45%. (6,7,52) These calculations were mainly based on global, annual production data and matched the TWP proportions of around 40% in this study. However, since C-PVC was excluded here, a comparison of the percentages is not trivial.

c_lang

Comment on

Ode to C

Firstly, I'm not sure where you got the impression that Rust is designed to replace C. It's definitely targetted at the C++ crowd.

The string comparison with Rust actually points out one of my problems with C: All those Rust types exist for a reason - they should behave differently. That means that in C these differences are hidden, implicit and up to the programmer to remember. Guess who is responsible for every bug ever? The programmer. Let's go through the list:

&str - a reference to a UTF-8 string on the stack, hence fixed size.

String - a handle to a UTF-8 string on the heap. As a result, it's growable.

&[u8] - a reference to a dynamically sized slice of u8s. They're not even ASCII characters, just u8s.

&[u8;N] - a reference to an array of u8s. Unlike above they have a fixed size.

Vec - a handle to a heap-allocated array of u8s.

&u8 - a reference to a u8. This isn't a string type at all.

OsStr - a compatibility layer for stack-allocated operating system strings. No-one can agree on what these should look like - Windows is special, as usual.

OsString - a compatibility layer for heap-allocated OS strings. Same as above.

Path - a compatibility layer for file paths, on the stack. Again, Windows being the special child demands special treatment.

PathBuf - a heap-allocated version of Path.

CStr - null-terminated stack-allocated string.

CString - null-terminated heap-allocated string.

&'static str - a string stored in the data segment of the executable.

If you really think all of these things ahould be treated the same then I don't know what to tell you. Half of these are compatibility layers that C doesn't even distinguish between, others are for UTF-8 which C also doesn't support, and the others also exist in C, but C's weaker type system can't distinguish between them, leaving it up to the programmer to remember. You know what I would do as a C dev if I had to deal with all these different use cases? I would make a bunch of typedefs, so the compiler could help me with types. Oh, wait...

I dislike C because it plays loosey-goosey with a lot of rules, and not in an opt-in 'void*' kind of way. You have to keep in your head that C is barely more than a user-friendly abstraction over assembly in a lot of cases. 90% of the bugs I see on a day to day basis are integer type mismatches that result in implicit casts that silently screw up logic. I see for loops that don't loop over all the elements they should. I see sentinel values going unchecked. I see absolutely horrible preprocessor macros that have no type safety, often resulting in unexpected behaviour that can take hours or days to track down.

These are all problems that have been solved in other, newer languages. I have nothing personal against C, but we've had 40+ years to come up with great features that not only make the programmer's life easier, but make for more robust programs too. And at this point the list is getting uncomfortably long: We have errors as types, iterators, type-safe macro systems, compile-time code, etc.. C is falling behind, not just in safety, but in terms of ease of use as well.

climate

Comment on

India is being left to die in the heat | Modi has denied climate change for years. Now, as the death toll climbs uncounted, his government offers branding instead of protection.

Just us and these terrible men – for it is mostly men – who fell trees and spend other people’s lives as pocket change.

Tripped right at the finish line. What a great way to turn a clear call to action against the leaders in charge into meaningless gender-based infighting instead.

gaming

Comment on

Todd Howard Reaffirms Bethesda Is Currently Developing The Elder Scrolls 6

Call me cynical, but I firmly believe that ES6 is more useful to Bethesda as a perpetual 'carrot on a stick' than anything they would get from actually releasing it. The people that made Morrowind, Oblivion, and even Skyrim what they are no longer work at Bethesda, but the goodwill of the series remains in people's minds, and they associate that with Bethesda, even if a majority of their modern releases have been dumpster fires for one reason or another.

There's a reason we've gone almost 15 years without a mainline elder scrolls game, and I'm pretty sure it's because even Bethesda knows that they likely can't capture that magic again.

Comment on

Anon predicts the future

Video evidence is relatively easy to fix, you just need camera ICs to cryptographically sign their outputs. If the image/video is tampered with (or even re-encoded) the signature won't match. As the private key is (hopefully!) stored securely in the hardware IC taking the photo/video, any generated images or videos can't be signed by such a private key.

linux

Comment on

New to Linux? Ubuntu Isn’t Your Only Option

Reply in thread

During my six month usage of Manjaro (my introduction to Arch-based distros), my desktop broke four times and booted me to the terminal. Almost once a month. I told myself this was the price you paid for living on the edge, using a rolling release. I switched to EndeavourOS and have not had a broken desktop in two whole years.

Manjaro's handling of AUR packages is fundamentally wrong and with their design decisions it cannot be fixed. You either give up the AUR entirely, or resign yourself to constantly breaking AUR packages and having to try and fix them.

Manjaro's handling of kernels via a GUI sounds good until you realise it's entirely manual and if you don't keep checking you will end up running an unsupported, out of date kernel with Arch packages that expect a newer one. Again, Manjaro violates Arch's golden rule of avoiding partial upgrades by holding your kernels back until you manually update them in their GUI. If you're running an Arch-based distro 99% of the time you want the latest kernel and an LTS kernel as a backup, but these are already in Arch as packages (and are thus updated in lockstep with your packages, as designed) so you don't need Manjaro's special GUI. Now if you wanted a particular kernel for some reason then sure, but Manjaro's GUI doesn't even let you pick the exact version you want anyway! All you can pick is the latest version of each major release.

If you're anything like I was at the time, you think you like Manjaro but what you actually like is Arch. Manjaro just gets in the way.

linux

Comment on

I feel like I'm missing out by not distro-hopping

I was surviving with Ubuntu, I had my complaints but I figured 'that's just how it is' on Linux, that it was the same everywhere. I didn't even realise what I was missing until I switched.

I got a hardware upgrade at one point, so in order to get those new drivers ASAP I tried an Arch-based distro, with plans to switch back once drivers became available. I never moved back.

The two big reasons I stayed was ironically enough the lack of good Ubuntu documentation, and the PPA system. Ubuntu is used a lot, but there's not really formal documentation anywhere, only random tutorials online (most likely out of date and never updated) and people on forums talking about their problems. By contrast the Arch wiki is the gold standard of Linux documentation, there's just no comparison. Even on Ubuntu I found myself using it as a reference from time to time.

Regarding PPAs, the official Ubuntu package list is strangely small so if you're like me and find yourself needing other software, even mainstream software like Docker, you'll be faffing about with PPAs. So if you want to install Docker, instead of typing sudo apt install docker You instead have to type:

# Add Docker's official GPG key: 
sudo apt-get update 
sudo apt-get install ca-certificates curl gnupg 
sudo install -m 0755 -d /etc/apt/keyrings 
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg 
sudo chmod a+r /etc/apt/keyrings/docker.gpg 
# Add the repository to Apt sources: 
echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt-get update

These are the official install instructions, by the way. This is intended behaviour. The end user shouldn't have to deal with all this. This feels right out of the 90's to me.

Instead of PPAs, Arch has the Arch User Repository (AUR). Holy moly is the AUR way nicer to work with. Granted, we're not quite comparing apples to apples here since the AUR (typically) builds packages from source, but bear with me. You install an AUR package manager like yay (which comes preinstalled on my flavour of Arch, EndeavourOS). yay can manage both your system and AUR packages. Installing a package (either official or AUR) looks like yay packageNameHere. That's it. A full system upgrade like sudo apt update; sudo apt upgrade is a single command: yay -Syu, a bit cryptic but much shorter. The AUR is fantastic not just for the ease of use, but for sheer breadth of packages. If you find some random project on github there's probably an AUR package for it too. Because it builds from source an AUR package is essentially just a fancy build script based on the project's own build instructions, so they're super easy to make, which means there's a lot of them.

You might argue 'but building from source might fail! Packages are more reliable!', which is somewhat true. Sometimes AUR builds can fail (very rarely in my experience), but so can PPAs. Because PPAs are often made to share one random package they can become out of date easily if their maintainer forgets or simply stops updating it. By contrast AUR packages can be marked out of date by users to notify the maintainer, and/or the maintainer role can be moved to someone else if they go silent. If a PPA goes silent there's nothing you can do. Also, since an AUR package is just a fancy build script you can edit the build script yourself and get it working until the package gets an update, too. PPAs by comparison are just a black box - it's broken until it gets updated.

Moral of the story? Don't be afraid to just give something a go. Mint will always be waiting for you if you don't like it.

Comment on

Why are New Zealand’s Maori protesting over colonial-era treaty bill?

Reply in thread

Not many people know the history of the treaty. It basically was signed under duress. Prior to the meeting where it was signed all but one of the Maori tribal leaders were against signing the treaty, even the Maori version. What was said at the signing was purposely never recorded, but considering the existential threat of the New Zealand Company (NZC) on the horizon (the primary reason a treaty was even being discussed), it is believed that the Maori leaders were basically given the choice of 'sign this treaty and be a part of the British empire, or don't and have no legal rights against the whims of the New Zealand Company'.

The New Zealand Company was a private British company with the goal of obtaining as much land as possible at any cost, and the Maori would have had zero legal protections unless they were part of the British empire. Without a treaty the NZC would have been able to push out the Maori entirely with no repercussions. The British people who brought the treaty to the Maori leaders knew this was coming, and wanted to avoid it.

Signing the treaty was a quick and dirty solution to the quickly approaching NZC and was responsible for preventing the worst of the damage, but it is a very flawed document. The translations were rushed, and vague. Basically everyone was against signing it, but they knew it was the least worst option available. It was never designed to be the core document underpinning a nation, merely a speed bump to stall the private annexation of New Zealand.

gaming

Comment on

Grand Theft Auto Online Reportedly Broken On Steam Deck

Reply in thread

GTA online took ages to load, like 10+ minutes on some machines. One guy got really annoyed and investigated. It turned out to be loading a single 10MB JSON file in an incredibly inefficient manner. The JSON file contains about 60,000 items and they need to extract each item from it, but every time they look for the next item they start from the beginning of the file again, despite already knowing where they found the previous item! All the entries in the JSON list are unique, but the code also checks for any duplicate entries, of course it's also done in the least efficient way possible requiring 1,984,531,500 comparisons for something that has no effect. Not only did this one person find these problems but he also implemented a fix that reduced load times by 70% as a result, shaving off more than 7 minutes of load times for some machines. The fact that Rockstar didn't notice this is frankly shocking and speaks to the fact that they really just don't care.

https://nee.lv/2021/02/28/How-I-cut-GTA-Online-loading-times-by-70/

Comment on

Question to those not in the USA, and who have lived outside the USA.

New Zealand. Gun laws are pretty strict, though we have lots of farmers who have guns for defending livestock. You can own guns with a valid reason (e.g. recreational shooting, not self defense) but essentially the only two places they can be is in a locked safe or (being transported to) a gun range.

In addition any and all tools and weapons are illegal to carry for the purpose of self defense (knives, pepper spray, tazers, clubs, screwdrivers, etc.). There's a crime epidemic here at the moment, corner stores being robbed by people with machetes, jewelry stores ram raided with trucks, but if you dare even carry pepper spray to defend yourself you can be jailed. Don't bother calling the cops either, they won't be there until at least half an hour later. Cops don't care about robberies. We literally once had the dispatcher tell us that no police would be coming. It's ridiculous.

I wish self defense laws were less crazy here, if someone enters your home or property armed with a weapon you should be able to respond appropriately without fear of going to jail yourself.

Comment on

RTS recommendation

How has nobody recommended Supreme Commander (Forged Alliance)? It's the inspiration for other games in this thread like Planetary Annihilation and Beyond All Reason. It's so good that when the official servers shut down the community banded together and formed their own server and dev team to continue regular balancing and updates. It's on steam and works on Linux with minimal tinkering. You can either play the campaign on the Steam version or head straight over to Forged Alliance Forever, the community-hosted server, to access the campaign (with added multiplayer support!), all the new patches and mods, and play some multiplayer games too.

Comment on

'World-first' waste-burning reactor: China eyes 1000-year nuclear energy

TL;DR: Combining a particle accelerator and a nuclear reactor to turn Uranium-238 into Plutonium-239, which then fissions. The reactor itself is subcritical, so if the proton accelerator turns off then the reaction stops.

The main advantages of the system claim to be 'increased efficiency of fuel use' since the uranium doesn't need to be enriched, the ability to burn long-lived nuclear waste, as well as the system being passively safe.

The first point strikes me as an odd thing to focus on, since all nuclear reactors are already very fuel efficient, and if you want maximum efficiency then breeder reactors exist already, which produce more fissile material than they consume - you can't get much more efficient than that. Fast breeder reactors are also great for burning up nuclear waste too, but they never really took off because, well, there isn't actually much nuclear waste to use, precisely because typical reactors are already very efficient: A reactor might consume one ton of fuel per year. You could fit all the spent nuclear fuel humanity has ever used into a single swimming pool. I mustn't be too critical though - any attempt to close the fuel cycle is good, I just don't think it's a really pressing issue. Lastly, being passively safe is cool and all, but almost all new reactor designs are, and attaching a particle accelerator to a nuclear reactor sounds like an expensive way of doing it.

All of that being said, I'm always interested to hear about new reactor designs, so I guess we'll see how it goes.

science

Comment on

*Permanently Deleted*

Reply in thread

Not that I know of, at least not for our cubesat. The aerospace sector moves extremely slowly because of 'flight heritage' - basically, if it hasn't been in multiple long-term space missions before then it's an instant rejection. You might ask 'then how does any new tech get into space?' and the answer to that is 'it generally doesn't'. More amateur satellite developers like university programs tend to 'move fast and break things' but with an emphasis on 'break'.

Besides this suborbital flight I haven't heard of anyone using carbon fibre frames before. I'm not a chemical engineer but I would imagine CF composites may have issues with outgassing, compared to metals. Outgassing can result in volatile compounds leaving suspension under a vacuum and depositing elsewhere, particularly bad for camera lenses and solar panels and such. Since the frame touches basically every part of the satellite, the risk here is high.

Comment on

Seeking Advice for Flawless Transition from Windows to Linux (Ubuntu or Fedora)

The buggest hurdle is usually software. Make a list of all the applications you use on a daily basis. If they all have a linux version that's great, otherwise I'd suggest finding alternatives that work on linux (or at least work okay through WINE) before you switch your OS. Ideally you would swap out all your software for linux-compatible ones before you even switch away from Windows to get a feel for everything and minimise the amount of things you have to learn all at once.

After that choosing a linux distro is honestly not as life-defining as you'd think. Don't feel like you have to stick with the first distro you choose, as chances are you won't pick the right one for you until you know a little more. I'd recommend setting up a USB drive with Ventoy and filling it full of distro images so you can get a feel for how they work without too much fuss.

For reference, my personal journey started with Ubuntu, then Kubuntu (uses the KDE desktop which I much prefer, instead of GNOME), then I hopped over to Arch-based distros with Manjaro (finally got me away from the very clunky and annoying PPA system that Ubuntu and derivatives have), then EndeavourOS when I realised Manjaro is honestly just a hot mess (the devs have screwed up several times. A more vanilla Arch distro like EndeavourOS works way better for the AUR too).