HNHacker News
TopNewBestAskShowJobs

abjKT26nO8

730 karma · joined March 19, 2016

submissionscomments
abjKT26nO8··on Concurrent Programming, with Examples
> Unlike a single process where you can use locks and other primitives to write correct code, there is no locking mechanism we can use to protect access to these global shared resources.

Databases provide transactions. This mechanism is also an inspiration for a synchronisation model called Software Transactional Memory proposed for Haskell, and used as "the" synchronisation model in Clojure. Locks and semaphores are rather lower-level primitives and it's harder for humans to reason about them with an ease comparable to using CSP or STM.

abjKT26nO8··on I, Backpack
> It was funded, however, by companies like Philip Morris, Anheuser-Busch, PepsiCo, and Coca-Cola, and it’s goal was to “confuse the public narrative regarding waste, and distract from the corporations and manufacturers creating the litter and waste” (wikipedia).

I looked for this part on the linked wikipage and didn't find it. I looked at the edit history and it turns out that this wikipage is subject to a PR fight and the account DoBeautifulThings keeps removing parts that may be too critical and adding things that put it in a positive light. The source for the quote was this recording: https://www.npr.org/2019/09/04/757539617/the-litter-myth

Here is an edit from them that removes this part (2019-10-03): https://en.wikipedia.org/w/index.php?title=Keep_America_Beau...

A revert of the change (2019-10-03): https://en.wikipedia.org/w/index.php?title=Keep_America_Beau...

The change is back in (2019-10-04): https://en.wikipedia.org/w/index.php?title=Keep_America_Beau...

Another change that reverts some lobbying edits (2019-09-12): https://en.wikipedia.org/w/index.php?title=Keep_America_Beau...

If you want to see the wikipage version which contained the quote, here it is: https://en.wikipedia.org/w/index.php?title=Keep_America_Beau...

Lobbying on Wikipedia is real.

abjKT26nO8··on Netflix to cut streaming quality in Europe for 30 days
And the comment I replied to was "literally" about problems encountered in US (Seattle is in US FYI).
abjKT26nO8··on Apple is looking for engineers to convert its code from C to Rust
I.e. it isn't a drop-in replacement. There is nothing wrong about a language not being good at something. When you want to have everything, you get C++. And working with C++ is just sad.
abjKT26nO8··on AbstractAlgebra: Computer algebra package for Julia language
You're mostly right, with one (or two) exception: > Matrices and linear algebra. This isn't abstract algebra. It's used in abstract algebra, but that's true for linear algebra in almost any branch of mathematics. Also, depending on what exactly they implemented for Univariate polynomials, this part may also be numerical.
abjKT26nO8··on Netflix to cut streaming quality in Europe for 30 days
You're describing an issue specific to US ISPs. It doesn't apply to Europe. From what I read even before the pandemic the US ISPs offered rather crappy services. In Europe, particularly in Poland, I don't have and haven't heard about anyone having any issues with connectivity right now, even though the country is in lockdown, schools and universities are closed, restaurants work only in delivery/take-out mode, companies switched to remote work, ... And still no issues at home nor at work.

Don't make decisions about the European infrastructure based on American problems.

abjKT26nO8··on Domain hacks with unusual Unicode characters (2018)
Not implementing the feature described in TFA sounds rather trivial. I'd dream for other problems to be as trivially-solvable as "not doing something".
abjKT26nO8··on MessagePack: like JSON, but fast and small
Your comment could benefit from pointing out the alternatives that outperform gzip.
abjKT26nO8··on Why operators are useful (2019)
> The definition is that sqrt(x²) = x, which has positive and negative solutions in x for any x² > 0.

When people write "sqrt", they mean the function, or, "principal square root". "A square root" is a different thing. Saying "the definition" makes sense only within the context where the definition is established, otherwise we have to fallback to the common usage. Wittgenstein would laugh at this conversation.

Also, I'm not arguing for this convention ("it needs to have a single formula to be a function"). And when you start substituting symbols, almost nothing withstands this test. Because then you can always always twist the formula into several cases. And generally thinking about functions as something that is defined by formulas is a very limiting view. Almost all functions cannot be defined by formulas.

abjKT26nO8··on What's so hard about PDF text extraction?
My bank lets me download bank statements in several formats, CSV among them - not entirely plain text, although embedded in it; seems like the best choice for the usecase.
abjKT26nO8··on Against Advice
You can phrase useful advice in a "non-advicy" way. E.g. "here is how I do it..." instead of "it's better to do it this way/you should do it like this". This form sends an implicit message "there may be other, maybe better, ways to do it/YMMV".

The phrasing indicates whether the sender thinks of themselves as someone who has all the answers vs someone who just found out that something works for them.

abjKT26nO8··on Cost of a thread in C++ under Linux
With the caveat that the destructor crashes your program if you neither join nor explicitly detach the thread.
abjKT26nO8··on How to Respond to COVID-19
> you'll be leaving a mess behind for your loved ones.

I don't have any loved ones.

> advanced medical directive

My country doesn't honor those.

Yup, I'm about as prepared as I can be.

abjKT26nO8··on Artificial Intelligence as the year 2000 approaches (1992)
And when was the last time you counted something on your fingers that was more than 3?

Also, quoting parent's link:

> It is possible to count to 12 with the thumb acting as a pointer, touching each finger bone in turn. A traditional finger counting system still in use in many regions of Asia works in this way, and could help to explain the occurrence of numeral systems based on 12 and 60 besides those based on 10, 20 and 5. In this system, the one (usually right) hand counts repeatedly to 12, displaying the number of iterations on the other (usually left), until five dozens, i. e. the 60, are full.

