slaymaker1907
Joined 10 years ago
Joined 10 years ago
Don't do weird crap with lifetimes to try and convince the compiler that what you're doing is ok, just throw Rc/Arc on it and be done with it.
The Rc/Arc advice also applies to C++ IMO, though you use different constructs, std::shared obviously, but there is a strong argument to be made for a std::shared_st or something which is single threaded.
It would not surprise me if this advice comes from experience with C++ where there is no Rc so reference counting is very expensive. Even so, you can greatly reduce the expense by passing things by ref where lifetimes are simple which is the vast majority of the time.
Most importantly, imagine a timeline where no one has invented any programming language beyond assembly. I think an LLM would have difficulties implementing complex programs in assembly without a bunch of supporting libraries.
Sure, the LLM might be able to make the libraries eventually (will it actually know them all without ANY domain knowledge from a human?) but it would take a lot of time and money to do that. And really, you’re still creating libraries, the only question is if you share them or not.
Another thing is that human written code can be much better than what the AI would write. For example, saw it basically duplicate the same complex operation three slightly different ways instead of just abstracting that away in a function.
However, that would clearly make your phone look suspicious from forensic analysis. To counteract that, you have two hidden volumes leaving you with three total systems: your insecure system (first password), the honeypot volume for “clever” actors to find, and then the truly secure volume.
I think one honeypot would be ideal. It needs to be convincing and have data that seems sensitive which would take a lot of effort. Put your nude photos there or something.
It’s obvious why you want to inline memcpy, but the specialization is more interesting. For example, I’ve seen the compiler optimize a memcpy with a static number of bytes and then use SIMD registers to do the copying with no loop at all. It can even be smart enough to take advantage of memory alignment for this.
Optional homework is often a disaster. At best, students would do it right before an exam and the goal of education is not to just pass exams. They’d probably still get a lower score than if they did the homework when they were supposed to.
What I think is better is to have a due date, but just make the maximum 10% each day it is late. So after 2 days, the highest score you could receive would be 80%.
I liked that system because it gave some flexibility with deadlines while still encouraging you to turn things in on time.
Jupyter also has a janky execution model. It doesn’t track dependencies so you have to be very careful in how you separate cells from one another and just running the whole notebook every time seems kind of pointless vs just writing a pure Python script.
Basic microeconomics is just that: basic and thus an oversimplification.
Spoiler: The <> combines lists as cross joins (for-loop within another for-loop). The lambda maps to new lists ['z', 'a'] and ['z', 'b'] (strings are just char arrays). It then computes the various combinations to recombine them so ['z', 'z'], ['z', 'b'], ['a', 'z'], ['a', 'b']. Note it's not all permutations since you don't have ['z', 'a'] even though that's actually one of the "base" arrays we got from the lambda. It took me a long time to really internalize that and it's still probably not a function I'd reach for.
It is kind of cool, though, that you can do `(,) <$> lista <> listb` and you get a nested for loop.