• 4 Posts
  • 24 Comments
Joined 2 years ago
cake
Cake day: June 15th, 2023

help-circle
  • A dash is a bit problematic from practical point of view. In example I allow single numbers without a colon like just 6 which would be interpreted as 6:6. And each element is optional as well, which would make -6 either be a negative number, an commandline option or a range? Some languages also use dots .. instead. If I want ever support negative numbers, then the hypen, dash or minus character would be in the way.

    I mean I could just do a duck typing like stuff, where I accept “any” non digit character (maybe except the minus and plus characters) with regex. Hell even a space could be used… But I think in general a standardized character is the better option for something like this. Because from practical point of view, there is no real benefit for the end user using a different character in my opinion. Initially I even thought about what format to use and a colon is pretty much set in stone for me.



  • I think that I’m going with these approaches. For the ‘0’, I’m now accepting it as the 0 element. Which is not 0 based index, but it really means before the first element. So any slice with an END of 0 is always nothing. Anything that starts at 0 will basically give you as many elements as END points to.

    • 0: is equivalent to : and 1: (meaning everything)
    • 0 is equivalent to 0:0 and :0 (meaning empty)
    • 1:0 still empty, because it starts after it ended, which reads like “start by 1, give me 0 elements”
    • 1:1 gives one element, the first, which reads like “start by 1, give me 1 element”

    I feel confident about this solution. And thanks for everyone here, this was really what I needed. After trying it out in the test data I have, I personally like this model. This isn’t anything surprising, right?





  • First, thanks for the answer. As for the user base, its actually gaming oriented and they typically do not interact with 0 base. So I guess that makes for an obvious choice. And at the moment its also “inclusive”. To get one element user needs to 2:2. If user gives only one element, such as 2, then I could convert it into 2:2, to get one element. Sounds logical, right? Sorry for having so many follow up questions, my head is currently spinning.

    Do you think this interferes somehow with the logic of a “missing” slice element, which would default to “the rest of the list”. In example 2: would then get the second element and until rest. This is the default behavior in Rust.

    If I have a 1 based index, how would you interpret the 0? Currently program panics at Argument interpretation phase.




  • There are couple of factors that makes this a confusing topic.

    Vim: On a high level, normally Vim (and Neovim) have their own clipboard system. Vim has multiple internal clipboards that can be used like variables and accessed with other commands. So its kind of sandboxed from your system. But you can explicitly use the commands to access the system clipboard. There is a configuration you can set to use the system clipboard by default.

    Linux: Unlike Windows, in Linux we also have two kind of clipboards: the “system” clipboard as you know and the “primary” clipboard. This has nothing to do with Vim and is a feature on Linux systems itself. If you in example in your browser mark a text without copying, it is automatically copied into the “primary” clipboard. Then you should be able to access and paste it with middle mouse button in example. The system clipboard where you explicitly copy stuff is not affected by it.

    You should read following documentation: 09.3 The clipboard - Neovim







  • Dolphin filemanager from KDE. Nowadays I default to “compact” view without “preview” enabled. This is similar to “Icon” view, but the icons are small. Lot of files scrolls horizontal instead vertical.

    • filenames in compact mode can be longer in one line, which is kind of similar to the look as “details” view, but are all displayed in a multiple rows instead one row
    • preview disabled, because this is extremely fast, as I have ton of files that do not even have a preview image

    That’s my default. Occasionally I enable preview image and switch to bigger “icon” view when I look into images or videos. Or sometimes I enable “details” view when needed. In normal usage I don’t need the details anyway.



  • If you want to do a Bash like management and programming, that is not dramatically different but fixes some irritations, then Fish is an alternative. Obviously it will not fix all issues, but there is no paradigm shift in handling streams. nushell is dramatically different and at that point, I would rather use a programming language to do the stuff. Speaking of programming language, there is also Xonsh (basically Python+Bash like combination as a system shell).

    All these alternatives have a singular big flaw to me: they are not the standard tools on the system, which defeats the purpose of a system shell to me. In the end, without changing the core system that these shells are built on, I don’t think its possible to make a really well made language that interoperates on system level like a shell does at the moment.

    That’s the reason why I got a bit more into Bash to understand some flaws, to understand how to use regexes inside Bash and variable substitutions and a few other concepts that are very useful to know. But man… there are so many traps… like looping over a wildcard for files (such as for file in *.txt) and if the wildcard does not match, then the loop consists of the wildcard as a literal word as if “*.txt” was a filename. What a stupid idea. There is an option to change that, but that’s the issue. The language is filled with traps and optional options and you have to know all of them.

    Edit: Added example code why default behavior sucks:

    $ for file in *.ABCD; do echo "${file}"; done
    *.ABCD
    shopt -s nullglob
    $ for file in *.ABCD; do echo "${file}"; done
    



  • The quoted image does not say so, they do not say the native packaging from your distribution is borderline unusable. That judgement was added by YOU. The devs just state the package on Archlinux is not officially supported, without making a judgement (at least in the quoted image).

    As for the Fedora issue, that is a completely different thing. That is also Flatpak, so its not the package format itself the issue. Fedora did package the application in Flatpak their own way and presented it as the official product. That is a complete different issue! That has nothing to do with Archlinux packaging their own native format. Archlinux never said or presented it as the official package either and it does not look like the official Flatpak version.

    So where does the developers say that anything that is not their official Flatpak package is “borderline unusable”?


  • And then there is software like OBS, which is known for being borderline unusable when not using the only officially supported way to use it on Linux outside of Ubuntu – which is Flatpak.

    But why is that? I mean just because it is packaged by someone else does not mean its unusable. So its not the package formats issue, but your distribution packaging it wrong. Right? In installed the Flatpak version, because they developers recommended it to me. I’m not sure why the Archlinux package should be unusable (and I don’t want to mess around with it, because I don’t know what part is unusable).


  • Those mystical average people would probably stay on Windows, if they don’t care or cannot learn basics of other systems. Its really not hard to explain and understand, even for “average person” that there is an universal source for applications and there are packages designed and managed by your operating system. I think its important for people to learn basics and we should teach them, not dumb them down like on Windows. Soon people won’t be able to eat themselves anymore…