[-] nous@programming.dev 5 points 1 year ago

You should have a live USB of the distro you want to use and ensure you have backups of all the data you care about. Then the easiest/quickest/least error prone way is to just wipe the whole drive and reinstall the distro from the live USB. They typically have an option to wipe and install things from an empty drive. Then just restore your data from your backups.

You could also, after creating backups, from a live USB environment delete the windows partitions and resize the linux ones - being careful not to delete the EFI partition as that is where the boot loader lives. You can optionally delete the windows boot loader from the EFI partition as well. If done right you should still be able to boot into your linux system afterwards though when missing with partitions like this, especially when you don't know what you are doing, it can be easy to break the boot systems. These can be fixed from a live environment and there are many guides out there on how to do that.

You can always just reinstall the system again if you mess things up and cannot figure out how to fix them - so always prep for that case by backing up everything you care about first.

[-] nous@programming.dev 5 points 2 years ago

Passwords should be hashed, not stored plain text! Hashes are always the same length so this is an immediate sign they are doing horribly insecure things with your password.

[-] nous@programming.dev 5 points 2 years ago

Linux makes up exactly one package on a so-called Linux system.

True, it was a poor proxy for what I really meant - which was the amount of code that my system runs. Linux as a project is growing quite fast these days and is getting bigger and bigger. But the number of GNU tools I use (and thus their code that I use) is growing smaller and smaller.

[-] nous@programming.dev 5 points 2 years ago

It is about WPEngine not contributing enough back to Wordpress, in terms of development effort or money. Apparently the trademark is the only legal grounds they have to go after WPEngine to try and get them to contribute back more.

[-] nous@programming.dev 5 points 2 years ago

How does that work? Encryption should not care at all about the data that is being encrypted. It is all just bytes at the end of the day, should not matter if they are compressed or not.

[-] nous@programming.dev 5 points 2 years ago

Nah, if you have some complex logic you are not sure about then you need to see it run to be able to see how it reacts to changes. You cannot run pseudocode so it is far harder to validate it will do what you want it to do.

[-] nous@programming.dev 5 points 2 years ago

The basic idea behind the builder pattern is to ensure the main thing can only ever exist in a valid state, no half valid values letting you call things in weird ways that break.

Here AppSettings is not the thing you care about, the App is. So you can think of AppSettings as a builder for the App. A final call to it should construct a valid App and you should not be able to do that when the settings are invalid.

If there are one or two required fields the having those on the new method of the AppSettings or the final build method that constructs the app is a good approach. If there is a set order things need to be created in then the generic state pattern or multiple structs can be used instead to limit what functions are available at each stage.

[-] nous@programming.dev 5 points 2 years ago

I don't know about that. I see there being more general chatbots like ChatGPT. But vastly more specialised ones as well. It is not a zero sum game here, more specialised chat bots does not mean there will be fewer general ones. We are only at the start of this and both sides are likely to grow a lot in the coming years. But I can see specialised ones taking off faster at the same time.

[-] nous@programming.dev 5 points 3 years ago

One of rusts biggest issues ATM is a less mature eco system. Especially when compared to something as old as python. Rust does have a light stdlib compared to other languages as well and leans more heavily on its ecosystem to fill the gaps. But common things are already well established and mature and the whole ecosystem is coming along quite well.

Currently the biggest issues are the more fringe areas, like libraries for specific APIs or services or areas people have not quite covered yet. But these are fairly quickly lessening as people write libraries as they need them to fill the gaps. I would say its ecosystem is most there, at least enough for most projects now.

And IMO rust has some very nice ergonomics for some libraries - such as json de/serialization that just don't/cannot exist in other languages.

[-] nous@programming.dev 5 points 3 years ago* (last edited 3 years ago)

For quickly throwing together a small script, a developer equivalently experienced in Python and Rust will likely find Python faster to use

I am not sure about that. I have written a few scripts in rust that I managed to do quite quickly. Once you have a project similar to what you have done before setup time is not that long and the more examples of things you have done before lets you get going quite quickly - this is true of any language really. The slowest part I tend to find is learning the libraries you need to use for a given script or doing something you have not quite done before. Which I think in rust it can take a bit longer for these parts - but once you have overcome that hurdle similar scripts are easier to write in the future. Python might win out if you constantly need to write things from scratch with no past examples and always needing to use new unfamiliar libraries. But I find that is not often the case and over time becomes less and less the case.

And for those cases where you can just adapt something you have written before rusts very easy refactoring actually adds a lot of value and helps to speed things up quite a bit. Though it does take quite a lot more knowledge with the language to get to that point that it does with python I think.

[-] nous@programming.dev 5 points 3 years ago

Looks like it is now failing on the SQL fmt checks - which you have not changed and so are likely a problem in master. Seems https://github.com/LemmyNet/lemmy/pull/3800 fixes that issue and you are likely going to need to wait for that to be merged first. Or otherwise talk to the maintainers about it since it is broken in master and there is aPR to fix the issue.

[-] nous@programming.dev 5 points 3 years ago* (last edited 3 years ago)

Looks to be failing a cargo fmt check: https://woodpecker.join-lemmy.org/repos/129/pipeline/1821/8

+ cargo +nightly-2023-07-10 fmt -- --check
Diff in /woodpecker/src/github.com/LemmyNet/lemmy/crates/utils/src/rate_limit/mod.rs at line 224:
 use std::sync::atomic::{AtomicUsize, Ordering};
 static CONCURRENT_API_USE: AtomicUsize = AtomicUsize::new(0);
 
-
 impl<s> Service for RateLimitedMiddleware<s>
 where
   S: Service + 'static,

If I read that right you have one extra blank new line that the nightly rust fmt is not happy about.

You should just need to run cargo fmt on the code, might need the same nightly version as above though.

view more: ‹ prev next ›

nous

0 post score
0 comment score
joined 3 years ago