Just a basic programmer living in California

  • 5 Posts
  • 243 Comments
Joined 2 years ago
cake
Cake day: February 23rd, 2024

help-circle

  • I’m not informed on all the details, but a key difference between the async_trait macro and a native async keyword is that async_trait gives you that boxed, trait object type. IIUC the thinking is native support should not automatically box futures, which implies it shouldn’t use dyn either. Using Box and dyn is an easy way to make sure the code works no matter what type of future a method returns. But the trade-off is some runtime overhead from heap allocation (due to Box), and dynamic dispatch (due to dyn).

    According to areweasyncyet.rs:

    async fn in trait method not stabilized yet

    • Workaround is available as an attribute macro: async-trait

  • It seems like some retconning, with the writers deciding that empathic characters are more interesting for storytelling than fully telepathic characters. It can be hard to create drama when someone on screen automatically knows what everyone else knows.

    The Betazoids also didn’t have black irises, which has previously been a distinguishing feature - albeit a feature that most viewers don’t seem to notice. Given the many, many franchise references included in the first two episodes it looks like the showrunners are aware of established details, and that both the lack of telepathy and eye color are deliberate choices.

    My impression was the president being deaf didn’t have anything to do with the plot, but was probably about showing that deaf people are people who have stories too. The Betazoids delegates signing and speaking to each other might be something Troi has said previously: that it’s rude to communicate telepathically among non-telepaths. But Lwaxana does it anyway because she doesn’t care. Or it might have been to avoid confusion: “they’re empathic with other species, but telepathic with each other? What is going on?” I don’t know what is the significance of taking off the translation device.



  • That’s not an unreasonable answer. But I find this thread a little frustrating. As I see it, it’s gone like this:

    • phpinjected: Why don’t I have a tool to do these non-hierarchical things?
    • frongt: You already have a tool that does those specific things.
    • hallettj: What could change to make that tool better suited for those non-hierarchical / tagging things?
    • frongt: Don’t use that tool to do tagging things. It’s the wrong tool.

    Why bring up hard links if people shouldn’t use them for the requested use case? I mean, I do think your original reply was interesting and relevant as a starting point to get to what I think OP has in mind. But that line of thinking does require getting into how to use hard links for a non-hierarchical workflow.

    I feel like OP was trying to start a discussion about what might be, if things were different. I tried to reply in the same spirit. I feel like I’m asking, “What if things were different?”, and I’m being told “It doesn’t work that way.” Which doesn’t feel like an especially helpful response to me.


  • We have hard links, but is there any good UI out there for them? I only know of using the ln command directly. Or put another way, do you know of anyone who actually uses hard links in a way similar to how a tagging filesystem would be used? What are the obstacles that prevent this use case from being easy or discoverable enough to be in common use?

    With a tagging system you can remove tags without fear of losing file data. But with hard links you could easily delete the last link without realizing that it’s the last link, and then the file is gone.

    That relates to another issue: in a tagging system you can look at file metadata to see all of the file’s tags. Is there a convenient way to do that with hard links? I see there is find . -samefile /path/to/one/link, but requiring a filesystem scan is not optimal.



  • I haven’t tried it, but I know people use it to run Minecraft Bedrock Edition. Although I’m reading reports that that broke recently, so I’m not sure if it’s working at the moment.

    Minecraft BE is very frustrating - there is a native Linux build for Android, that works great when you can get it to run on a proper computer. But Microsoft’s authentication system makes it very difficult to do that. Minecraft Java Edition works without problems, and is probably the better Minecraft; but the two editions don’t interoperate without server mods, a lot of people run BE, and the kids want to be able to play online with their friends.




  • Oh yeah, I do find Helix interesting! I sometimes recommend it to people who don’t have a background with modal editing as a batteries-included option for getting started. I have tried it a little bit myself. It’s hard for me to give up leap.nvim and fugitive, which is holding me back.

    I’ve been meaning to try out dedicated git programs to see how comfortable I can be without fugitive. Tig is one that caught my eye. Or sometimes I even think about using Gitbutler because its virtual branch feature seems very useful, and I haven’t seen any other tool that does that.



  • I certainly see the value in this strategy! But I’m not going to give up my top-level aliases. I enjoy saving two keystrokes too much!

    Here are my most used aliases (these ones use Nushell syntax):

    alias st = git status
    alias sw = git switch
    alias ci = git commit
    alias lg = git log --color --graph '--pretty=format:%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
    alias push = git push
    

    I was also delighted to learn that I could get the same short aliases for corresponding fugitive commands in vim/neovim using the vim-alias plugin:

    -- This is a lazy.nvim plugin module
    return {
      'Konfekt/vim-alias',
      config = function()
        -- Shortcuts for git operations to match some of the shell aliases I have.
        -- For example, `:sw ` expands to `:Git switch `
        vim.cmd [[Alias sw Git\ switch]]
        vim.cmd [[Alias ci Git\ commit]]
        vim.cmd [[Alias pull Git\ pull]]
        vim.cmd [[Alias push Git\ push]]
        vim.cmd [[Alias show Git\ show]]
        vim.cmd [[Alias re Git\ restore]]
        vim.cmd [[Alias lg GV]]
      end,
    }
    

    Fugitive is very nice for integrating git workflows in the editor, and its commands have very nice tab completion for branches and such.


  • I have to dual boot for work, so every day I have to reboot into a different OS install. It’s on its own drive with its own bootloader, so I can’t use systemctl reboot --boot-loader-entry. But I was able get a smooth process using efibootmgr.

    This is my Nushell implementation:

    def boot-to [
      device: string@boot-devices # Identifier of device to boot to (e.g. 0003)
    ] {
      sudo efibootmgr --bootnext $device
      systemctl reboot
    }
    
    # This function exists to provide tab completion for boot-to
    def boot-devices [] {
      efibootmgr | parse --regex 'Boot(?<value>\S+)\* (?<description>(?:\w+ )*\w+)'
    }
    

  • I like mkcd! I have the same thing. Although what I use more is a function I pair with it that specifically creates a temporary directory, and cds to it. It’s useful for temporary work, like extracting from a zip file.

    These are my Nushell implementations:

    # Create a directory, and immediately cd into it.
    # The --env flag propagates the PWD environment variable to the caller, which is
    # necessary to make the directory change stick.
    def --env dir [dirname: string] {
      mkdir $dirname
      cd $dirname
    }
    
    # Create a temporary directory, and cd into it.
    def --env tmp [
      dirname?: string # the name of the directory - if omitted the directory is named randomly
    ] {
      if ($dirname != null) {
        dir $"/tmp/($dirname)"
      } else {
        cd (mktemp -d)
      }
    }
    


  • Not OP, but I’ve been using Niri as my daily driver for almost two years (since v0.1.2). The stability and polish have really impressed me. In addition to the scrolling workflow it has some especially nice features for screen sharing & capturing, like key binds to quickly switch which window you are sharing, and customizable rules to block certain windows when showing your whole desktop.

    I do use a 40" ultrawide. Looking for options for getting the most out of an ultrawide was how I got into scrolling window managers.

    I only occasionally use my 13" laptop display. I still like scrolling because I like spatial navigation. Even if windows end up mostly or entirely off the screen I still think about my windows in terms of whether they’re left, right, up, or down from where I’m currently looking.

    I don’t like traditional tiling as much because I find squishing every window to be fully in view to be awkward; and with e.g. i3-style wms if I want to stash a window out of view, like in a tab that’s a separate metaphor I have to keep track of, with another axis where windows might be. Scrolling consistently uses on spatial metaphor, placing all windows on one 2D plane with one coordinate system.


  • Home Manager is a Nix tool for managing configuration for a single user, usually on a Linux or MacOS system, or possibly WSL. You configure installed programs, program configuration (such as dot files), and a number of other things, and you get a reproducible environment that’s easy to apply to multiple machines, or to roll back configuration, etc. I find it helpful for having a clear record of how everything is set up. It’s the sort of thing that people sometimes use GNU Stow or Ansible for, but it’s much more powerful.

    A Home Manager configuration is very similar to a NixOS configuration, except that NixOS configures the entire system instead of just configuring user level stuff. (The lines do blur in Nix because unlike traditional package managers where packages are installed at the system level, using Nix packages can be installed at the system, user, project, or shell session level.) Home Manager is often paired with NixOS. Or on Macs Home Manager is often paired with nix-darwin. As I mentioned, the Home Manager portion of my config is portable to OSes other than NixOS. In my case I’m sharing it in another Linux distro, but you can also use Home Manager to share configurations between Linux, MacOS, and WSL.



    • NixOS + Home Manager
    • Niri
    • Kitty
    • Neovim, via Neovide

    For work it’s Fedora + Home Manager because the remote admin software doesn’t support NixOS. Thankfully I’ve been able to define my dev environment almost fully in a Home Manager config that I can use at work and at home.

    I use lots of Neovim plugins. Beyond the basic LSP and completion plugins, some of my indispensables are:

    • Leap for in-buffer navigation & remote text copying
    • Oil for file management
    • Fugitive + Git Signs + gv.vim + diffview.nvim for git integration
    • nvim-surround to add/change/remove delimiters
    • vim-auto-save
    • kitty-scrollback