Skip Navigation

Posts
3
Comments
90
Joined
2 yr. ago

  • Obviously I don't know your codebase but couldn't you do something like the following?

     
        
    function loadTranslations(locale) {
      const fallbackTranslations = require("/i18n/en.json");
      const translations = require(`/i18n/${locale}.json`);
      return {
         ...fallbackTranslations,
        ...translations
      };
    }
    
      
  • Ooh, that makes sense. I'm not too familiar with key resellers, so I was just guessing. But you explanation makes more sense. Thank you

  • I guess pirates don't result in additional costs for the developer from dealing with support tickets or other forms of customer care 🤷

  • GPG is probably the most commonly used one. If you want something with a slightly less awkward command line interface, you could try sequoia-pgp.

  • I've never worked on a larger C project, so I'm not the best judge, but I would recommend 21st Century C by Ben Klemens. It was very accessible and gave me a pretty good understanding of how the language worked and how to use modern versions of it.

  • Thank you and I hope you enjoyed your vacation :)

  • For me personally, I only keep things I find worth rewatching, so about 50% I delete after. Same with e-books. Games I don't really pirate (or only pirate them to see if I can run them on my computer). Usually I buy them on Steam and that's good enough, even though sometimes you lose access to them. I tend to not go back to older games.

  • Thank you for taking the time and writing out such a detailed response 🙏

  • You're not wrong but i don't think this has anything to do with being free. If companies want to track you, they will (except for those whosr business model is privacy maybe). Regardless of how much you pay them.

  • Is the screenshot you posted from Ubuntu or Pop!_OS? Because partition 4 is a swap partition.

    But I agree with mudeth, having a system partition and a dedicated /home one is a decent setup.

  • It was a cool movie with amazing scenes and it made A New Hope make more sense (explained why the death star had a design flaw.) But I found all the characters really forgettable and it just didn't give me a satisfying emotional payoff.

  • I think I misunderstood your initial post (and definitely didn't read it as carefully as I should have 😅).

    Do I understand your correctly that your goal is a companion object for your arrays that simplifies access? Not a new data structure that you'd user instead of arrays? If so, most of my points are moot.

    If your IDs are integers then there is no need for an hybrid at all, precisely because all you have to do is put each item at the same position as their ID.

    If you don't treat IDs as opaque values, this is true.

    I'll definitely run benchmarks so that users would be aware of performance losses, if any. But use cases of hybrid arrays are mostly small datasets so it usually shouldn't be a concern indeed.

    I think my point is actually wrong (it was really late when I was writing my initial response). Performance would be O(n), since that's the worst case scenario.

    Anyways, I hope you could take something useful from my answer.

    Happy hacking :D

  • I can second the recommendation for Andor. Used to love Star Wars, lost all interest in it after the new trilogy (although rogue one was alright) and finally got around to watch Andor which I really loved.

  • I think with digital content platforms in general, competition means more headaches for customers.

    The store front/streaming service is not what people sign up for, but the access to a certain movie, show or game. If the catalog of all available pieces of content gets scattered across multiple services you now have to use multiple apps, pay multiple subscription fees and search through multiple catalogs.

    I'd say from a customer's perspective, increased competition lead to a worse situation.

  • I'm pretty sure I've been in your situation but haven't created a dictionary/array hybrid.

    Without any more details about your use case and situation, I can imagine a few pitfalls with your solution:

    • Serialization might not behave as you would expect (JSON.stringify).
    • 3rd-party functions might not be able to deal with your data structure properly (again, potentially unexpected behavior).
    • You can't easily access array methods (find, filter, map etc).
    • How do you distinguish between ID access and index access? ArrayLike([ {id: "1" }, { id: "2" } ])[1] returns { id: "2" }, how do you access { id: "1" } by ID?
    • It's harder to reason about access time of lookups. However, this might not be a concern of yours.
    • It may cause confusion if you're working with other developers.

    That being said, unless you work in an environment where your code should be easily understandable by others, the best way to find out if this is a good idea or not, is to try :)

    Me personally, I usually use an associateBy function, when I need a values-by-ID structure. Of course this is not as convenient to use as your approach, but it's good enough for me.

     
        
    // this WILL drop elements if key is not unique 
    function associateBy(array, key) {
      return array.reduce((acc, el) => ({
        ...acc,
        [el[key]]: el
      }), {});
    }
    
    associateBy([
      {id: "foo"},
      {id: "bar"}
    ], "id").foo; // -> {id: "foo"}
    
      

    Good luck!

  • The pace at which you release new updates is very impressive. I hope you guys don't put too much pressure on yourselves and burn out.

    But anyways, thank you so much for the effort you pour into Jerboa. It makes using Lemmy a real joy!

  • I don't disagree but isn't the data on Lemmy public anyways? If they wanted they could scrape it, whether we defederate or not, couldn't they?