HNHacker News
TopNewBestAskShowJobs

tbodt

2,466 karma · joined August 27, 2016

[ my public key: https://keybase.io/tbodt; my proof: https://keybase.io/tbodt/sigs/EuGrfEEYEUHCCbfDXiIK72jl1nAaZBbmx5VARJTazl0 ]

https://tbodt.com hnchat.com:C8Lt0S6VoYSJX6n5htYy

submissionscomments
tbodt··on Apple's investment into Clangd and refactoring tooling
No.
tbodt··on Fake Barack Obama delivers a PSA about “deep fakes” using a deep fake video
Can we get the link changed to the non-amp version? https://www.theverge.com/tldr/2018/4/17/17247334/ai-fake-new...
tbodt··on Cambridge Analytica’s Virtual Currency Plans
No.
tbodt··on Xit: Another Git Client for MacOS
It's open source and mac native, both things I care about but you might not care about.
tbodt··on Pip 10 has been released
The reason it links you to 2.6.6 instead of 2.6.9 is because 2.6.6 is the newest version that has binaries available for download. You have to compile the newer versions from source if you want to use them.
tbodt··on Why SQLite Does Not Use Git

  git tag --contains <commit>
or

  git branch --contains <commit>
tbodt··on Apple Plans to Use Its Own Chips in Macs from 2020, Replacing Intel
I've been using homebrew for years and have never heard of this. Maybe the reason there's only 285 patrons is that the patreon page has not been promoted in any way that I can remember?
tbodt··on The joy of max()
It relies on sizeof(void) and sizeof(int) being different, and also on sizeof(void) being legal (it's only legal in the gcc dialect).
tbodt··on The joy of max()
The type of == is always int, so the sizeof is sizeof(int), and the !! makes the result always be 1 (true). The entire purpose of the macro is to have the compiler warn if the types are incompatible.
tbodt··on The joy of max()
No, I wrote it myself. I figured out how it worked from reading the C standard.
tbodt··on The joy of max()
> In fact, in Linux we did try C++ once already, back in 1992.

> It sucks. Trust me - writing kernel code in C++ is a BLOODY STUPID IDEA.

https://lkml.org/lkml/2004/1/20/20

tbodt··on The joy of max()
Ah, that's because cmp_once doesn't yield a constant even when the inputs are constant. The reason that matters is there are some arrays in the kernel declared like

  int things[max(size1, size2)];
and there's been recently a push to remove all VLAs (arrays with non constant size) from the kernel. The -Wvla flag was warning about these arrays even though they're actually constant size, so something needed to be done.
tbodt··on The joy of max()
If foo and bar are functions,

  foo() > bar() ? foo() : bar()
can have a different result than

  int __x = foo();
  int __y = bar();
  __x > __y ? __x : __y
tbodt··on The joy of max()
The most insane macro in that is this monstrosity:

  #define __is_constant(x) \
      (sizeof(int) == sizeof(*(1 ? ((void*)((long)(x) * 0l)) : (int*)1)))
If x is a compile-time constant, (void* )((long)(x) * 0l) is equivalent to NULL, otherwise it's just a regular void* . And if both sides of a ternary are pointers, the rule is:

If one side is NULL, the type of the ternary should be the type of the other side (int* in this case).

Otherwise, if one side is a void* , the type of the ternary should be void* .

So if x is constant, the type of the ternary is int* , and if it's not constant the type is void* . The sizeof(* ()) around it turns that into sizeof(int) or sizeof(void), and in the GNU dialect sizeof(void) is 1, which is different from sizeof(int). Whew.

What I want to know is what's wrong with __builtin_constant_p.

tbodt··on Facebook tracks your private calls
I have my browser set to only accept first party cookies, does this help?
tbodt··on Show HN: Minimal native MP3 player for Mac
Fun fact: if you press and hold the spotlight icon in the menu bar, the spotlight window is reset to its default position.
tbodt··on WebAssembly architecture for Go
If you tried to look at the document and found that the entire internet has been screwing with the formatting, change "Suggesting" to "Viewing" in the top right. Seems like someone forgot to check permissions on the document.
tbodt··on LCUI – A small C library for building user interfaces with XML and CSS
https://github.com/lc-soft/LCUI/issues/127
tbodt··on LCUI – A small C library for building user interfaces with XML and CSS
Interesting that most of their showcase apps are antivirus apps.
tbodt··on Boring Flamethrower
...he wasn't joking.
tbodt··on Show HN: RetroClip – Instant Replay for Your Mac
Just fired up OBS and it turns out it was defaulting to software encoding, and I switched it to hardware encoding and it's now quite a bit smoother.

Do you have your streamer program posted on GitHub or something? I want it.

tbodt··on Show HN: RetroClip – Instant Replay for Your Mac
How much of a speed boost did compositing the mouse cursor yourself get you? If it's big, I'd be really interested in hacking OBS to do this, so I can stream and use my computer at the same time.
tbodt··on Intel Issues Updates to Protect Systems from Security Exploits
Yes. Spectre2 can be and is being patched with a microcode update that partially disables branch prediction.
tbodt··on A Python internals adventure (2014)
The convention with the Python C API is to return a non-NULL pointer to a python object on success, and return NULL and set the exception global variable on error. Yes, global variables are also alive and well.

    PyObject *fout = _PySys_GetObjectId(&PyId_stdout);
    stdout_encoding = _PyObject_GetAttrId(fout, &PyId_encoding);
The python equivalent of this is `sys.stdout.encoding`. The StringIO object was constructed without an encoding, so this is None.

    stdout_encoding_str = PyUnicode_AsUTF8(stdout_encoding);
This tries to convert None to a C string, which fails.
tbodt··on Show HN: One year devoted to open source and I've almost made $2 – horrraaaaay
no
tbodt··on Show HN: Termipal – native micro-GUIs for shell scripts and command line apps
This is written by the same guy who wrote Electrino, which was supposed to be a lightweight Electron replacement but never really caught on. So I'm not surprised that this has a lot of code from Electrino in the core. This is a great way to use the idea of Electrino for something that doesn't require many years of work to become useful.
tbodt··on The sequence 1 1 ∞ 5 6 3 3 3
This is the first time I've seen IPFS-hosted content on HN for a reason other than that it is IPFS-hosted.
tbodt··on Code together in real time with Teletype for Atom
I just want this in vim.
tbodt··on Simplicity: A New Language for Blockchains [pdf]
Which is what makes it better.
tbodt··on HTTP 103 – An HTTP Status Code for Indicating Hints
Sounds a lot like HTTP/2 push.
← PreviousPage 7 of 9Next →