Skip Navigation

Posts
9
Comments
205
Joined
2 yr. ago

  • Lower skill ceiling. One option can be done by pretty much anyone at a high volume output, the other would require a lot training and are not available for your average basement dweller.

    Good luck trying to regulate it though, Pandora's box is opened and you won't be able to stop the FOSS community from working on the tech.

  • I personally would prefer the if check and return 0 in most instances just because it's clearer and more readable. But the two previous functions were one-liners so it just looked better if get_winnings() also was.

  • Feels like the challenges are getting easier than harder currently. Fairly straightforward when doing it the lazy way with python. ::: spoiler Python

     
        
    import re
    
    winning_number_pattern: re.Pattern = re.compile(r' +([\d ]*?) +\|')
    lottery_number_pattern: re.Pattern = re.compile(r'\| +([\d ]*)')
    
    
    def get_winning_numbers(line: str) -> set[str]:
        return set(winning_number_pattern.search(line).group(1).split())
    
    
    def get_lottery_numbers(line: str) -> set[str]:
        return set(lottery_number_pattern.search(line).group(1).split())
    
    
    def get_winnings(winning_numbers: set[str], lottery_numbers: set[str]) -> int:
        return int(2 ** (len(winning_numbers.intersection(lottery_numbers)) - 1))
    
    
    def puzzle_1() -> int:
        points: int = 0
        with open('day4_scratchcards.txt', 'r', encoding='utf-8') as file:
            for line in file:
                points += get_winnings(get_winning_numbers(line), get_lottery_numbers(line))
        return points
    
    
    class ScratchCard:
        def __init__(self, line: str):
            self.amount: int = 1
            self.winnings: int = len(get_winning_numbers(line).intersection(get_lottery_numbers(line)))
    
        def update(self, extra: int) -> None:
            self.amount = self.amount + extra
    
        def __radd__(self, other):
            return self.amount + other
    
    
    def puzzle_2() -> int:
        scratch_card_list: list[ScratchCard] = []
        with open('day4_scratchcards.txt', 'r', encoding='utf-8') as file:
            for line in file:
                scratch_card_list.append(ScratchCard(line))
    
        for i, scratch_card in enumerate(scratch_card_list):
            for j in range(1, scratch_card.winnings + 1):
                try:
                    scratch_card_list[i + j].update(scratch_card.amount)
                except IndexError:
                    pass
        return sum(scratch_card_list)
    
    
    if __name__ == '__main__':
        print(puzzle_1())
        print(puzzle_2())
    
      
  • Then I would suggest you to re-read the article and spend a minute to think about how that relates to how the technology can be abused. I'm not sure I can make it more obvious, and honestly if feels like you don't understand it in bad faith.

  • You asked how it can be abused. This is one way it can be abused.

    If it's computer, it can be hacked. Doesn't have to be the car company itself that does the spying, though considering the track record of American companies, it wouldn't surprise me. It could be you local police department, your distrustful partner, etc...

  • Please refrain from using the word "retard" as a slur on our instance in accordance to our user rules.

  • I don't have any experience with pipx and personally prefer to just skip the .toml and place the whole pyprojectsetup in setup.py.

    With that method, I would write inside setup()

     
        
    packages=find_packages()  # Include every python packages
    package_data={  # Specify additional data files
        'yourpackagename': [
            'config/*'
            etc...
        ]
    }
    
    
      

    This would however require you to have a package folder which all your package files/folders are inside, meaning the top level repo folder should not have any files or other folders that you want to distribute. Your MANIFEST.in looks fine.

  • If you believe it's an bug with our instance, try making a post over at !meta@programming.dev . Posting here is unlikely to grab the attention of an admin unless the post gets reported (which it did). Before that though, look up if isn't just the more likely scenario of a general lemmy bug/quirk caused by mismatched lemmy versions, etc...

  • I don't believe for one bit that windows will move to a pure subscription based model. They are greedy, but not stupid.

    What's more believable is that the base OS will be the same as usual, but if you want fancy AI assistants in your OS, you must subscribe, with the justification being that MS must pay for the servers running the models you're using.

  • Boost really should just update the UI to simply show how many upvotes and downvotes a post has. No reason to stick the inferior sum total of all upvotes and downvotes that reddit prefers.

  • Stickied post would work just fine yeah, can't really expect the developer to set up a public repo for just tracking features. Hopefully Ruben takes notice.

  • if Valve isn't selling at a loss to poorer regions then they are simply extracting additional profit from higher-income regions on the assumption that those customers can afford it.

    Valve can't sell for a loss the same way ebay can't. Valve simply takes a percentage of the price everytime a game is bought, publishers are in complete control of the price they want to sell. Often, publishers will let Steam automatically set regional pricing based e.g. the American price though.

    The way these publishers operate, they will simply set the price at the highest possible value to extract as much as money ad they can from those willing to spend 60+$. Those unwilling or incapable of spending that amount of money, will just buy the game later on a sale. Price skimming has only become more and more prevalent in PC gaming with steam being the "innovator" of frequent sales.

  • Yes I did read it. I was pointing out that all this will do is screw over citizens of poorer EU countries. India vs USA was simply to make it obvious why the concept of geo blocking makes sense. Germans will on average have stronger buying power than someone in Latvia.

    Steam is a storefront, not a competitor to game publisher. It's effectively no different than Lidl agreeing to run a regional rebate program for Samsung TVs in Latvia for whatever reason.

    The geo blocking enabled cheaper prices for certain countries, not higher. The only people who would have an issue with it is people from richer countries that for some reason are jealous of lower prices in some countries.

  • Localised pricing is good though? Is it really fair ask someone in India to pay the same price as an American? If you can't geo block keys, you can't stop people taking advantage by using a VPN to buy games from whatever country got the lowest price. The result will just be publishers keeping the high price for every country, screwing poorer regions over.

    Also, what they did wouldn't really qualify as price fixing.

  • Valve won't break the law for other publisher's profits. Steam is just a store front, they were geo blocking on behalf of other publishers.

    Valve also doesn't take a cut from steam key sales not bought directly through their storefront, so the geoblocking keys isn't something that will impact them. More likely, this will result in citizens of poorer EU countries getting screwed over by having to pay higher prices for games, since they can't stop EU citizens from taking advantage of buying the game from the poorest EU country.

  • Nynorsk supporters just never quit do they. Half the country wants it gone and less than 10 percent of the country uses it, still it's on the list while Swedish and Danish aren't, lmao.