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

Пребарај: #nationalday

当前筛选 #nationalday清除筛选
Embassy of Russia in Singapore

@rusembsg · Post #3154 · 12.06.2024 г., 02:08

On June 11, 2024, Russian Embassy in Singapore hosted a state reception dedicated to the #NationalDay of the Russian Federation – Russia’s Day. Minister of State for Culture, Community and Youth, Minister of State for Trade and Industry, H.E. Mr. Alvin Tan attended the function as the Chief Guest. Among the guests were Members of the Parliament of Singapore, eminent representatives of business and social, scientific and cultural community, mass media along with Ambassadors and Military Attaches of foreign states and Russian compatriots. In his welcoming speech, Ambassador stressed that Russia remembers and appreciates that Singapore and other ASEAN countries were among the first to recognize the new Russia. He stated that thanks to this step, we have the opportunity today to look together into the face of the emerging new, fair, multipolar world. Ambassador continues mentioning that “even though large distances separate us, even though the natural and geographical conditions in which we have to live vary, even though we have different views with Singapore on the parameters of regional architecture and the genesis of the events in Ukraine, there is something very significant that connects us and is the subject of our common daily concerns”. “This connecting link is the mutual concern about the threats created by the arms race and the prospect of its spreading into outer space! This connecting link remains the common resistance to the dangers created by terrorism, transnational crime and the money laundering schemes that feed them! We rightfully consider our devotion to the ideals of building a drug-free world to be this connecting link! We consider our common efforts to guarantee international information security to be this connecting link, which would securely block the destructive use of the information environment! And finally, closer to the venue of our meeting today, we see such a link in cooperation for building an open and inclusive, free, predictable region based on the inviolable principles of ASEAN centrality”, he noted. “We invite you to take a closer look at the concept of the Greater Eurasian Partnership that we are promoting and to join the triptowards a new, common and indivisible formula for security in Asia and the Pacific as an alternative to conflicting Indo-Pacific concepts of the collective West. I am convinced that our cooperation has a bright future. It should contribute to the creation of a new world community free from the remnants of colonialism”, concluded the Ambassador.

Hashtags

聖小熊的秘密基地 🇹🇼

@holybeartw · Post #1213 · 10.10.2025 г., 10:18

🇹🇼 祝大家國慶連假快樂!🇹🇼 中華民國屹立於台灣之島,雖身處天災頻發與地緣緊張的前線,一路以來戰戰兢兢、克服一切困難。 我們或許時有歧見與爭論,然而「團結」始終是這片土地上最堅韌而無畏的力量。願我們在相互理解與信任之中,持續邁向更具包容與希望的社會。 中華民國台灣萬歲! #NationalDay#ROC#Taiwan