<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Hacker News: ambrop7</title><link>https://news.ycombinator.com/user?id=ambrop7</link><description>Hacker News RSS</description><docs>https://hnrss.org/</docs><generator>hnrss v2.1.1</generator><lastBuildDate>Mon, 06 Apr 2026 03:14:50 +0000</lastBuildDate><atom:link href="https://hnrss.org/user?id=ambrop7" rel="self" type="application/rss+xml"></atom:link><item><title><![CDATA[New comment by ambrop7 in "Disney unveils the HoloTile floor"]]></title><description><![CDATA[
<p>The issue is not motion, the vestibular system cannot measure velocity, only linear acceleration and rotation. The only issue is while you are accelerating in a horizontal direction in VR, but you are not actually acccelerating (remember acceleration is absolute not relative). But I don't expect this will be much of an issue. We don't have a problem speeding up or slowing down on a treadmill.</p>
]]></description><pubDate>Sun, 28 Jan 2024 09:16:27 +0000</pubDate><link>https://news.ycombinator.com/item?id=39163841</link><dc:creator>ambrop7</dc:creator><comments>https://news.ycombinator.com/item?id=39163841</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=39163841</guid></item><item><title><![CDATA[New comment by ambrop7 in "Firefox 75 on Wayland now to have full WebGL, working VA-API acceleration"]]></title><description><![CDATA[
<p>Do you maybe know, when frames rendered by GPU 1 (e.g. fast GPU) need to be sent to GPU 2 (e.g. slow GPU doing the compositing and outputting to the monitor), how does the data actually get transferred? I can imagine the following possibilities:<p>1) GPU 1 writes to CPU RAM, GPU 2 reads from CPU RAM<p>2) GPU 1 writes to GPU 2 RAM via PCI Express (DMA between devices)<p>3) GPU 2 reads from GPU 1 RAM via PCI Express (DMA between devices)</p>
]]></description><pubDate>Tue, 03 Mar 2020 22:06:07 +0000</pubDate><link>https://news.ycombinator.com/item?id=22479163</link><dc:creator>ambrop7</dc:creator><comments>https://news.ycombinator.com/item?id=22479163</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=22479163</guid></item><item><title><![CDATA[New comment by ambrop7 in "Firefox 75 on Wayland now to have full WebGL, working VA-API acceleration"]]></title><description><![CDATA[
<p>This is quite unclear to me. Is DMA-BUF so generic that the memory it refers to can be in different types of RAM, including GPU RAM and CPU RAM?</p>
]]></description><pubDate>Tue, 03 Mar 2020 18:15:00 +0000</pubDate><link>https://news.ycombinator.com/item?id=22477153</link><dc:creator>ambrop7</dc:creator><comments>https://news.ycombinator.com/item?id=22477153</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=22477153</guid></item><item><title><![CDATA[New comment by ambrop7 in "Firefox 75 on Wayland now to have full WebGL, working VA-API acceleration"]]></title><description><![CDATA[
<p>The mention of DMA-BUF makes me suspect that it involves rendered video being copied from the GPU to the main RAM and back to the GPU, which wastes energy. Does someone have details about how the integration works?</p>
]]></description><pubDate>Tue, 03 Mar 2020 17:21:30 +0000</pubDate><link>https://news.ycombinator.com/item?id=22476536</link><dc:creator>ambrop7</dc:creator><comments>https://news.ycombinator.com/item?id=22476536</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=22476536</guid></item><item><title><![CDATA[New comment by ambrop7 in "Fork() can fail: this is important (2014)"]]></title><description><![CDATA[
<p>In any case, if the program forks in order to exec, it shouldn't be using fork at all, but posix_spawn. Fork gets more expensive as the virtual memory of the process grows, since it needs to copy page tables. For very large process forking can be prohibitively expensive due to this. And posix_spawn does not have this problem.</p>
]]></description><pubDate>Mon, 02 Mar 2020 19:06:25 +0000</pubDate><link>https://news.ycombinator.com/item?id=22467642</link><dc:creator>ambrop7</dc:creator><comments>https://news.ycombinator.com/item?id=22467642</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=22467642</guid></item><item><title><![CDATA[New comment by ambrop7 in "Green Wave"]]></title><description><![CDATA[
<p>Suppose the the period of lights is equal to the time expected to move from one light to the next, and each light is red/green for the same amount of time. You have a green wave if you pass the first light green and drive at the expected speed. But if you drive twice as fast, you reach the second light red instead of green. Now it would work if the period of lights was half the time expected to get from one light to the next, but why would that generally be the case?<p>Actually I think the opposite will usually hold: you will still have a green wave if you drive at the expected speed divided by an integer.</p>
]]></description><pubDate>Tue, 28 Jan 2020 18:47:39 +0000</pubDate><link>https://news.ycombinator.com/item?id=22172698</link><dc:creator>ambrop7</dc:creator><comments>https://news.ycombinator.com/item?id=22172698</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=22172698</guid></item><item><title><![CDATA[New comment by ambrop7 in "My C code works with -O3 but not with -O0"]]></title><description><![CDATA[
<p>Programming languages aren't able to express arbitrary real numbers, so to "determine whether a given real number is representable as an int or not" is mostly meaningless in a programming language as opposed to a computer algebra system.<p>What you can do is:<p>- determine if a float is an integer (trunc(x) == x),<p>- convert a float to a certain integer type with some kind of rounding, or get an error if it's out of range (see my comment with double_to_uint64),<p>- convert a float to a certain integer type exactly, or get an error if it's not representable (e.g. by doing both of the above).<p>The basic reason that so many people fail to use floats correctly is that they act like operations on floats are equivalent to operations on the real numbers they represent, when in fact they are usually defined as the operation on real numbers rounded to a representable value.</p>
]]></description><pubDate>Fri, 17 Jan 2020 00:27:24 +0000</pubDate><link>https://news.ycombinator.com/item?id=22070616</link><dc:creator>ambrop7</dc:creator><comments>https://news.ycombinator.com/item?id=22070616</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=22070616</guid></item><item><title><![CDATA[New comment by ambrop7 in "My C code works with -O3 but not with -O0"]]></title><description><![CDATA[
<p>Each floating point value that is not a NaN represents a certain real number, -inf or +inf (this can be expressed in terms of the sign bit, exponent and mantissa). Knowing that, a == b when neither operand is a NaN is defined as equality of what they represent, in purely mathematical terms. Similar can be said for inequality operators.<p>Be aware that +0.0 and -0.0 are different floating point values but represent the same real number, so +0.0 == -0.0 follows.<p>People who say == means nothing for floating point and you always need epsilon checks are wrong, plain and simple. == is very well defined. Don't confuse the definition of floating point operations with common practices for using them effectively.<p>You can iterate through all non-NaN values and check that successive ones are indeed not equal:<p><pre><code>    #include <math.h>
    #include <stdint.h>
    #include <assert.h>
    #include <stdio.h>
    #include <inttypes.h>

    int main()
    {
        float x = (float)-INFINITY;
        uint64_t count = 1;
        while (x != (float)INFINITY) {
            float y = nextafterf(x, (float)INFINITY);
            assert(y != x);
            x = y;
            ++count;
        }
        printf("Found %" PRIu64 " floats.\n", count);
        return 0;
    }
    
    $ gcc -std=c99 -O3 a.c -lm -o a
    $ ./a
    Found 4278190081 floats.
