At first this article reads like your typical anti-piracy screed. It rants about how 10x more people watched GoT illegally (confusing them with lost sales) and ends with how downloading movies can get your credit card stolen....
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 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.
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.
Rogue One SpoilerAll the main characters just died and I didn’t really care 🤷♂️
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.
<pre style="background-color:#ffffff;">
<span style="color:#323232;">// this WILL drop elements if key is not unique
</span><span style="color:#323232;">function associateBy(array, key) {
</span><span style="color:#323232;"> return array.reduce((acc, el) => ({
</span><span style="color:#323232;"> ...acc,
</span><span style="color:#323232;"> [el[key]]: el
</span><span style="color:#323232;"> }), {});
</span><span style="color:#323232;">}
</span><span style="color:#323232;">
</span><span style="color:#323232;">associateBy([
</span><span style="color:#323232;"> {id: "foo"},
</span><span style="color:#323232;"> {id: "bar"}
</span><span style="color:#323232;">], "id").foo; // -> {id: "foo"}
</span>
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.
I’ve tried using it over the years but I never liked it because there was no information. So last night I looked at my local city and there is almost no information at all. I spent a few hours last night adding buildings and restaurants and removing incorrect items. It was actually kind of fun and therapeutic and I plan to do...
I regularly use OSM data through Organic Maps (mostly for larger European cities). The app is really polished and is a joy to use. So far I’m not missing any features from Google Maps.
I’ve also updated some faulty business hours for some restaurants so I guess I’ve contributed back.
E: With the recent developments in the world of free online services (YouTube blocking ad-blockers, Google lying to their customers about its TrueView ads, Twitter rate limiting free access, the Reddit API fiasco), I wonder how much longer we can take free services like Google Maps for granted. Having an open alternative may become even more important in the future.
Hey peeps. By now you all heard that Zuck’s meta has started and in a defederated mode. This instance has already signed the Anti-Meta Fedi Pact and we plan to not help improve the value of Facebook, if and when they plan to open federation....
That sounds good. Green-ish is really not the best look for oatmeal, though :)
Do you know if soaking chia seeds is enough to absorb their nutrients? I’m just asking because it’s often recommended to grind flax seeds, as they otherwise go through you without being digested properly.
Hi everyone, someone can explain, in simple words, why considering to switch on NixOs over other distro? And the use case? I think would help a lot of people (including me) to understand it better :D
Probably because most don’t know what Chromium is, or what open-source means or why certain websites don’t work (or work as well as in Chrome). Sad but true.
It is sad but did you really expect anything else?
Since many users migrated from Reddit, you’ll mostly get the same attitude that was prevalent there. And let’s not forget that veganism is still a very niche worldview. Most people look at meat as food and not as someone else’s body
I'm too lazy to cook and to follow complicated recipes, I'm the kind of guy who is more driven by feelings and vibes when I cook. Anyway, the recipe is: a jar of jackfruit. Ratatouille (bought, from a jar) How to: Boil the jackfruit in the ratatouille for a while (30-40 minutes?) When it is cooked: Add Bbq sauce (bought in the...
Love how simple the recipe is. That's actually something I might try because I don't need to buy two dozen exotic ingredients I'll never use ever again. Thanks for sharing!
One question though: I've never had pulled pork. Is it normal to eat it in an open sandwich? Won't the filling just fall out? Wouldn't a some kind of pocket or flat bread work better?
This is just a short rant and is not meant to insult anyone already on here, or further newcomers that joined, join or will still join. Also reminder that this is based on my experience and not necessarily facts, YMMV....
I feel the same way. I'm actually surprised how easy it was too break my Reddit habit and transition over here. So far the communities I've joined seem to have a more pleasant crowd than on Reddit. We'll see how long that lasts 😂
I started with Linux like many, I guess, by distro hopping. My first experience was with Knoppix in the late 2000s (because I didn't know what a live CD was), then I tried OpenSuse, went on to Fedora (is SELinux still such a pain in the ass as it was back then?) and then to Kubuntu.
If I remember correctly I switched to Arch some time after Plasma 4 came out. About 11 years ago. It was, back then, one of the only distributions that shipped the newest stock KDE that "just worked". Actually that might be wrong, but I didn't know what I was doing with Linux anyways and somehow I liked Arch enough to stay. I used it at home, for work (software development) and at college. And it serves me well in all those areas (minus some minor hiccups).
It's still fulfilling my needs but lately I've been flirting with NixOS. I might change my daily driver once I get a new laptop (still rocking a Thinkpad T430 from 2012 but it's starting to show its age).
I suspect there is some self-selection happening with the "exodus". Those who bother to take the extra steps to join the fediverse probably have some feeling of "we're in this together". We have a uniting cause. I personally have been lurking on Reddit for the last seven years or so, and yet here I am on Lemmy replying to your comment a few hours after joining.
The Vegan Chinese Kitchen by Hannah Che has been a favorite of mine this year. Every recipe I've tried from it tastes phenomenal. Great balance of quick/simple vs more complex/rewarding recipes.
While the recipes in there are not the fanciest, none other of my cookbooks has gotten as much use as "Easy Vegan Comfort Meals" by Derek Simnett. A lot of the recipes your can actually find on his YouTube channel (https://YouTube.com/@SimnettNutrition).
However, I have to say that none of the desserts look that appealing, so I've never made any. Maybe I just need to try some, though.
Game of Thrones was nearly "destroyed" by pirates illegally streaming HBO content (www.forevergeek.com)
At first this article reads like your typical anti-piracy screed. It rants about how 10x more people watched GoT illegally (confusing them with lost sales) and ends with how downloading movies can get your credit card stolen....
Jumping Spider at the park (lemmy.world)
Jerboa v0.0.40-alpha release (github.com)
[Help] JS array with getter by ID ?
Hi !...
Has anyone used or contributed to OpenStreetMap?
I’ve tried using it over the years but I never liked it because there was no information. So last night I looked at my local city and there is almost no information at all. I spent a few hours last night adding buildings and restaurants and removing incorrect items. It was actually kind of fun and therapeutic and I plan to do...
Paint me like one of your French ground beetles (lemmy.world)
Variegated June beetle, Eastern Ontario
Alright you dogs, you barked loud and clear. Facebook's Threads is blocked (lemmy.dbzer0.com)
I asked and enough of you answered that allowing to federate with threads.net even for the lolz would be considered too risky for y’all....
The Zuckiverse and you (lemmy.dbzer0.com)
Hey peeps. By now you all heard that Zuck’s meta has started and in a defederated mode. This instance has already signed the Anti-Meta Fedi Pact and we plan to not help improve the value of Facebook, if and when they plan to open federation....
Overnight oats with chia seeds
Our standard breakfast. Started adding spirulina powder which does NOT make it look that great…...
(Ars Technica article) Reddit mods fear spam overload as BotDefense leaves “antagonistic” Reddit (arstechnica.com)
NixOs why? (lemmy.ml)
Hi everyone, someone can explain, in simple words, why considering to switch on NixOs over other distro? And the use case? I think would help a lot of people (including me) to understand it better :D
When I hear about YouTube banning AdBlockers (lemmy.ml)
Not even on the fediverse are people willing to think about the animals they abuse every day :(
So I made lazy vegan pulled pork hamburger (lemmy.world)
I'm too lazy to cook and to follow complicated recipes, I'm the kind of guy who is more driven by feelings and vibes when I cook. Anyway, the recipe is: a jar of jackfruit. Ratatouille (bought, from a jar) How to: Boil the jackfruit in the ratatouille for a while (30-40 minutes?) When it is cooked: Add Bbq sauce (bought in the...
[Rant] The people - or rather the attitude - of r/piracy
This is just a short rant and is not meant to insult anyone already on here, or further newcomers that joined, join or will still join. Also reminder that this is based on my experience and not necessarily facts, YMMV....
TIL about /dev/full (en.wikipedia.org)
No, that's not a typo.
What's the longest you've stayed on a distribution?
This is kind of the anti-distro hopping thread. How long have you stayed on a single Linux distribution for your main PC? What about servers?...
deleted_by_author
What's your favorite vegan cookbook?
The Vegan Chinese Kitchen by Hannah Che has been a favorite of mine this year. Every recipe I've tried from it tastes phenomenal. Great balance of quick/simple vs more complex/rewarding recipes.