TGTGInsightтелеграм анализLIVE / telegram public index
← Такты, стеки, два колеса

TGINSIGHT SIMILAR POSTS

Намери подобно съдържание

Изходен канал @clockstackwheels · Post #1029 · 17.10

TW: нудный гик-стафф про бытовую технику. Кофемашина в какой-то момент не включила индикатор переполненности контейнера для жмыха. Это странно, поэтому я стал разбираться. Вообще, техника редко глючит непонятным образом и ведет себя хаотично. Всегда есть какая-то причина. При отладке программы это тоже надо всегда помнить. Как машина узнаёт, что контейнер полон? Никак. У контейнера есть герконовый датчик, показывающий факт его установки в корпус. Когда ты его вытаскиваешь, машина думает, что ты его очистил. А дальше программа просто знает, что одинарный кофе наполняет контейнер на X, двойной на 2X, а вместимость nX. Что произошло: я открыл контейнер посмотреть, заполнен ли он целиком. А потом закрыл обратно, не очистив. В оценке уровня жмыха появилась аддитивная погрешность. Если позволить человеку ввести систему в неправильное состояние, он рано или поздно это сделает. Кстати, по той же причине мне нравится DDD как архитектура для энтерпрайз разработки: если всё правильно спроектировать, то программист слоя приложения, который является "пользователем" домена, не сможет сломать состояние сущностей и агрегатов. В общем, в машине не хватило защиты от дурака. Как бы я решал эту задачу? Сходу приходит в голову какой-нибудь оптический датчик в верхней части контейнера. В худшем случае он запачкается и сработает ложно-положительно, что вызовет необходимость для пользователя лишний раз почистить контейнер. Но ТРИЗ намекает нам на другой подход. Можно попробовать полностью исключить появление жмыха. Так устроены, например, капсульные машины. У нас такая была, но перешли на зерновую, потому что вкусный качественный кофе в зёрнах на порядки дешевле, чем в капсулах, а пьем мы его много. Особенно кофе с молоком, для которого в капсулах просто концентрат, а не настоящее молоко. Если исключить жмых нельзя, то нужно сделать его удаление неотъемлемой частью процесса обслуживания машины. Думаю, я бы попробовал объединить конструктивно контейнер для зёрен и для жмыха, и рассчитать объёмы так, чтобы второго хватило на один цикл траты первого. Тогда даже датчики не нужны: кончились зёрна, и ты неизбежно достаешь контейнер и очищаешь. Сфоткал для вас чашечку ароматного капучино. #life

Hashtags

Резултати

Намерени 8 подобни публикации

Търсене: #lambda

当前筛选 #lambda清除筛选
djangoproject

@djangoproject · Post #341 · 27.05.2017 г., 13:10

# Because Python has first-class functions they can be used to emulate switch/case statements def dispatch_if(operator, x, y): if operator == 'add': return x + y elif operator == 'sub': return x - y elif operator == 'mul': return x * y elif operator == 'div': return x / y else: return None def dispatch_dict(operator, x, y): return { 'add': lambda: x + y, 'sub': lambda: x - y, 'mul': lambda: x * y, 'div': lambda: x / y, }.get(operator, lambda: None)() #lambda »> dispatch_if('mul', 2, 8) 16 »> dispatch_dict('mul', 2, 8) 16 »> dispatch_if('unknown', 2, 8) None »> dispatch_dict('unknown', 2, 8) None

Hashtags

#lambda#bangdream!

djangoproject

@djangoproject · Post #582 · 17.03.2018 г., 05:18

http://www.paulbrownmagic.com/blog/vslambda Python has support for #lambda functions, Haskell is built upon lambda calculus. The two are not the same and this is the reason why lambda should have been removed in #Python3. This post examines the differences, reviews the use in Python, and offers a more pythonic, honest syntax. #learn

GitHub Trends

@githubtrending · Post #14851 · 22.06.2025 г., 11:30

#python#aws#aws_cli#aws_sdk#cloud#cloud_management#cloudformation#cloudwatch#dynamodb#ec2#ecs#elasticsearch#iam#kinesis#lambda#machine_learning#rds#redshift#route53#s3#serverless AWS Lambda lets you run code without managing servers, automatically scaling to handle any number of requests and charging you only for the compute time you use. It supports many programming languages and integrates well with other AWS services, making it ideal for tasks like real-time data processing, image handling, chatbots, and automating backups. This serverless approach saves you time and money by removing infrastructure management and adapting instantly to demand spikes, so your applications stay responsive and cost-efficient even as usage changes. Lambda is great for building scalable, event-driven applications quickly and easily. https://github.com/donnemartin/awesome-aws

