HNHacker News
TopNewBestAskShowJobs

pierrebai

1,310 karma · joined October 13, 2011

submissionscomments
pierrebai··on How UTF-8 Works
I never understood why ITF-8 did not use the much simpler encoding of:

    - 0xxxxxxx -> 7 bits, ASCII compatible (same as UTF-8)
    - 10xxxxxx -> 6 bits, more bits to come
    - 11xxxxxx -> final 6 bits.
It has multiple benefits:

    - It encodes more bits per octet: 7, 12, 18, 24 vs 7, 11, 16, 21 for UTF-8
    - It is easily extensible for more bits.
    - Such extra bits extension is backward compatible for reasonable implementations.
The last point is key: UTF-8 would need to invent a new prefix to go beyond 21 bits. Old software would not know the new prefix and what to do with it. With the simpler scheme, they could potentially work out of the box up to at least 30 bits (that's a billion code points, much more than the mere million of 21 bits).

The

pierrebai··on Deming's Red Bead Experiment (2002)
That's also my whole point: this is not an experiment but an elaborate artificial argument designed to prove a point of view decided in advance. That is why I find it unsavory.
pierrebai··on Deming's Red Bead Experiment (2002)
I find the experiment skewed. Or more precisely, that it is not meant to investigate human behaviour or psychology. It is rather precisely designed to support a chosen result to support a given world view. The fact that it has been ran for 50 years is a strong indication of this.

IOW, the experimenter wanted to be able to arrive at the conclusion that difference in performance was unrelated to workers and designed the experiment so it would give this result. In short, this demonstrate few things outside of a very artificially setup situation, where the workers have no say and the job is predestined to fail.

Anyone who worked anywhere knows very well that there are actually vast difference between two workers.

pierrebai··on The Revenge of the Hot Water Bottle
I personally use a bean bag. I put it 2 minutes in the microwave. Seems simpler than heating water.
pierrebai··on Window System X (1984)
You think that color management belongs in the window manager / compositor.

Wayland thinks color management belongs in the app.

The main difference, though, is not this disagreement, but your righteous insistence that your opinion is not an opinion but a very simple obvious fact. I can tell you from having been part of many dev teams of many major app having to do color management that such apps really, really like to be in control.

So no, the lack of color management in wayland is not such an obvious wrong decision. It's debatable, with pros and cons.

pierrebai··on We used C++20 to eliminate a class of runtime bugs
Oh how I agree about the uniform initialization! And to make matter worse, I now work on a code base where it is the mandated form in the coding standard. At least your initial example now gives me ammunition against it, but too late for this coding standard.

It makes code look silly, too, as now initialization looks different from assignment.

     int i { a + 2 };
     i = a + 4;
     
     int j = a + 2;
     j = a + 4; // ah! consistency!
pierrebai··on How programmers make sure that their software is correct
The roots of the problem you described are many. One is that there are very good unit test libraries out there, which encourages writing unit tests. That sounds good, and is a good starting point, but it often become the be-all end-all of testing.

In my experience working on many very large software, I have encountered one that was head and shoulder above the others in quality. This is not just a hunch. There were metrics tracked, thing like MTBF, and percent of sessions with clean exits, etc and this software was ridiculously better than the others.

The difference lied entirely on the fact that the better software had almost no unit test, but had 21K+ integration tests. I've worked on other software that also had more integration tests than average, and they too were of better quality.

The problem is making integration testing easy needs to be designed in from the start and requires not just one simple trick but multiple inter-locked design decisions that accumulate into making integration testing easy. In this particular case, one could write a new test just by using the software and a new test would be generated automatically. That's how you achieve writing 21k integration tests.

There are many unit test framework, but I've yet to see a generic integration framework. The reason is that integration tests are run with the whole software, so the whole software needs to be designed around them.

pierrebai··on Go 1.18 Beta 1 is available, with generics
That is a strange sentiment, based on the reasons you've given. Package management on Python with pipenv or poetry have not been an issue in my experience. The other half is kinda hard to pinpoint since "feel" doesn't say much, but is surprising given how clear and powerful the syntax is. I've also taken to use type annotation in Python to ease some of the typing obscurantism of pure dynamic typing.

And python does have map / reduce and much more... so I'm not sure what you mean there.

OTOH, I feel Go and Python are mostly used in quite different domains. To me, Python is the new bash. Go is more for those who dislike C++ and Rust (or Haskell or...) and prefer a certain kind of simplicity.

pierrebai··on The [Rust] Core Team Is Toxic
I don't get the problem with Palantir. You can't prevent an organization from using a language in their project can you? The issue as stated seems to be that some people both worked for Palantir and were involved with Rust? Why single-out Palantir? Should anyone remotely related to any defense or surveillance be ostracized? Where does that stops? Who gets to say who is pure enough to be accepted?

I;m sure some will read this as me supporting Palantir, because that's how the Internet works, but I don't and find them unpalatable.

The same goes for travel costs. It seems a delicate issue: do you fund people who are deeply involved in the project and have shown a continued effort, or new members who might drop next week? To the author, the answer seems so obvious, to me it isn't.

pierrebai··on Human image synthesis from reflected radio waves
Isn't the training and GAN mean that the resulting image will look like the persons they trained? You probably could have a dog walk around and you'd still "see" a human in the synthetized image.

The idea of this being used for, say, security would have obvious dangerous bias in it. "Hey, every robber is a middle aged black man."

pierrebai··on No Easter Eggs in Curl
Weird, I could have sworn I've read this before, not necessarily about curl, but the exact same words and sentiment. Searching for "no easter egg in" yielded nothing. Yet the post is dated as of today. Maybe I lived briefly in an alternate universe?

Maybe it was this: https://docs.microsoft.com/en-us/archive/blogs/larryosterman...

Which was discussed on HN in 2005 here: https://news.ycombinator.com/item?id=17517085

pierrebai··on “Risc V greatly underperforms”
Re-read what was written. He is saying exactly that the RISCV code size is larger, but to see it you need the right tool used the right way to actually look at the code, not debug info, constant sections, etc.
pierrebai··on Microsoft’s new Windows prompts try to stop people downloading Chrome
That was a crash course on how to self-disprove one's argument, all in the first sentence. "It works well, except for this extremely common use case that requires arcane knowledge to fix."
pierrebai··on Microsoft_craziness.h (2018)
It's scriptable and you can assign shortcut key combo to anything, so... part ofthe blame falls back to you?

Do you think VS designers should accommodate your particular needs and desire of a particular shortcut over the needs of all other users who participate in their beta and user feedback and instrumentation data?

pierrebai··on Microsoft_craziness.h (2018)
That only works if someone does not race and modify the content of that registry key between the two function calls. And that, my friend, is how buffer overflow exploits are born.

Don't poke beyond your end. Don't poke using a value that was returned by a function you don't control. The code shown does both. Such quality, it Jonathan Blow.

pierrebai··on Microsoft_craziness.h (2018)
Because bundling DLL in your installer is not hard? Because most non-toy program will have DLL of their own anyway that will need installing?

As for the original craziness header, I found it hilariously, but pretty typically, harsh and unfair. Finding the compiler and all is environment is not an easy task in any OS. I've been programming for a looooong time I remember havign to write code that compiled on: IRIX, Solaris, HpUx, IBM unix, Windows and more.

Anyone who ever took a look at configure.sh knows the horrors it holds at bay.

pierrebai··on You can no longer bypass microsoft-edge:// links using apps like EdgeDeflector
It's not an analysis, it's an opinion. There is no possible analysis: there is a behavior, you choose how to interpret it. It's not like you decompile the code and the machine code spells out "screw you".
pierrebai··on How can we break our addiction to contempt?
I whole-heartedly agree with you. People love to demonize who they disagree with, assuming that disagreement is just a proxy for the fact the others are idiots. In reality, it is merely that they hold different values, their source of true facts they believe in are different and prioritize different things.
pierrebai··on Brave and Firefox to intercept links that force-open in Microsoft Edge
They are OS-generated links. Kinda funny that you claim I don't know what I'm writing about when the very example you give is an OS-generated link.

The start menu search is very much integrated with the OS and even gives you result right in the menu. Would be weird if the result shown in the menu would not be the same as the ones shown when it opens a web-browser?

But I guess you did not stop to think about such minor details.

pierrebai··on Brave and Firefox to intercept links that force-open in Microsoft Edge
No, I claim that if you write an OS that you need to support, you need to ensure that some of its basic functionality have been tested and can be vouched to always work for all users.

And also, you have misunderstood my claims about locales. Not all alternative browser support all locals that Windows support. Would you like to have help page from the OS or search result from the OS open in a browser with a UI in another language. Don't forget: not every computer is your own, so people can get in a situation where a browser they have chosen is installed.

If you cannot fathom why this is necessary, it mostly shows you haven't work on large software, with a large install base and support personnel. And yes, search from the start menu and F1 from the explorer are exactly the type of things where you need to guarantee some baseline of functionality and testing and support. Do you want to be the guy in support on the phone trying to explain something about a web browser you know nothing about?

It's not like I'm too dumb to understand the line of reasoning people are using. But people are clearly unwilling to admit there are also good reasons why things are the way they are. Just adamantly repeating that Microsoft does thing for one single reason is just being close-minded for the sake of being right.

As for the competitive aspect: you'd have a leg to stand on if we were talking about how Microsoft makes it harder to switch browsers in Windows 11. But, unfortunately, that is not the subject at hand. It's about specific links that are generate right inside the OS. There is no competition around showing help and OS search result. The browser competition is not about the microsoft-edge: URL schemes. In what world do you live where it is the relevant competition?

pierrebai··on Brave and Firefox to intercept links that force-open in Microsoft Edge
You mean rely and hope that whatever the user installed as the default browser will not mess-up help, documentation and other such links?

I'm quite certain that all those non-standard URLs are all for internal links to OS-related information hosted on the web. If they instead just popped a custom app that hosted an Edge webview nobody would rip their shirts. Doing that would be ridiculous given that Edge is just there and has been tested and vetted by QA.

Don't forget that these things need to work on all versions of the OS and in all locales. You're asking MS to trust that any 3rd party app will give proper user experience for any locale when presenting such links.

It's not as-if MS was hijacking normal URLs. But ripping shirts is soooo much fun.

pierrebai··on Ship / Show / Ask: A modern branching strategy
The problems I see with the Ship / Show / Ask approach are

    - How often each is selected will be *very* personality-based and I'm afraid the worst ones will be magnified. AKA "I'm so super good, all my changes are Ship" kinda persons.

    - It becomes harder to justify imposing a mode on someone. How do you rein in the ultra-shippers?

    - It can become a source of frustration and strife between co-worker. Not just due to the above, but when someone breaks the builds with a Ship and people will start keeping count how many time X broke it, etc.

    - With time, I feel there will be drift into less and less Ask.
Basically, freedom to choose is fragile. I think it is better to have an approach were Ship is exceptional, and pretty much everywhere I've work, there has been ways to avoid branching or reviews. I also think that the time-wasting vs time-saved due to reviews is heavily in favor of time-saved. We're no longer in the olden days, we got terabyte disk and easy branching. Starting to work on something else while waiting for a review is easy.
pierrebai··on Ship / Show / Ask: A modern branching strategy
Where I currently work, we have "skip review" and "skip preflight" labels for this. The mergers have the power to merge anything anyway, the labels are only to make it an official request.
pierrebai··on Thomas Nagel: Thoughts Are Real (2013)
So, hum, multiple consciousnesses create the same reality because our bodies, which are part of reality, are similar? Sounds to me this implies reality came first, but I'm just a simple man, not a book-writing philosopher.

... and the good old "visual illusions therefore 'anything'". About the level of argument sophistication I expected.

pierrebai··on Thomas Nagel: Thoughts Are Real (2013)
I'll say this colloquially and rhetorically (as I have little real interest in what the probably contorted answer might be), but I wonder how it can possibly account for the vast early period of time since the big bang when there was no consciousness.

Or was consciousness-created reality all made up on the spot on the birth of the first conscience?

And how has it been kept consistent through the life of all different consciences?

I think the simple fact that, for example, separated tribes of people have lived for millennium within a physically identical world is kinda a dead give-away that reality lives independently of consciousness.

pierrebai··on New Ways to Be Told That Your Python Code Is Bad
The point is not that we're idiots who don't know the language, but that functional-style ordering does not align with human cognitive cues.

The problem is that functional-style fails to separate essential bits and fails to give strong visual clues where each bits begins and ends.

That is why the old imperative style is clearer. Compare:

    for i in container:
        do something with i
and

    [do something with i for i in container]
One has a clear separation of loop and action, the other requires scanning for the "for i" in the middle. This generalize to other similar construct, and the Python ternary operator has the same flaw. The imperative if / else version clearly separate alternatives on separate lines.

IMO, syntax design should always try to learn from the imperative style and always strive to produce a syntax that clearly separate each logical item in a compound statement, and using different lines is one of the best for us human to visually grok.

(That's why even Lisper will often format their code to separate bits on different lines!)

pierrebai··on On the proliferation of try, and soon, await (2020)
> "If there are no exceptions and you have a function-call control flow, you can enforce that the only types the caller understands from the callee are the types in the signature."

This has historically resulted in either ignoring errors from sub-functions, because their error return type don't map properly, or returning generic "i got an error" without any more information about what the error was.

And all this was historically patched over by having verbose log files that could be written to from anywhere and the user had to peruse and try to make sense of after the fact.

Some franework tried to create complicated error code (like Windows COM) but in the end there is no free lunch. Errors are hard.

pierrebai··on The secretive, semi-illicit world of WhatsApp mango importing
People are discussing in hushed tones of mangoes at parties?

The world sure has changed.

Yes, this is a comment about what I call the New-Yorker tired long-form style of writing. Hype, hyperbole, weird mix of personal anecdotes, facts and always with a heavy syrup of cold-war-era like of under-cover midnight-meeting, world-weary, globe-trotting investigation.

pierrebai··on Pythonic monotonic
FWIW, here is my solution. I think it is grokable and does not rely on one knowing complex python, I think even someone without Python knowledge would understand what is going on:

    def order_values(value, prev):
        """
        Compare value and prev, returns, -1, 0, 1
        depending on the relative ordering.
        """
        return int(value > prev) - int(prev > value)

    def monotonic_increasing(seq):
        """
        Given a sequence of elements, detect the inner sequences of
        increasing and decreasing values.

        Return a list of list of values of these inner sequences,
        but with the decreasing ones reversed to be increasing.
        """
        if not len(seq):
            return []

        new_seq = [seq[0]]      # Record the current sequence being built.
        seq_of_seq = [new_seq]  # The sequence of sequences to return.
        seq_of_order = [0]      # Record the sequences ordering (0 for unknown).
        for value in seq[1:]:
            value_order = order_values(value, new_seq[-1])
            if value_order == seq_of_order[-1] or not value_order or not seq_of_order[-1]:
                new_seq.append(value)
                # If sequence order was unknown, adopt value order.
                if value_order and not seq_of_order[-1]:
                    seq_of_order[-1] = value_order
                continue

            new_seq = [value]
            seq_of_seq.append(new_seq)
            seq_of_order.append(0)

        # Reverse decreasing sequences.
        for seq, order in zip(seq_of_seq, seq_of_order):
            if order < 0:
                seq.reverse()

        return seq_of_seq


    print(list(monotonic_increasing([1, 2, 3, 2, 1, 4, 5, 6, 7])))
    print(list(monotonic_increasing([1, 1, 2, 3, 3, 2, 1, 1])))
    print(list(monotonic_increasing([2, 1, 1])))
    print(list(monotonic_increasing([])))
pierrebai··on Pythonic monotonic
Why is [2, 1, 1] not being reversed? Since you do call reverse(), I'm not even sure what the bug is on first inspection, which is not a good sign!

Edit: I believe the bug is that the code assumes the first sequence is increasing. It seems a bug carried by all these variants that starts by declaring a -inf variable at the top.

IMO, the problem is trying to find a solution in one's head, then trying to write Pythonic code. The issue is that when someone else reads the code, one does not have the unwritten idea you had in your head.

To write simple code, you must have the least amount of idea in your head. I usually try to write the code dumbly, even if it is inefficient, then do a second pass to remove the most offending parts and maybe make the code more general.

← PreviousPage 5 of 15Next →