Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
amavect
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
7 ms
·
91.
▲
by
amavect
2y ago
I think that you can omit the call to malloc, as realloc(NULL, size) does the same thing as malloc(size), and free(NULL) does nothing. void *sane_realloc(void *ptr, size_t size) { if (size == 0) { free(ptr); return
92.
▲
by
amavect
2y ago
Personal preference, hence nitpicking. It forms a special case of the signed integer algorithm, which feels nice.
93.
▲
by
amavect
2y ago
>unsigned is trivial (just test `a+b < b`) Nitpicking, the test itself should avoid overflowing. Instead, test "a <= UINT_MAX - b" to prove no overflow occurs. For signed integers, we need to prove the following without o
94.
▲
by
amavect
2y ago
I feel like this all motivates for a very expressive type system for integers. Add different types for wraparound, saturation, trapping, and undefined. Probably require theorem proving in the language to provably never overflow for undefine
95.
▲
by
amavect
2y ago
I think that a wire protocol could support that with a query response for supported versions and functions. The decision of dynamic linking removes the overhead of serialization, but removes the option of static linking.
96.
▲
by
amavect
2y ago
I really want to statically link OpenGL and Vulkan for exactly this purpose, but neither use a wire protocol (unlike X11 or Wayland). The whole "loading library" scheme feels like hazing for any beginner graphics programmer on top
97.
▲
by
amavect
2y ago
>plus weirdo stuff like the ability to hand out references to local data in functions that have already returned (which remains valid as long as you don't call the function again, which I think should be possible to enforce via a bo
98.
▲
by
amavect
2y ago
Can you share a few studies, please? I'd like a good theory for the effectiveness of bromelain, first.
99.
▲
by
amavect
2y ago
Yeah, thinking about this a bit more, shouldn't stomach proteases break the protein sources into dipeptides? I found a few comments online arguing that hydrolyzing doesn't matter and may cost more. If that's true, then we sho
100.
▲
by
amavect
2y ago
I just read through the study. I corroborate your summary. > The tryptophan found in hydrolyzed whey binds to a different receptor than normal dietary tryptophan, thereby allowing your body to reuptake it and produce serotonin as usual.
101.
▲
by
amavect
2y ago
I suggest practicing on perfboards, TH and SMT. Chipquik has boards for about $2 each. Compare different solders (SAC305, K100LD, SN100C), temperatures, pad sizes, fluxes, etc.
102.
▲
by
amavect
2y ago
A IEEE754-like arithmetic (transrational arithmetic, or transreal arithmetic) creates new problems due to adding new values. 0*x=0 now requires x≠∞, x≠-∞, and x≠NaN. (x/x)=1 now requires x≠0, x≠∞, x≠-∞, and x≠NaN, so this system doesn&
103.
▲
by
amavect
2y ago
The main issue lies in weakening the field axioms to accommodate any strange new numbers. Instead, defining division by 0 to 0 adds no new numbers, so the field axioms don't change (x/x=1 still requires x≠0). I hope you see the va
104.
▲
by
amavect
2y ago
Because of your comment, I spent some time reading about DSP. https://www.analog.com/en/resources/technical-books/scientis... Chapter 14 demonstrates how digital filters can achieve perfect linear phase accur
105.
▲
by
amavect
2y ago
Saying 1/0=∞ means creating a new number system with ∞ as a number. Now you have to figure out all operations with ∞, like -1*∞, 0*∞, ∞*∞, ∞/∞, or ∞-∞. Making wrong definitions creates contradictions. With 1*x=x, ∞/∞=1, the a
106.
▲
by
amavect
2y ago
I'd like to answer your questions. While no finite audio clip qualifies as bandlimited, the Nyquist theorem cheats by assuming that the audio clip repeats indefinitely. Doing so results in sharp frequency lines, separated by gaps of ze