Hacker Newsnew | past | comments | ask | show | jobs | submit | detrino's commentslogin

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.


I do use OSX, but I'm also on Linux Mint. Both are sharp and smooth as butter. I'm uncertain why your experience has been what it has with Linux. Could be drivers or something. I did have to set Mint to work for 4k60. It did not work out of the box properly. (HiDPI was off. Hardware vsync was off.) Mint has never had sub pixel rendering as far as I know. It looks crisp and great.


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,


When did that happen? Back in my day, OSX was the one with sub pixel rendering and Windows users would constantly complain that it looked fuzzy.


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.


They were paying to license Microsoft’s ClearType patents and decided not to pay anymore once retina displays had become near standard for lost Macs and subpixel rendering was no longer necessary


If true, it's a pity they were paying. Apple's SPR goes back to the Woz days, whereas ClearType didn't come around until XP, and wasn't a default until Vista.


This! MacOS (mbp15r) with seemingly any non-Apple external monitor, text looks just awful regardless of font or resolution settings.


I've had to use this fix for non-Apple monitors https://www.mathewinkson.com/2013/03/force-rgb-mode-in-mac-o...


I was thinking macos always had subpixel rendering, but maybe it does not? I am not running mojave

https://news.ycombinator.com/item?id=17476873

Also, apple has a tendency to support fancy features ONLY on its own hardware. I know apple retina displays allowed display scaling, but non-apple displays only let you set the absolute display resolution.


Not true. I get the same scaling options on my 4K monitor as I do on my Retina display.


I'm not running the latest os.

On my displays I could only get the list of resolutions for my monitor, even holding down alt with preferences.

Meanwhile apple displays showed this dialog:

https://support.apple.com/library/content/dam/edam/applecare...

Maybe the latest OS allows it?


Yeah, maybe it's the OS version. I'm running Catalina and I see the scaling options from that screenshot for my external non-Apple monitor.


I don't know what you're seeing but the retina scaling options don't appear on any non-Apple display I've ever used. (Unless I hack the kexts.)


You generally have to use the right equipment -- using mini displayport or thunderbolt 3 instead of HDMI, depending on the generation. It's definitely finicky (much like getting guaranteed 4k60 output, especially through a dock)


Ah, maybe that's the key, I almost exclusively use hdmi.


Works for me, I'm using two fairly new dell 4K screens, as far as I know it works on any hidpi display


It does for me on both LG and Dell monitors.


On windows with a 27in 4k I definitely see a difference much better then the past 2560x1440 or 2560x1600


macOS looks fine on a 32” 4K


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.


So, let's say I keep $100k in my emergency fund account... what exactly does 75% cash back for my credit card mean?


They increase the cash back by 75% of whatever it already was. So if you were getting 3% back (currently, for their Cash Rewards card, that can be 1 of the following categories: gas, online shopping, dining, travel, drug stores, or home improvement/furnishings), you'd now be getting 5.25% back.

Which is a complete rip-off. You could easily get 2% interest on that $100k you're leaving with them by just leaving it with a better bank. For that to be worth it, you'd need to get at least $2k cash back on that credit card. At 5.25% (which is only for that 1 category you chose!) you'd need to burn through $38k/year... i.e., you gotta $100 a day on that card.

Except even if you somehow were planning to spend $100/day on that one lucky category, your cash back would be an order of magnitude lower, because they'd only give you that cash back on the first $2,500 in purchase, i.e. you could only earn $131 at most. So you're losing out on at least $2,000 to earn at most $131. Terrific deal!


> Which is a complete rip-off. You could easily get 2% interest on that $100k you're leaving with them by just leaving it with a better bank.

The optimal method is to invest the $100k in VTI or even a money market fund. You don’t have to leave it as cash.


The more optimal method is to leave 1-3 months worth of expenses as cash and put the rest of the money in something like VTI. You don't want a market crash to erase half of your emergency fund at the exact moment you need it.


Emergency funds should be in FDIC insured savings accounts, that pay at least 50 basis points less than the fed funds rate.

Also, you should have a stash of cash you can find at home in case of power outage or network loss and you can’t get money from the bank. And guns and canned food and clean water.


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.


Not sure why you're downvoted. Parent is worded in a very confusing way.


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.


How is that different from a rope data structure?


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.


Should've said a generalized rope, as ropes are generally described as a replacement for strings, but if you replace characters with other fixed size data types everything still works.


If you enforce the use of clang-format then this is not an issue as it will indent the code correctly.


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.


Returning a stack allocated value is a move in C++11/14. It is also true that in many circumstances a compiler may optimize that move away using RVO/NRVO.

Consider this example: http://ideone.com/T872Oj

In F1 the compiler can NRVO away the move.

In F2 it cannot.

Both will fail to compile if you delete the move constructor.


Does that mean that side effects in a move constructor is undefined behavior since you can't know whether it's going to be called?

Edit: I see that StephanTLavavej clarified that below.


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.


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.


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.


It looks easy but it isn't.

The second example causes unexpected behavior (and probably ub later) if: min + step > MIN_TYPE_MAX

The last example causes undefined behavior if: max - min < step - 1.


I've written a Data Structure[1] for C++ to handle this problem. It uses counted B+Trees internally and is a drop in replacement for C++14's std::vector.

[1] https://github.com/det/segmented_tree


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: