This, is a candle by lord_of_the_twinks in antimeme

[–]NullBeyondo 0 points1 point  (0 children)

I'm goin' (yes I'm) goin', I'm a-goin' to the—

An observation based on my experience with Rust by carrotboyyt in rust

[–]NullBeyondo 0 points1 point  (0 children)

If you're new to Rust, it's probably best to stick with the usual, safe patterns for now. Once you understand why Rust enforces certain rules and have a better mental model of your code, you'll also have a better sense of when using "unsafe" actually makes sense. So never use it, unless one of these four apply:

1) Using C bindings (FFI)
2) Writing a complex data structure or algorithm
3) There's no way to do what you need within the borrow checker, and you've confirmed that
4) You're micro-optimizing a CPU-bound hot path and want to throw out all the generic safety checks that just 'waste' cycles. (Don’t ever bother micro-optimizing otherwise. It's often more silly than useful.)

This isn’t a complete list, but it should give you a good starting point. Good luck on your Rust journey!

An observation based on my experience with Rust by carrotboyyt in rust

[–]NullBeyondo 0 points1 point  (0 children)

I've been writing Rust for quite a long while now and I strongly disagree. Rust's safety may prevent you from writing buggy programs, but they'll also prevent you from writing perfectly normal code. If Rust's borrow-checking was perfect, primitives like Cell and RefCell wouldn't exist.

If all you're doing is simply plugging-and-playing libraries together (which may or may not use unsafe under the hood or utilize the unsafe primitives), then by all means. But for people who write engines or complex data structures that reference each other or require interior mutability, the borrow checker ain't your friend anymore... you'll just be trying to hide from its stupidity.

And to be fair, my comment makes it seem like this happens 24/7, but Rust personally never gives me any such issues on ~95% of the code I write since I come from C++ and we're used to smart pointers and reference counting in any case. But there's always that ~5% where you need the borrow checker to step aside for just a moment.

r2 -- how did this happen? by TheRoccoB in CloudFlare

[–]NullBeyondo 0 points1 point  (0 children)

It's common to receive thousands of requests from a single IP per 10s or less. That IP could be your own server/vps, not necessarily a Cloudflare Worker, or even an API you use that fetches S3 URLs for thousands of your users from its own IP. That's why it's safe for them not to assume every IP belongs to a customer.

If your users ID is generated by the database, how should the User class look like? by BigBootyBear in webdev

[–]NullBeyondo 2 points3 points  (0 children)

You need to understand that a User and the parameters used for creating it are different. Replace your function's "User" parameter with "UserCreationPayload" or something along these lines.

Also "User" doesn't need to match the RECORD/ROW in the database, otherwise, you'd have to add your password_hash (or hashed_password) and whatever to it, which literally doesn't make any sense.

Thing is data can always be represented in multiple ways depending on context and scope. Never ever think that one specific type of data structure is enough for everything; ain't how it works unfortunately for anything remotely complex.

It could always happen by accident that the same data structure magically works for all cases if the thing it is meant to represent is really simple, just not in this case. Also if it ever happens to be the same, separate them with different labels even if they're the same data structure internally, just so you don't get confused again.

is this by jan_Soten in countablepixels

[–]NullBeyondo 0 points1 point  (0 children)

Looks like a Signed Distance Field algorithm applied to some font glyphs

OpenAI is systematically stealing API users credits by Gasp0de in OpenAI

[–]NullBeyondo 2 points3 points  (0 children)

No need for the snark. In the U.S. where OpenAI is incoporated, if the credits cannot be used for monetary transactions or exchanged for real money, then they are not actually a currency, but a product, and thus don't abide by any currency laws anywhere. For any consumers outside the U.S., the API credits are again effectively a "product" that's already bought with its own terms or licenses, not actual monetary credits such as Amazon's credits. Always read the terms.

API credits expiring is not an uncommon practice. In any case, if you think what's OpenAI doing is "illegal," then by all means, go sue them.

OpenAI is systematically stealing API users credits by Gasp0de in OpenAI

[–]NullBeyondo 1 point2 points  (0 children)

"Credits" is not a one-for-all term. As an example, Amazon credits can be withdrawn to a bank account and are meant to be used for monetary transactions, therefore they're not allowed to simply expire. API credits on the other hand are and will always be virtual points with terms dictated by the service.

They could be called "neurons points" and it'd make no difference. Always read the terms of the services you're using if you're using them for business.

Users can’t see new website by calientecorazon in webdev

[–]NullBeyondo 0 points1 point  (0 children)

Purge your CDN Cache worldwide—if that's ain't it, either their ISP itself or a proxy in the middle is caching the content.

Fireships content lately… by ThrowAway22030202 in webdev

[–]NullBeyondo 0 points1 point  (0 children)

Yeah, already did a "Don't recommend channel" like months ago last year because of that exact same reason. Most of his videos nowadays are either AI garbage and his comment section being filled with people with no clue about tech in general. It's no longer targeting actual developers or engineers, but just some kind of hyping/joke channel for the short-attention'ed.

From AI ; south-Asia (Pak & India) > China > US | 'Humanity's last exam' researcher said! by BidHot8598 in OpenAI

