Self-documenting Code
  • tatterdemalion tatterdemalion 29m ago 100%

    Agreed.

    And sometimes code is not the right medium for communicating domain knowledge. For example, if you are writing code the does some geometric calculations, with lot of trigonometry, etc. Even with clear variable names, it can be hard to decipher without a generous comment or splitting it up into functions with verbose names. Sometimes you really just want a picture of what's happening, in SVG format, embedded into the function documentation HTML.

    4
  • linux
    Linux 19h ago
    Jump
    Concerns Raised Over Bitwarden Moving Further Away From Open-Source
  • tatterdemalion tatterdemalion 12h ago 100%

    Sadly the Android app is no longer maintained, and it hasn't been released for newer versions of Android.

    6
  • linux
    Linux 19h ago
    Jump
    Concerns Raised Over Bitwarden Moving Further Away From Open-Source
  • tatterdemalion tatterdemalion 12h ago 100%

    There's an unmaintained Windows client.

    Actually here is one that's still active: https://github.com/IJHack/QtPass

    3
  • What are some mind blowing Rust tricks?
  • tatterdemalion tatterdemalion 5d ago 90%

    One thing I like a lot about Rust is that it rarely does blow my mind.

    But one crate that actually did blow my mind is corosensei. It's not Rust per se that is so crazy here, but the way it's essentially implementing a new language feature with assembly code. This is how you know Rust really is a systems programming language. I invite you to read the source code.

    9
  • What are some mind blowing Rust tricks?
  • tatterdemalion tatterdemalion 5d ago 100%

    Clippy will warn you if you don't use this feature.

    4
  • Home server recommendations?
  • tatterdemalion tatterdemalion 1w ago 100%

    Retro ROMs are usually small. Videos can get quite large though, on the order of ~100GB per movie if you are storing 4K Blurays.

    I personally bought a couple > 20TB HDDs off of serverpartdeals.com and installed them in my gaming PC so now it also functions as a small NAS. Because it's only on when I'm using the PC, the electric bill is not too bad. But it's worth doing the math to see what your average kW/hour usage is. Wattage monitors are pretty cheap.

    If you specifically want a lower-power NAS in a separate machine, this will require a bit more research, and they can get pricey. I highly recommend using ZFS though.

    If you're OK using a cheap, low-power mini PC as a home server and/or gateway, I can recommend the BeeLink EQ12. Mine is currently running 24/7 attached to a Hasivo 2.5Gb switch with PoE powering my WiFi AP.

    There are also options for connecting large external HDDs to a mini PC, but you would be compromising throughout via some SATA adapter.

    2
  • ActivityPods 2.0 is out!
  • tatterdemalion tatterdemalion 2w ago 100%

    Sounds a lot like the AT Protocol.

    2
  • Are there any animes or TV shows you can't stop recommending?
  • tatterdemalion tatterdemalion 2w ago 100%

    Monster

    74 episodes. Psychological thriller. Serial murder mystery, but instead of "whodunit?" it's "whydunit?". Dramatic as an opera. No weird tropes. Superb character development. I love Magnificent Steiner.

    8
  • Why I ditched Twitter for Bluesky - and hope you will, too!
  • tatterdemalion tatterdemalion 2w ago 100%

    What are you talking about? BlueSky has absolutely nothing to do with Facebook. It's a different company using the open AT Protocol.

    3
  • Why I ditched Twitter for Bluesky - and hope you will, too!
  • tatterdemalion tatterdemalion 2w ago 100%

    Technically it's an open protocol. Whether or not any other implementations will surface remains to be seen.

    3
  • What scares you?
  • tatterdemalion tatterdemalion 2w ago 100%

    Being eternally trapped in a mental prison. Imagine having a panic attack that never ends. I'm pretty sure that type of prolonged stress would cause a psychotic break where your psyche fractures and you become a despondent shell. You would become deathly afraid of everything, even the people you love, because of an unceasing paranoia. That basically sounds like hell to me.

    I'm not really afraid of the idea of nothingness after death, because at least then I am released from the torment of living.

    7
  • Nina Simone: Mississippi Goddam
  • tatterdemalion tatterdemalion 2w ago 100%

    That was awesome, good find. I love these kind of old recordings.

    5
  • Uzumaki - Episode 2 discussion
  • tatterdemalion tatterdemalion 2w ago 100%

    I'm still thoroughly enjoying it! It's really bizarre and I don't see where it's going. I'll be disappointed if the whole town just gets swallowed into one big spiral at the end.

    I haven't read the manga so I don't have that point of comparison.

    1
  • I ask because it would be nice to use the "I2P mixed mode" features of qbittorrent, but I want to keep my clearnet traffic on the VPN. # Background I have I2PD running only on my home gateway for better tunnel uptime. To ensure that torrent traffic never escapes the VPN tunnel, I have configured qbittorrent to use only the VPN Wireguard interface. # Problem I think this means qbittorrent I2P traffic will flow into the VPN tunnel, but then the VPN host won't know how to route back to my home gateway where the SAM bridge is running.

    15
    1

    I've configured my i2pd proxy correctly so things are somewhat working. I was able to visit notbob.i2p. But sometimes Firefox really likes to replace "http" with "https" when I click on a link or even enter the URL manually into the bar. I have "HTTPS-only mode" turned off, and I also have "browser.fixup.fallback-to-https" set to "false" and "network.stricttransportsecurity.preloadlist" to false. I tried spying on the HTTP traffic in web dev tools, and I see the request gets NS_ERROR_UNKNOWN_HOST. This does not happen when using the `xh` CLI HTTP client, so Firefox is doing something weird with name resolution. I made sure to turn off the Firefox DNS over HTTPs setting as well, but it didn't seem to make a difference. I assume that name resolution needs to happen in i2pd. How can I force Firefox to let that happen? Update: Chrome works fine. Update: I started fresh and simplified the setup and it seems fixed. I'm not entirely sure why. The only things I've changed from default are DoH and the manual HTTP proxy.

    29
    1
    Is it possible to stay anonymous when joining a private tracker community?
  • tatterdemalion tatterdemalion 3w ago 89%

    My point wasn't so much that I think RED is shady but that exposing my IP seems like an unnecessary requirement to join. Why can I not have my membership tracked via an anonymous account? If they are concerned about account harvesting or something, then the interview already seems like a good enough measure, accompanied by seed ratio minimums.

    15
  • I was just reading through the [interview process for RED](https://interviewfor.red/en/starting.html), and they specifically forbid the use of VPN during the interview. I don't understand this requirement, and it seems like it would just leak your IP address to the IRC host, which could potentially be used against you in a honeypot scenario. Once they have your IP, they could link that with the credentials used with the tracker while you are torrenting, regardless of if you used VPN while torrenting.

    60
    33
    Pop!_OS 24.04 and new COSMIC desktop hit alpha • The Register
  • tatterdemalion tatterdemalion 3w ago 100%

    Thanks for all the info. This makes me want to try it even more now!

    2
  • Suggest me a book on algorithms
  • tatterdemalion tatterdemalion 3w ago 100%

    There are plenty of good resources online. Here are some topics you probably wouldn't see in an intro algos course (which I've actually used in my career). And I highly recommend finding the motivation for each of these in application rather than just learning them abstractly.

    • bloom filter
    • btree
    • b+ tree
    • consensus algos (PAXOS, RAFT, VSR, etc)
    • error correction codes (Hamming, Reed Solomon, etc)
    • garbage collection (mark+sweep, generational, etc)
    • generational arena allocator
    • lease (i.e. distributed lock)
    • log-structured merge trees
    • min-cost + max-flow
    • request caching and coalescing
    • reservoir sampling
    • spatial partition (BVH, kd-tree, etc)
    • trie
    • write-ahead log
    4
  • Pop!_OS 24.04 and new COSMIC desktop hit alpha • The Register
  • tatterdemalion tatterdemalion 3w ago 100%

    That's good to hear. Is it as easy to navigate and customize as Sway/i3?

    2
  • I'm preparing for a new PC build, and I decided to try a new atomic OS after having been with NixOS for about a year. First I tried Kinoite, then Bazzite, but even though KDE has a lot of features, I found it incredibly buggy, and it even had generally poor performance, especially in Firefox. I don't really have time to diagnose these issues, so I figured I would put in just a little more effort and migrate my Sway config to Fedora Sway Atomic. I'm glad I did. The vanilla install of Fedora Sway is awesome. No bloat and very usable. I haven't noticed any bugs. Performance is excellent. And it was very straightforward to apply my sway config on top without losing the nice menu bar, since Fedora puts their sway config in `/usr/share/sway`. I'm also quite happy with the middle ground of using an OSTree-based Linux plus Nix and Home Manager for my *user config*. I always thought that configuring the system-level stuff in Nix was the hardest part with the least payoff, but it was most productive to have a declarative config for my dev tools and desktop environment. I originally tried NixOS because I wanted bleeding edge software without frequent breakage, and I bought into the idea of a declarative OS configuration with versioned updates and rollback. It worked out well, but I would be lying if I said it wasn't a big time investment to learn NixOS. I feel like there's a sweet spot with container images for a base OS layer then Nix and Home Manager for stuff that's closer to your actual workflows. I might even explore building my own OS image on top of Universal Blue's Nvidia image. Hope this path forward stays fruitful! I urge anyone who's interested in immutable distros to give this a try.

    47
    25

    I've never felt the urge to make a PL until recently. I've been quite happy with a combination of Rust and Julia for most things, but after learning more about BEAM languages, LEAN4, Zig's `comptime`, and some newer languages implementing algebraic effects, I think I at least have a compelling set of features I would like to see in a new language. All of these features are inspired by actual problems I have programming today. I want to make a language that achieves the following (non-exhaustive): - significantly faster to compile than Rust - at least has better performance than Python - processes can be hot-reloaded like on the BEAM - most concurrency is implemented via actors and message passing - built-in pub/sub buses for broadcast-style communication between actors - runtime is highly observable and introspective, providing things like tracing, profiling, and debugging out of the box - built-in API versioning semantics with automatic SemVer violation detection and backward compatible deployment strategies - can be extended by implementing actors in Rust and communicating via message passing - multiple memory management options, including GC and arenas - opt-in linear types to enable forced consumption of resources - something like Jane Street's Ocaml "modes" for simpler borrow checking without lifetime variables - generators / coroutines - Zig's `comptime` that mostly replaces macros - algebraic data types and pattern matching - more structural than nominal typing; some kind of reflection (via `comptime`) that makes it easy to do custom data layouts like structure-of-arrays - built-in support for multi-dimensional arrays, like Julia, plus first-class support for database-like tables - standard library or runtime for distributed systems primitives, like mesh topology, consensus protocols, replication, object storage and caching, etc I think with this feature set, we would have a pretty awesome language for working in data-driven systems, which seems to be increasingly common today. One thing I can't decide yet, mostly due to ignorance, is whether it's worth it to implement algebraic effects or monads. I'm pretty convinced that effects, if done well, would be strictly better than monads, but I'm not sure how feasible it is to incorporate effects into a type system without requiring a lot of syntactical overhead. I'm hoping most effects can be inferred. I'm also nervous that if I add too many static analysis features, compile times will suffer. It's really important to me that compile times are productive. Anyway, I'm just curious if anyone thinks this would be worth implementing. I know it's totally unbaked, so it's hard to say, but maybe it's already possible to spot issues with the idea, or suggest improvements. Or maybe you already know of a language that solves all of these problems.

    14
    9

    Who are these for? People who use the terminal but don't like running shell commands? OK sorry for throwing shade. If you use one of these, honestly, what features do you use that make it worthwhile?

    124
    84

    More specifically, I'm thinking about two different modes of development for a library (private to the company) that's already relied upon by other libraries and applications: 1. Rapidly develop the library "in isolation" without being slowed down by keeping all of the users in sync. This causes more divergence and merge effort the longer you wait to upgrade users. 2. Make all changes in lock-step with users, keeping everyone in sync for every change that is made. This will be slower and might result in wasted work if experimental changes are not successful. As a side note: I believe these approaches are similar in spirit to the continuum of microservices vs monoliths. Speaking from recent experience, I feel like I'm repeatedly finding that users of my library have built towers upon obsolete APIs, because there have been multiple phases of experimentation that necessitated large changes. So with each change, large amounts of code need to be rewritten. I still think that approach #1 was justified during the early stages of the project, since I wanted to identify all of the design problems as quickly as possible through iteration. But as the API is getting closer to stabilization, I think I need to switch to mode #2. How do you know when is the right time to switch? Are there any good strategies for avoiding painful upgrades?

    28
    24

    I just commented on [this post](https://lemmy.world/post/1076816) and it got removed very quickly. Then I noticed that all of the comments had been removed and the post is locked. I cannot understand why this happened, as the comments section had seemed pretty reasonable to me. This seems like bad moderation and I'm now less inclined to post or comment in the world news community. What should I do? I tried messaging a mod that is seemingly online and actively posting, but I got no response.

    49
    22

    After moving from lemmy.ml to programming.dev, I've noticed that web responses are fulfilled much more quickly, **even for content on federated instances like lemmy.ml and lemmy.world**. It seems like this shouldn't make such a big difference. If a large instance is overloaded, it's overloaded, whether the traffic is coming from clients with accounts on that instance or from other federated instances. Can this be explained entirely by response caching?

    4
    2