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

Резултати

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

Пребарај: #eubeachcleanupcampaign

当前筛选 #eubeachcleanupcampaign清除筛选
EU in Kazakhstan 🇪🇺🇰🇿

@euinkazakhstan · Post #958 · 21.09.2024 г., 13:23

21 September2024 ASTANA – As part of World Cleanup Day and the #EUBeachCleanup environmental campaign, the Delegation of the European Union to Kazakhstan, in collaboration with the Estonian Embassy in Kazakhstan and with the support of the Akimat of Astana and the environmental movement “We are for a clean country” organized a cleanup event along the banks of the Karasu River in Astana on September 21, 2024. In her address to participants, the Head of the EU Delegation to Kazakhstan, Ms. Aleska Simkic, remarked: “Today's #EUBeachCleanup campaign is more than just picking up litter. It is about taking responsibility for our planet. Each and everyone of us can contribute, by decreasing his/her carbon footprint – at least not litter, by making those close to him/her aware of the importance of individual action and by influencing the politicians of our countries to enforce policies for cleaner environment. Together, we can tackle waste pollution and inspire lasting change. When communities unite, we can build a cleaner, greener future for Kazakhstan and the world.” Ambassador of Estonia to Kazakhstan, Mr. Jaap Ora, extended his gratitude to the Akimat of the City of Astana, local environmental activists, the EU Delegation to Kazakhstan, and all participants of the World Cleanup Day in Kazakhstan. “This shows our joint commitment to preserving the environment. This year is particularly significant, as World Cleanup Day, which originated in Estonia, has been officially added to the UN Calendar of International Days starting from 2024. This recognition will undoubtedly enhance its visibility and impact.” The event brought together around 300 participants, including diplomats and staff from embassies representing countries of Europe, America, Asia, and Africa, as well as representatives from international organizations and the Youth Public Association of the Earth Foundation, local residents and visitors to the Capital alsojoined in, cleaning the banks of the Karasu River of litter and waste. World Cleanup Day and the #EUBeachCleanup campaign were also supported by all regions and cities of Kazakhstan, making it part of the large-scale environmental campaign “Taza Qazaqstan”. This made the campaign part of a nationwide effort to raise awareness about cleanliness and promote the development of ecological culture. On this day, winners of the Instagram Reels contest – which encouraged participants to showcase their eco-friendly habits – were awarded with special prizes. In addition, thanks to the efforts of the participants, a large number of plastic bottles were collected and sent for recycling. To conclude the event, participants took part in a flash mob, forming a large heart to symbolize their love for Planet Earth. As part of this significant environmental initiative, a teleconference was organized between the UN Office in New York and Astana. During a live broadcast, Ms. Heidi Solba, President and Head of the global network Let’s Do It World and World Cleanup Day, discussed the importance of this action and highlighted Kazakhstan’s role in the global environmental movement. The European Union Delegation and the Estonian Embassy in Kazakhstan extend their deepest gratitude to all partners and participants of World Cleanup Day and the #EUBeachCleanupcampaign! Background information: World Cleanup Day is one of the largest global movements that unites millions of volunteers, governments and organisations. With 19,068,786 participants from a new high of 198 countries and territories – which includes a new high of 90% of UN member states – WCD marked a return to pre-Covid engagement levels, with the movement’s second-highest annual turnout. From 2024, World Cleanup Day is declared an official UN Day, on 20 September annually, and has now been added to their Calendar of International Days and Weeks. This world-changing idea began in Estonia, in 2008. #EUBeachCleanup is a more focussed global campaign organised by the EU and the UN to raise awareness about plastic pollution all over the world.