• 1 Post
  • 316 Comments
Joined 1 year ago
cake
Cake day: June 30th, 2023

help-circle




  • Yeh, immutable distros… You can install software, it’s just you have to declaratively define what software you want, then apply that as a patch.
    You don’t just apt install cowsay, you have to create a file that defines the installation of cowsay.
    This way, if you have to change how cowsay is installed, you tweak that patch file and reapply it.
    If you have to wipe & reinstall (or get a new computer or whatever) you just apply all your patches, and the system is the same again.










  • For me, after looking over the docs, it’s close enough to JavaScript that it might as well adopt more of the syntax (for example, conditionals and loops don’t use parenthesis). It also has some similarities to python, but again not enough to be python.

    Feels like an in-between language that has enough similarities to seem easy, but some gotchas that will regularly catch you out.
    And then some extra features like the if chaining, which doesn’t have the keyword if or switch in it. So you have to know that that structure implies an if or switch conditional.

    Especially for something like bash scripting, which devs probably don’t spend as much time doing compared to python or js. So, it would probably take them longer (and break their brain more) than just scripting it in python/js directly or dealing with bash directly.

    It’s an improvement over bash, and it’s nice that it transpiles to bash.
    I might have to play around with it and see how it actually feels to use



  • A quick Google suggests what you have.

    If the code you have quoted is verbatim what you have tried, seems like you need to extract the parentheses and possibly a single or double quote, depending on the source css. The example source you have given has a single quote.

    select-before(select-after(//div/@style, "backgound-image: url("), ")") 
    

    Should be (notice the extra ' relating to url('...url'))

    select-before(select-after(//div/@style, "backgound-image: url('"), "')")
    

    But I don’t think that would cause xpath to fail… It would just extract the wrong value

    Edit:
    Further reading suggests xpath 1.0 does have limited functionalities. But, like you, can’t find anything concrete.