</code></pre>
(a little bit harder for doubles)<p>Interestingly, this only finds one zero (-0.0), hence the assert doesn't actually fail around zero.</p>
]]></description><pubDate>Thu, 16 Jan 2020 22:19:42 +0000</pubDate><link>https://news.ycombinator.com/item?id=22069630</link><dc:creator>ambrop7</dc:creator><comments>https://news.ycombinator.com/item?id=22069630</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=22069630</guid></item><item><title><![CDATA[New comment by ambrop7 in "Google is finally killing off Chrome apps, which nobody really used"]]></title><description><![CDATA[
<p>One benefit would be to protect yourself from security issues in the main torrent code. Anyway it was just an idea, not a serious proposal.</p>
]]></description><pubDate>Thu, 16 Jan 2020 21:52:06 +0000</pubDate><link>https://news.ycombinator.com/item?id=22069385</link><dc:creator>ambrop7</dc:creator><comments>https://news.ycombinator.com/item?id=22069385</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=22069385</guid></item><item><title><![CDATA[New comment by ambrop7 in "My C code works with -O3 but not with -O0"]]></title><description><![CDATA[
<p>You don't always need epsilon. I've written lots of floating point code that works well without epsilon checks. See my comment in this thread (double_to_uint64) how what the OP needs can be done correctly without an epsilon check.</p>
]]></description><pubDate>Thu, 16 Jan 2020 21:34:00 +0000</pubDate><link>https://news.ycombinator.com/item?id=22069203</link><dc:creator>ambrop7</dc:creator><comments>https://news.ycombinator.com/item?id=22069203</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=22069203</guid></item><item><title><![CDATA[New comment by ambrop7 in "My C code works with -O3 but not with -O0"]]></title><description><![CDATA[
<p>This is not right. The current rounding mode is not guaranteed to apply to integer to floating point conversions. Quoting C99, section 6.3.1.4, paragraph 2:<p>"When a value of integer type is converted to a real floating type, if the value being converted can be represented exactly in the new type, it is unchanged. If the value being converted is in the range of values that can be represented but cannot be represented exactly, the result is either the nearest higher or nearest lower representable value, chosen in an implementation-defined manner. If the value being converted is outside the range of values that can be represented, the behavior is undefined."<p>See it says implementation-defined manner, not according to the current rounding mode.<p>Test case:<p><pre><code>    #pragma STDC FENV_ACCESS ON
    #include <stdio.h>
    #include <stdint.h>
    #include <fenv.h>

    int main()
    {
        fesetround(FE_DOWNWARD);
        printf("%f\n", (double)UINT64_MAX);
        fesetround(FE_UPWARD);
        printf("%f\n", (double)UINT64_MAX);
        return 0;
    }

    $ gcc -std=c99 -frounding-math x.c -lm
    $ ./a.out 
    18446744073709551616.000000
    18446744073709551616.000000
