• 17 Posts
  • 369 Comments
Joined 5 years ago
cake
Cake day: May 31st, 2020

help-circle

  • You technically didn’t ask for them, but presumably this goes hand-in-hand with reduce and reuse as first steps, which would have perhaps a more visible impact.

    Reduce means to cut back on the amount of products we produce in the first place, particularly also the trash being used for packaging.
    This would require:

    • More craftsmanship. Instead of buying a new jeans when your pants have a hole, you’d sew them.
    • More robust, repairable products. Don’t need to throw away the whole phone due to a broken screen when it doesn’t break in the first place or if you can get the screen replaced.
    • More sharing. Not every household needs their own car or toolbox or whatever, if you can share them with your neighbors.
    • There would be more shops that sell products unpackaged, where you bring your own containers to fill.

    Reuse means to sell products in glass jars, metal boxes or similar, which can be washed out and filled anew.
    This would require:

    • Some container-deposit system, so that you can bring your emptied glass jars etc. back to the shops and the shop sends it back to the producer.
    • In that vein, there would need to be a tax on non-reusable packaging to finance the recycling or safe deposition of it.
    • Some products would probably be sold in larger quantities or not anymore, because they just aren’t sustainable, if you make them pay their environmental costs.

    As for recycling, i.e. breaking the thing down and creating a new thing, it’s unlikely that we would ever reach 100% with it alone, at the very least because it’s more effort than reduce and reuse.
    But to improve our rates, there is a whole load of products currently being sold in plastic, which could be sold in paper or wood, if glass jars or metal boxes don’t work there.

    In a hypothetical world, where we could have 100% effective recycling without giving a toss about reduce and reuse, then I guess, we’d have a garbage disposal system which funnels right back into a massive 3D printer.



  • Just to note, I disagree entirely. Even in commercial development, it’s the core premise of agile development to ship features early and continuously integrate feedback. Granted, lots of companies claim to do agile without actually doing it, but it’s at least not a law of nature what you’re describing.

    But with this not being commercial development either way, I really don’t feel like you can make any predictions. If the volunteer that implemented this sees your bug report, they could decide to drop everything else and fix that, because they get to pick their own priorities. They might have the solution in their head right away and it doesn’t take them long at all to implement. Or someone new to the project might decide this sounds like a good issue to get started with.





  • Probably the very same thing that the post talks about, which is extracting the first word of a line of text.

    The output of md5sum looks like this:

    > md5sum test.txt
    a3cca2b2aa1e3b5b3b5aad99a8529074 test.txt
    

    So, it lists the checksum and then the file name, but you wanted just the checksum.


  • It’s a Linux command-line program (awk). It’s pre-installed practically everywhere, it’s very powerful for string processing, but it also uses a fairly complex syntax.

    As a result, not many people know how to really make use of it, but awk '{print $1}' is something you encounter fairly quickly when you need to get the first word in each line.



  • I don’t have proper experience with it, I just built a small prototype with it back in 2021, to evaluate it for a project. But yeah, apparently these were my notes:

    Nim: Significant whitespace [derogatory], no interfaces/traits, imports throw random functions into scope like in Python (plays a big role with supposed object-orientation, as methods don’t get imported along with a type; they’re loosely attached and just imported along), somewhat ugly syntax

    Apparently, past-me wasn’t as big on the syntax. 😅

    But I can see why, because this is the code I wrote back then, apparently (I wanted to create a OS configuration framework à la Puppet, Ansible etc.):

    main.nim:

    import strformat
    import role, host
    
    let host2 = Role(
      description: "sdadsj",
      code: proc (host: Host) = echo "sakjd"
    )
    
    echo host2
    
    
    type Role2 = ref object of RootObj
      description: string
    method deploy(self: Role2) {.base.} = discard
    
    
    type KWriteConfig5 = ref object of Role2
      cheese: string
    method deploy(self: KWriteConfig5) = echo fmt"Deploying: {self.cheese}"
    
    
    let test = KWriteConfig5(
      description: "Deploy KWriteConfig5.",
      cheese: "cake"
    )
    
    test.deploy()
    
    
    let rolerole = Role2(
      description: "RoleRole",
    )
    
    rolerole.deploy()
    

    host.nim:

    type Host* = object
    

    role.nim:

    import host
    
    type Role* = ref object of RootObj
      description*: string
    method deploy(self: Role) {.base.} = discard
    

    Certainly some syntax elements in there where I have not even the faintest guess anymore what they would do…



  • No, no, you’re mathing correct. I did receive 12ct back. But 12cts is a 2ct coin + a 10ct coin. If I would have given 51.00€, it would have been a 2ct coin + a 5ct coin back. I didn’t mention the 2ct coin, because it’s always involved.

    And I didn’t have 3cts myself, otherwise I would have made it 51.03€, yeah.


  • To be honest, I’m always a bit amazed that this doesn’t happen more often. Yesterday, I had to pay 50.93€ and handed the cashier 51.05€, because I’d rather have a 10ct coin and the cashier typically needs smaller coins more often.

    In this case, it was obvious that I didn’t hand them the 5ct by accident, but that’s the sort of mind games I’ll play and so far, the cashiers were always a step ahead of me…


  • Ah, I’m not talking about Ruby, I’m talking about language design in general.

    I’m currently mostly doing Rust, so I can only really name that as an example (even though there’s very likely other languages that allow this, too), but yeah, here’s for example the 64-bit signed integer in Rust: https://doc.rust-lang.org/stable/std/primitive.i64.html

    That is a primitive type, not an object, so it is exactly 64-bits in size and stored on the stack, not the heap. But as you can see in the documentation, Rust allows for associated functions anyways, like for example:

    let my_number: i64 = -3;
    my_number.abs()  //returns the absolute value, so 3
    

    That’s because that last call is just syntactic sugar for calling the same function statically on the type:

    i64::abs(my_number)
    



  • Yeah, this has been one of my biggest takeaways from this whole LLM thing, just how many people are completely unaware of what constitutes good writing. A good chunk of human communication was apparently upheld by people simply being too lazy to type out many word when few do trick.

    And now that laziness isn’t the problem anymore, now that they just have to provide two sentences of information to get a full page of text, they think that’s good. That lots of words mean you put in lots of effort. And lots of effort signifies that what you say is important.

    I do expect societal norms to change. That the association of lots of words with lots of effort will fall by the wayside. That people get tired of the noise that LLMs add. But unfortunately, it is going to take a while, because people are so unaware of why writing is good or not.



  • I wish that string command and also their math command were just general-purpose utilities pre-installed on all systems.

    Tried to script something with sed the other day and was so confused why my regexes weren’t matching, until we realized you need to pass --regexp-extended to get modern-day regex.

    And then I later tried to calculate an average, which bc decided to round down, because it was presumably doing integer math. I actually ended up running python -c "print($total / $count)", because I could not be arsed to work out, if there was some flag to make bc work properly.

    I’m fine with these tools continuing to exist for legacy purposes, but I would like a modern replacement just about now.