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

TGINSIGHT SIMILAR POSTS

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

Изходен канал @clockstackwheels · Post #884 · 5.10

Роскосмос пару дней назад опубликовал отчёт о том, почему упала "Луна-25". Там конечно канцелярит, но можно примерно понять, что двигатель коррекции получил неверные данные от акселерометра: из-за возможного попадания в один массив данных команд с различными приоритетами их исполнения прибором Это очень похоже на программную ошибку, а это моя сфера, и я решил над ситуацией поразмыслить. Хейтеры сразу стали строчить комментарии в стиле "Ололо, наняли каких-то идиотов, которые простейшие тесты не провели". Тут обычно справедливо вспоминают аварию с европейской ракетой Ариан-5 в 1996 году. Там буквально из-за пары строчек кода в результате неправильного приведения числовых типов ракета за 7 млрд баксов развалилась на куски в воздухе. Бывает. Что касается Роскосмоса, при всей его сомнительной репутации, объяснение "Дураки не провели тесты" звучит лично для меня неправдоподобно. На мой личный взгляд возможны два варианта: 1. Если в описании ошибки слово "приоритет" обозначает какой-то признак внутри объекта команды, значит, на входе в приёмный модуль эти команды не были отфильтрованы. Выглядит как грубая ошибка, целый логический блок упущен. Вряд ли этот блок вообще не написан, скорее всего он не выполнился. Такое бывает, если в тестовой среде есть какое-то условие, которого нет в рабочей, и именно это условие отвечает за выполнение участка кода. Сталкивался с таким миллион раз. Самое дикое из последнего: код парсит эксель-таблицу с числами. Разработчик написал, запустил проверил, прогнал тесты, всё ок. Отправляем в прод — все числа будто бы рандомно меняются на другие. Запускаем снова — у всех разработчиков функционирует нормально, а в проде на сервере нет. Таблица одна и та же. Можете подумать, почему так. Ответ: у разработчиков стоит русская локаль и десятичный разделитесь это запятая, а на проде в докере точка. При парсинге на проде запятая уже интерпретируется как разделитель тысячных разрядов. 2. Куда вероятнее, что слово "приоритет" в описании ошибки обозначает время, а, значит, список команд просто не был отсортирован, и в обработчик уже после актуальных значений попали какие-нибудь начальные нулевые данные, сбившие логику. По косвенному описанию проблемы очень похоже именно на это. Значит, на тестах всегда порядок возникновения команд соответствовал порядку их прихода, а в реальности перестал соответствовать. Вообще, работать с железом очень сложно. Какую-нибудь схемку заглючило от холода, она задержала ответ от датчика на миллисекунду, и всё. Никто не знал, что такая проблема возможна, пока она не возникла. Мне рассказывали о таком случае: юзер логинится на сайт и иногда логин проходит, а иногда нет. Логин и пароль те же самые. Просто в случайные моменты времени ему возвращают токен авторизации, а в другие моменты времени ошибку 403. Никакой закономерности нет вообще. Нет зависимости от времени суток и даты. Сервер точно работает стабильно и не падает все 100% времени. Почему так может быть? Ответ: у сервиса авторизации два инстанса, перед которыми балансировщик нагрузки. В одном инстансе данные для авторизации есть, в другом нет. Балансировщик при примерно одинаковой нагрузке включает просто случайный выбор между ними. В общем, программисты иногда допускают такие косяки, что какая-то мелочь может привести к серьёзной аварии. Это я вам говорю как программист, который пишет для атомных станций :) #dev

Hashtags

Резултати

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

Търсене: #class

当前筛选 #class清除筛选
djangoproject

@djangoproject · Post #86 · 11.07.2016 г., 11:52

