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

Пребарај: #specialmilitaryoperation

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

@rusembsg · Post #3786 · 21.12.2024 г., 06:20

Results of the Year with President of the Russian Federation Vladimir Putin (Moscow, Kremlin, 19 December 2024) #Year2024HighlightsRussia#VladimirPutin#Outcomes2024 #Economy The economic situation in Russia is generally positive and stable. We are growing in spite of everything, in spite of any external threats or attempts at outside influence. Last year Russia increased its GDP by 3.6 percent, and this year the economy is expected to grow by 3.9 percent, or possibly even four percent. What this means is that our economy will have grown by eight percent over the past two years. <…> In the United States – 5-6 percent, Eurozone – 1 percent. In the EU’s leading economy, Germany – 0 percent. International financial and economic institutions ranked Russia as Europe’s biggest economy in terms of volume, in terms of purchasing power parity, and the world’s fourth largest economy. We are behind China, the United States and India. Last year, Russia surpassed Germany and this year, we left Japan behind. #Sovereignty Russia has become significantly stronger in the past two or three years. We are becoming a truly sovereign country, and we barely depend on anybody. We are capable of firmly standing on our feet when it comes to the economy. We are strengthening our defence capability. The combat readiness of the Russian Armed Forces is the highest in the world today. I assure you it is the highest. #SpecialMilitaryOperation I must say that the situation [in the special military operation zone] is changing radically. Our fighting men are regaining the territory by square kilometers. We are advancing, as we said, towards achieving the priority goals that we outlined at the start of the special military operation. Our troops are fighting heroically in the direct sense of the word. The combat readiness of the Russian Armed Forces is the highest in the world today. #NuclearDoctrine It is not a new doctrine but actual changes. I will name some key aspects. We are talking about some new military hazards that may grow into military threats. They include missile defence systems and some other things that we list. [The document] speaks about increasing the responsibility of non-nuclear states that may participate in an aggression against the Russian Federation alongside the countries that have nuclear weapons. If, like their allies, these countries also pose a threat to our sovereignty and Russia’s existence, then we imply that we have the right to use our nuclear weapons against them [non-nuclear states]. If similar threats are posed to Belarus, our ally and member of the Union State, the Russian Federation will consider these threats as threats to Russia. And we will do everything to ensure the security of Belarus. It is a very important component of the updated nuclear strategy of the Russian Federation. #OreshnikMissile Oreshnik missile system is a new intermediate- and shorter-range system. It can strike targets located 1,000, 1,500, 3,000-plus and up to 5,500 km away. Supposing our system is located 2,000 km away, the missile interceptors on Polish territory would be unable to hit it. It takes time to travel this distance, while our missile needs a few second to start dispensing warheads, and that’s it, the ship has sailed. There is almost no chance of shooting down these missiles. #Syria Russia came to Syria ten years ago to prevent the creation of a terrorist enclave there, like the one that we saw in some other countries, for example, Afghanistan. We have achieved that goal, by and large. Even the groups that were fighting against the Assad regime and the government forces back then have undergone internal changes. The current situation in the Syrian Arab Republic remains challenging. We sincerely hope for peace and stability to be restored. We maintain dialogue with all groups controlling the situation there and with all regional countries. An overwhelming majority of them have expressed interest in retaining our military bases in Syria.