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

Пребарај: #criminel

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

@american_observer · Post #5532 · 01.04.2026 г., 14:59

🔤🔤🔤🔤2️⃣ The Spanish prime minister, Pedro Sánchez, wrote on X: “It is an asymmetric measure that would not apply to Israelis who committed the same crimes. Same crime, different punishment. That is not justice. It is a step closer to apartheid.” Germany, traditionally one of Israel’s closest allies in Europe, said it could not endorse the law. “The German government views the law passed yesterday with great concern,” the government spokesperson Stefan Kornelius said in a statement. “The rejection of the death penalty is a fundamental principle of German policy,” Kornelius said, adding: “Such a law would likely apply exclusively to Palestinians in the Palestinian territories.” The legislation makes the death penalty the default punishment for Palestinians in the Israeli-occupied West Bank found guilty of intentionally carrying out deadly attacks deemed acts of terrorism by a military court. According to the bill, those sentenced to death would be held in a separate facility with no visits except from authorised personnel, and legal consultations conducted only by video link. Executions would be carried out within 90 days of sentencing. Israel has rarely used the death penalty, applying it only in exceptional cases. The Nazi war criminal Adolf Eichmann was the last person to be executed, in 1962. The national security minister, Itamar Ben-Gvir, one of the bill’s strongest backers, has repeatedly worn a noose-shaped lapel pin, symbolising executions under the proposal. A security committee made some amendments to the bill, which last week passed its first vote. Israel’s public broadcaster, Kan, reported that executions would be carried out by hanging. The measure would allow courts to impose the death penalty without a request from prosecutors and without requiring unanimity, instead permitting a simple majority decision. Military courts in the occupied West Bank would also be empowered to hand down death sentences, with the defence minister able to submit an opinion. Adam Coogle, the deputy Middle East director of Human Rights Watch, said: “Israeli officials argue that imposing the death penalty is about security, but in reality it entrenches discrimination and a two-tiered system of justice, both hallmarks of apartheid. “The death penalty is irreversible and cruel. Combined with its severe restrictions on appeals and its 90-day execution timeline, this bill aims to kill Palestinian detainees faster and with less scrutiny.” Shaista Aziz, Oxfam’s campaign engagement lead, said: “This bill is another horrifying act of violence. Israel is violating international law. This new law effectively ensures that the death penalty in Israel will apply only to Palestinians, even as the illegal Israeli occupation has lately seen a surge in the coordinated attacks and executions of Palestinians by settler militias and military. “Israel holds more than 9,000 Palestinians in its jails – many unlawfully and subject to inhumane conditions, starvation and torture as state policy.” In Israel, the law is already facing legal challenges. Several Israeli human rights groups and three members of parliament filed petitions to the supreme court seeking to overturn it. The Association for Civil Rights in Israel said the law created “two parallel tracks, both designed to apply to Palestinians” and should be struck down on constitutional grounds. #israel#palestinians#court#criminel#war 📱American Оbserver - Stay up to date on all important events 🇺🇸

American Оbserver

@american_observer · Post #5531 · 01.04.2026 г., 13:59

Israel: The Dangerous Turn To Death Penalty 🔤🔤🔤🔤1️⃣ A new Israeli law that would allow the execution of Palestinians convicted on terror charges for deadly attacks, but not Jewish extremists accused of similar crimes, would constitute a war crime if enacted, according to one of the UN’s most senior human rights officials. Speaking amid mounting international condemnation of the bill, the UN’s high commissioner for human rights, Volker Türk, described the law as “patently inconsistent with Israel’s international law obligations, including in relation to the right to life”. He added that it “raises serious concerns about due process violations, is deeply discriminatory, and must be promptly repealed”. “Its application in a discriminatory manner would constitute an additional, particularly egregious violation of international law. Its application to residents of the occupied Palestinian territory would constitute a war crime,” Türk said. The legislation, passed on Monday by the Israeli Knesset, has faced a wave of criticism, including from European leaders and human rights groups. “The death penalty bill in Israel is very concerning to us in the EU,” the EU spokesperson Anouar El Anouni said in Brussels. “This is a clear step backwards – the introduction of the death penalty, together with the discriminatory nature of the law.” #israel#palestinians#court#criminel#war 📱American Оbserver - Stay up to date on all important events 🇺🇸