abjKT26nO8··on Why operators are useful (2019)
When people take the square root of a number during working with real numbers, they almost always mean the non-negative root. It's a convention. Only when they start considering complex numbers, this convention breaks, and the square root ceases to be a function - even according to the modern definition -, because "non-negative" still doesn't narrow it down to a single number in the general case.
abjKT26nO8··on Why operators are useful (2019)
In this case it's justified, because there is no ambiguity. Just as a mathematician would write using traditional notation without parentheses. At the courses I attended in group theory, module theory etc. we were always required to prove that things are associative before dropping parentheses. Lisp notation just requires less characters (the '+' isn't repeated), but the convention is the same.
abjKT26nO8··on Why operators are useful (2019)
A lot of these things were established long before mathematicians started talking about functions, let alone give a robust definition of what a function is. It may have obscured the fact that these things are very similar to each other.

At the point when there was an effort to formalize these things ideas like RPN starting popping up.

Mathematics also deals with a much more flexible medium. It's written on a plane, in 2 dimensions, whereas programmers confine themselves to just one. Mathematicians are also free to make up their own notation and symbols, whereas programmers are confined to a single alphabet and most often can't extend the syntax.

EDIT: Case in point: some mathematicians argued for a while if abs (absolute value) is a function. Some argued that it's not, because you need two formulas to define it. When somebody pointed out that (for real numbers) it's just "sqrt(x^2)", the first ones agreed. Sounds silly in retrospect now that we have a set-theoretic definition, but at the time it wasn't obvious and all these functions looked very different from each other.

abjKT26nO8··on Why operators are useful (2019)
Both... at the same time? I.e. they are associative?

If only one at a time, then perhaps there is. But TBH I can't think of an example from the top of my head right now.

abjKT26nO8··on Why operators are useful (2019)
This is a problem of the model of polymorphism a language has. It's orthogonal to the function/operator distinction. It doesn't arise based on having this distinction or not.

In Haskell you use typeclasses (you can think of them as Go interfaces or Rust traits) and without them you cannot introduce nameclashes. In Scheme (the Lisp that I know)... you don't have anything. You import things from libraries, define variable bindings and depending on the order of all this your variable is going to be bound to something, most likely a procedure... but which one? Depends on the order. Not great. I prefer the Haskell approach to this, but then Haskell is a bit complicated in other areas. :/

But again, this has little to do with "operators vs functions".

abjKT26nO8··on Why operators are useful (2019)
No. That assumes that "add" is left-associative, i.e. it expands to add((add(x, y), z)). It's not obvious.
abjKT26nO8··on Why operators are useful (2019)
I much prefer languages which simply do not make a distinction between functions and operators.

This distinction seems useful only in the context of lower-level languages like C where the operators translate directly to single machine code instructions and thus they provide clues about performance.

But in a higher-level language this distinction is superficial. It's just another function, just with a much shorter name and perhaps using infix instead of prefix notation. E.g. in Lisps there is no such distinction. "+" is a valid function name. In Haskell - same, but you also have a built-in syntax for specifying that you want your function to be called using infix notation by default.

abjKT26nO8··on i3 4.18
> I agree that would be nice, though I've never really minded; If I'm gonna touch the mouse, I'm gonna touch the mouse.

My problem is that my table isn't perfectly stable, so when I type, my mouse moves on its own by microscopic distances. When I'm in the middle of typing, the results range from mildly annoying to infuriating, depending on how a random application handles given input.

I've just found this video describing a solution (writing a minimal script): <https://www.youtube.com/watch?v=7QeZkq88jTw>

abjKT26nO8··on i3 4.18
Could you share you config somehow?
abjKT26nO8··on i3 4.18
Have you figured out how to make i3 move the mouse pointer to the area of the newly-focused window when you change window focus by keyboard? AwesomeWM does that out of the box. i3 doesn't and it's very annoying, because then when my table makes a microscopic movement and causes the mouse to move, suddenly what I'm typing is diverted to another window and weird things happen.
abjKT26nO8··on Miguel de Icaza on Windows 10x
Judging from the screenshots, the UI looks like KDE.
abjKT26nO8··on Mac OS Catalina: more trouble than it’s worth (Part 2)
Really? https://www.cvedetails.com/vulnerability-list/vendor_id-72/p...
abjKT26nO8··on Apple Edge Cache
I used "nmap -A" on Apple servers that my iPhone downloaded the last OS update from. They were all Linux servers.
abjKT26nO8··on Quadsort: a stable non-recursive merge sort
You forgot about heapsort. It's a combination of three sorting algorithms, not two. However trivial the difference may seem, I'd still prefer to look at a "C introsort vs C++ introsort" benchmark than a "C quicksort vs C++ often quicksort, but not really" benchmark.
abjKT26nO8··on Quadsort: a stable non-recursive merge sort
libstdc++'s std::sort doesn't implement quicksort per se. It implements introsort[1]. I'm curious how a pure C implementation of introsort would fare against std::sort.

[1]: <https://en.wikipedia.org/wiki/Introsort>

abjKT26nO8··on Quadsort: a stable non-recursive merge sort
libstdc++'s std::sort doesn't implement quicksort per se. It implements introsort[1]. I'm curious how a pure C implementation of introsort would fare against std::sort.

[1]: <https://en.wikipedia.org/wiki/Introsort>

← PreviousPage 4 of 7Next →