Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
bstamour
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
8 ms
·
31.
▲
by
bstamour
9y ago
So virtual function overloading? Can you give a small bit of sample code to demonstrate what you mean?
32.
▲
by
bstamour
9y ago
Ah gotcha. Yes in the current situation we can do nearly everything that the concepts proposal for C++20 does with enable_if, void_t, and a few other helpers. Though concepts have the benefit of letting you "say what you mean", in
33.
▲
by
bstamour
9y ago
Concepts are also C++20. They were voted in, however, shortly after 17 shipped.
34.
▲
by
bstamour
9y ago
C++ doesn't have multiple dispatch. I think the OP was referring to multiple inheritance, which is not the same thing.
35.
▲
by
bstamour
9y ago
That's interesting, and a bit counter-intuitive IMO. But I guess that's why we measure things. The reserve operation is essentially just a single reallocation, whereas the resize is a reallocation plus a bunch of zeroing out. Stra
36.
▲
by
bstamour
9y ago
One other minor nitpick: know the difference between vector.resize vs vector.reserve. If all you're doing is copying new data into the vector after sizing it, use reserve. This avoids default-constructing all of the values inside of it
37.
▲
by
bstamour
9y ago
It doesn't make sense, in my opinion (though I could be ignorant). For classification, wouldn't it be better to stick to discrete probability mass functions?
38.
▲
by
bstamour
9y ago
This has been going on for a lot longer than the current US government. Chances are high it's just Zug Island, which contains blasting furnaces for steel and whatnot. The problem is that Zug Island is a part of Michigan, while Windsor
39.
▲
by
bstamour
9y ago
Hopefully that will be fixed in a future C++ standard. There is an interesting static reflection proposal floating around that would allow for this, plus more.
40.
▲
by
bstamour
9y ago
Me too. Sendmail and his friends did unspeakable things to me.
41.
▲
by
bstamour
9y ago
I remember HTMLGoodies. Before coming across it I learned the basics from a site called Lissa Explains [0]. [0] http://www.lissaexplains.com/
42.
▲
by
bstamour
9y ago
Fundamental Proof Methods in Computer Science, by Konstantine Arkoudas and David Musser.
43.
▲
by
bstamour
9y ago
When C++11 came out, I bought the ANSI copy (identical to the ISO one except for the front page if I remember correctly) for $30. It sure beat the ISO version in terms of price.
44.
▲
by
bstamour
9y ago
I wrote my master's thesis in literate haskell. It was cool to watch the same source material generate either a program or a dissertation, depending on what processor I sent it through.
45.
▲
by
bstamour
9y ago
What if you're selling something that they gave to you as a gift?
46.
▲
by
bstamour
9y ago
My supervisor's thesis from the 70's is in about as good as shape as the one linked. Must depend on when it was scanned.
47.
▲
by
bstamour
9y ago
xhtml: it's just a good idea, IMO.
48.
▲
by
bstamour
9y ago
Yep! It runs on all of my personal gear for that exact reason. Praise Bob!
49.
▲
by
bstamour
9y ago
The languages, idioms, and ecosystems are different enough that I don't see that as a problem. They should be treated like two different languages. You wouldn't read a C book and expect to understand the conventions of C#. Neither
50.
▲
by
bstamour
9y ago
Unfortunately yes. The implementation is straight forward though: template <typename Container> std::size_t size(Container const& c) { return c.size(); } template <typename T, std::size_t K> std::size_t si
51.
▲
by
bstamour
9y ago
Or use the std::size free function. It's overloaded to work with C-style arrays.
52.
▲
by
bstamour
9y ago
They've been voted into C++20! The wait may finally be over (in a few more years) :-)
53.
▲
by
bstamour
9y ago
It's a simple concept that appears all over in computing. I'm not surprised that that's the case.
54.
▲
by
bstamour
9y ago
At least in C++, knowing your type forms a monoid with your operation informs you when you are safe to use various parallel algorithms. e.g. `std::accumulate` with an associative operator is safe to run in parallel.
55.
▲
Lofti Zadeh has passed away
(en.apa.az)
2 points
by
bstamour
9y ago
|
1 comments
56.
▲
by
bstamour
9y ago
Nope, but they are in the pipe. Maybe we'll see them for C++20.
57.
▲
by
bstamour
9y ago
Access control rules are all checked at compile time. There's literally nothing to store. If you want proof, check the output of your compiler. The only thing a non-virtual struct/class might do is reorder member variables if they
58.
▲
by
bstamour
9y ago
Unless you explicitly type `virtual`, your C++ classes will have the exact same overhead as C structs. Even with inheritance. The memory layout of struct A { int x; }; struct B : A { int y; }; is the same as if you had written
59.
▲
by
bstamour
9y ago
If you have the horsepower to test a population of deep nets, then absolutely.
60.
▲
by
bstamour
9y ago
Genetic algorithms and the like are still useful for various combinatorial search problems. Not everything can be mapped to a smooth function, and so there will always be (in my opinion at least) room for metaheuristics.
More ›