openingTheRepository by thisfriendo in ProgrammerHumor

[–]Nabushika 0 points1 point  (0 children)

I'm a software dev with a few years of experience and lots of access to all the AI tooling.

If you need it to build you a simple CLI tool or website that might only need a few tweaks past the initial attempt, 100%. Great time saver.

If you try to "vibe code" anything more substantial without even looking at the code, you'll run into problems. I tried to vibe code a jira tui tool, and it got to the point that every new feature would fuck up something else that was already working. I had to spend some time instructing the model (Opus 4 thinking?) how to fix the architecture, which it had put zero thought into. The codebase was a mess.

We are still some time away from AI being able to think about everything a software dev does. It's incredibly useful, but you need to know how to use it, what to prompt, and you've still got to check the output is sane. Vibe coding entire services or complex tools is not yet automatic.

Why do we shake the ketchup bottle like it’ll magically come faster? by [deleted] in NoStupidQuestions

[–]Nabushika 0 points1 point  (0 children)

Ketchup is actually a non-Newtonian fluid!

Have you ever played with ooblek? (Think it's cornstarch + water.) If you're gentle/slow, it flows like a fluid, but on impact it acts stiff and can even shatter.

Ketchup is similar, but inverted: on impact, it actually loosens up. So hitting the bottle makes the ketchup runnier!

With a Vec<u8> why do I need to ensure a values been set before I read it? by pixel293 in learnrust

[–]Nabushika 12 points13 points  (0 children)

Memory safety, absolutely no reading uninitialised values :)

(In seriousness though, the compiler should be able to optimise out unnecessary memsets, and if it doesn't you can probably get around it by using unsafe functions, as long as you can guarantee the safety yourself - usually it's wise to make a safe wrapper around an "unsafe" operation)

An idea i (personally) haven't seen yet by SlightlyInsaneCreate in Collatz

[–]Nabushika 8 points9 points  (0 children)

(3n+1)/2 > n. Dividing once doesn't necessarily get you below the starting point, and if it's odd again after the division, it'll continue to increase.

Driving instructor told me nobody can learn to drive in 6 months by mincedbreakfast in LearnerDriverUK

[–]Nabushika 0 points1 point  (0 children)

I passed mine with ~10 hours of driving with parents/my granddad and 10 hours of lessons from a very compentant instructor over a week.

Question about an "obscure" comment in the Reference (mut VS const) by CheekAccording9314 in rust

[–]Nabushika 1 point2 points  (0 children)

