Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
sltkr
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
28 ms
·
331.
▲
by
sltkr
3y ago
It's not even clear what part you're dismissively replying "Nope!" to. I'll be explicit: on POSIX systems that implement the POSIX threads extension there is a header file called pthread.h that declares a regular fu
332.
▲
by
sltkr
3y ago
Those memory barriers are in the function implementation. They don't exist at the call site. Again, from the perspective of the compiler it's a regular function call. > However setjmp()/longjmp() are different beasts entir
333.
▲
by
sltkr
3y ago
Calls to functions like pthread_mutex_lock() don't magically add memory barriers. From the perspective of the compiler they are regular function calls. They "work" because of escape analysis, but that applies to any function
334.
▲
by
sltkr
3y ago
It's the top link in the XML Sitemap that is linked from robots.txt. This is how Search Engines generally find new content on large sites, rather than by crawling. i.e. https://www.phoronix.com/robots.txt contains:
335.
▲
by
sltkr
3y ago
This still doesn't solve the overflow problem. It's also too limiting: with u8 you can't ask for page-aligned data, and with u16 not for hugepage-aligned data. Granted, those aren't exactly prime use cases for a bump all
336.
▲
by
sltkr
3y ago
It matters because if the allocator cannot allocate a given amount, it should reliably return NULL to iform the caller that the allocation failed, not return a random invalid pointer that's not usable, which will lead to undefined beha
337.
▲
by
sltkr
3y ago
You can also implement BumpUp() with only two conditionals and no overflow like this (in C, because I don't know Rust, but the logic is identical): size_t alignment_needed = align - (ptr & (align - 1)); if (alignment_need
338.
▲
by
sltkr
3y ago
That version is unsafe: what if size == 0xfff..fff and alignment is needed? You will end up with ptr <= new_ptr < end, seemingly a valid result, but actually with not enough space. edit : code moved to a toplevel comment
339.
▲
by
sltkr
3y ago
You can check with `curl -v`. tl;dr: the server doesn't support that header, but since the response does include a Last-Modified header, curl helpfully aborts the transfer if the Last-Modified date is the same as the mtime of the previ
340.
▲
by
sltkr
3y ago
The IPCC is a panel of climate doomers. It exists mainly to promote globalism and secure funding for “scientists” who are willing to sell their soul to the political powerful. “Scientific consensus” has little bearing on truth. In Galileo G
341.
▲
by
sltkr
3y ago
... he said with 0 evidence to back it up.
342.
▲
by
sltkr
3y ago
I find it extremely callous to label a net reduction of people dying of extreme weather as only “questionably positive”.
343.
▲
by
sltkr
3y ago
Five seconds of googling will reveal: > https://www.downtoearth.org.in/news/climate-change/extreme-t... > > The study found that extreme heat and cold killed 5.08 million people on an average every year f
344.
▲
by
sltkr
3y ago
Simple. If the Topics API is disabled, then you are a nerd who spends too much time on sites like Hacker News, and they can show you ads accordingly.
345.
▲
by
sltkr
3y ago
My favorite tool that (ab)uses LD_PRELOAD to do something useful is `stdbuf`: https://linux.die.net/man/1/stdbuf The implementation is completely bonkers. The tool sets some environmental variables, then spawns a
346.
▲
by
sltkr
3y ago
Here's a Brainfuck implementation: ++++++++++[->++++++++++++>+<<]>+[.>.<] (Unfortunately, Brainfuck doesn't support command line flags.)
347.
▲
by
sltkr
3y ago
See also: https://en.wikipedia.org/wiki/User:Guy_Macon/Wikipedia_has_C... tl;dr: Wikipedia's expenses grow exponentially year-over-year and it's not clear where the extra money is going, since the basic
348.
▲
by
sltkr
3y ago
The article did a really poor job of explaining the logic. > It's strange to me that there are 5-6 options for each exchange, instead of a canonical name. The point isn't to assign them canonical names, but to define a mapping
349.
▲
by
sltkr
3y ago
tl;dr: partial indexes.
350.
▲
by
sltkr
3y ago
Why do we put spaces after punctuation in English?It's completely redundant.actually,why even put a capital letter at the beginning of a sentence?it can obviously be inferred. OK, I'll stop now, but the point is: matching braces p
351.
▲
by
sltkr
3y ago
It's explained here: https://sqlite.org/getthecode.html#verifying_that_the_code_i...
352.
▲
by
sltkr
3y ago
This is literally addressed in the article: More branchless, more better? Short answer: no. This section can be skipped but here’s the long answer: For n elements where 2k <= n < 2k+1 sb_lower_bound will always do k+1 compar
353.
▲
by
sltkr
3y ago
As far as I can tell it does return the earliest match. Why do you think it doesn't?
354.
▲
by
sltkr
3y ago
I would enjoy these posts more if they actually documented how the game implementation works, rather than just dumping an assembly file for the reader to figure out. Also, I don't find “fits into a QR code” all that impressive. QR code
355.
▲
by
sltkr
3y ago
Instead of: sed -n "/$label:/{:a;n;p;ba};" I think it's more idiomatic to do: sed -n "/$label:/,$ p" Or even: sed "0,/$label:/,$ d" Which deletes the l
356.
▲
by
sltkr
3y ago
The compiler is able to warn you about this: <source>:8:18: warning: comparison is always false due to limited range of data type [-Wtype-limits] 8 | if (*ptr == EOF) { Of course this warning only happens when you
357.
▲
by
sltkr
3y ago
Since you're being pedantic my reply is going to be equally pedantic: no, this is not correct if you understand the difference between numerals and numbers . A numeral is a written way of denoting a number . So while the string &
358.
▲
by
sltkr
3y ago
Feminism is closer to the middle of the Overton window, which is not the same as being more in touch with reality.
359.
▲
by
sltkr
3y ago
You are missing the point: saying that some preferences are problematic while others are not by itself creates an unfair double standard, even if you pay lip-service to the idea of individual right to consent. When a man rejects a woman b
360.
▲
by
sltkr
3y ago
How much faster is this: int run_switches(const char *buf) { size_t len = strlen(buf); int res = 0; for (size_t i = 0; i < len; ++i) { res += (buf[i] == 's') - (buf[i] == 'p');
More ›