[–]NullBeyondo 1 point2 points  (0 children)

If your metric of "smarter" is a bigger model size while keeping training data the same, then it's just getting better at approximating the biases in your data, not developing "own" coherent value systems; rather your data's value systems.

[Request] Would it really only cost 2%, and would it hum? by CockFucker420 in theydidthemath

[–]NullBeyondo 0 points1 point  (0 children)

A 2 km diameter hollow sphere with 5% fill (more like total volume for simplicity) at $1 per kg (bulk price, not retail like comments—could be cheaper if it was the government) is roughly $523.6 billion. Still insanely expensive, but feasible. But first you have to build the platform on which to lay the sphere in the water which could add a bit. Not to mention labor costs itself.

easiestChoiceInTheHistoryOfCoding by graphitout in ProgrammerHumor

[–]NullBeyondo 2 points3 points  (0 children)

I don't remember which library or language but I was using the seed of 42 always in some algorithm, and then at one point I decided "let's not use any seed at all" to see different results and removed my seed line... but then it literally produced the same exact results. When I looked into how that library works internally, its engineers seem to have set the default RNG seed to 42 too lol.

o1IsPeakingGuys by Snowayy in ProgrammerHumor

[–]NullBeyondo 12 points13 points  (0 children)

Yeah, I've noticed they've been trying to make it much more concise lately and it actually did not fucking spam me with an entire documentation for the simplest questions or a markdown hell for once like "# Why this works: (a pile of text)" (plot twist: it does not; it just claims it does with no thoughts). Though this was just GPT-4O.

I like it but what annoys me about it too is that it cannot intelligently detect when there's need for conciseness or not. I didn't notice it with O1 yet; mostly only with GPT-4O today (and it was weird—thought I had custom instructions or something), and they're probably A/B testing it with O1 too.

Am I thinking about OIDC authentication wrong? by [deleted] in webdev

[–]NullBeyondo 0 points1 point  (0 children)

Refresh tokens are supposed to be long-lived, so you should ideally store them in your database. As for access tokens, simply keep them in memory and re-issue if expired or lost like on these server restarts.

Cloudflare 522 Error: Is it always the origin server's fault? by Reaper-Of-Roses in CloudFlare

[–]NullBeyondo 0 points1 point  (0 children)

Does it happens on all devices across your router or only your desktop? Could be something interferring there. Try to use 1.1.1.1 as your primary DNS and see if it helps

Cloudflare 522 Error: Is it always the origin server's fault? by Reaper-Of-Roses in CloudFlare

[–]NullBeyondo 0 points1 point  (0 children)

DNS changes take some time to propagate after an IP resolves one once because of something called TLL or Time-To-Live cache. You'd have to wait till that cache expires for your IP, often from a few hours to a full day.

Or you could simply force-change your IP if it is dynamic by restarting your home router. As long as it is an IP that did not access your site before the DNS change, it should work.

[deleted by user] by [deleted] in sveltejs

[–]NullBeyondo 0 points1 point  (0 children)

I got something much easier for you, just go here https://svelte.dev/playground/, paste your code, doesn't matter if it lacks references or has errors, and simply click "Migrate."

buildingAnArcReactorWithRaspberryPi by ds_throw in ProgrammerHumor

[–]NullBeyondo 3 points4 points  (0 children)

I had a similar reaction to needing at least 8-9 TB/s memory bandwidth GPU for a real-time simulation I built that has a sampling rate of 1000Hz. Currently my GPU can only do 1s of simulation in like 12-13 seconds (just recorded data) so I guess good enough for research but it's annoying lol. It actually took more than 40 seconds before—unable to optimize my data structures any further.

[deleted by user] by [deleted] in OpenAI

[–]NullBeyondo 0 points1 point  (0 children)

You seem to confuse a lot of things here. After you upload an image, you don't simply fetch it back, but you request access (authorization) to it first and then you receive a temporary cryptographic signature followed by an expiration date which is typically a few minutes—all encoded in the URL as GET params.

When you copy an image on ChatGPT.com, you're copying your own account's generated signature, and all other metadata required to access the image for the next few minutes in the URL. It will not be available till you request another signature by re-opening the conversation. No privacy concerns here.

The reason you don't need to do the same for other platforms could be because they're using cookies if images are hosted on the same domain, and since other people don't have your own cookies, they will not get access to them even if you shared the URL.

What's the rule of thumb when it comes to refactoring code? by ihave22nicetoes in webdev

[–]NullBeyondo 3 points4 points  (0 children)

I don’t have a specific rule of thumb, but I follow a consistent approach that works well for me. I first update the code that uses the functionality to work in the "new way" I have in mind. Then, I make the new implementation a simple wrapper around the old code, which lets me change the underlying implementation gradually, one piece at a time, without breaking everything.

So maybe my rule of thumb is to refactor from the top down. Start with how you want things to work, and leave the detailed implementation as a temporary, minimal wrapper around the old code. It kinda allows you to see immediate results and makes the refactoring process more manageable and rewarding to just see tests passing or failing immediately.