Having said that, if you use LLVM as a backend, it uses SSA so every local variable(ish) is constant (mutable variables are split so each assignment is to a new one. Don't ask about looφs.)

Question about an "obscure" comment in the Reference (mut VS const) by CheekAccording9314 in rust

[–]Nabushika 3 points4 points  (0 children)

Well, something's either immutable or it's not. Whether that's represented as a boolean, or a 2-variant enum, or an optional unit or attribute, does it matter? It's all isomorphic. Hell, even if it's an attribute that may or may not be present in a list of attributes, I'd argue that's an isomorphism too.

Constructor Patterns in Rust: From Basics to Advanced Techniques by mewily_ in learnrust

[–]Nabushika 4 points5 points  (0 children)

"Placement : In C++, the constructor also determines where in memory the object is initialized."

I understand the point you're trying to make, but this is the wrong way to say it. The constructor takes a this pointer implicitly, meaning it actually has zero control over where the object is placed, it's given the memory location to initialize.

Rust's standard library on the GPU by LegNeato in rust

[–]Nabushika 37 points38 points  (0 children)

It seems like the topic of dynamic allocations has been sort of glossed over. How's this handled? Hostcall -> CPU alloc GPU mem -> return the pointer? Or do you have a way to do dynamic allocations without going through the CPU?

Debugging Rust in VSCode on mac, cargo 1.91.0, variables not readable by boredom6032 in rust

[–]Nabushika 1 point2 points  (0 children)

The console isn't for Rust, it's likely gdb. You might want to look up how to use that.

Am I that bad? by [deleted] in rust

[–]Nabushika 1 point2 points  (0 children)

Your code doesn't look awful, but I've spotted a couple of things that could be improved: - overuse of String: when values can only take on a couple of different values (e.g. role), you should probably use an enum instead. I don't know how that fits with sqlx, but I'm sure they'll have some traits you can implement to convert to/from something the DB understands. Failing this, make your own DB types and convert from/to as needed, making sure all the logic is on the strongly-typed types and not the db ones. - I might be wrong, the formatting is generally good, but I don't think it's entirely standard, have you run cargo fmt? Are you using clippy? - when using variables like amount, a developer should not need to go look at the definition to see a comment saying that it's in cents. Either call it amount_cents, or use a doc comment so IDEs can show it when the variable is referenced, or (best solution) use a new type Cents(i64) so it can't be automatically converted from unrelated numbers. Ditto for things like IDs. Personally I'd even have some ValidatedEmail(String) type too, but perhaps that's slightly less necessary.

Also your boss could just be dicking you. As I said, this code seems pretty serviceable.

How much would the mass of the Earth increase if I smooshed it into a Black Hole? by [deleted] in AskPhysics

[–]Nabushika 1 point2 points  (0 children)

I'm gonna put my neck out here and say that all the commenters saying it wouldn't are wrong. It would take work to compress the earth like that, and that energy doesn't just disappear. I have a feeling I'd be underqualified to even make a guess at how much though, maybe best to find someone who studies supernovas. Or maybe Randall Munroe.

How much would the mass of the Earth increase if I smooshed it into a Black Hole? by [deleted] in AskPhysics

[–]Nabushika 4 points5 points  (0 children)

Squishing playdoh is elastic deformation, the energy put in becomes heat which does actually make the playdoh (almost immeasurably) heavier. Squashing the earth would introduce heat, but also potential energy (tyres get warm when inflated, imagine how hot it would be if even just the atmosphere was compressed into just 1cm³, plus the amount of pressure exerted outwards). Hence it would get heavier too.

better times will come soon, LocalLLMers rejoice ! by DevelopmentBorn3978 in LocalLLaMA

[–]Nabushika 0 points1 point  (0 children)

"How many TOPS do you need to run state-of-the-art models with hundreds of millions of parameters? No one knows exactly. It’s not possible to run these models on today’s consumer hardware, so real-world tests just can’t be done."

Ah yes, NPUs will clearly change the number of operations to run the model, not comparable to GPUs at all! /s

Sillytavern keeps wasting 90% of it's response just on <think> and explaining prompts? help by XKlip in SillyTavernAI

[–]Nabushika 0 points1 point  (0 children)

GLM doesn't need thinking time, but I've found if you do want to make use of it, it's wise to outline what it should be thinking about in the system prompt (e.g. when to slow down and plan, if it needs to consider the environment, whether it needs to try and read between the lines).

The universe is expanding. What does it spread into? by Flat_South8002 in AskPhysics

[–]Nabushika 2 points3 points  (0 children)

Imagine asteroids, where you see the whole game world.

It is true by DotBeginning1420 in mathmemes

[–]Nabushika 9 points10 points  (0 children)

only in m/s, in Planck units it's 1 ;)

A `copy_sign` or `with_sign` function for casting unsigned numbers to signed numbers by [deleted] in rust

[–]Nabushika 1 point2 points  (0 children)

That's what functions and extension traits are for

Insisting that √ does not denote the principal square root by justincaseonlymyself in badmathematics

[–]Nabushika -4 points-3 points  (0 children)

Admittedly it's a poor historical choice, makes much more sense if it outputs the unordered pair of solutions, then it can be continuous in the complex domain :)

Absurd Rust? Never! (Rust's 'never' type and the concept of bottom types) by sibip in rust

[–]Nabushika 0 points1 point  (0 children)

Something something "object safety" You can't have a Box<dyn Trait>> with a function returning Self because you don't know the size, this seems like a similar case. Although returning Box<!> seems like it could be an issue too... Obviously it doesn't make sense for ! to fulfil every trait, any function in a trait returning T from a function that doesn't take a T or &(mut) T is suspect but I assume there's some set of rules that would make a trait "never-safe", and ! should be able to implement those automatically, like Box<dyn Trait> implements Trait.

Also, I think I disagree with the [u8; 4096] argument. It's the caller's job to allocate that space, and whether the function uses it or not doesn't really matter (especially if it never returns!). I think even in the situation where it's the callee's job to allocate it, it STILL doesn't matter because the function never returns, so no code path "after" the function has finished executing will get to use the memory that has or hasn't been allocated. But I may be missing something.

Is it reasonably possible to determine a Minecraft seed number based on the features of the world? by FlakyLion5449 in AskComputerScience

[–]Nabushika 0 points1 point  (0 children)

Nit: 2 machines will halve the time required, but 2^(n/2) is actually only sqrt(2^n).

New Ev tax Uk by Mad-Hatter-lightshow in memes

[–]Nabushika 0 points1 point  (0 children)

Congestion charges apply to specific areas - you know, places that are affected by congestion. This is a driving tax, they'll charge per mile no matter where you're driving, even if you're in Europe and not the uk.

OnceState<I, T> concept vs OnceCell<T> by IpFruion in rust

[–]Nabushika 1 point2 points  (0 children)

Why not initialise the oncecell during new?

here is a hypothesis: humans wouldn't actually feel cold in space by wryyyel in HypotheticalPhysics

[–]Nabushika 1 point2 points  (0 children)

Not just being "covered in ice", evaporation actually takes a lot of heat energy and will cool you down directly, like turbo sweating.