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

TGINSIGHT SIMILAR POSTS

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

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

reload_flag="" if [[ -n "${DEBUG}" ]]; then reload_flag="--reload" fi if [[ -n "${WORKER_COUNT}" ]]; then workers=${WORKER_COUNT} else workers=2 fi gunicorn --workers ${workers} \ --bind 0.0.0.0:8000 \ ${reload_flag} main.wsgi Писали такие конструкции чтобы проверить наличие флага и сформировать команду правильно? На самом деле можно сделать тоже самое проще. Для этого используются операторы условной подстановки, доступные в оболочках семейства POSIX. :- для установки значений по умолчанию ${WORKER_COUNT:-2} Если переменная не объявлена, то будет дефолтное значение 2. :+ подставляет указанный текст, если переменная не пуста ${DEBUG:+--reload} Если что-то есть в переменной то распечатается текст после символа +, в противном случае - ничего. Удобно для опциональных флагов, как в нашем примере. Итого наш скрипт может выглядеть так: gunicorn --workers ${WORKER_COUNT:-2} \ --bind 0.0.0.0:8000 \ ${DEBUG:+--reload} main.wsgi Есть еще два оператора. := не только подставить дефолтное значение, но и присвоить его переменной, если она пуста # никаких переменных еще нет VAL1=${VAL2:=hello} # теперь доступны обе echo $VAL1 $VAL2 # hello hello :? остановить выполнение с ошибкой, если переменной нет. echo ${MISS:?is required} bash: MISS: is required Код выхода будет 1. #tricks#linux

Резултати

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

Пребарај: #ancestry

当前筛选 #ancestry清除筛选
DNAmeter

@DNAMeter · Post #1922 · 20.05.2025 г., 09:50

Possible Y-DNA paternal lineage of Genghis Khan 🇲🇳 Scholars suggest haplogroups C3*, Q, R1b, and C2 for his paternal line. Dayan Khan’s descendants show C2c1a1a1-M407, a distinct Mongol C2 subclade, while common C2b1a3a1c2-F5481 in Kazakhs and Hazaras comes from ordinary soldiers. Jochi’s line links to C2b1a1b1-F1756; Derenko suggests C-F4002; a 2016 study points to R-M343 (R1b). Conflicting data leave his true Y-DNA unknown. تبار پدری Y-DNA احتمالی چنگیز خان 🇲🇳 دانشمندان برای خط پدری او هاپلوگروپ‌های C3*، Q، R1b و C2 را پیشنهاد کرده‌اند. نوادگان دایان خان زیرشاخه C2c1a1a1-M407 را نشان می‌دهند—یک شاخه منحصربه‌فرد از C2 مغولی—در حالی که C2b1a3a1c2-F5481 رایج در قزاق‌ها و هزاره‌ها ناشی از سربازان عادی است. نسل جُچی به C2b1a1b1-F1756 مرتبط است؛ درنکو C-F4002 را مطرح می‌کند؛ و مطالعه‌ای در ۲۰۱۶ به R-M343 (R1b) اشاره دارد. این تناقض‌ها تبار Y واقعی چنگیز خان را همچنان نامشخص نگه می‌دارد. #ancestry Oymaqat | اویماقات

Hashtags

Interesting Planet 🌍

@interesting_planet_facts · Post #480 · 01.08.2025 г., 16:22

🌎 The pikaia, a tiny worm-like creature from 500 million years ago, may be one of our earliest known ancestors. Its flexible, cord-like structure helped pave the way for the backbone found in all vertebrates today. ✨ #evolution⚡#paleontology⚡#ancestry 👉subscribe Interesting Planet

Google Facts™ [ ️@googlefactss🌎]

@googlefactss · Post #40667 · 18.02.2026 г., 07:04

The “Identical Ancestors Point” is estimated to be about 5,000–15,000 years ago. For Europeans, it may be around 1000 A.D. Some religions teach that all humans share common ancestors from a few thousand years ago, which is similar to these estimates. Simplified: Before this point, all living people share the same ancestors, but inherit different amounts of DNA. 🧬🌍 [Read more] #humanhistory#genetics#sciencefacts#ancestry#history@googlefactss