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

Резултати

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

Пребарај: #sgdengueupdate

当前筛选 #sgdengueupdate清除筛选
NEA Singapore

@NEASingapore · Post #701 · 10.11.2023 г., 03:48

#SGDengueUpdate 153 new dengue cases and 53 active dengue clusters were reported in the week ending 4 Nov 2023. If you are living in a dengue cluster area, or have been diagnosed with or are suspected to be infected with dengue,carry out ‘S-A-W’ and ‘B-L-O-C-K’ actions immediately: https://go.gov.sg/mozzieproof ⚠️ Continued urgent action from all is critical to prevent a surge in dengue cases at year-end.

NEA Singapore

@NEASingapore · Post #697 · 02.11.2023 г., 09:37

#SGDengueUpdate 191 new dengue cases and 50 active dengue clusters were reported in the week ending 28 Oct 2023. If you are living in a dengue cluster area, or have been diagnosed with or are suspected to be infected with dengue,carry out ‘S-A-W’ and ‘B-L-O-C-K’ actions immediately: https://go.gov.sg/mozzieproof ⚠️ Continued urgent action from all is critical to prevent a surge in dengue cases at year-end.

NEA Singapore

@NEASingapore · Post #682 · 20.10.2023 г., 00:39

#SGDengueUpdate 215 new dengue cases and 66 active dengue clusters were reported in the week ending 14 Oct 2023. If you are living in a dengue cluster area, or have been diagnosed with or are suspected to be infected with dengue,carry out ‘S-A-W’ and ‘B-L-O-C-K’ actions immediately: https://go.gov.sg/mozzieproof The weekly number of dengue cases has increased steadily, and is expected to rise beyond the traditional peak dengue season, with many dengue clusters across the island. Urgent action from all is critical to prevent a surge in dengue cases at year-end.

NEA Singapore

@NEASingapore · Post #667 · 12.10.2023 г., 09:28

#SGDengueUpdate 267 new dengue cases and 90 active dengue clusters were reported in the week ending 7 Oct 2023. If you are living in a dengue cluster area, or have been diagnosed with or suspected to be infected with dengue,carry out ‘S-A-W’ and ‘B-L-O-C-K’ actions immediately: https://go.gov.sg/mozzieproof ⚠️ The number of dengue cases is expected to rise beyond the traditional peak dengue season, as fast rate of dengue transmission is seen in dengue clusters across the island. Urgent action from all is critical to prevent a surge in dengue cases at year-end.

NEA Singapore

@NEASingapore · Post #655 · 05.10.2023 г., 10:15

#SGDengueUpdate 343 new dengue cases and 76 active dengue clusters were reported in the week ending 30 Sep 2023. No new Zika cases were reported last week. If you are living in a dengue cluster area, or have been diagnosed with or suspected to be infected with dengue,carry out ‘S-A-W’ and ‘B-L-O-C-K’ actions immediately: https://go.gov.sg/mozzieproof

NEA Singapore

@NEASingapore · Post #649 · 28.09.2023 г., 09:14

#SGDengueUpdate 303 new dengue cases and 64 active dengue clusters were reported in the week ending 23 Sep 2023. No new Zika cases were reported last week. If you are living in a dengue cluster area, or have been diagnosed with or suspected to be infected with dengue,carry out ‘S-A-W’ and ‘B-L-O-C-K’ actions immediately: https://go.gov.sg/mozzieproof

NEA Singapore

@NEASingapore · Post #647 · 21.09.2023 г., 09:53

#SGDengueUpdate 330 new dengue cases and 56 active dengue clusters were reported in the week ending 16 Sep 2023. Two new Zika cases were also reported last week. The number of dengue cases at Toa Payoh remains high. If you are living in a dengue cluster area, or have been diagnosed with or suspected to be infected with dengue,carry out ‘S-A-W’ and ‘B-L-O-C-K’ actions immediately: https://go.gov.sg/mozzieproof

NEA Singapore

@NEASingapore · Post #643 · 14.09.2023 г., 09:10

#SGDengueUpdate 261 new dengue cases and 53 active dengue clusters were reported in the week ending 9 Sep 2023. There are two fast-growing dengue clusters at Science Park Drive (47 cases) and Lentor Loop (33 cases). The number of dengue cases at Toa Payoh remains high. If you are living in a dengue cluster area, or have been diagnosed with or suspected to be infected with dengue,carry out ‘S-A-W’ and ‘B-L-O-C-K’ actions immediately: https://go.gov.sg/mozzieproof

NEA Singapore

@NEASingapore · Post #640 · 07.09.2023 г., 10:06

#SGDengueUpdate 213 new dengue cases and 42 active dengue clusters were reported in the week ending 2 Sep 2023. There are two fast-growing dengue clusters at Science Park Drive (26 cases) and Lentor Loop (22 cases). The number of dengue cases at Toa Payoh remains high. Particularly if you are living in a dengue cluster area, or have been diagnosed with or suspected to be infected with dengue,carry out ‘S-A-W’ and ‘B-L-O-C-K’ actions immediately: https://go.gov.sg/mozzieproof

NEA Singapore

@NEASingapore · Post #276 · 26.10.2021 г., 10:16

#SGDengueUpdate Over 4,500 dengue cases have been reported this year, and there are currently 12 active dengue clusters. Although recent weekly dengue cases have been lower than during the same period in 2020, we should all continue to stay vigilant, to prevent a year-end rise in dengue cases amid higher circulation of less common Dengue virus serotype 3 (DENV-3)! Learn how you can prevent Aedes mosquitoes from breeding in your home: www.nea.gov.sg/dengue-zika/prevent-aedes-mosquito-breedin

NEA Singapore

@NEASingapore · Post #155 · 26.01.2021 г., 10:35

#SGDengueUpdate The number of weekly dengue cases has come down slightly to 156 cases as of 23 Jan. However, the Aedes aegypti mosquito is still high in parts of Singapore. Coupled with a sizeable proportion of people still working from home, the risk of dengue remains high in 2021. The strong support from our stakeholders and the public helped to bring down the weekly number of dengue cases from its peak of 1,792 in Jul 2020. Let’s stay vigilant in this fight against dengue! Here’s how: www.nea.gov.sg/stop-dengue

NEA Singapore

@NEASingapore · Post #137 · 03.12.2020 г., 03:41

#SGDengueUpdate 281 weekly dengue cases were reported last week, reversing the downward trend in the number of weekly dengue cases over the past 6 weeks. The Aedes mosquito population has also increased by 11% since the second week of Nov. Let’s all stay vigilant and do our part to reduce the Aedes mosquito population! Learn more: go.gov.sg/mozzieproof

123•••78
ПретходнаСтраница 1 од 8Следна