Well, if I asking for help, it’s probably because I am wrong about something. So I know who to trust.
- 0 Posts
- 64 Comments
anton@lemmy.blahaj.zoneto Programming@programming.dev•What Are The “Objects” in “Object-Oriented Programming”?2·7 days agoWhy assembly?
Does C not allow putting the v-table in static memory/text or where is the hangup?
Having the sign bit in front, makes them compare like sign-bit-integers and if they are compared/sorted like 2s-complement integers, the negatives are reversed but still come after the positives.
This doesn’t change it to a png, but your image viewers recognize it as webp. You should just associate .wepb with your image viewer in the OS.
deleted by creator
anton@lemmy.blahaj.zoneto Programming@programming.dev•Daniel Stenberg is awarded as Developer of the year by Developers Bay5·1 month ago* Swedish developer of the year
Don’t get me wrong, he does great work, but your post should mention it somewhere.
Rust doesn’t allow type inference in function signatures, c++ does with auto. IIRC, they recommended against using it, because of -you guessed it- compile time.
anton@lemmy.blahaj.zoneto Programmer Humor@programming.dev•Yes, I did spend time on this21·1 month agoYou could save 0.64 bit per char more if you actually treated you output as a binary number (using 6 bits per char) and didn’t go through the intermediary string (implicitly using base 100 at 6.64 bits per char).
This would also make your life easier by allowing bit manipulation to slice/move parts and reducing work for the processor because base 100 means integer divisions, and base 64 means bit shifts. If you want to go down the road of a “complicated” base use base 38 and get similar drawbacks as now, except only 5.25 bits per char.
anton@lemmy.blahaj.zoneto Programmer Humor@programming.dev•Yes, I did spend time on this5·1 month agoUnless you only copy and compare you have to decode it, or implement more complicated logic for everything from searching to concatenation (which is normally just memcopy).
anton@lemmy.blahaj.zoneto Programming@programming.dev•I just created an experimental Node.js Framework.41·2 months agoThe standard xkcd on making another thing:
https://xkcd.com/927On frameworks specifically, I recommend the song:
We’re gonna build a framework,
cause we wanna use one,
but don’t wanna choose oneWe’re gonna build a framework
We didn’t like the others,
So we’ll write another
I never understood why they don’t add just a little syntactic sugar. You don’t need much to take it from a mess of brackets to something comprehensible.
It was in the original design, but not the first implementation. By the time someone got around to it, people where used to S-expressions.
anton@lemmy.blahaj.zoneto Programmer Humor@programming.dev•I got to avoid memory management for quite some time3·2 months agoI can’t comment whether learning C first improves your rust, but it certainly makes you appreciate what the rust compiler does.
Also learning rust improved my C.
C++ already has much more of the required language constructs, which is why there is already an attempt to add borrow checking to C++ called circle. Until that standardizes, I wouldn’t expect it in C.
anton@lemmy.blahaj.zoneto Programming@programming.dev•Handling of unlikely syscall errors2·3 months agoI think you should make the overwhelmingly likely case crash in a controlled way, but provide a way to handle it for people who truly want to keep going in such strange conditions.
In rust I would panic in
now()
, but also provide a alternative call that returns a result named something liketry_now()
, similar toVec::with_capacity
andVec::try_with_capacity
.
In languages that provide them, you could also throw a runtime exception that can be ignored and just bubbles up to main unless explicitly caught.
anton@lemmy.blahaj.zoneto Programming@programming.dev•We Asked 100+ AI Models to Write Code. The Results: AI-generated Code That Works, But Isn’t Safe7·3 months agoIf a system was made to show blogs by the author and gets repurposed by a LLM to show untrusted user content the same code becomes unsafe.
As if a white space sensitive language protects from this fuckery.
- How many thin spaces are one level of indentation?
- Will anyone notice a hair space?
- Who can tell the difference between a space and a figure space? they are the same size in a mono spaced font
anton@lemmy.blahaj.zoneto Programmer Humor@programming.dev•Replication of Quantum Factorisation Records with an 8-bit Home Computer, an Abacus, and a Dog8·3 months agoAnyone able to find the prime factors of 35 in their head is able to outperform state of the art quantum computers.
anton@lemmy.blahaj.zoneto Programmer Humor@programming.dev•Something something history is a flat circle1·3 months agoRust has monomorphisation like C++ and every function has the aliasing guarantees of restrict, a keyword rarely seen in C code bases use and C++ doesn’t even support.
This means you can get more optimisations while writing in an intuitive style, where C/C++ requires some changes to the code.On the other hand rustc has some hiccups with argument passing and rvo. One could argue that that’s just the compiler while the aliasing problems are part of the language in the C/C++ case, but while there is only one rust compiler its performance is the languages performance.
For most use cases they are about equally fast.
anton@lemmy.blahaj.zoneto Programming@programming.dev•How thorough is this testing and review process? Am I understanding this correctly that they only review portions of the code, on top of function & security testing?4·3 months agoIts probably the usual closed source, but maybe not, I can’t take more of the abbreviation soup.
The other big danger is a attacker from the inside, and unless they have a amazing solution in their confidential jira, they just declared it not a problem.
It’s probably hungry, feed it a mouse.
The actual best thing to do, apart from getting professional help, would probably setting the climate control to the lowest temperature to make the snake slow and sluggish before doing anything else.