https://docs.python.org/3/library/functions.html#classmethod classmethod(function) Return a class method for function. A #class method receives the class as implicit first argument, just like an instance method receives the instance. To declare a class method, use this idiom: class C: @classmethod def f(cls, arg1, arg2, ...): ... The @classmethod form is a function decorator – see the description of function definitions in Function definitions for details. It can be called either on the class (such as C.f()) or on an instance (such as C().f()). The instance is ignored except for its class. If a class method is called for a derived class, the derived class object is passed as the implied first argument. Class methods are different than C++ or Java static methods. If you want those, see staticmethod() in this section. For more information on class methods, consult the documentation on the standard type hierarchy in The standard type hierarchy.

Hashtags

🧠"Zamonaviy dizayn" kursida biznes savodxonligi va tadbirkorlik ko‘nikmalari 🏛 Biznes va tadbirkorlik oliy maktabi hamda Xalqaro inklyuziv hab hamkorligida “Zamonaviy dizayn” kursiga “Biznes savodxonligi” fani qo‘shimcha fakultativ dars sifatida kiritildi. ➕ Dasturda o‘quvchilar nafaqat ijodiy, balki tadbirkorlik va biznes ko‘nikmalarini ham o‘rganadilar. Ular biznes turlari, tashkiliy-huquqiy asoslar, soliq imtiyozlari, xarajatlarni tahlil qilish, tannarxni hisoblash, narxlarni shakllantirish va foydani baholash kabi muhim ko‘nikmalarni egallaydilar. Bu jarayonda Oliy biznes maktab professori D. Rasulova va malakali mutaxassis B. Ishmuxamedov kabi tajribali o‘qituvchilar o‘quvchilarga bilim va tajribalar ulashdilar. #GSBE#GraduateSchool#Class#Academic#Study 🔝Web-site |🔝Facebook | 🔝Instagram | 🔝Youtube

djangoproject

@djangoproject · Post #550 · 15.01.2018 г., 07:05

http://www.wikipython.com/other-concepts/anatomy-of-a-class/ It seems obvious, but note that you must define a class before you use it. When you create a #class, it establishes its own namespace and all its own local variables (except global definitions) exist only inside that #namespace. They do not interact with other variables of the same name outside it. This leads us to one very important “feature” of classes that you need to know. If you use the same word to designate some specific value both inside and outside the class blueprint, the instance value will take precedence when you try to use that value. #learn

djangoproject

@djangoproject · Post #451 · 27.09.2017 г., 19:33

https://en.wikipedia.org/wiki/Single_responsibility_principle The #single_responsibility_principle is a computer programming principle that states that every #module or #class should have responsibility over a single part of the functionality provided by the software, and that responsibility should be entirely encapsulated by the class. All its services should be narrowly aligned with that responsibility. Robert C. Martin expresses the principle as, "A class should have only one reason to change."

djangoproject

@djangoproject · Post #549 · 14.01.2018 г., 22:32

https://julien.danjou.info/blog/2013/guide-python-static-class-abstract-methods Mixing #static, #class and #abstract methods When building classes and inheritances, the time will come where you will have to mix all these methods decorators. So here's some tips about it. Keep in mind that declaring a method as being abstract, doesn't freeze the prototype of that method. That means that it must be implemented, but it can be implemented with any argument list.

科技&趣闻&杂记

@kejiqu · Post #4130 · 02.02.2026 г., 14:30

中国数十年来沿用的“天才班”培养体系正悄然助力其对美国的 AI 挑战 中国通过数十年来沿用的“天才班”培养体系,正在积极提升其在 AI 领域的竞争力。该体系每年选拔约 100,000 名青少年,提供大学水平的 STEM 教育。毕业生包括字节跳动、淘宝、拼多多、美团、寒武纪和 DeepSeek 等公司的关键人物。DeepSeek 在发布 R1 模型时,其 100 多人的研究团队几乎全部由“天才班”毕业生组成,成本远低于国际竞争对手。中国每年培养约 500 万 STEM 专业毕业生,远高于美国的 50 万。2025年,中国在国际科学奥林匹克竞赛中获得 22 枚金牌。Slashdot 🏷#China#AI#Genius#Class#DeepSeek 📢频道👥群组📝投稿

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