HNHacker News
TopNewBestAskShowJobs

pierrebai

1,310 karma · joined October 13, 2011

submissionscomments
pierrebai··on The social obligation to be bad at things
That's one way of looking at growth.

Another is to learn from the mistakes; this sometimes requires others to point them out. A lot of the issues around it comes down to ego and how one takes criticisms. One needs to learn not to take it too personal. A lot of times, the weak points of one's work is often the bit we're lazy. Of course, many times we already know very well where we're weak, and getting it pointed out repeatedly can sting.

And to make it back to the obligation to be bad, it comes down to recognizing you can always get better. In fact, the more I learn about a subject, the more I see how little I know.

pierrebai··on Pharaoh Ramesses VI Tomb
Was impressed, until I got to the very end, were you see multiple depictions of people being beheaded. (With blood fountains from their neck.) You then remember that pharaohs were not gentle people.
pierrebai··on How Google Meet's noise cancellation works
As far as my experience goes, the single best way to deal with background noise is... the mute button.

In every video conf I've been, you can instantly tell when "one of them" who can't be bothered to mute themselves joins. The audio quality immediately goes down the drain. It's always the same subset of people who do it, too. As soon as they're enjoined to please mute, the audio quality is restored.

No amount of magic signal processing will ever match it.

While perhaps misguided to use it that way, the mute button thus act as a social-clueness meter.

pierrebai··on Rust: Dropping heavy things in another thread can make your code 10000x faster
I've seen variations on this trick multiple times. Using threads, using a message sent to self, using a list and a timer to do the work "later", using a list and waiting for idle time...

They all have one thing in common: pampering over a bad design.

In the particular example given, the sub-vector probably come from a common source. One could keep a big buffer (a single allocation) and an array of internal pointers. For example of such a design to hold a large array of text strings, see for example this blog entry and its associated github repo:

    https://www.spiria.com/en/blog/desktop-software/optimizing-shared-data/
    https://github.com/pierrebai/FastTextContainer
Roughly it is this:

    struct TextHolder
    {
        const char* common_buffer;
        std::vector<const char*> internal_pointers;
    };

This is of course addressing the example, but the underlying message is generally applicable: change your flawed design, don't hide your flaws.
pierrebai··on Black hole paradoxes reveal a fundamental link between energy and order
As a true amateur,I don't understand the basic premise of this extremal black hole mystery.

In my simple view, if a charged black whole is extremal and cannot shrink then... the solution simply is that it must grow again. It absorbs particles of the opposite charge until it becomes neutral enough to shrink again and the process repeat until it completely evaporate.

That seems both a simple and straightforward theory.

(Then my other misunderstanding is how a black whole would become so charged when the universe is seemingly so neutral. The law of big number ensures that a black hole would be mostly neutral and the extremal case would only happen for very small ones on the brink of evaporation.)

pierrebai··on Plywood: A New Cross-Platform Open Source C++ Framework
And somewhat unfortunately, C++ has plan for a kind of reflection in the future [1]. But it's not here today. I'm wary of relying on a parser though: it could prove a real drag as C++ evolve and you need to keep the parser up to date.

[1] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p059...

pierrebai··on Language Design: Use 'ident: Type' not 'Type ident'
This has nothing to do with order and everything to do with the chosen grammar of C and C++.

You can have an ambiguous grammar in a language that puts the type after. A * B could be ambiguous even if A is the identifier name and B the type.

All arguments in the "Language Design" notes are of the same nature.

pierrebai··on Psychological effects of coding style (2016)
Worse: its psychological claims are entirely made up and only serve to artificially support his chosen style. It's the worse kind of argument: using made up science that is thus impossible to counter.
pierrebai··on Psychological effects of coding style (2016)
And so are every upper-case letter. And if you want, you can modify your keyboard layout to swap the - and _ and no longer have to reach for the shift key at all.

