TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #32 · 7 фев.

Скорее всего уже слышали, что складывать строки через + это плохая практика. Падение производительности, и всё такое. Без лишних слов, давайте измерять: from timeit import timeit def t1(): # складываем 10 строк через + из переменной t = 'text' for _ in range(1000): s = t + t + t + t + t + t + t + t + t def t2(): # склеиваем список строк через метод join arr = ['text'] * 10 for _ in range(1000): s = ''.join(arr) def t3(): # складываем через + но не из переменной а непосредственно инлайн объекты for _ in range(1000): s = 'text' + 'text' + 'text' + ... # всего 10 раз Теперь каждую строку склейки запустим по 10М раз >>> timeit(t1, number=10000) 0.21951690399964718 >>> timeit(t2, number=10000) 1.4978306379998685 >>> timeit(t3, number=10000) 0.2213820789993406 Хм, а нам говорили что через "+" это плохо и медленно ))) 😁 Тут стоит учитывать, что речь идёт о склейке множества длинных строк. Давайте изменим условия: def t4(): t = 'text'*100 for _ in range(1000): s = t + t + t + t + t + t + t + t + t def t5(): arr = ['text'*100] * 10 for _ in range(1000): s = ''.join(arr) def t6(): for _ in range(1000): s = 'text'*100 + 'text'*100 + ... # всего 10 раз >>> timeit(t4, number=10000) 12.795130728000004 >>> timeit(t5, number=10000) 2.642637542999182 >>> timeit(t6, number=10000) 0.2184546610005782 Вот, уже другой разговор, сразу видна разница, в среднем в 6 раз. Но погодите, почему последний тест t6() по скорости такой же как и t3()? Ведь строки теперь в 100 раз длиннее! Это вопросы оптимизации кода, какие простые изменения ускоряют или замедляют выполнение программы. Мы столкнулись с примером обхода обращения к переменной. Например, именно так работает директива #define в С++, во время компиляции подставляя значение переменной вместо ссылки на неё. В Python это тоже работает, но часто ли вы сможете встретить такой способ работы со строками? К сожалению, способ почти только теоретический. В целом, тесты показали то, что мы хотели. Делаем выводы самостоятельно. Полный листинг 🌍 #tricks

Резултати

Пронајдени 1 слични објави

Пребарај: #glanders

当前筛选 #glanders清除筛选
VET's HUB ®

@vets_hub · Post #29716 · 16.08.2025 г., 14:10

#disease🤢 #Glanders: A Zoonotic Disease Affecting Equines and Humans 🟢1. Cause of Disease: Glanders is a contagious and often fatal disease caused by the bacterium Burkholderia mallei. This bacterium primarily affects equines (horses, donkeys, mules) but can also infect other animals and humans. 🟢2. Ways of Conflict and Disease Transmission: • Direct Contact: The most common route of transmission is through direct contact with infected animals, such as through bodily fluids (nasal discharge, saliva, urine, milk), or contaminated equipment. • Inhalation: Inhaling contaminated dust or aerosols can lead to infection. • Ingestion: Consuming contaminated food or water can also cause infection. 🟢3. Disease Symptoms: Glanders can manifest in both acute and chronic forms, with symptoms varying depending on the severity and location of the infection. Acute Form: • High Fever: Sudden onset of high fever. • Nasal Discharge: Thick, purulent nasal discharge that often has a foul odor. • Coughing: Severe coughing with potential respiratory distress. • Skin Lesions: Nodules and ulcers on the skin, often on the head, neck, and limbs. • General Weakness: Loss of appetite, lethargy, and muscle weakness. Chronic Form: • Chronic Nasal Discharge: Persistent nasal discharge, often with a more localized involvement of the nasal passages. • Nodules: Subcutaneous nodules, especially around the head and neck. • Joint Pain: Lameness and swelling in joints. • Lung Lesions: Pneumonia and respiratory complications. 🟢4. Disease Diagnosis Methods: • Bacteriological Culture: Samples from nasal discharge, skin lesions, or blood can be cultured to identify the Burkholderia mallei bacterium. • Serological Tests: Tests to detect antibodies against the bacterium. • Polymerase Chain Reaction (PCR): A molecular test that detects specific DNA sequences of Burkholderia mallei. 🟢5. Disease Treatment and Appropriate Drugs: • Antibiotics: Treatment typically involves long-term administration of specific antibiotics like tetracyclines or aminoglycosides. • Anti-inflammatory Medications: To manage inflammation and pain. • Supportive Care: Hydration, nutrition, and symptomatic treatment. Glanders is often difficult to treat, and long-term follow-up is necessary to prevent relapses. 🟢6. Disease Prevention: • Quarantine: Strict quarantine measures for infected animals and potential contact animals are essential. • Vaccination: A vaccine for horses is available in some countries, offering limited protection. • Biosecurity: Implementing strict hygiene practices to prevent the spread of the bacterium, including disinfecting equipment and minimizing direct contact with potentially infected animals. • Early Detection: Promptly identifying and isolating animals exhibiting signs of Glanders is crucial for preventing further spread. 🟢7. Quarantine & Human Involvement: • Quarantine: Quarantine of infected animals and animals that may have been in contact is crucial to prevent further transmission. • Human Involvement: Glanders is a zoonotic disease, meaning it can be transmitted to humans. The most common route of infection in humans is through contact with infected animals or their bodily fluids. Human symptoms are similar to those seen in horses, and treatment often involves antibiotics. 🟢8. Immunity and Recovery: • Immunity: Recovery from Glanders does not guarantee immunity, and reinfection is possible. • Recovery: The disease can be fatal, even with treatment. Recovery can be prolonged, and long-term complications are possible. 🔴Important Note: Glanders is a highly contagious and potentially fatal disease. It's crucial to consult with a veterinarian immediately if you suspect your horse or another animal may be infected. https://t.me/vets_hub