</code></pre>
In both cases it rounded up.</p>
]]></description><pubDate>Thu, 16 Jan 2020 20:04:24 +0000</pubDate><link>https://news.ycombinator.com/item?id=22068307</link><dc:creator>ambrop7</dc:creator><comments>https://news.ycombinator.com/item?id=22068307</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=22068307</guid></item><item><title><![CDATA[New comment by ambrop7 in "My C code works with -O3 but not with -O0"]]></title><description><![CDATA[
<p>Here's a reliable/portable solution:<p><pre><code>    bool double_to_uint64 (double x, uint64_t *out)
    {
        double y = trunc(x);
        if (y >= 0.0 && y < ldexp(1.0, 64)) {
            *out = y;
            return true;
        } else {
            return false;
        }
    }
</code></pre>
If you need different rounding behavior, just change trunc() to round(), floor() or ceil(). Note that it is important that the result is produced by converting the rounded double (y) to an integer type, not the original value (x).<p>Explanation:<p>- we first round the value to an integer (but still a floating point value),<p>- we then check that this integer is in the valid range of the target integer type by comparing it with exact integer values (0 and 2^N),<p>- if the check passes, then converting this integer to the target integer type is safe, and if the check fails, then conversion is not possible.<p>Of course if you literally need to convert to "long" you have a problem because the width of "long" is not known, but that is a rather different concern. I argue types with unknown width like "long" should almost never be used anyway.<p>(based on my answer here: <a href="https://stackoverflow.com/questions/8905246/how-to-check-if-float-can-be-exactly-represented-as-an-integer/17822304#17822304" rel="nofollow">https://stackoverflow.com/questions/8905246/how-to-check-if-...</a>)</p>
]]></description><pubDate>Thu, 16 Jan 2020 19:09:08 +0000</pubDate><link>https://news.ycombinator.com/item?id=22067773</link><dc:creator>ambrop7</dc:creator><comments>https://news.ycombinator.com/item?id=22067773</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=22067773</guid></item><item><title><![CDATA[New comment by ambrop7 in "Google is finally killing off Chrome apps, which nobody really used"]]></title><description><![CDATA[
<p>It could be done with a local TCP / UDP <=> WebSocket gateway, especially if it's written in a safe language like Rust.</p>
]]></description><pubDate>Thu, 16 Jan 2020 18:56:59 +0000</pubDate><link>https://news.ycombinator.com/item?id=22067653</link><dc:creator>ambrop7</dc:creator><comments>https://news.ycombinator.com/item?id=22067653</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=22067653</guid></item><item><title><![CDATA[New comment by ambrop7 in "Switching from Chrome to Firefox"]]></title><description><![CDATA[
<p>See my sibling comment, that should make it much better.</p>
]]></description><pubDate>Mon, 30 Dec 2019 21:12:37 +0000</pubDate><link>https://news.ycombinator.com/item?id=21916762</link><dc:creator>ambrop7</dc:creator><comments>https://news.ycombinator.com/item?id=21916762</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=21916762</guid></item><item><title><![CDATA[New comment by ambrop7 in "Switching from Chrome to Firefox"]]></title><description><![CDATA[
<p>Two more about.config:<p>- gfx.webrender.all = true (important on Linux, fixes jerky scrolling)<p>- general.smoothScroll.mouseWheel.durationMaxMS = 200 (makes mouse scroll animation faster)</p>
]]></description><pubDate>Mon, 30 Dec 2019 21:11:40 +0000</pubDate><link>https://news.ycombinator.com/item?id=21916759</link><dc:creator>ambrop7</dc:creator><comments>https://news.ycombinator.com/item?id=21916759</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=21916759</guid></item><item><title><![CDATA[New comment by ambrop7 in "Ubuntu 19.10: It’s fast"]]></title><description><![CDATA[
<p>Plasma/KDE is mostly great, but a major thing that GNOME and Xfce still do better is GVFS and GVFS-FUSE. That means I can browse to smb://something or sftp://something, double click a file and it just works whatever the application is (e.g. play in VLC, edit in VS Code). This has never worked in KDE where only KDE apps can open remote files (and even that has bad performance).</p>
]]></description><pubDate>Wed, 27 Nov 2019 19:38:47 +0000</pubDate><link>https://news.ycombinator.com/item?id=21651219</link><dc:creator>ambrop7</dc:creator><comments>https://news.ycombinator.com/item?id=21651219</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=21651219</guid></item><item><title><![CDATA[New comment by ambrop7 in "Sand-slithering snakes behave like light waves"]]></title><description><![CDATA[
<p>Or at least the basic double-slit experiment with snakes. WILL the snakes form an interference pattern?</p>
]]></description><pubDate>Sat, 16 Nov 2019 13:50:49 +0000</pubDate><link>https://news.ycombinator.com/item?id=21552611</link><dc:creator>ambrop7</dc:creator><comments>https://news.ycombinator.com/item?id=21552611</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=21552611</guid></item><item><title><![CDATA[New comment by ambrop7 in "Developing open-source FPGA tools"]]></title><description><![CDATA[
<p>Also, more SW programmers should be getting into this field, as by working in SW first you realize all the things that need improvement in the FPGA world (which the FPGA people didn't recognize, not knowing how SW is done in the modern world, or got used to).</p>
]]></description><pubDate>Wed, 13 Nov 2019 18:11:11 +0000</pubDate><link>https://news.ycombinator.com/item?id=21527347</link><dc:creator>ambrop7</dc:creator><comments>https://news.ycombinator.com/item?id=21527347</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=21527347</guid></item><item><title><![CDATA[New comment by ambrop7 in "Build OpenJDK for a Nice Speedup"]]></title><description><![CDATA[
<p>> -march=native and -mtune=broadwell tell the compiler to optimize for your architecture. One would think given the compiler documentation that march implies mtune, but this is apparently not the case.<p>That sounds like a bug to me which should be reported.</p>
]]></description><pubDate>Mon, 04 Nov 2019 21:51:34 +0000</pubDate><link>https://news.ycombinator.com/item?id=21446900</link><dc:creator>ambrop7</dc:creator><comments>https://news.ycombinator.com/item?id=21446900</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=21446900</guid></item><item><title><![CDATA[New comment by ambrop7 in "I tried to adjust the time on my alarm clock"]]></title><description><![CDATA[
<p>I only use my alarm clock in addition to my phone when I must not miss something really important.</p>
]]></description><pubDate>Mon, 04 Nov 2019 20:40:46 +0000</pubDate><link>https://news.ycombinator.com/item?id=21446263</link><dc:creator>ambrop7</dc:creator><comments>https://news.ycombinator.com/item?id=21446263</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=21446263</guid></item></channel></rss>