(I'll just laugh at the argument that underscores causes problem with line width limitations.)

I prefer the underscore style as I find the names more legible, it's easier to see where each particle starts and ends. It's particularly evident when using acronyms: read_JPEG_image is much more legible than ReadJPEGImage. Many style guide resort to lower-casing acronym due to that: ReadJpegImage.

pierrebai··on How much power can we expect from rainfall?
Wrong. One can harvest power from raindrop. It's called an hydro-dam. Seems to be working pretty well from what I know.
pierrebai··on Monorepoize – Bash scripts for creating a monorepo out of smaller repos
git submodules tracks the version of the sub repos.

So if you organize that your releases are a master repo with all needed repos as sub-modules, your sub-repo version tracking is already done fr you.

All that while still allowing sub-repo to move forward faster than other repos. With a mono-repo, you can only allow some sub-system to go forward faster than others by making them live permanently in separate branches.

Basically, in monorepo you have to use branches to do what separate repo do normally for free.

(Then there is the issue that with a monorepo, any screw up screws everybody. You're all on the same boat, all the time.)

pierrebai··on Monorepoize – Bash scripts for creating a monorepo out of smaller repos
git has submodules.

A repo can thus host any number of sub-repos. Using modules can also be pretty much like having a monorepo if you have a master repo with all others under it. This way, you can still publish things like public API as a repo.

pierrebai··on Harvard professor rides 170x return in Moderna stock to become a billionaire
Biotech is hot in general and as the article says, the ones around Harvard were doing well. So investing 5m in one is not crazy. I'm sure he merely expected single or double digits return.

He got lucky to be an investor in one that hit it big. Stories are also about spectacular winners or losers. There are no story on all the investor that got normal returns last year.

pierrebai··on 500K bet on rock paper scissors ruled invalid by Quebec court
RPS in the strictest sense is a totally balanced game which cannot have a winning strategy if played completely logically.

Yet, all the RPS algorithm starts from the same premise.

The counter-intuitive reason why there can be winning strategy to RPS is that people try to devise winning strategies. Once you deviate from purely randomly choosing RPS, your adversary can try to analyze your past moves to create a model of your strategy and used that model to defeat you.

As for us poor humans, we're really bad at choosing randomly, so the best RPS players are very good at picking up what type of players you are.

PS: and in any population of players in a tournament, the mere presence of a few that want to have a non-random strategy will win over those without strategy. The strategy-less will just have a random streak of wins and losses no matter who they are facing. Of those with a strategy, the one with the best analysis of their opponent will win.

pierrebai··on Background Matting: The World is Your Green Screen
Ex-VFX part-time software team member here.

I can assure you they read these papers. If it is good, it will be part of a future version of the software.

pierrebai··on Bored? How about trying a Linux speed run?
Bus factor is irrelevant.

It's a concept that basically boils down to "people would not be smart enough to understand the code unaided". This is plainly wrong. I speak from experience of diving into some horrible code base.

It also assumes that reproducing the functionality from scratch would be hard. Looking at all the reimplementations of A where A is one of unix, X, web browser, network stack, SQL database and other complex techno, it is also clearly not true.

pierrebai··on Yak Shaving – Swift Edition

   > Yet, this prevents a bug where the base constructor can
   > call a virtual method that you override, and might not
   > be ready to handle. So eventually I just learned to
   > embrace and love this capability.
But this merely means that sub-classes cannot call functions (virtual or not) of their base class, since the base class is not yet initialized. It's not clear it is a net benefit. I have called base-class non-virtual functions a few times in the past, so this is not purely theoretical.

The correct solution would be for a language to have two-phase initialization. In the first phase you cannot call virtual functions, it would be a compile-time error. In the second phase, you can, as everything has been initialized already.

(You can have a poor-man version of this with static create() or make() functions and private constructors in C++ and similar languages.)

pierrebai··on Zig cc: A drop-in replacement for GCC/Clang
In the Zig main page, there is a claim that making overflow undefined on unsigned can allow more optimization... but the example given is extremely dependent on the constant chosen. Try to change the 3/6 used in C++ to 2/4, 3/8 and 4/8 for example... It is very strange how the clang code generation changes for each pair of constants!

(Also, having undefined behaviour on unsigned overflow can make some bit twiddling code harder to write. Then again, maybe Zig has a bit-twiddling unsigned-like type without overflow check? Zip allow turning off checks, but then it turns off checks for everything...)

pierrebai··on Rational Math Catches Slippery Irrational Numbers
There must be a subtlety I don't understand. To cover the number line at precision of at least 10^n, just cover it with intervals of 1/10^n, surely?

IOW, to approximate an irrational number to 10 decimal places... use 10 decimal places? Geen, use 11 decimal places just to be double-sure and not have to worry.

What am I missing?

pierrebai··on Defunctionalisation: An underappreciated tool for writing good software
You're focusing on my not knowing the syntax and specific of the languages. It's still just giving names to things that did not have a name. Whether the name is a variable name, a function name, a type name, doesn't matter.

It's still a fancy, obscure jargonish way of saying "name things".

pierrebai··on Defunctionalisation: An underappreciated tool for writing good software
So.... this is just a fancy name for the advice "give your functions a name"?

The example he gave is just replacing an anonynous lambda for addition with a named function call Add?

Maybe I'm too critical, but this is a thing I see in many fields:

1. Take a simple well-known idea and give it a new obscure name. 2. Write blogs, give lectures, organize summit and conventions. 3. Profit!

pierrebai··on Ampere Altra 80-core ARM CPU
No, the correct thing to do is to publish multiple columns showing performance under the different compilers. Large co do use the specific compiler that will give them better performance. I know many big software compiled with ICC. Then, there is the lack of tlak about MSVC. That's one standard compiler used extensively.

In benchmarking you have two choices: publish the real numbers or not. Which option you choose marks you as honest or not.

You can argue about why the numbers for your product are lower in the discussion section of your report. Not in an asterisk.

pierrebai··on Threads Are a Bad Idea for Most Purposes (1995) [pdf]
That may be true in some language, but it is not generally true. The awaited task can run in parallel and both are only re-sync when you use the result. Thus anything can also be mutated in parallel with await/async style of programming.
pierrebai··on Pygame Zero: Creating games without boilerplate
In the example code for pygame you give, what happens if there is a single typo? It doesn't work either and you probably get an incomprehensible stack trace.

There is no benefit to teh extra code because that extra code is magic gibberish. It's an incantation that somehow makes things work.

pierrebai··on The Cruise Origin
Read the blog entry on disengagement. This is exactly it: there are remote operator that can disengage the AI and take over in some situation for caution.
pierrebai··on Flight stats, entertainment, and trying to crack Widevine
I'm going to profoundly disagree with you here.

These are not open-standards. These are not self-documenting, csv, receiver-has-to-guess formats. These are two on-board non critical systems talking to each other. The main requirement is that the format be specified.

A desirable trait is that the format be easy to implement. Sorry, ISO 8601, you're too complicated for the task. Integrating a library to handle it is already too hard, too risky and over-engineering. You'd have to either trust it to be bug-free or heavily test it.

KISS, remember?

pierrebai··on How Complex Modern Headlights Can Be
How blinding modern headlights can be.

My neighbour onthe other side of the street regularly blinds us in teh kitchen when parking in his driveway. It doesn't help that white or blue is the new default color for new headlights.

pierrebai··on Is It a ‘5’ or a ‘6’? The Answer Could Make an Art Fortune
That's how it works and is why people buy reproductions. There is a huge market of reproduction. Every museum sells them in their shop.

For the original art, the main drive is its monetary value. Many piece of arts by famous artists are locked up in vaults. Not even locked up in expensive houses of the ultra rich for them to admire. In locked obscure vaults, gaining value until resold.

pierrebai··on Interstellar space even weirder than expected, NASA probe reveals
Wouldn't it be possible if we launched from the moon instead? Most of the trust of rocket is loss to get out of the earth gravity well.

(Not that we're anywhere near having a rocket factory on the moon... but maybe one could be assembled and fueled in orbit?)

pierrebai··on Which answer in this list is the correct answer to this question? (2017)
Well, if you're forced to choose one, then you should minimize your error. So the answer is E), and as 19% is part of "None of the above", you would be only 1% off, much closer than any other answer...
← PreviousPage 9 of 15Next →