Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
detrino
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
15 ms
·
91.
▲
by
detrino
11y ago
I don't think its clear at this point.
92.
▲
by
detrino
11y ago
This just comes off as a bunch of bragging with the issue in the title sitting in the periphery. Also, people would be well served to realize that companies use these tests as a proxy for intelligence and education. They very much try to av
93.
▲
by
detrino
11y ago
That sounds like less than 1000 calories a day. You must be getting more calories than that or you are very atypical.
94.
▲
by
detrino
11y ago
Less repetition: http://ideone.com/yPQzy6
95.
▲
by
detrino
11y ago
I think I found the symmetry: http://ideone.com/KnaAMm Edit: Now with more symmetry: http://ideone.com/edNgre
96.
▲
by
detrino
11y ago
How is it possible to write a no-allocation intrusive linked list without move constructors ? When you move one of the nodes (or sentinel if you use one) it would invalidate the links in other nodes.
97.
▲
by
detrino
11y ago
That's not an intrusive list, it does an allocation for each node.
98.
▲
by
detrino
11y ago
The turing-complete argument makes no sense here.
99.
▲
by
detrino
11y ago
>- allows traits to be implemented for existing types, as opposed > to C++ where the type's declaration has to list all base classes. >- allows a type to be used through dynamic dispatch while allowing users
100.
▲
by
detrino
11y ago
IOW, sometimes a hack can be a valid engineering decision.
101.
▲
by
detrino
11y ago
I think the author may be missing the point of this exercise. Solving this problem requires the following things: 1) Decompose a number into digits. Less experienced candidates will likely convert the number into a string and then the chara
102.
▲
by
detrino
11y ago
It's probably just a PR move. By pretending to have been financially hurt by this campaign they both stroke the ego of the internet gaming crowd and make it seem that they have been sufficiently punished.
103.
▲
by
detrino
11y ago
I just gave an explanation of reference-to-const in 1 sentence, not several pages. Also, my objection to your comment was your focus on what const means to foo() when the value is in what it means to main().
104.
▲
by
detrino
11y ago
That's a fair point.
105.
▲
by
detrino
11y ago
I think you may be thinking of C++14, GCC has had full C++11 support since 4.8.1.
106.
▲
by
detrino
11y ago
Let's not that forget c++11's codename was c++0x ;)
107.
▲
by
detrino
12y ago
A function may not reliably cast a pointer-to-const-T to a pointer-to-T because T may actually be immutable, in which case modifying it would be UB. Like all casts, const_cast exists as an escape hatch in the type system for when you know
108.
▲
by
detrino
12y ago
You misunderstand reference-to-const, it does not imply that what "a" points to is immutable, it is a contract to the caller that foo will not use "a" in any non-const way.
109.
▲
by
detrino
12y ago
A closure is 1 function and an environment. An object is N functions and an environment. Objects are more useful as you don't need to repeat the environment to implement more than 1 operation. Both objects and closures can be type eras
110.
▲
by
detrino
12y ago
> First, please don't compare Go and Rust. They are completely different languages with completely different target use cases. Go has very different design goals than Rust, so very little that Rust does would actually be possible in
111.
▲
by
detrino
12y ago
I actually agree with you that Zimbardo and Milgram are relevant to the wallet-steal trick. Keep in mind that the studies you are referencing didn't involve random strangers being told what to do, they were people who had applied to ta
112.
▲
by
detrino
12y ago
How do you explain this then? https://www.youtube.com/watch?v=jPhVqA2KAbM
113.
▲
by
detrino
12y ago
> I don't really think that is true. Unless it's explained to them I don't see most viewers picking up on the subtly touches and strange hand/wrist holding, the body language mirroring, the use of the water bottle to
114.
▲
by
detrino
12y ago
Yes, it is unfathomable that people act like this. This stunt presents itself as an easy to understand trick that works like magic in making people do things like give you their wallet. This is appealing to viewers who can follow what'
115.
▲
by
detrino
12y ago
This is obviously staged.
116.
▲
by
detrino
12y ago
From C++: calling vector<T>::reserve in a loop can lead to quadratic behavior. For example: std::vector<int> v; while (...) { v.reserve(v.size() + 3); v.push_back(0); v.push_back(1); v.push_back
117.
▲
by
detrino
12y ago
Assuming that the DB is backed by some kind of tree, it would need to maintain extra metadata in the branches in order to achieve even O(log n) offsetting. For this reason I could understand it being a linear operation.
118.
▲
by
detrino
12y ago
> Could you please expand on your linked code, not really a C++ programmer and line 22/25 confuse me a bit? I've annotated the program here: http://ideone.com/gmaBri > Unfortunately I don't understand h
119.
▲
by
detrino
12y ago
Sorry, I deleted this comment immediately after posting but you managed to respond to it too quickly, it originally said: >Having a large input set of known size (and your result set is not large) is not a time when you would want to use
120.
▲
by
detrino
12y ago
You can still use this approach as long as you know the total size upfront, just sort the generated index array and use it to skip elements from your input stream, this will save you from having to generate random numbers for every element.
More ›