Readit News logoReadit News
AnyTimeTraveler commented on Origin of the rule that swap size should be 2x of the physical memory   retrocomputing.stackexcha... · Posted by u/SeenNotHeard
LowLevelKernel · 15 days ago
Curious, How much swap have you personally allocated on your personal setup?
AnyTimeTraveler · 15 days ago
My work laptop currently has 96GB of RAM. 32 of it is allocated to the graphics portion of the APU. I have 128GB (2x) of SWAP allocated, since I sometimes do big FPGA Synthesizations, which take up 50GB of RAM on its own. Add another two IDEs and a browser, and my 64GB or remaining RAM is full.
AnyTimeTraveler commented on The struggle of resizing windows on macOS Tahoe   noheger.at/blog/2026/01/1... · Posted by u/happosai
Someone1234 · 2 months ago
Windows has no such option, and regularly steals focus, particularly Visual Studio/Debug tools/applications loading. It had an option for a short period with the original TweakUI, but Microsoft removed support for it even in the registry.

No OS should steal focus, Windows absolutely is guilty of it.

AnyTimeTraveler · 2 months ago
Many Linux display managers let you chose what to do, when a window requests focus. For me on Sway, it just turns the border red.

I chose what happens after. Can recommend. I wasn't even aware of my privilege.

AnyTimeTraveler commented on Learning music with Strudel   terryds.notion.site/Learn... · Posted by u/terryds
bobim · 3 months ago
True that compared to FoxDot, Sardine or Tidal, the syntax and visualization are just making the whole thing a real pleasure to use.

But this is way too taxing for my linux boxes that are ending stuttering quite badly sometimes. Are you all using macs or something?

AnyTimeTraveler · 3 months ago
Weird. My android phone is 3+ years old and was not a flagship when I got it. It had a little problem with stuttering on more complex examples. It sounded like it was running out of things that can play at the same time, but scrolling was still smooth. It didn't feel like it was pinning my phone's cpu. On my laptop, it didn't break a sweat with firefox and pipewire. Are you sure it's not a config issue?
AnyTimeTraveler commented on The Programmer Identity Crisis   hojberg.xyz/the-programme... · Posted by u/imasl42
AnyTimeTraveler · 5 months ago
What?

This website

1. reacts well to my system preference of a dark theme in my news-reader

2. has a toggle at the top for dark theme

3. works flawlessly with DarkReader in my browser

Until I saw your comment, I didn't even know the website had a light version.

Again: What?

AnyTimeTraveler commented on Arenas in Rust   russellw.github.io/arenas... · Posted by u/welovebunnies
t43562 · 5 months ago
My productivity level in C is medium. In rust I'm competely blocked because I want to create a global variable and absolutely none of the described ways in the docs or stackoverflow work for my example. Should I give up on this "bad idea".....well I cannot because I can't accept not understanding why this is not working when people say it can.

Compared to C the situation is outlandishly, even hellishly impossible to understand. If I can't understand this one thing then I feel there's no point in continuing so I must stay and battle it till I get it or give up completely. I don't think I've ever hit anything like this in any other language I've ever learned.

AnyTimeTraveler · 5 months ago
Have you thought about just not making the variable global and instead adding it as a parameter to the functions that actually need it?

You can also create a struct, put your "global" variable inside it and then put all the functions that need the variable into an Impl block of that struct. If you then add the parameter `&self` to these functions, you can access the "global"variable any time via `self.global_variable`.

If that is not enough, then you can always make an actual global variable by first wrapping it in a Mutex, to prevent simultaneous access and then wrapping that in an Arc for Atomic Reference Counting. That allows you to pass "copies" of that variable around anywhere, satisfying the borrow-checker (since the variable is now reference-counted in a thread-safe way).

If you need a lot of parallel reading, replacing the Mutex with an RwLock is a good idea, since it allows locking from multiple threads, if you want to read it in most cases.

AnyTimeTraveler commented on Wild performance tricks   davidlattimore.github.io/... · Posted by u/tbillington
quotemstr · 6 months ago
> be careful in critical code because things like integer overflow can also raise a panic

So you can basically panic anywhere. I understand people have looked at no-panic markers (like C++ noexcept) but the proposals haven't gone anywhere. Consequently, you need to maintain the basic exception safety guarantee [1] at all times. In safe Rust, the compiler enforces this level of safety in most cases on its own, but there are situations in which you can temporarily violate program invariants and panic before being able to restore them. (A classic example is debiting from one bank account before crediting to another. If you panic in the middle, the money is lost.)

If you want that bank code to be robust against panics, you need to use something like https://docs.rs/scopeguard/latest/scopeguard/

In unsafe Rust, you basically have the same burden of exception safety that C++ creates, except your job as an unsafe Rust programmer is harder than a C++ programmer's because Rust doesn't have a noexcept. Without noexcept, it's hard to reason about which calls can panic and which can't, so it's hard to make bulletproof cleanup paths.

Most Rust programmers don't think much about panics, so I assume most Rust programs are full of latent bugs of this sort. That's why I usually recommend panic=abort.

[1] https://en.wikipedia.org/wiki/Exception_safety#Classificatio...

AnyTimeTraveler · 6 months ago
Rust's number types have functions like "wrapping_add" or "overflowing_add", which do not panic when overflowing and instead explicitly wrap around or return a result that must be checked.

You can easily write code that does not contain any possible panic points, if you want.

AnyTimeTraveler commented on Git: Introduce Rust and announce it will become mandatory in the build system   lore.kernel.org/git/20250... · Posted by u/WhyNotHugo
taminka · 6 months ago
bruh what is that goofy ass capcha protection??
AnyTimeTraveler · 6 months ago
That's Anubis. A proof-of-work based protection against AI-Crawlers.

https://github.com/TecharoHQ/anubis

AnyTimeTraveler commented on Show HN: LightCycle, a FOSS game in Rust based on Tron   github.com/Tortured-Metap... · Posted by u/DavidCanHelp
AnyTimeTraveler · 6 months ago
This readme could really benefit from a screenshot.
AnyTimeTraveler commented on Linux Performance Analysis (2015)   netflixtechblog.com/linux... · Posted by u/benjacksondev
appleaday1 · 7 months ago
he forgot about rusttop
AnyTimeTraveler · 7 months ago
I'm pretty sure that that didn't exist in 2015 ;)

u/AnyTimeTraveler

KarmaCake day219January 9, 2019View Original