Sobes.tech

Compare multithreading, multiprocessing, and asynchronous in Python: differences, advantages, and disadvantages.

211

def withdraw(user_id, amount): user = User.objects.get(id=user_id) if user.balance < amount: raise InsufficientFundsError() user.balance -= amount user.save()

203

How to refresh the access token after expiration without requiring the user to log in each time? Where does the refresh token come from and how is it used?

185

Fix the error in the following Python class definition: ```python class OrderService: def __init__(self): self.db = PostgresDB() ```

182

What files and mechanisms of Claude Code can be used for persistent instructions, skills, and subagents? Have you used them?

154

-- Процесс A BEGIN; SELECT * FROM orders WHERE id = 1 FOR UPDATE; SELECT * FROM orders WHERE id = 2 FOR UPDATE; -- Процесс B (в это же время) BEGIN; SELECT * FROM orders WHERE id = 2 FOR UPDATE; SELECT * FROM orders WHERE id = 1 FOR UPDATE;

144

Write a timer decorator that measures and outputs the execution time of a function; then ensure argument passing and metadata preservation.

139
/3