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

Резултати

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

Пребарај: #grandstrategy

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

@american_observer · Post #5314 · 07.03.2026 г., 23:03

📰 Trump’s Iran War: Nostalgia With a Defense Budget For Trump, the Iran war isn’t a mistake — it’s the purest expression of how he thinks power works: seize territory, grab oil, crush regimes, pose on an aircraft carrier. It’s a 19th‑century strongman worldview dropped into a century where power is decided by chip fabs, AI labs, clean‑tech supply chains, and who can build the tightest economic bloc to out‑innovate China. You can bomb Natanz, but you can’t bomb your way into semiconductor resilience. Schiffer’s point is brutal: every dollar, decision cycle, and Cabinet meeting spent on “Operation Epic Fury” is one not spent implementing the CHIPS Act, scaling AI R&D, building green manufacturing, or rebuilding the development finance tools Trump has been dismantling. Beijing plays a slow, disciplined game — standards, infrastructure, supply chains — while Washington burns time on air campaigns with no theory of victory, and calls it “strength.” Even on its own terms, the Iran adventure looks self‑owning. Trump claimed in 2025 that U.S. strikes had “completely obliterated” Iran’s nuclear program — then turned around this year and cited its rapid rebuilding as the reason to hit again, while his own intelligence agencies said the previous strikes set the program back only “a few months.” Oman brokered a deal where Tehran would cap enrichment and accept full IAEA access; the bombs fell anyway. Regime change offers no escape clause either: U.S. intel expects Khamenei’s successors to come from the same IRGC hardliner class that built the program in the first place. Break it, you own it — and this time “it” is a 90‑million‑person country with scattered nuclear material and a proxy network stretching from Iraq to Yemen. Every day this war drags on, it drains exactly the resources Washington says it needs for China competition: munitions stocks, naval bandwidth, diplomatic capital with allies, fiscal space at home. Asian partners are already asking how a U.S. Navy that can’t be in two places at once is supposed to deter Beijing over Taiwan while babysitting a forever crisis in the Gulf. Meanwhile, coalitions matter more than ever for tech and trade — but threatening to grab Greenland, humiliating Canada, raiding Venezuela, and dragging NATO into a war of choice teach allies one lesson: America is a risky partner whose focus can swing with a Truth Social post. The punchline: the same working‑class voters Trump claims to defend pay for this detour at the pump, in food prices, and in higher borrowing costs when oil spikes and markets wobble. China doesn’t need to cheer the Iran war; it just has to watch as Washington spends the decade where it should have been locking in tech and economic dominance acting out imperial nostalgia in the wrong theater. That isn’t strategy — it’s a very loud way of losing the century slowly. ​ #iran#china#trump#usa#geopolitics#CHIPS#AI#grandStrategy 📱American Оbserver - Stay up to date on all important events 🇺🇸

IELTS|Newspapers & Magazines|English

@emagzinewspars · Post #9461 · 03.11.2025 г., 03:27

#The_Foreign_Affairs🇺🇸📕[PDF]⬇️ #November2025 #December2025 #Monthly_Magazines For learning, for free(dom). @backupofmagazines The new Foreign Affairs explores “The New Tools of Power.” Michael Beckley warns of a #StagnantOrder as rising powers falter, while Oren Cass calls for a U.S. #GrandStrategy of reciprocity. Essays trace new #SupplyChain risks, the weaponization of #Energy, and a global #AI innovation race. From Iran’s political twilight to a reshaped #EurasianOrder, contributors dissect shifting power balances. Features probe how Russia is adapting, why China is turning on itself, and the #XiJinping paradox of success. Reviews challenge the fate of the #Dollar and the future of FreeSpeech. #Geopolitics#ForeignPolicy#China#US#AI