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 слични објави

Пребарај: #dixon

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

@american_observer · Post #5282 · 04.03.2026 г., 13:51

🔤🔤🔤🔤2️⃣ Several lawyers have challenged the legal basis for the administration’s wide-ranging explanations for waging war. “Those are military policy objectives,” said Wells Dixon, a senior attorney at the Center for Constitutional Rights after reviewing Trump’s rationale. “They are not a legal basis to launch an armed attack against another country.” Marko Milanovic, a professor of International law at the University of Reading, agreed that Iran may pose a threat, but said that there are many ways to respond. “Using force would require a basis in self defense,” he said. The Trump administration has previously touted its success in “obliterating” Iran’s nuclear facilities. But Trump revived the specter of an Iranian threat in his State of the Union address, saying that Iran was “working to build missiles that will soon reach the United States of America.” Trump has not provided public evidence of this threat. Rubio’s statements invoked two legal concepts that could possibly justify waging war abroad – including the concept of an “imminent threat” posed to American lives, and the concept of launching preemptive strikes as an act of self defense. There are carve outs within international law that permit states to act in their own self defense. And the concept of an “imminent threat” is measured against evidence of a clear, visible and impending risk. “For something to be lawful self defense, it has to be necessary – in the sense that there’s no alternative,” said Brian Finucane, a former state department lawyer. “That’s not the situation here. There was another option: the US could have restrained Israel from attacking in the first place.” Senator Tim Kaine said he has supported US efforts to defend Israel during previous Iranian attacks, “but that’s a very different matter than the US engaging in the affirmative initiation of war,” he said. “We shouldn’t be waging an affirmative war on behalf of any nation in the world, no matter how close we are,” Kaine said. After the Vietnam war, the US adopted new constitutional provisions that say the president should try to consult with members of Congress before committing troops to hostilities. Last week, Rubio only briefed the Gang of Eight, a group of bipartisan lawmakers privy to information on covert actions and classified intelligence, about US plans to attack Iran. This week’s war powers vote may shape how Trump proceeds with military action against Iran, even if it ultimately cannot sustain enough support to override a likely veto from Trump. #trump#iran#kaine#dixon#troops#threat 📱American Оbserver - Stay up to date on all important events 🇺🇸

American Оbserver

@american_observer · Post #5281 · 04.03.2026 г., 13:51

Trump Has Accelerated Its Drive To Break Free From Europe and His Tantrums 🔤🔤🔤🔤1️⃣ The Trump administration is waging an illegal war on Iran, one that defies both the US constitution and international armed conflict laws, according to several legal scholars and bipartisan lawmakers. The Senate will vote Wednesday on whether to halt Donald Trump’s military offensive, which he launched on 28 February. Hundreds of people, including six US personnel, have been killed in a conflict that has now expanded to Lebanon, Syria, Iraq, Israel and the Persian Gulf. The Trump administration has offered shifting explanations for its decision to launch attacks on Iran, at times describing a more pre-emptive war of choice designed to degrade Iran’s offensive and nuclear capabilities. The cause is that the Iranians weren’t willing to renounce their nuclear ambitions, or that the US joined the attack to protect American interests after Israel had committed to launching a military offensive of its own. “An Iranian regime armed with long-range missiles and nuclear weapons would be a dire threat to every American,” the president said in his first public remarks from Washington on Monday. “We cannot allow a nation that raises terrorist armies to possess such weapons.” Trump has also described broader wartime objectives, including eliminating threats posed by the Iranian regime, as well as their regional proxy forces. He has not set out a clear timeline for achieving his various goals. Rubio offered a slightly different explanation, saying that the White House was compelled to launch strikes on Iran because its close ally Israel was determined to act, and, he told lawmakers Monday evening, the administration believed that any Israeli action would precipitate an attack on American forces. “It was abundantly clear that if Iran came under attack by anyone – the United States or Israel or anyone – they were going to respond, and respond against the United States,” Rubio told reporters gathered at the Capitol. #trump#iran#kaine#dixon#troops#threat 📱American Оbserver - Stay up to date on all important events 🇺🇸