HNHacker News
TopNewBestAskShowJobs

henrikeh

807 karma · joined April 20, 2012

Contact: heh@optoceutics.com
submissionscomments
henrikeh··on You Don't Need a GUI
Update. I tried the `file -u` example you gave above and the `-u` flag doesn't exist in my version of `file`. I also find it a bit hilarious that the example lists `ed` as the editor of choice.
henrikeh··on You Don't Need a GUI
Ah, thanks for the clarification, it definitely cleared up what you mean.

As I understood the suggestion re. file actions it is meant as some sort of interactive completion. So if I type the name of an image file and press tap, I am given the suggestions or options about resizing, format conversion etc. Several shells already have interactive completion of file names.

And I think that pattern makes sense from an exploration perspective. If you learn that file name + tab gives suggestions, then a lot of the learning about what the command line can do can be done directly in the command line.

And maybe it could be a command rather than a tab-press. Then it, given a file, prints typical actions/commands/tasks to stdout and then subsequent CLI tools can be used to process that output.

I really don’t see how this is incompatible with existing workflows :-)

henrikeh··on You Don't Need a GUI
Can you explain more clearly what you mean?

Why does the order of commands or their names have any influence on whether pipes can be used? How do you pipe the output of cp into awk?

henrikeh··on Side effect worry grows for AstraZeneca vaccine
For what it is worth, I read it as a neutral statement: it is literally just the official estimate of the impact in terms of time.
henrikeh··on Information Is Surprise (2015)
Yes, it is from Hamming's "The Art of Doing Science and Engineering".

From page 89:

> Information Theory was created by C.E.Shannon in the late 1940s. The management of Bell Telephone Labs wanted him to call it “'Communication Theory” as that is a far more accurate name, but for obvious publicity reasons “Information Theory” has a much greater impact—this Shannon chose and so it is known to this day. The title suggests the theory deals with information—and therefore it must be important since we are entering more and more deeply into the information age.

Then later on on page 90:

> First, we have not defined “information”, we merely gave a formula for measuring the amount. Second, the measure depends on surprise, and while it does match, to a reasonable degree, the situation with machines, say the telephone system, radio, television, computers, and such, it simply does not represent the normal human attitude towards information. Third, it is a relative measure, it depends on the state of your knowledge. If you are looking at a stream of “random numbers” from a random source then you think each number comes as a surprise, but if you know the formula for computing the “random numbers” then the next number contains no surprise at all, hence contains no information! Thus, while the definition Shannon made for information is appropriate in many respects for machines, it does not seem to fit the human use of the word. This is the reason it should have been called “Communication Theory”, and not “Information Theory”. It is too late to undo the definition (which produced so much of its initial popularity, and still makes people think it handles “information”) so we have to live with it, but you should clearly realize how much it distorts the common view of information and deals with something else, which Shannon took to be surprise.

> This is a point which needs to be examined whenever any definition is offered. How far does the proposed definition, for example Shannon’s definition of information, agree with the original concepts you had, and how far does it differ? Almost no definition is exactly congruent with your earlier intuitive concept, but in the long run it is the definition which determines the meaning of the concept—hence the formalization of something via sharp definitions always produces some distortion.

henrikeh··on Information Is Surprise (2015)
Just to be clear. I don't disagree. Albeit information theory is a grand name, "communication" theory would not strike at the general applicability.
henrikeh··on Information Is Surprise (2015)
Richard Hamming (known for the Hamming code among others) has said that "information theory" ought to be called "communication theory". Obviously, communication theory is a field in itself, but I think the gist of his argument holds somewhat true in that information theory tells little about what information is intrinsic but instead tells about what information can be _learned_.

But I think the intuition breaks down. What is mutual information then? Classically, it is the information which can be reliably transmitted between a transmitter and receiver (given some model of both.) However, the unit is still bits.

henrikeh··on Giving Ada a Chance
Except that it the GNAT compiler is part of GCC and GPL with the linking exception. Why not use that?

And I don’t get what you mean with “pestering for info”. I’ve once discussed buying their compiler and I was by no means in a F500 (decided against buying btw).

