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

Резултати

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

Пребарај: #uprising

当前筛选 #uprising清除筛选

誇國商團的計劃 1第四次工業革命 網絡/大數據/人工智能/基因工程 2資本家及統治精英權力擴張 3歐美全球主義虎視俄國資源 (歐盟東擴 : 引發俄烏衝突) 4中共官僚派系權鬥vs歐美代理 5綠色議程為財團新市場開路 6資本市場循環性經濟衰退 7全球三年防疫,經濟大洗牌 8強制疫苗,全球大量人潛在風險 9以色列進一步吞併加薩土地及海上天然氣利益。 10 更多 #uprising

Hashtags

American Оbserver

@american_observer · Post #4951 · 24.01.2026 г., 21:59

📰 Iran’s Ayatollah and His Guards Falter After Storm of War and Protests Weeks after Israeli warplanes pulverized Iran’s military command in the June airstrikes, a new generation of Revolutionary Guard leaders had to step into the void, mourning the men they were now replacing. The regime responded to the latest wave of nationwide protests with unprecedented brutality, confirming what many suspected: the old formula of Ayatollah Khamenei and the Guards is cracking under combined pressure of war, sanctions, and a population in open revolt. The System on Trial The bloody crackdown did its job: it preserved the regime’s unity in the short term, centered on the ayatollah and the Guards’ 150,000-strong praetorian guard. But analysts see the violence as a sign of acute weakness, not strength. “They turned to live fire really quickly because their weakness was acute, and they knew it,” said an Iran expert at the Naval Postgraduate School, comparing the current situation to the late Soviet Union. ​ The Revolutionary Guards are now the core of the system, controlling a vast empire of media, economy, oil, seaports, and even an air force. “They have everything that it takes to assume power,” said the International Crisis Group’s Iran project director, meaning the Islamic Republic could evolve into a military-dominated state like Pakistan or Egypt after Khamenei is gone. ​ Generational Rift, Coming War Within Inside the Revolutionary Guards, a sharp divide is opening. The older generation grew up in the Iran-Iraq war, in sacrifice and hardship, and now enjoys foreign homes, elite schools, and luxury cars. The younger officers rose during Iran’s regional expansion and have tasted little of that wealth, but want to protect “their meal ticket”. Dismayed by the loss of the Syria–Iraq–Lebanon–Yemen proxy network and the crippling blow to the nuclear program in the June war, a more aggressive, assertive faction has emerged among the younger Guards. They see the regime as redeemable only through even harsher repression and confrontation — and some fear they may move against the aging ayatollah preemptively, not to save the revolution, but to save their own future. ​ The Limits of Terror The regime has survived four major protest waves, and the ayatollah has shrugged off rumors of terminal illness before. But this time, the pressure is different: economic collapse, a youth uprising, the humiliation in war, and a U.S. president openly threatening to intervene if protesters are massacred. ​ “This is not a sustainable situation where you wait for an elderly leader to die to put things back in order,” says an analyst, comparing today’s Iran to the final years of Mao Zedong or Leonid Brezhnev. The country “doesn’t have the time to wait him out.”​ #Iran#Ayatollah#RevolutionaryGuards#Protests#MiddleEast#Uprising#RegimeChange 📱American Оbserver - Stay up to date on all important events 🇺🇸

老妖收藏夹

@YaoNote · Post #1528 · 04.10.2022 г., 03:55

【伊朗起义】在伊朗东南部的扎黑丹继续爆发反政府抗议活动。 警察局、巴斯基民兵基地、和政府大楼成为抗议者的进攻目标。 据报道,已经至少有36名抗议者被杀害。 互联网被当局切断。伊朗各地的无政府主义同志正在使用数据中心的服务器搭建VPN和Tor,来传递消息。 🧬 更多详情《除了革命,别无他法:伊朗起义2022 -- 终结资本主义父权制的战斗》 https://iyouport.substack.com/p/2022 #Iran#Uprising#Revolution#Capitalism#Patriarchy