4,901 karma · joined Sep 13, 2020 (6y ago) · 1,641 submissions
comment 4y ago · link · parent
So all commits are made sequentially, but most of the time developers don't need to rebase them themselves before pushing. The time distribution of commits sent to the queue is non-uniform, so you may have a long queue during the day, but by late evening it's pretty much empty. It has the greatest number of commits on Fridays.
comment 4y ago · link · parent
Another hurdle is that you can't specify the heights of images. So now you're left with translating all those bounds from width x height to just width based on width x height of viewport. This srcset and sizes business feels really half-baked.
I wish I could just give the browser a list of image versions with their dimensions (both width and height), and the browser would just pick the smallest one with sufficient quality for a given viewport based on size of the viewport and dimensions of the img element in the given layout, i.e. the website author would only specify content and its different versions in a declarative way, not fill out algorithm details.
comment 4y ago · link · parent
The ancient Greeks called non-Greek-speaking peoples "barbarians", suggesting they are uncivilised, primitive. To this day, the name of Germany in Polish means "those-who-cannot-speak".
comment 4y ago · link · parent
The only person I've ever met in my life who did not believe in evolution was a catholic priest. It's honestly bewildering to me that evolutionary sceptics are common enough to warrant a note in mainstream media or even just normal conversation. To me it's comparable to finding out there are still geocentrism apologists.
Although from what I've read it's more common in US. I'm in Europe so that may be the source of my bubble.
comment 4y ago · link · parent
I don't care about FOSS, so the principles are not a motivation for me.
comment 4y ago · link · parent
And the type errors very non-local and therefore hard to understand. The reason is that HM type inference infers types not only in the leaves->roots direction, but also roots->leaves. An expression gets assigned a type based on the context it appears in. It works wonderfully when the program type checks, because e.g. it allows one to write something like "let x = None" in Rust instead of "let x: Option<very long type name> = Option<very long type name>::None;" as long as further uses of x (such as returning it as the value of the enclosing function) clarify its type. However, when a program is during development, you change things here and there, when one variable binding (such as a function definition), which wasn't explicitly typed, appears in at least two places which require this variable to have conflicting types, then almost certainly the error is going to be generated for a line that you as a human see completely disconnected from where the error actually is. Maybe it's in the function definition, maybe it's in one of its uses. And those things can be further obscured by several indirections of intermediate functions with successfully inferred types.
comment 4y ago · link · parent
When something doesn't involve a computer, I don't have the slightest problem staying focused. So when part of my job requires doing some maths on a piece of paper/window/whatever, when I want to read a book, when I engage in a hobby etc., I don't need to try hard to focus. It's only those bloody computers.
comment 4y ago · link · parent
comment 4y ago · link · parent
Doubting yourself and then winning at everything doesn't make you relatable. It makes you like that colleague from school who was stressed out before every exam, saying for sure they're gone fail, proceeding to have straight A's from every one of them. When you hear them doubt themselves next time, you don't empathise with them, you say "oh shut up".
comment 4y ago · link · parent
Of the ones you listed I watched The Last Jedi and Captain Marvel. I know what I wrote is also true for Mulan thanks to friends who watched it and the Critical Drinker. He has a couple good films on YouTube actually demonstrating this aspect of modern films:
- Mulan: <https://www.youtube.com/watch?v=kIH-eFqBLP4>
- Star Wars: <https://www.youtube.com/watch?v=GSj6wEm4zZY>
- Captain Marvel: <https://www.youtube.com/watch?v=WKHEjpFF6J0>
comment 4y ago · link · parent
UPDATE: After seeing a reply to this comment, I googled some screenshots. It seems that Macs normally do display a hint for the shortcut to delete files. I'm not sure why mine doesn't.
Windows is also more learnable. On Mac at least today you're just supposed to know stuff. The most basic operation: deleting files. Seems like an operation you'd like to speed up with a shortcut, since you're going to be doing a lot of that with your computer. Mac has hints in its menus about shortcuts for different actions, just like Windows. However, they're hardly ever there. That sounds a bit contradictory, but mind the quantifiers. The selection of which actions have hints about their shortcuts is completely arbitrary. It's completely disconnected from the potential frequency of use, and the hints that are there are far and few between. So, back to deleting files: this is not hinted in the menu. You can select this action with the mouse, but come on, going to the menu, finding this action and clicking it is a ridiculously slow process for such a common operation. Dragging files to the trash bin is only marginally better. It has a shortcut, it's just that macOS won't tell you what this shortcut is. This is insider knowledge. And then you google it, and find that it's "Cmd+Delete". So you press that... and it doesn't work. Because on macOS Delete is Backspace and Delete is Reverse Delete.
Also, it's a theme that what requires a single keypress or two on Windows, on macOS requires a convoluted chord making you look like Axl Rose playing solo of November Rain. I mean, look at the shortcuts to take screenshots: <https://support.apple.com/en-us/HT201361> Wat??? 1. Who thought that would be easy to remember? 2. Who thought that would be easy to press?
comment 4y ago · link · parent
$ mawk --version
mawk: not an option: --version
$ mawk --help
mawk: not an option: --help
$ mawk -W version
mawk 1.3.4 20200120
Copyright 2008-2019,2020, Thomas E. Dickey
Copyright 1991-1996,2014, Michael D. Brennan
random-funcs: srandom/random
regex-funcs: internal
compiled limits:
sprintf buffer 8192
maximum-integer 2147483647
And mawk is (was in 16.04 at least) the default version of awk on Ubuntu. How is the user supposed to know this magic incantation? ¯\_(ツ)_/¯comment 4y ago · link · parent
SFTP also transports data over SSH channels.
comment 4y ago · link · parent
That was exactly the implementation of /bin/true in Unix v7: <https://github.com/v7unix/v7unix/blob/master/v7/bin/true>
comment 4y ago · link · parent
I mentioned gluten not in relation to chocolate, but to other sweets that do contain gluten, but also have chocolate.
comment 4y ago · link · parent
Tangentially, in those times avoiding gluten wasn't as fashionable as it is today, and so there wasn't really any gluten-free bread to buy. My mum would bake bread herself for that purpose, because otherwise I wouldn't even be able to eat bread.
comment 4y ago · link · parent
1. VirtualAlloc:
1.1: separation of reserving memory from committing it, thus making overcommit unnecessary, when you want to have memory arenas and reserve a large contiguous chunk of virtual address space, but commit it (so tell the system that you actually want this virtual memory mapped to some physical memory), when you need it. So you can grow your arenas as you need more memory, without worrying that you may not have enough virtual space due to fragmentation, and without relying on invisible things like lazily committing memory on page-faults as long as your program doesn't have any bugs which make it touch that memory in advance and thus make the bugs go unnoticed silently and increase memory use
1.2: ability to implement a circular buffer[1] with a contiguous view instead of head + tail parts; thus making it possible to pass your ring buffer to functions which expect a normal array, and also avoid branches and complexity in code operating on the buffer.
Generally, VirtualAlloc > mmap IMO.
2. Behaviour in OOM conditions. Linux can become completely unresponsive for minutes. Windows is usually responsive enough to kill the offending applications.
3. GUI apps have reasonable baseline for performance of GUI. On Windows it's expected that watching YouTube/Netflix you won't see screen tearing. On Linux screen tearing with VOD in browsers is completely unsurprising.
4. Powershell is nice for a whole variety of reasons.
5. CreateProcess > fork [2]
6. MSVC, unlike GCC and Clang, doesn't come with guns for your children when you unknowingly dare trigger UB.
[1]: <https://docs.microsoft.com/en-us/windows/win32/api/memoryapi...>
[2]: <https://www.microsoft.com/en-us/research/uploads/prod/2019/0...>
(Posted from Linux btw.)
comment 4y ago · link · parent
comment 4y ago · link · parent
$ nix-env -qa | wc -l
39168
Of course, it's important to note that Nix doesn't lag behind upstream as much as Debian. Actually, it's usually one of the first places where new versions of packages appear. So you don't have the problem such as the one Debian has with maintaining PHP 7.4.comment 4y ago · link · parent
When I used to work in office, there was this one time when I had an urgent ticket from customer to resolve, so I made the necessary fix and started building it. Normally builds would take something like 15 minutes, provided they were incremental and this wasn't the first (clean) one. But they could also take hours. It was at the end of the working day, I was working hard on this fix, didn't even take a lunch break. I started building it and waiting, because I wanted to share the fix with the customer as soon as possible. 15 minutes passed... 30 minutes passed... 1 hour passed... 90 minutes passed... 2 hours passed... And it was still compiling. At that point I gave up, went out and started walking home. But due to not eating the whole day and then staying late waiting for the build to finish, now I was so hungry that my hands started trembling on my way home and I felt generally weak, on the edge of being able to reach home. The next day I found out this build took ~4h 30min.
The reason for this state of affairs: of course I shouldn't care that much about my work and just make the customer wait instead. Put my health and time above that. But another important reason is that the build times were so unpredictable: when I hit "compile", it could take anywhere from 3 minutes to 4.5 hours. There is no planning you can do around that. If it was just a fixed 3 hours, it would be even better, because then I could plan my day around it. But it being so unstable destroys everything. Of course, if every build took 3 hours, people making decisions would wake up and see that we've got a pathological situation and there is something seriously wrong with the project. But when you often hit 15 minutes, it's going to be brushed off. And for the C++ committee even though compilation speed may be an issue, it is never a priority. There are always going to be other issues which eclipse it.
Personally, I think a build for even a OS-size project like that shouldn't take more than at most 1 minute. Even the incremental times in this one are a travesty.
What I like about what was planned for Jai (still not released) is that it's designed to always make a clean build. And the clean builds need to be fast. There should be no reason to make incremental builds. They are hacks that make the situation worse, but make it look better. Suddenly you're dealing with weird bugs, because the build system did not detect a necessary recompile and used stale cache entries (happened multiple times to me). The compile times are unpredictable (see the above story of why that matters).
I've seen some Delphi jobs in my country a year ago I think. Maybe I should switch there...
comment 4y ago · link · parent
However from the Linux desktop end user's point of view, whether a system is glibc-based, or musl-based is less directly significant than whether it is Gnome or KDE-based; alternatively, whether it's systemd or OpenRC or runit-based. So if GNU wants some clout for glibc, then in fairness the name starts to sound more like "GNU/systemd/KDE/Linux" at which point it sounds ridiculous. And for all those components the famous "I'd like to interject for a moment" makes equal sense as for GNU.
I frequently work with busybox-based systems and they're not nearly as different from GNU/Linux as KDE is different from Gnome.
comment 4y ago · link · parent
[1]: <https://cseweb.ucsd.edu/~voelker/cse221/papers/qnx-paper92.p...>
comment 4y ago · link · parent
import System.Random
randomInt :: IO Int
randomInt = randomIO
isEven1 :: Int -> Bool
isEven1 n = (n `rem` 2) == 0
isEven2 :: IO Int -> IO Bool
isEven2 n = do
m <- n
return $ isEven1 m
example1 :: IO ()
example1 = do
i1 <- randomInt
let result1 = isEven1 i1
putStrLn $ show result1
i2 <- randomInt
let result2 = isEven1 i2
putStrLn $ show result2
let result2' = isEven1 i2
putStrLn $ show result2'
example2 :: IO ()
example2 = do
result1 <- isEven2 randomInt
putStrLn $ show result1
result2 <- isEven2 randomInt
putStrLn $ show result2
randomIntIsEven :: IO Bool
randomIntIsEven = isEven2 randomInt
example3 :: IO ()
example3 = do
result1 <- randomIntIsEven
putStrLn $ show result1
result2 <- randomIntIsEven
putStrLn $ show result2
main :: IO ()
main = do
putStrLn "Example 1:"
example1
putStrLn "Example 2:"
example2
putStrLn "Example 3:"
example3
In example1, result1 and result2 may differ, which is signalled by the arrow (instead of "="). result2 and result2' cannot differ, which is signalled by "=", where the right hand side is verbatim the same.In example2, result1 and result2 may differ, which is signalled by "<-" (instead of "=").
In example3, result1 and result3 may differ, which is signalled by "<-" (instead of "="). Another argument here is that they may differ, because example3 is the same as example2, except it used randomIntIsEven in place of isEven2 randomInt. But we defined randomIntIsEven to be equal to isEven2 randomInt, so result1 and result2 being able to be different in example2 but not in example3, or vice versa, would be a contradiction.
comment 4y ago · link · parent
They are the same thing in Haskell (except for when forcing the thunks into eager values happens, due to the weirdness of laziness, but that has nothing to do with purity).
> I assume FP has answers for these things but the tutorials never cover them.
Except this one does:
> The <- works like an =, except it signals that equational reasoning doesn't apply to this value. You can't replace what_the_user_typed with getline - your program won't compile.