henrikeh··on Giving Ada a Chance
It is indeed a common misconceptions, but here is the official Ada 83 Language Reference Manual on the subject: http://archive.adaic.com/standards/83lrm/html/lrm-02-09.html...

> Reserved words differing only in the use of corresponding upper and lower case letters are considered as the same (see 2.3).

Interestingly, the manual itself doesn't even use upper case:

> For readability of this manual, the reserved words appear in lower case boldface.

So even the Ada standard recognizes the upper case is less readable and undesired.

Case insensitivity also applies to identifiers (variable names, type names etc.) (sec 2.3) and that is a definitely an archaic feature, but the GNAT compiler has the helpful -gnatya style check which enforces the Pascal_Case style: https://gcc.gnu.org/onlinedocs/gcc-4.6.4/gnat_ugn_unw/Style-...

---

Another common misconception is that function/procedure names (designators) must appear after the `end`. That is optional:

> If a designator appears at the end of a subprogram body, it must repeat the designator of the subprogram specification. http://archive.adaic.com/standards/83lrm/html/lrm-06-03.html...

henrikeh··on Giving Ada a Chance
> [...] tiring with the all caps.

I guess there is more to like then, since the keywords are case insensitive. The OP doesn’t even use all caps.

henrikeh··on Mutation Driven Testing: When TDD Just Isn’t Good Enough
I don’t really get what you are saying. Are you talking about automated tools as a better option?

Edit: To elaborate a bit, programming is naturally limited by the programmer's imagination, too. But what alternative is offered is a much more interesting topic than just disregarding something because it isn't a perfect solution.

henrikeh··on Why I still Lisp
Ada has that. Bounded types and subtyping.

For example, the type system is aware of the ranges of allowed values and can statically enforce this. Runtime checking is used by default but can be disabled.

henrikeh··on Again on 0-based vs. 1-based indexing
Ada is actually not 1-based. Arrays are accessed using an index type which is defined at declaration. It can be any discrete type, including ranges starting at 0 (or 1, or -1, or anything else which fits the domain).
henrikeh··on Again on 0-based vs. 1-based indexing
Or indexed by any discrete type with a defined order, including enums and negative numbers. The latter being quite useful for signal processing.

Another thing to the add to the list of good ideas in Ada everyone ought to copy.

henrikeh··on The Genius of RISC-V Microprocessors
https://community.arm.com/developer/ip-products/processors/b...

> Javascript uses the double-precision floating-point format for all numbers. However, it needs to convert this common number format to 32-bit integers in order to perform bit-wise operations. Conversions from double-precision float to integer, as well as the need to check if the number converted really was an integer, are therefore relatively common occurrences.

> Armv8.3-A adds instructions that convert a double-precision floating-point number to a signed 32-bit integer with round towards zero. Where the integer result is outside the range of a signed 32-bit integer (DP float supports integer precision up to 53 bits), the value stored as the result is the integer conversion modulo 2^32, taking the same sign as the input float.

The semantics of numbers in JavaScript behave in a specific way. Since we are talking about numbers, it hardly gets more low-level and thus it makes good sense to design ALU operations targeting common numerical operations.

henrikeh··on Solving Algorithmic Problems in Python with Pytest (2019)
> unittest is an old horse and cart, while pytest is the batmobile.

I really wish more was said than just this. Why is it that pytest is often preferred and unittest is considered a bad choice? What is the impact on the quality of the tests?

henrikeh··on Solving Algorithmic Problems in Python with Pytest (2019)
You could approach this a number of ways.

First, if you can ensure the seed of the generator, then that could be used on a case by case basis. But this tricky, since it introduces a subtle dependency on the implementation of biasedcoin.

Another option is to split the function/process into a stochastic and deterministic part. Test the deterministic part thoroughly. biasedcoin is too trivial for this, but it works nicely in more complicated setups.

For biasedcoin, I would probably go with a statistical approach. Given a certain bias, the expected value and distribution is known. I would simply test that several trials of the function lie within some bound.

