Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
charleslmunger
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
6 ms
·
31.
▲
by
charleslmunger
8mo ago
The default Gboard keyboard has settings for always showing the number row, or only showing it when entering a password. There is also a setting for the "suggestion strip" under "corrections & suggestions". You can a
32.
▲
by
charleslmunger
8mo ago
Not OP, but used Arch for a while in 2011, and at some point doing an update moved /bin to /usr/bin or something like that and gave me an unbootable system. This was massive inconvenience and it took me many hours to un-hose
33.
▲
by
charleslmunger
8mo ago
You have a list of IDs, and want to make them compact for storage or transport - fast and simple way is to sort and delta encode.
34.
▲
by
charleslmunger
8mo ago
C99, but with a million macros backporting features from newer language versions and compiler extensions. Lovely features you don't get with ordinary c99: free_sized #embed static_assert Types for enum Alignof, alignas, aligned_alloc _
35.
▲
by
charleslmunger
9mo ago
What hardware are you running on where the cost of a relaxed 64 bit load and a branch is significant compared to a (possibly contended) cas? You could always use ldset on arm for this.
36.
▲
by
charleslmunger
9mo ago
Yup this works but there's as of yet no HBR13.5 or better input so you're not getting full hdmi 2.1 equivalent. But if you don't care about 24 bits per pixel DSC then you can have an otherwise flawless 4k120hz experience. ht
37.
▲
by
charleslmunger
10mo ago
It's so weird to see the leading heroin story phrased like a hypothetical, when: 1. Heroin itself was marketed as a "non-addictive morphine substitute", and sold to the public. It didn't become a controlled substance unt
38.
▲
by
charleslmunger
10mo ago
That depends on your workload. If you're making a game that's expected to use near 100% of system resources, or a real time service pinned to specific cores, your local application is the overall system.
39.
▲
by
charleslmunger
10mo ago
>Critical section under 100ns, low contention (2-4 threads): Spinlock. You’ll waste less time spinning than you would on a context switch. If your sections are that short then you can use a hybrid mutex and never actually park. Unless yo
40.
▲
by
charleslmunger
10mo ago
>The compiled compressed binary for an APK This doesn't undermine your argument at all, but we should not be compressing native libs in APKs. https://developer.android.com/guide/topics/manifest/applica
41.
▲
by
charleslmunger
11mo ago
>Not at all? Most memory-safety issues will never even show up in the radar Citation needed? There's all sorts of problems that don't "show up" but are bad. Obvious historical examples would be heartbleed and cloudble
42.
▲
by
charleslmunger
11mo ago
Unfortunately the standard library mutex is designed in such a way that condition variables can't use requeue, and so require unnecessary wakeups. I believe parking lot doesn't have this problem.
43.
▲
by
charleslmunger
11mo ago
You can influence the choice of conditional moves (usually inserting them) with __builtin_expect_with_probability(..., 0.5) https://github.com/protocolbuffers/protobuf/commit/9f29f02a3...
44.
▲
by
charleslmunger
1y ago
Jetbtains IDEs let you configure this - my favorite use is to highlight kotlin extension functions differently than normal functions. This kind of highlighting as a secondary information channel for compiler feedback is great. Color, weight
45.
▲
by
charleslmunger
1y ago
If you're working on something where the cost of bugs is high and they're tricky to detect, LLM generated code may not be a winning strategy if you're already a skilled programmer. However, LLMs are great for code review in t
46.
▲
by
charleslmunger
1y ago
Surprised not to see the foreign functions and memory apis on this list, or varhandle. Try-with-resources was a 10/10 feature for sure though.
47.
▲
by
charleslmunger
1y ago
Mobile apps store SQLite dbs in their private data directory that only they can access. In order to exploit a vulnerability you'd have to first break the sandbox. Desktop OSes generally have far weaker protections than that, if you hav
48.
▲
by
charleslmunger
1y ago
That's true, but most usage of sqlite is not as an application file format, and many of those CVEs don't apply even to that use case. The reason people have policies around CVE scanning is because CVEs often represent real vulnera
49.
▲
by
charleslmunger
1y ago
Very cool. Hardware asan did not catch the pointer provenance bug in the previous implementation of that code because it relies on tag bits, and the produced pointer was bit-identical to the intended one. It sounds like fil-c would have cau
50.
▲
by
charleslmunger
1y ago
Out of curiosity, does this idiom work in fil-c? https://github.com/protocolbuffers/protobuf/blob/cb873c8987d... // This somewhat silly looking add-and-subtract behavior provides provenance
51.
▲
by
charleslmunger
1y ago
>and they seem to get annoyed that people run fuzzers against SQLite, even though application file formats should definitely be fuzzed. I think that's an unfair reading. Sqlite runs fuzzers itself and quickly addresses bugs found by
52.
▲
by
charleslmunger
1y ago
This is really cool! I noticed >The fast path of a pollcheck is just a load-and-branch. A neat technique I've seen used to avoid these branches is documented at https://android-developers.googleblog.com/2023/11&
53.
▲
by
charleslmunger
1y ago
>If you switch to WAL mode, the default behavior is that transactions are durable across application crashes (or SIGKILL or similar) but are not necessarily durable across OS crashes or power failures. Transactions are atomic across OS c
54.
▲
by
charleslmunger
1y ago
>EXTRA synchronous is like FULL with the addition that the directory containing a rollback journal is synced after that journal is unlinked to commit a transaction in DELETE mode. EXTRA provides additional durability if the commit is fol
55.
▲
by
charleslmunger
1y ago
The default is FULL https://sqlite.org/compile.html#default_synchronous >SQLITE_DEFAULT_SYNCHRONOUS=<0-3> This macro determines the default value of the PRAGMA synchronous setting. If not overridden at compile-time
56.
▲
by
charleslmunger
1y ago
I too interpretat those docs as contradictory, and I wonder if, like how Java 5 strengthened volatile semantics, this happened at some point in C# too and the docs weren't updated? Either way the specification, which the docs say is de
57.
▲
by
charleslmunger
1y ago
>A volatile write operation prevents earlier memory operations on the thread from being reordered to occur after the volatile write. A volatile read operation prevents later memory operations on the thread from being reordered to occur b
58.
▲
by
charleslmunger
1y ago
Avoiding false sharing is a separate problem best solved by explicitly aligning the struct or relevant members to std::hardware_destructive_interference_size.
59.
▲
by
charleslmunger
1y ago
I tried implementing an optimized varint encoder that did something similar, by populating an 8 byte value and then storing it to ram, but unaligned overlapping stores caused big regressions. The approach that worked required a different te
60.
▲
by
charleslmunger
1y ago
A connection pool is absolutely a best practice. One of the biggest benefits is managing a cache of prepared statements, the page cache, etc. Maybe you have temp tables or temp triggers too. Even better is to have separate pools for the wri
More ›