djangoproject

@djangoproject · Post #298 · 17.04.2017 г., 07:42

#AI#Artificial_Intelligence #aiohttp #API #AWS #asyncio #audio #automated_testing #automation #atexit #BeeWare #button #client #concurrency #cron #Coroutine #data_analysis #data_mining #data_processing #database #Deep_Learning #Debian #decorator #dispatch #django #dropdownbox #Docker #event #Firefox #form #freeze #functool #Generator #GeoDjango #Google #GPU #Gym #learn #Image_processing #intelligence #input #IOT #lambda #lists #machine_learning #Magenta #map #Metaprogramming #Micro_services #mind #monitoring #MongoDB #Mozilla #Multipart #multi_touch_apps #multiprocessing #Nodes #NoSQL #numeric_computation #numerical #NumPy #OAuth #object_serialization #OCR #overloading #package #parallel #pipeline #protocols #PostGIS #pyAudioAnalysis #PyInstaller #PySide #PyTorch #pytest #python #Pyvideo_archives #Qt #Redis #random #request #REST #satellite #scrapy #scikit_learn #SciPy #searching #submit #selectbox #Selenium #serialization #server #session #socket #sound #task #TensorFlow #text_boxes #text #test #telegram #Thread #transport #tuples #Universe #Unix #urllib #upload #Web

djangoproject

@djangoproject · Post #425 · 28.08.2017 г., 03:37

#AI#Artificial_Intelligence #aiohttp #AngularJS #API #AWS #asyncio #audio #automated_testing #automation #atexit #BeeWare #button #client #concurrency #Coroutine #cron #curl #data_analysis #data_mining #data_processing #database #Deep_Learning #Debian #decorator #dict #dispatch #django #django_cms #dropdownbox #Docker #event #Firefox #form #Generator #GeoDjango #git #Google #GPU #Gym #learn #Image_processing #intelligence #input #IOT #lambda #learn #lists #machine_learning #Magenta #map #Metaprogramming #Micro_services #mind #monitoring #MongoDB #Mozilla #Multipart #multi_touch_apps #multiprocessing #Nodes #NoSQL #numeric_computation #numerical #NumPy #OAuth #object_serialization #OCR #overloading #package #parallel #pipeline #protocols #PostGIS #pyAudioAnalysis #pycon #Pyflakes #PyInstaller #PySide #PyTorch #pytest #python #Pyvideo_archives #Qt #React #Redis #random #request #REST #satellite #scrapy #scikit_learn #SciPy #searching #submit #selectbox #Selenium #serialization #server #socket #task #telegram #TensorFlow #test #text_boxes #text #tuples #unicode #Universe #Unix #urllib #upload #Web

djangoproject

@djangoproject · Post #513 · 30.11.2017 г., 22:00

#AI#Artificial_Intelligence #AJAX #aiohttp #Anaconda #AngularJS #API #Atom #AWS #asyncio (#Asynchronous) #audio #automated_testing #automation #atexit #BeeWare #Big_Data #bitcoin #blockchain #Bluemix #Brython #button #Celery #client #class #classmethod #concurrency #Coroutine #cron #CSS #curl #data_analysis #data_mining #data_processing #database #Deep_Learning#deep_learning #Debian #decorator #deploy #dict #dispatch #django #django_cms #Django_REST_Framework #dropdownbox #Docker #event #Firefox #Flask #form #functions #Generator #GeoDjango #git #Google #GPU #GUI #Gym #host #HTML #httplib #learn #Image_processing #intelligence #input #Instagram #IOT #iPython #Jupyter #lambda #learn #License #Linux #lists #machine_learning #Magenta #map #Matplotlib #Metaprogramming #Micro_services #Micropython #mind #monitoring #MongoDB #modules #Mozilla #Multipart #multi_touch_apps #multiprocessing #Nodes #NoSQL #numeric_computation #numerical #NumPy #network #neural_network #OAuth #object_serialization #OCR #overloading #package #parallel #pipeline #protocols #PostGIS #pyAudioAnalysis #pycon #Pyflakes #PyInstaller #PyPI #PyQt #PySide #PyTorch #pytest #python #Pyvideo_archives #Qt #Raspberry_Pi #React #Redis #random #request #Regular_Expressions (#re) #REST #RSS #satellite #scikit_learn #SciPy #scrapy #searching #selectbox #Selenium #serialization #server #sessions #single_responsibility_principle #socket #Spark #str #submit #task #telegram #template #TensorFlow #test #text_boxes #text #tuples #unicode #Universe #Unix #unit_test #urllib #upload #uWSGI #Web #WSGI