Live data from Hacker News

Viewing profile — david2ndaccount

david2ndaccount

HN member
Joined
Fri, Feb 28, 2020, 3:02 AM UTC
HN karma
1,145
Public activity
274 items

About david2ndaccount

blog: https://www.davidpriver.com

Recent public activity

  1. comment
    Comment #48275621

    Use the new standards-conformant preprocessor with `/Zc:preprocessor` https://learn.microsoft.com/en-us/cpp/build/reference/zc-pre...

  2. comment
    Comment #47596503

    Pascal strings might be the only string design worse than C strings. C Strings at least let you take a zero copy substring of the tail. Pascal strings require a copy for any substr…

  3. comment
    Comment #46941835

    The world won’t allow a dependence on a single geopolitically threatened entity in the long run, so either they defuse that risk themselves or risk a competitor filling that role. …

  4. comment
    Comment #46394632

    If you want to remain portable, write your code in the intersection of the big 3 - GCC, Clang and MSVC - and you’ll be good enough. Other implementations will either be weird enoug…

  5. comment
    Comment #46394608

    You can apply `#` to __VA_ARGS__, which won’t preserve the exact whitespace, but for many languages it’s good enough. biggest issue is you can’t have `#` in the text.

  6. comment
    Comment #45937922

    I wrote a similar article in the past: https://www.davidpriver.com/ctemplates.html I use this technique in my hobby projects as it has worked out the best for me of the options I’v…

  7. comment
    Comment #45831248

    Works with MSVC if you add /Zc:preprocessor (to get a standard compliant preprocessor instead of the legacy one).

  8. story
  9. comment
    Comment #44736118

    The author relies on the compiler fitting the bitfield in unused padding bytes after “speed”, but that is implementation-defined behavior (almost everything about bitfields is impl…

  10. comment
    Comment #44735993

    C23 has _Float16

  11. comment
    Comment #44594108

    Summer reading programs are a band-aid on the problem that children shouldn’t have such a long summer break now that air conditioning is common. Spread the breaks out throughout th…

  12. comment
    Comment #44515655

    > We immediately began disclosure of this issue once we realized the potential impact. Unfortunately, no disclosure contacts were publicly available and we had to resort to emailin…

  13. comment
    Comment #44428640

    The “typeof on old compilers” section contains the code: (list)->payload = (item); /* just for type checking */\ That is not a no-op. That is overwriting the list head with your (i…

  14. story
  15. comment
    Comment #43989858

    In D, you can just do a static foreach over a sequence to generate case labels: https://d.godbolt.org/z/PxWEW14K1

  16. comment
    Comment #43917166

    Don’t ignore food addiction, the app turns into a button you can press on your phone and in a bit you’ll have a dopamine hit from the food. You don’t have to get dressed or confron…

  17. comment
    Comment #43895559

    That’s not the point of hello world. It’s not to be as small a valid program as possible. It’s to be a small program that also exercises the needed functionality for using the tool…

  18. comment
    Comment #43874518

    Tabs are a control character and have no business being in a text file. Do you use ascii record separator characters too?

  19. comment
    Comment #43698278

    You’re switching to the build system of a different, pre 1.0 programming language that has frequent breaking changes?

  20. comment
    Comment #43626139

    This does actually look a lot better. Using the inspector to toggle it on and off, “pretty” does look a lot prettier.

  21. comment
    Comment #42653103

    Backslash is a valid path character (you can use / or \ as the path separator on windows) so if the backslash isn’t actually escaping anything it is left as-is.

  22. comment
    Comment #42486247

    let not thy left hand know what thy right hand doeth

  23. comment
    Comment #42362237

    If you’re interested in this, I wrote a blogpost on a simple c hash table without deletion. https://www.davidpriver.com/c-hash-table.html

  24. comment
    Comment #42139912

    Without a non-linear activation function, chaining perceptrons together is equivalent to one large perceptron.

  25. comment
    Comment #42073173

    You can have methods with NamedTuple