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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #239 · 3 мај

Один из самых удобных способов записать данные это использование готовых форматов, такие как JSON или YAML. Из плюсов такого подхода стоит отметить вот что: 🔸 готовый, повсеместно используемый и поддерживаемый формат 🔸 простой и понятный файл, удобочитаемый для человека 🔸 можно легко редактировать в любом текстовом редакторе без специальных программ и библиотек Но есть и минусы 🔹 затраты времени при записи файла (кодирование данных в нужный формат строки) 🔹 затраты времени при чтении файла (декодирование данных в Python объекты) 🔹 размер файла увеличивается из-за разметки данных (скобки, запятые, переносы, отступы...) 🔹 перед записью все данные должны быть помещены в память в полном объёме (не всегда) 🔹 при чтении необходимо считать весь файл в память и только потом декодировать данные Если нужно писать немного данных в несколько файлов, то затраты по времени не ощутимы. Обычно это файлы конфига или какие-либо метаданные. Это отличный вариант под такие задачи. Есть и другой поход к записи файлов - это бинарные файлы. Используется, когда данных достаточно много и никто их не собирается читать глазками😳. 🔸 очень быстрая запись 🔸 чтение значительно быстрей чем JSON, YAML итд 🔸 размер файла значительно меньше, так как нет разметки 🔸 можно записывать данные по мере поступления не загружая всё в память 🔸 можно извлечь любую часть данных независимо Из минусов 🔹 нужно определить свой формат записи данных (если не используете готовую спецификацию определённого формата) 🔹 не получится открыть файл и визуально понять что там записано, а для чтения файла потребуется знать его спецификацию. 🔹 не так-то просто создать такой файл без специальной библиотеки В таком виде удобно записывать большой массив любых однородных данных. Например, мониторинг валютной биржи или кэшированная анимация 3D геометрии. (Это не означает что нельзя записать данные разного типа, просто это будет не так удобно) Представьте себе JPG-картинку. По сути это немного мета-информации и большой массив пикселей. Тоже самое со звуком или видео файлом. Поэтому, если вы попробуете открыть картинку в текстовом редакторе вы увидите что-то вроде такого f15d cd29 a564 4578 ... 09e2 9bc4 a696 1253 ... 84e9 4de1 3b23 c24a ... 2534 5161 28e0 709d ... ... Это и есть записанные байтики. И для их чтения требуется определённый софт который знает что с ними делать. Под каждый тип файла. К чему это я? Читайте в следующем посте... #tricks#basic

Резултати

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

Пребарај: #industrialbase

当前筛选 #industrialbase清除筛选
American Оbserver

@american_observer · Post #4947 · 24.01.2026 г., 17:59

📰 Pentagon Unveils 2026 National Defense Strategy: Fortress America, Not Global Policeman The Pentagon’s 2026 National Defense Strategy marks a sharp break from the post–Cold War era: the U.S. military is reordering its mission around homeland defense, deterrence through strength, and pushing allies to pick up a far heavier military burden. Defense Secretary Pete Hegseth calls this a return to the armed forces’ “core, irreplaceable role” — winning wars that directly affect U.S. interests, not endless nation-building. Four Pillars of the New Strategy 1. Defend the Homeland First Homeland defense is now the top priority, with broader responsibilities: border security, countering narco-terror groups, and protecting key terrain in the Western Hemisphere (including the Panama Canal and, importantly, Greenland). The plan also emphasizes air, missile, cyber and nuclear defenses, and the emerging “Golden Dome” missile shield concept to protect the U.S. homeland from hypersonic and ballistic threats [2026 NDS]. 2. Deter China, Not Dominate The NDS views China as the pacing threat, stressing that the goal is not to strangle or humiliate Beijing, but to prevent it from dominating the U.S. or its allies. The U.S. will rely on overwhelming military strength in the Indo-Pacific to achieve a regional balance of power, while also expanding military-to-military communication with Beijing to reduce the risk of conflict. 3. Europe’s Job: Europe’s Defense The strategy labels Russia a “persistent but manageable threat,” especially to NATO’s eastern flank, and bluntly states that European allies must take primary responsibility for their own conventional defense. This is the “America First” logic in military terms: Europeans must spend far more and be capable of defending themselves, so the U.S. isn’t forever on the front line. 4. Revitalize the U.S. Defense Industrial Base A “once-in-a-century” rebuild of the U.S. defense industrial base is called essential. The Pentagon wants a surge in domestic production of weapons and equipment, so that the U.S. can sustain readiness, arm allies, and produce at scale in a crisis [2026 NDS]. The New Rules for Allies The strategy formalizes the Trump administration’s demand for a new global benchmark: allies and partners should move toward 5% of GDP on defense-related spending. The U.S. pledges continued support but insists that allies must: • Take the lead in their own regions • Buy more U.S. and allied weapons • Pre-position equipment and enable U.S. access to local bases and infrastructure [2026 NDS]. Taiwan, the Philippines, Australia, Japan, and the Baltics are singled out as key Indo-Pacific and European partners to receive priority investment and coordination, while the Pentagon is also directed to plan for U.S. forces to train and operate right alongside partner militaries “to counter China’s aggression” [2026 NDS]. Fortress, or Fool’s Trap? The strategy is full of martial grandeur: a shielded homeland, a supercharged industrial base, and allies forced to finally “grow up” militarily. But the real question is: can this new “Fortress America” actually deter a rising China, resist imperial fantasies like Greenland, and still keep the U.S. from being dragged into every crisis — or is it just a varnished retreat behind ever-higher walls? #USDefense#NDS2026#Trump#Pentagon#HomelandDefense#China#NATO#Allies#IndustrialBase 📱American Оbserver - Stay up to date on all important events 🇺🇸