Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
mtklein
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
10 ms
·
61.
▲
by
mtklein
3y ago
It is a developer tool, and it is Wine. It sure seems like you can just run an unmodified DX12 game from a Windows .exe on your Mac, provided you're running the latest beta OS.
62.
▲
by
mtklein
3y ago
I have always assumed it's that originally their purpose was to provide the shade of each pixel.
63.
▲
by
mtklein
3y ago
I've started to do the same for C arrays, leaving the plural as the name for its paired count: User *user = ...; int users = ...; for (int i = 0; i < users; i++) { user[i] = ...; } This also used to
64.
▲
by
mtklein
3y ago
That's right, char in C doesn't necessarily mean an 8-bit byte. There are modern architectures where there is no 8-bit type and CHAR_BIT is 16.
65.
▲
by
mtklein
4y ago
If you're an Apple user, it's built-in, and I've found it ergonomic to assign its toggle to a triple-tap on your phone's back and/or laptop power button. Those triple-taps are effortlessly quick and rarely if ever m
66.
▲
by
mtklein
4y ago
Oh yes! I totally agree with that approach; I find it much clearer to typedef the function type rather than the function pointer type: typedef int (*CallbackPtr)(int,int); void foo(..., CallbackPtr callback); always reads less
67.
▲
by
mtklein
4y ago
Usually I use a do-while loop, unsigned char x = 0; do { printf("%d\n", x); } while (++x);
68.
▲
by
mtklein
4y ago
It's worth noting that this does also work on signed types, so it can be a kind of handy idiom to see while (N --> 0) { ... } and know it will execute N times no matter the details of the type of N.
69.
▲
by
mtklein
4y ago
I have found this pretty handy for declaring a bunch of functions of all the same type, e.g. steps in a direct-threaded interpreter. typedef void Step(whatever...); Step add,sub,mul,div, load,store, etc...;
70.
▲
by
mtklein
4y ago
If you're used to ASAN, think of Valgrind like ASAN, TSAN, MSAN, and UBSAN all at once at the same time, and then has other facilities like profiling. In any situation where I have control of how the code is built, I personally prefer
71.
▲
by
mtklein
4y ago
Not saying it's worked out perfectly, but the US Declaration of Independence must count among those crusty old documents, and its preamble explicitly declares that throwing off such a government is the right and duty of the governed (a
72.
▲
by
mtklein
4y ago
Like a Surface Duo?
73.
▲
by
mtklein
4y ago
I think you maybe meant to say “integer”?
74.
▲
by
mtklein
4y ago
I would of course be happy to do something like this. Safety first, absolutely. Also, um, can we maybe be cool here folks? This is just two people meeting for the first time in a funny way. I understand what you might read into this, but
75.
▲
by
mtklein
4y ago
Hey! I'm a guy, single, 37, also living in Austin, and I have no idea what I'm doing with my own love life. I read a lot of my own feelings in what you write. If you'd like to meet someone with no weirdo agenda (or at leas
76.
▲
by
mtklein
4y ago
Oh that’s amazing! OKLab looks really good to me!
77.
▲
by
mtklein
4y ago
Oh sorry, yeah ugly is a really subjective term, I should have explained. The 0.5 sRGB grey (aka 50%, 0x7f or 0x80) is right smack at the grey value most people would pick as the halfway point between black and white. A linear 0.5 grey is w
78.
▲
by
mtklein
4y ago
Having worked on this in Skia (and so Chrome, Android) for a good while, I can vouch this is an issue browser/phone developers would have liked to fix a long time ago, but have kept by default for compatibility with old expectations.
79.
▲
by
mtklein
5y ago
I’m with you generally, but having written some code targeting these instructions from a disinterested third-party perspective, there are big enough differences in some instructions in performance or even behavior that can sincerely drive y
80.
▲
by
mtklein
6y ago
I'm not sure that that's true. Some of the tricky cases for the halting problem boil down to the spiritual equivalent of trying to determine whether "this sentence is false" is true or false. It's not; it's n
81.
▲
by
mtklein
6y ago
Yep! That general version of the halting problem is Rice's Theorem, and that's exactly the thinking that proves it, by showing that if we did have an algorithm to determine any given non-trivial property of a program, we'd b
82.
▲
by
mtklein
6y ago
This reminds me of Unladen Swallow: https://www.python.org/dev/peps/pep-3146/ (So not holding my breath.)
83.
▲
by
mtklein
6y ago
You're both right... the 32-bit ARM encoding gives every instruction a 4-bit condition field, but the 16-bit Thumb and mostly-16-bit Thumb2 encodings use the IT instruction to carry the conditions for the next few instructions.
84.
▲
by
mtklein
6y ago
Having looked at Skia against a lot of different OS/GPU/driver combinations, I would be surprised to see bit identical results from GPU rendering except perhaps across different nvidia cards. I wouldn't even necessarily expe
85.
▲
by
mtklein
6y ago
I once ran into the same sort of issue with this very chip, in that the little A55 cores supported half-float compute, while the big Mongoose cores didn't. Seriously a pain.
86.
▲
by
mtklein
6y ago
Red, green, and blue have been scaled by .2126, .7152, and .0722, which add up to 1.0 exactly (even in single-precision float), and if those values really were all in [0,255] range, the maximum value that could be produced by this math is o
87.
▲
by
mtklein
6y ago
Yep, I think that's exactly what happened, an uncaught java.lang.ArrayIndexOutOfBoundsException crashed the rather important com.android.systemui process.
88.
▲
by
mtklein
6y ago
I wrote a lot of the Skia color management code involved here, and I think maybe I can clear some things up? I'd be happy to answer any questions you might have, either here or on https://bugs.chromium.org/p/skia&
89.
▲
by
mtklein
10y ago
The correct answer is 1,065,353,216. This is easy to work out yourself if you remember one basic, handy property of floats: adjacent floats are adjacent in bit representation, except -0.0f and 0.0f. For example, 0x00000000 is +0.0f. 0x0000
90.
▲
by
mtklein
11y ago
(Just FYI, this only works with SSSE3+, which to be fair is essentially all x86 machines. It's also >1 cycle on mobile x86 chips, which is very frustrating.)
More ›