Recent submissions

Comment · 6 years ago
I think you misunderstand me. I am saying that on Linux text at normal PPI is pretty much as good (to me) as text at high PPI because it has sub pixel rendering and strong hinting that Mac OS X lacks,
Comment · 6 years ago
OSX has had sub pixel rendering disabled by default since Mojave. It also never had the strong hinting that you can find on Linux and Windows which makes text significantly sharper at the cost of differing from the shape as specified by the font.
Comment · 6 years ago
Do you use Mac OS X?

When using Windows or Linux I don't find much benefit in text rendering on a 4k display.

But as Mac OS X has no sub pixel rendering or grid fitting text looks terrible without a high ppi display.

Comment · 7 years ago
You can still get 2% interest on that buy buying treasury ETFs, or 1.56% currently by asking them to open a preferred deposit account for you, which is essentially a savings account with a high interest rate. You dont have to keep it in cash.
Comment · 7 years ago
If you have bank of america you can link your bofa and merrill accounts. They even give you bonuses on your credit cards of +25/50/75% cash back for balances over 25/50/100k in assets between both.
Comment · 7 years ago
Depends what you consider a Rope.

Does it require constant time concat?

Does it require immutability?

Does it require a balancing scheme based on the fib sequence?

Does it require that the tree is binary?

My tree is an attempt to be as fast as possible with log everything operations and no pointer/reference stability.

Comment · 7 years ago
Re benchmarking vs other data structures: Here is a B+Tree based sequence container I made: https://github.com/det/segmented_tree

Basically, it has O(log n) everything like a binary search tree you suggested but also very good constant factors.

By default, leaves hold 1024/sizeof(T) elements and branches hold 47 elements, so it can access up to 13,289,344 8 byte elements with only 4 levels.

Comment · 9 years ago
If you enforce the use of clang-format then this is not an issue as it will indent the code correctly.
Comment · 9 years ago
It's impressive that clang generates the same assembly for both versions: https://godbolt.org/g/yLh1EF

Note that the assembly for process_message2 calls each function only once even though some appear twice in the body.

Comment · 9 years ago
Comment · 10 years ago
I would expect B-trees to outperform binary trees even in a persistent data structure. The necessity of binary trees comes when you need stable iterators/references.
Comment · 10 years ago
std::array does not exist because it is easier to read. It exists because C arrays behave strangely. Two examples: decay to pointer and no value semantics.
Comment · 10 years ago
Your loop:

    void TestSigned(int min, int max, int step) {
      for (int i = max; i >= min; i -= step) F(i);
    }
Becomes this with unsigned:

    void TestUnsigned(unsigned min, unsigned max, unsigned step) {
      while (true) {
        F(max);
        if (max < min + step) break;
        max -= step;
      }
    }
Now if I want to transform my loop to operate on pointers or iterators, the transformation is trivial:

    void TestUnsigned(unsigned *min, unsigned *max, unsigned step) {
      while (true) {
        F(*max);
        if (max < min + step) break;
        max -= step;
      }
    }
Quick: Do the same for yours.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton