magic_lobster_party

  • 0 Posts
  • 17 Comments
Joined 6 months ago
cake
Cake day: August 15th, 2024

help-circle


  • I’m confused about the state of Christians in America. I mean, they surround their entire lives around this Jesus character as he’s depicted in the Bible. They believe he’s God’s manifestation as a person without sin and yada yada.

    Yet, they think Trump is a good representation of Christian values. If anything, he’s closer to the embodiment of the antithesis of Jesus Christ. How is it possible to be so bad at your own religion? The teachings of Jesus isn’t exactly rocket science. It’s mostly just ”be kind to others”.

    But somehow these people - who supposedly spend all their waking hours around his teachings - are so ignorant they fail to grasp this basic concept. Nah, instead they cherry pick some ambiguous sentence from their book to justify their hate for others.

    Well, that’s my rant about how the level of ignorance is beyond my comprehension. Or if you prefer: I’m ignorant about where all this ignorance is coming from.













  • magic_lobster_party@fedia.iotoMicroblog Memes@lemmy.worldNo no no
    link
    fedilink
    arrow-up
    35
    arrow-down
    4
    ·
    14 days ago

    It’s the voters who voted for Trump. It’s that simple.

    Although I didn’t have ”Trump ending the Israel Palestine conflict by making Palestine American” on my bingo card, it was always super obvious that Trump is way more pro Israel than Kamala. If you thought otherwise you didn’t pay attention at all.



  • Basically it’s just an optimization of a double nested for loop. It’s a way to avoid running the inner for loop when it is known there will be no hit.

    This is useful when we for example want to find all product orders of customers in a particular country. The way we can do this is to first filter all customers by their country, and then match orders by the remaining customers. The matching step is the double for loop.

    Something like this:

    for order in orders:
        for customer in customers_in_country:
            if order.customer_id == customer.id:
                …
    

    Many orders won’t match a customer in the above query, so we want to single out these orders before we run the expensive inner for loop. The way they do it is to create a cache using a Bloom filter. I’d recommend looking it up, but it’s a probabilistic cache that’s fast and space efficient, at the cost of letting through some false positives. With this particular use case it’s ok to have some false positives. The worst thing that can happen is that the inner for loop is run more times than necessary.

    The final code is something like this:

    bloom_filter = create_bloom(customers_in_country)
    for order in orders:
        if bloom_filter.contains(order.customer_id):
            for customer in customers_in_country:
                if order.customer_id == customer.id:
                    …
    

    Edit: this comment probably contain many inaccuracies, as I’ve never done this kind of stuff in practice, so don’t rely too much on it.