News for hackers. Stuff that matters.

MaxMoney

Re:DRY is an over-rated programming principle? on Thursday July 07, 2022 @05:57AM (#32011907)
I wouldn't recommend naming your function with a suffix that relates to a model. You are better off doing:

def generate_payload(crust, sauce, cheese, toppings):

In the past I've used a timestamp key for the org. Create a key like f"org_{org.pk}" that has a timestamp. Then append that timestamp to the `get_users_for_org`. Now all you have to do is invalidate the org timestamp to generate a rolling key (requires more memory).
Re:More intuitive partial function application in Python on Sunday February 20, 2022 @08:57PM (#30411126)
whats wrong with functools.partial? I don't see that anywhere in the arguments.. all you say is "I find functools.partial unintuitive".. why? its a simple wrapper.
Re:Self-Organizing Teams on Sunday December 19, 2021 @09:43PM (#29621015)
I suppose it depends on what product you have
Re:Box – Python dictionary with dot notation on Sunday December 19, 2021 @09:42PM (#29621010)
it probably does nested dicts
Re:Self-Organizing Teams on Sunday December 19, 2021 @05:58PM (#29619424)
I've always thought that the closer the engineer is to the end user the better.
Re:Box – Python dictionary with dot notation on Friday December 17, 2021 @06:08PM (#29599437)
You can get away with a single hashed dict:

from types import SimpleNamespace

mydict = { "name": "moe", "age": 3, "test": {"name": "josh"} # wont work }

dotted = SimpleNamespace(*mydict)

print(dotted.name, dotted.age) # moe 3

Re:Chess.com vs. Lichess on Friday December 17, 2021 @10:54AM (#29593860)
i have sources. lots of old employee posts who quit also talking shit about the ceo
Re:Chess.com vs. Lichess on Wednesday December 15, 2021 @06:46PM (#29573025)
Lichess is so much better. It's free. chess.com thinks its facebook and it looks really childish (they probably copied things from chesskid). They have like a billion developers (why? its chess.. and already done). Lichess is like 1 guy (who I think used to work for chesscom until the ceo was a dick or something)
Re:Chess.com vs. Lichess on Wednesday December 15, 2021 @06:45PM (#29573015)
Lichess is much, much better. It's free. Chess.com is a bloated mess and it won't change.. they think they are facebook.