henrikeh··on If-then-else had to be invented
Bulgarian also has a question particle (li or ли). In many cases questions are phrased by simply inserting “li” next to the focus of the question.
henrikeh··on South Korea's fusion device KSTAR runs for 20 seconds at 100M degrees Celsius
It should be said that the methods were developed before he joined SpaceX and were used at NASA / JPL for at least on Mars mission.
henrikeh··on South Korea's fusion device KSTAR runs for 20 seconds at 100M degrees Celsius
I don’t think it is fair to say that Apollo could have been pulled off by a few kind of people. It was a massive undertaking spanning almost all fields of science and engineering. Just read a book like _Stages to Saturn_ to see what an undertaking it was to just conceive, design, implement and _manage_ the Saturn rockets.

But I’m more curious about your second statement. Could you back that up with some evidence? How is ITER’s management and leadership “MBA/Political”? Is it really different from the other projects’? Such a statement needs to be backed up with some evidence.

henrikeh··on Notation as a Tool of Thought
Just tested it and it worked fine. Note that your function takes too many parameters in its definition and that functions can't be passed as parameters by name.

It is definitely not as elegant as the built-in facility in J, but definitely doable and usable in Matlab. In fact, I think any language with flexible enough function overloading should be able to implement such a feature.

henrikeh··on Notation as a Tool of Thought
Yes, the symbolic functions can be made "retroactively". The various conventional functions are overloaded with the symbolic input.

    >> syms x
    >> f = @(x) log(sqrt(x)).^2

    f = function_handle with value:

        @(x)log(sqrt(x)).^2

    >> f(x)
 
    ans = log(x^(1/2))^2
 
    >> finverse(f(x))
 
    ans = exp(2*x^(1/2))
And to implement under:

    function u = under(f, g)

    syms x

    g_inv = matlabFunction(finverse(g(x)));

    u = @(x) g_inv(f(g(x)));

    end
henrikeh··on Notation as a Tool of Thought
That can definitely be implemented in Matlab with the symbolic math toolbox.

But interesting nonetheless.

henrikeh··on Notation as a Tool of Thought
> It is completely impossible to implement something like "under" in matlab.

I’m a little curious about this. Does J have a notion of the relationship between certain functions and their inverse? What is it that enables “under” in J which makes it impossible in Matlab?

henrikeh··on First beta release of Alire, the package manager for Ada/SPARK
The GNAT compiler (part of GCC) supports both static and dynamic linking.
henrikeh··on I No Longer Tell My Friends about Anki/SuperMemo
Sorry if I come off as pedantic, but what makes it look dodgy? Is it just the polish and alignment?

I use it daily and I just find it functional, but I’m also very used to it.

henrikeh··on I No Longer Tell My Friends about Anki/SuperMemo
I’m sorry for being dense, but I don’t quite understand the issue.

From the workflow of downloading Anki and adding to the default deck, how do the settings and knobs factor into it?

I’m not here to just argue. I am legitimately interested. I just don’t want to assume too much.

henrikeh··on I No Longer Tell My Friends about Anki/SuperMemo
I’m always curious about the “Anki should be prettier” comment.

I use Anki a lot, so I’m not in the best position to judge its first-hand impression. But, what would you say should change? Both in terms of visuals and interaction?

Genuinely asking.

henrikeh··on I No Longer Tell My Friends about Anki/SuperMemo
I’ve used flashcards quite extensively during my studies (electrical engineering and telecom engineering) and I continue to use it for technical subjects; albeit with reduced intensity.

Spaced repetition systems are not just about “rote” memorization. When used right it is a very personalized practice tool that can help with quite high-level ideas.

I wouldn’t fx. make flashcards for an entire API — instead I would focus on the concepts and features that are important for what I am doing. You can make it about “exactly” what you want to practice and remember.

Think of it more as a collection of personal notes with build in recall practice, rather than remembering scores of “random” facts.

henrikeh··on Programming language notation is a barrier to entry
I think casting is an important part of documenting and encoding intent. Especially in embedded systems.
← PreviousPage 3 of 9Next →