:wq
will save the current buffer and quit.
- 2 Posts
- 420 Comments
And the database layer is a separate truck sorta welded onto the outer truck with varying degrees of weld quality.
When handling things that are serialized over the wire, you have to do it this way. Yes, you can use typed serialization formats, but in a string-based serializer, there’s nothing stopping the other system from sending “0.0000005” on a field that should be an int. If you don’t validate that it’s an int, you would just pass that value to your equivalent of
parseInt()
.If you do validate that it’s an int, then it still didn’t matter if the language has static typing or not. You’re doing that at runtime or you’re not.
In Rust, doing
"0.00005".to_string().parse::<i32>().unwrap()
causes a panic on theunwrap()
from an invalid digit. However, that’s runtime. It’s not something the type system can handle statically. The real benefit here, I think, is that it at least forced you to consider that the invalid input could have unexpected results. This is a pretty good reason to be careful about puttingunwrap()
on everything. The compiler isn’t going to save you here.
frezik@midwest.socialto Programmer Humor@programming.dev•This might have some impact on efficiency10·23 days agoReduce them later. Tell your boss you found a 2x speedup.
I understand the motivated reasoning of upper management thinking programmers are done for. I understand the reasoning of other people far less. Do they see programmers as one of the few professions where you can afford a house and save money, and instead of looking for ways to make that happen for everyone, decide that programmers need to be taken down a notch?
That might be the underlying problem. Software project management around small projects is easy. Anything that has a basic text editor and a Python interpreter will do. We have all these fancy tools because shit gets complicated. Hell, I don’t even like writing 100 lines without git.
A bunch of non-programmers make a few basic apps with ChatGPT and think we’re all cooked.
frezik@midwest.socialto Programming@programming.dev•Linus Torvalds built Git in 10 days - and never imagined it would last 20 years4·1 month agoAlong those lines, consider the decision for why the Model S charge port is where it is, according to Tesla’s former chief engineer:
tl;dr: you don’t want it directly in the front-center (like the Nissan Leaf) because a minor fender bender will ruin it. Front-driver’s side is a good choice that a lot of other manufactures are going to. Elon didn’t want that, because it didn’t line up with his Bel Air garage. So they stuck it in back, but due to the way Tesla Superchargers are laid out, it now means Tesla drivers have to back into the parking space.
frezik@midwest.socialto Programmer Humor@programming.dev•me when i find out i can use ssh to sign my git commits41·1 month agoI know it because I’ve actually implemented RSA as an exercise and know how it works.
What you’re talking about with hashes is an implementation detail. It’s an important one, because using exactly the same algorithm for signing and encryption has some security pitfalls, and it will usually be slower. However, the function you call is exactly the same. The hash is encrypted with the private key. It can be verified by generating the same hash, decrypting with the public key, and matching the two hashes.
See also: https://cryptobook.nakov.com/digital-signatures/rsa-signatures
Signing a message msg with the private key exponent d:
- Calculate the message hash: h = hash(msg)
- Encrypt h to calculate the signature: s = hd (mod n)
The operation “hd (mod n)” is just RSA encryption, but with the private key.
frezik@midwest.socialto Programmer Humor@programming.dev•me when i find out i can use ssh to sign my git commits2·1 month agoMathematically, signing is encryption using the private key. That’s how the algorithm works. The input to the function is irrelevant.
if you can solve logic puzzles, you’ll make a decent programmer.
I mean, that’s what Google did several years ago. They stopped because data showed it didn’t mean anything.
That said, debugging existing code is a more realistic test of what you’ll be doing on any programming job, as opposed to writing anything from scratch.
There’s a lot of ways to test communication skills. This doesn’t seem like a very good one.
If it were a question about the tradeoffs of different sort algorithms and how they might apply to a given problem, I would agree. That’s not what these interview questions are about.
Where is this? I’m pretty sure I’m overqualified.
So glad Nintendo is catching up with PC features from 20 years ago.
Open world Mario Kart is one of the last new things you could do with the series. Otherwise, it’s just updated graphics and tracks.
“Improvement” is an open ended term. Would having longer or shorter toes be beneficial? Depends on the evolutionary environment.
ChatGPT does have a feedback loop. Every prompt you give it affects its internal state. That’s why it won’t give you the same response next time you give the same prompt. Will it be better or worse? Depends on what you want.
I’ve played with markov chains. They don’t create serious results, ever. ChatGPT is right just often enough for people to think it’s right all the time.
I also started with GTA V in the last few years. I sometimes describe it as an interactive movie rather than a game.
That’s not meant to be insulting. It’s a very well told story with perfect social satire. The characters are excellent. If you judge it the way a movie is judged, it’s very good. The one thing is that the story should have finished with the big three-way shootout instead of Franklin’s choice. Otherwise, very well put together.
As a game, though, it’s mid. There are several mechanics where they teach you to do a thing, but it never comes up again. Money is no longer a limitation after the first heist is done. Owning a business isn’t likely to be profitable for the length of a likely playthrough.
I accepted most of the morally questionable stuff. It comes with the series, and you’ll either have to accept it or not play. It’s balanced out with obvious social satire; it’s aware that this is not how people should act in real life. It’s a game for mentally mature players who understand that none of these are good people. That mental maturity doesn’t necessarily come with age.
However, I drew the line at the paparazzi storyline. Just felt too sleezy. The FIB torture bit also came close to me, but in-game, even Trevor didn’t feel comfortable with that, and he’s a monster.
Only other part I skipped was that damn yoga bit. Glad the game let you skip it while still progressing, because I don’t know what it wanted me to do.
I’m a little surprised it got so many 10 out of 10 reviews at launch. I guess the draw distances are impressive for a game that worked on the Xbox 360, and it uses those draw distances for important artistic effects. It makes it feel like a real city. But there are bugs that prevent progression years after release (albeit with workarounds most of the time), and some of the mechanics are bolted on. It’s a 9/10 movie and a 7/10 game that averages to 8/10.
There’s psychological quizzes that are much shorter than that. There’s a four question quiz that, on the surface, is about parenting. They’re actually about authoritarianism, and the answers are highly correlated with support for Trump.
https://www.vox.com/2016/3/1/11127424/trump-authoritarianism
A lot of it was fair criticism at the time. Linux fixed some of what was wrong. Having a good
sudo
config mostly resolves the problem of having one superuser account, and big, multiuser systems are a lot less common now, anyway. X’s network transparency features aren’t that useful in modern computing contexts, either, though I have found a few over the years.But mostly, it’s because the landscape changed from a hundred Unix vendors vs a bunch of other OSen, to now where it’s Windows vs Linux vs OSX. By that comparison, the two with Unix-derived history look well thought out.
(This also implies that NextStep was the one old Unix vendor that has survived in a meaningful way. I don’t think anyone would have guessed that 30 years ago.)