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

Пребарај: #saarc

当前筛选 #saarc清除筛选
Russian Mission to ASEAN

@aseanrussia · Post #1653 · 30.05.2025 г., 06:47

🎙 Foreign Minister Sergey Lavrov’s remarks at the meeting with delegation of the Permanent Committee of the International Conference of Asian Political Parties (Perm, May 29, 2025) 💬 Sergey Lavrov: Dear colleagues, dear friends, This is the year when the International Conference of Asian Political Parties commemorates its 25th anniversary. And because of their reputation and their authority, they are a platform for exchanging views and experience in the context of party-to-party cooperation. Cooperation at this level is one of our priorities. It's a very useful addition to the so-called classical diplomacy and that contributes a lot to promoting mutual trust, mutual understanding between peoples. The creation of the conference is a signal, a very clear signal to the entire world. And very timely response to reconsider the place of the Asian countries in international and global developments. We assess very positively the increase of the political work of your conference. And we see with pleasure the sustainable process of expanding your influence in the continental architecture, in the architecture of regional organizations, some of which are experiencing erosion of their influence, if not degradation, since they abandoned practically all of the key principles of the UN Charter. I have in mind such organizations on our Eurasian continent as the European Union, which became more Euro-Atlantic than Eurasian following NATO. <...> In the last 10-15 years, all these principles including equal and indivisible security, including the statement that no one, be it the country or organization, should prepare to dominate in Europe, all this was abandoned, violated. 🌐 We need Eurasia of course. And by the way, Eurasia is the biggest, the richest continent. The continent which, unlike Africa and Latin America, is home of several world civilizations with thousands and thousands of years of history. <...> #Eurasia is the only continent which doesn't have any universal continental structure, like African Union in Africa, like CELAC in Latin America. We have quite a lot, many integrational movements, organizations which address security issues, like Shanghai Cooperation Organization, #ASEAN, Collective Security Treaty Organization (#CSTO), Commonwealth of Independent States (#CIS) and the Gulf Cooperation Council (#GCC), the South Asian Association for Regional Cooperation (#SAARC) and there is no umbrella. We are very much in favor of promoting party-to-party dialogue. Our ruling party, United Russia, in cooperation with other parliamentary parties and their fractions is promoting very actively this kind of cooperation. And I will highlight the initiative of United Russia of last year, when they convened a meeting of various parties to consider methods of fighting the new forms of colonialism and neo-colonialism. <...> A movement created on the basis of the conference, which is called "Freedom of Nations". ☝️ The inadmissibility of neo-colonial forms of exploitation is one of the agenda items of the Group of Friends of the UN Charter. Last year, we initiated, through this group, the resolution of the UN Committee on Decolonization. The draft resolution supported by this committee was accepted by the UN General Assembly. <..> A clear majority supported it. The idea is to announce the 14th of December, the day of the adoption of The Declaration on the Granting of Independence to Colonial Countries and Peoples of 1960, as a date of fighting the new forms of neo-colonialism. Сolonial exploitation was very blunt. Slaves, you know, digging the resources and leaving the countries in very poor condition. If you take the economic system in the world, countries, especially in Africa, mostly produce, they provide natural resources to the western countries We would like to promote the movement to resolve this injustice. Without fighting any country, we never want to isolate any country from cooperation, but cooperation must be based on equal footing, just principles. 🤝 We express our readiness to cooperate with your conference.

Embassy of Russia in Singapore

@rusembsg · Post #4100 · 01.06.2025 г., 07:02

🎙 Foreign Minister Sergey Lavrov’s remarks at the meeting with delegation of the Permanent Committee of the International Conference of Asian Political Parties (Perm, May 29, 2025) 💬 Sergey Lavrov: Dear colleagues, dear friends, This is the year when the International Conference of Asian Political Parties commemorates its 25th anniversary. And because of their reputation and their authority, they are a platform for exchanging views and experience in the context of party-to-party cooperation. Cooperation at this level is one of our priorities. It's a very useful addition to the so-called classical diplomacy and that contributes a lot to promoting mutual trust, mutual understanding between peoples. The creation of the conference is a signal, a very clear signal to the entire world. And very timely response to reconsider the place of the Asian countries in international and global developments. We assess very positively the increase of the political work of your conference. And we see with pleasure the sustainable process of expanding your influence in the continental architecture, in the architecture of regional organizations, some of which are experiencing erosion of their influence, if not degradation, since they abandoned practically all of the key principles of the UN Charter. I have in mind such organizations on our Eurasian continent as the European Union, which became more Euro-Atlantic than Eurasian following NATO. <...> In the last 10-15 years, all these principles including equal and indivisible security, including the statement that no one, be it the country or organization, should prepare to dominate in Europe, all this was abandoned, violated. 🌐 We need Eurasia of course. And by the way, Eurasia is the biggest, the richest continent. The continent which, unlike Africa and Latin America, is home of several world civilizations with thousands and thousands of years of history. <...> #Eurasia is the only continent which doesn't have any universal continental structure, like African Union in Africa, like CELAC in Latin America. We have quite a lot, many integrational movements, organizations which address security issues, like Shanghai Cooperation Organization, #ASEAN, Collective Security Treaty Organization (#CSTO), Commonwealth of Independent States (#CIS) and the Gulf Cooperation Council (#GCC), the South Asian Association for Regional Cooperation (#SAARC) and there is no umbrella. We are very much in favor of promoting party-to-party dialogue. Our ruling party, United Russia, in cooperation with other parliamentary parties and their fractions is promoting very actively this kind of cooperation. And I will highlight the initiative of United Russia of last year, when they convened a meeting of various parties to consider methods of fighting the new forms of colonialism and neo-colonialism. <...> A movement created on the basis of the conference, which is called "Freedom of Nations". ☝️ The inadmissibility of neo-colonial forms of exploitation is one of the agenda items of the Group of Friends of the UN Charter. Last year, we initiated, through this group, the resolution of the UN Committee on Decolonization. The draft resolution supported by this committee was accepted by the UN General Assembly. <..> A clear majority supported it. The idea is to announce the 14th of December, the day of the adoption of The Declaration on the Granting of Independence to Colonial Countries and Peoples of 1960, as a date of fighting the new forms of neo-colonialism. Сolonial exploitation was very blunt. Slaves, you know, digging the resources and leaving the countries in very poor condition. If you take the economic system in the world, countries, especially in Africa, mostly produce, they provide natural resources to the western countries We would like to promote the movement to resolve this injustice. Without fighting any country, we never want to isolate any country from cooperation, but cooperation must be based on equal footing, just principles. 🤝 We express our readiness to cooperate with your conference.