Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
leni536
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
40 ms
·
691.
▲
by
leni536
6y ago
I always rinse out the remaining with a little bit of water. The water will boil out anyway when I cook.
692.
▲
by
leni536
6y ago
The problem in general is a language feature silently increasing the API surface. In this specific case the function was already callable with two parameters, without the library author's intent. Another example to the general rule is
693.
▲
by
leni536
6y ago
> At least in my tests GCC and Clang seem to propagate it just fine. In my tests gcc clones sort and inlines the comparison only in -O3. clang doesn't do it even with -O3, neither with libstdc++ nor libc++. https://godbol
694.
▲
by
leni536
6y ago
If you pass a function name then the corresponding type template parameter deduces to a function pointer type. Then this function pointer is passed all the way down where the comparison happens, and by that point it's unlikely to be in
695.
▲
by
leni536
6y ago
The performance of sort being exactly the same as the C++ implementation looked a bit suspicious to me at first. Notable that in the C++ performance test a function pointer is passed to std::sort in a similar way how the C library is used [
696.
▲
by
leni536
6y ago
I should have wrote a "good name".
697.
▲
by
leni536
6y ago
Rule of thumb: If you can't give the thing a name then maybe don't extract it. What you extract becomes an abstraction. No abstraction is better than a bad abstraction.
698.
▲
by
leni536
6y ago
I think it should be bidirectional. Random access is expected to mean O(1) advancing of the iterator. I don't think it can be done without upfront work and allocation at construction. If one needs random access they can always do the b
699.
▲
by
leni536
6y ago
It should return a range of string views, no allocation is necessary.
700.
▲
by
leni536
6y ago
I don't think it should. Heat expansion should slightly increase the diameter.
701.
▲
by
leni536
6y ago
Notice that in the example the field 'H' has much higher probability to contain a mine than the fields 'I' and 'F'. This can be very unintuitive. The reason is when counting configurations one needs to consider
702.
▲
by
leni536
6y ago
One needs to be careful when calculating exact probabilities. http://nothings.org/games/minesweeper/ previous discussion: https://news.ycombinator.com/item?id=13566730
703.
▲
by
leni536
6y ago
The layout of objects, including dynamic objects, is implementation defined. Accessing them through reinterpret_cast is however undefined. Don't expect that compilers won't screw you over this.
704.
▲
by
leni536
6y ago
In other words if your program relies on undefined behavior then make sure you look at your compiler's documentation and then you might be able to make it implementation defined.
705.
▲
by
leni536
6y ago
Non-Turing complete doesn't mean that you can't create too high complexity algorithms out of O(1) primitives.
706.
▲
by
leni536
6y ago
The way it was worded in the GP comment would change name lookup in existing well-formed programs, making them fail to compile, or compile differently. I'm not familiar with Stroustrup's proposal, but I doubt that he proposed it w
707.
▲
by
leni536
6y ago
> C++ could adopt the UFCS universal-function-call feature of D-language that allows any ordinary free function to be called as if they were methods, without any special kind of type annotation. It really couldn't. It would be a br
708.
▲
by
leni536
6y ago
Please, no. It makes sense to remove username from a post. Removing content is horrible.
709.
▲
by
leni536
6y ago
On the web you can do it with SVG. https://github.com/leni536/trans_jpg
710.
▲
by
leni536
6y ago
In C++ comparing them is unspecified, and theoretically can even change from invocation to invocation. But it's not UB. http://eel.is/c++draft/expr.rel#4.3.sentence-1 std::less is blessed by the standard to work w
711.
▲
by
leni536
6y ago
It can't, but blurring might remove less data than what you want.
712.
▲
by
leni536
6y ago
How resilient is blurring against deconvolution?
713.
▲
by
leni536
6y ago
The built-in comma operator has strict sequencing semantics: Every value computation and side effect of the first (left) argument of the built-in comma operator , is sequenced before every value computation and side effect of the second (
714.
▲
by
leni536
6y ago
A somewhat analogous effect/paradox in thermodynamics is the Joule expansion: https://en.wikipedia.org/wiki/Joule_expansion
715.
▲
by
leni536
6y ago
The aggressive sound processing (mainly echo cancellation and noise reduction) doesn't help either. Works great for speach legibility, not so well for music.
716.
▲
by
leni536
6y ago
> How can sine and cosine be computed efficiently in a calculator that has a hard time even doing multiplication? The trick is to do repeated rotations by 0.001 radians until the desired angle is reached. Genius!
717.
▲
by
leni536
6y ago
It's also a consequence of some unfortunate mistakes, like uniform initialization being screwed up by std::initializer_list.
718.
▲
by
leni536
6y ago
If you need k percentile values then I think you could do it in O(n log(k)) with introselect. You most definitely don't need O(n log(n)).
719.
▲
by
leni536
6y ago
Ranges will help with some of the composability issues of standard library algorithms. [1] https://en.cppreference.com/w/cpp/ranges
720.
▲
by
leni536
6y ago
Variadic templates are essential for simple, argument forwarding template functions. std::vector::emplace_back is a very simple example, this kind of use comes up now and then during work. [1] https://en.cppreference.com/w&#
More ›