defmodule AppWeb.Component.FormFromSchema do | |
use AppWeb, :live_component | |
attr :changeset, :any, required: true | |
attr :event_suffix, :string, default: "" | |
attr :schema, :any, required: true | |
attr :uploads, :any, default: nil | |
attr :visibility_rules, :any, default: %{} | |
attr :field_type_rules, :any, default: %{} |
Celery worker blocks on rate limited task | |
========================================= | |
by github.com/miraculixx | |
Problem: | |
If a worker has a rate_limit active on some task, and that task | |
arrives (is received) more often than the rate limit interval, all | |
worker processes will block on these task instances and stop | |
consuming other tasks as soon as the prefetch count has maxed out |
library(data.table) | |
prep_data=F | |
if(prep_data){ | |
# https://www.insee.fr/fr/statistiques/2520034 | |
carreaux=foreign::read.dbf("external_data/carroyage_200m.dbf") | |
carreaux=data.table(carreaux) | |
head(carreaux) | |
carreaux[,idINSPIRE:=as.character(idINSPIRE)] |
# Rate limiting with Celery + Django + Redis | |
# Multiple Fixed Windows Algorithm inspired by Figma https://www.figma.com/blog/an-alternative-approach-to-rate-limiting/ | |
# and Celery's sometimes ambiguous, vague, and one-paragraph documentation | |
# | |
# Celery's Task is subclassed and the is_rate_okay function is added | |
# celery.py or however your App is implemented in Django | |
import os | |
import math |
Citing BlakeClass https://www.reddit.com/r/AskReddit/comments/24vzgl/you_just_won_a_656_million_dollar_lottery_what_do/chba4bf/
Now you're fucked.
No really.
You are.
import os | |
import unittest | |
from airflow.models import DagBag | |
class TestDags(unittest.TestCase): | |
""" | |
Generic tests that all DAGs in the repository should be able to pass. | |
""" |
Instructions: Solve the levels in ascending order, and send your code and data at [email protected] when you’re done. We love SQL tricks, but we also value your ease to write code. You can use any langage you like (brainfuck anyone?) as long as you have a strategy to deploy and maintain this code.
Goal: Provide the BI team a report of the occupancy rate of the fleet per city.
For a certain half-day, we define the occupancy rate as the nb of rented cars / nb of available or rented cars.
For a half day T, a car is considered available by default. This default state can be changed to:
- Seek out failure, it teaches us to think like a scientist. If you start with a hypothesis, then try to prove yourself wrong, you’re bound to make much better decisions. You have to be willing to fail, and that in itself is going to help you build confidence and be more convicted about what your strategy is in the end.
- There are hundreds of methods for building products and running teams. As a quality PM, it's important to have an open mind about all of it, but finding your own process and philosophy can be grounding. It helps you find your pillars so that you don't smash into things while you're building. Remember, however, that you can always find a budget for remodeling. 😉
- The beauty of a good process is when it just becomes how you do your work. When you forget you're following a process at all is when you know the process is working for you, your team, your company, and your customers.
- The advice I give new Product Managers or PMs coming onto a team for the first
A running example of the code from:
- http://marcio.io/2015/07/handling-1-million-requests-per-minute-with-golang
- http://nesv.github.io/golang/2014/02/25/worker-queues-in-go.html
This gist creates a working example from blog post, and a alternate example using simple worker pool.
TLDR: if you want simple and controlled concurrency use a worker pool.