• 0 Posts
  • 173 Comments
Joined 2 years ago
cake
Cake day: June 30th, 2023

help-circle
  • BSP Tree (with custom nodes).

    With a vanilla BSP-tree you can accomplish your diagram. Simply reordering your splits can do it by making the footer and main content areas first. Better approach is to support splits on non-leaf nodes. In the example below just split the root where all its children go to the new top node and a new bottom bar leaf node is created.

    Root (split: vertical, ratio: 0.6)
    ├── Left child (Window A)
    └── Right child (split: horizontal, ratio: 0.5)
        ├── Top child (Window B)
        └── Bottom child (Window C)
    

    To access neighbors you’ll need your nodes to track their parents (double linked). Then you can traverse until all edges are found. Worst case its O(height+num neighbors that exist) if I am remembering.

    Depending on how efficient you want it to be, there are speed ups. It has been awhile, but I do remember keeping the tree as balanced as possible makes the search around log(n). Each split node keeping an index of all children in its sub-tree also reduces how much traversing is needed when you need all children after a split.

    Can get a little complicated but it is doable. That said, how many splits will a TUI have? This may be preemptive to do.

    Custom nodes is where you support some patterns that could use further optimizations. Tables that will always be a grid. Tab bars that are a 1xn grid could be a further specialized node.

    This is all about layout. Fixed/Dynamic width/height windows, padding and margins, borders, are all render processing and don’t effect the layout (unless you want reactivity). By that I mean you have windows that will split differently when the viewport is portrait or landscape and it dynamically adjusts to the window size. Sometimes with different “steps” like a square viewport may be different from both portrait or landscape or 4:3 could be treated different from 16:9.

    TUIs are not my day job but I’ve made a few in my day. Above are just my opinions from experiences. There is no “right” answer but hopefully some of this helps your journey.


    TypeScript is my day job and using a custom JSX Factory makes it pretty easy to define HTML-like interfaces for devs that can support mixing layout, render attributes, content, and app logic.

    Explicit BSP splits:

    <Split type="vertical" ratio={0.6}>
      <WidgetA />
      <Split type="horizontal" ratio={0.5}>
        <WidgetB />
        <WidgetC />
      </Split>
    </Split>
    

    Custom nodes:

    <Container>
      <TabBar>
        <Tab>Tab 1</Tab>
        <Tab>Tab 2</Tab>
      </TabBar>
      <StatusBar />
    </Container>
    

    Not sure your stack but throwing it out there as something I’ve used successfully.



  • Toooo real. Its like companies have taken the worst of everything and just call it agile. List out every task and estimate them so we have timelines, but don’t actually architect anything as that’s waterfall. Fake waterfall, with fake dates, but fingers will be pointed like they were real commitments, and spend a month doing it for this executive power point instead of fucking off so devs can build the damn thing.













  • sloppy_diffuser@sh.itjust.workstoMemes@lemmy.mlIdk if y'all knew this
    link
    fedilink
    English
    arrow-up
    28
    arrow-down
    1
    ·
    11 months ago

    This is why we trust but verify. Thanks mom for teaching me that cruel lesson of unplugging the phone cord to get me to bed (dial up days). It lasted about a week before I caught on you always came up from the basement before bed.

    I’m so glad you never noticed I swapped my line with the guest bedroom. Also glad that ancient block in the basement could be hand wired.




  • I use immutable nixos installs. Everything to redeploy my OS is tracked in git including most app configurations. The one exception are some GUI apps I’d have to do manually on reinstall.

    I have a persistence volume for things like:

    • Rollbacks
    • Personal files
    • Git repos
    • Logs
    • Caches / Games

    I have 30 days (or last 5 minimum) of system rollbacks using BTRFS volumes.

    The personal files are backed up hourly to a local server which then backs up nightly to B2 Backblaze using rclone in an encrypted volume using my private keys. The local server has a mishmash of drives in a mirrored LVM setup. While it works well for having mixed drives, I’ll warn I haven’t had a drive failure yet so I’m not sure the difficulty of replacing a drive.

    My phone uses the same flow with RoundSync (rclone + GUI).

    Git repos are backed up in git.

    Logs aren’t backed up. I just persist them for debugging and don’t want them lost after every reboot.

    Caches/Games are persisted but not backed up. Nixos uses symlinks and BTRFS to be immutable. That paradigm doesn’t work well for this case. The one exception is a couple game folders are part of my personal files. WoW plugin folder, EvE online layouts, etc.

    I used to use Dropbox (with rclone to encrypt). It was $20/mo for 2Tb. It is cheaper on paper. I don’t backup nearly that much. Backblaze started at $1/mo for what I use. I’m now up to $2/mo. It will be a few years before I need to clean up my backups for cost reasons.

    The local server is a PC in a case with 8 drive bays plus some NVME drives for fast storage. It has a couple older drives and for the last couple years I typically buy a pair of drives on sale (black Friday, prime day, etc). I have a little over 30TB mirrored, so slightly over 60TB in total. NVME is not counted in that. One NVME is for the system, the others are a caching layer (monero node) or temp storage (transcoding as it also my media server).

    I like the case, but if I were to do it again, I’d probably get a rack mountable case.