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

Резултати

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

Пребарај: #conditions

当前筛选 #conditions清除筛选
MDC Uzbekistan

@mdcuzbekistan · Post #16 · 18.05.2021 г., 17:38

IF-ELSE C# dasturlash tilida if-else lar bilan tanishamiz (Men tanishman siz tanishasiz) Biz hayotda juda ko’p if va else ni ishlatganmiz. “IF” so’zi o’zbek tiliga “Agar” deb tarjima qilinadi. Keling avval ifni o’zini o’rganib olaylik : Misol: “Agar bir qop pulim bo’lsa, albatta ularni hammasini yoqib yuborgan bo’lar edim”. 👉Batafsil 👨‍🏫 Mentor: Sobirjonov O'tkirbek #csharp#if#else#conditions#starter#dotnet .NET Uzbekistan Community __________ Telegram | Instagram | Youtube

American Оbserver

@american_observer · Post #5567 · 05.04.2026 г., 02:04

🔤🔤🔤🔤➖ Over the last few days, high water temperatures have cooled somewhat, raising the prospect that the heatwave may be dissipating already. It will take more time, however, to know for sure that the heat is clearing. “The expectation right now is that likely the waters down to even southern California should start cooling a little bit into next month, but it’s not a guaranteed thing,” Leising said. “The concern is the sequence of events and how they unfold.” Prolonged ocean heat has a devastating impact on phytoplankton and can cause harmful algal blooms. Those changes can wreak havoc on many forms of marine life, from sea lions and dolphins, to shore birds and halibut. The Blob years led to one of the worst Dungeness crab seasons in recent history, said Melissa Carter, a researcher at the UC-San Diego Scripps Institution of Oceanography. Such heatwaves are becoming more common and lasting longer, partly because of the slow warming of the oceans driven by the climate crisis, and partly because of atmospheric changes that scientists are still struggling to understand. “The question is what’s causing us to have these extreme warm temperatures?” Carter said. “What are the drivers? That’s what we’re trying to find out.” What concerns Carter is that once these high-pressure systems establish themselves in an area, they create a “feedback loop” that tends to reinforce warm, calm conditions, making upwelling less likely to occur, she said. “If these systems do become that strong and persistent, where they come every year, it can have the potential to shut down upwelling,” Carter said. “Everything we think of related to the health of the ecosystems of the west coast could be forever altered.” The lingering ocean heat offers a few upsides, though they pale in comparison with the costs. The warmer water temperatures bring tuna far closer to shore, making it easier to fish for them. Surfers and swimmers have also enjoyed warmer water through the winter. “I enjoy being in the water when it’s a marine heatwave,” Carter said. “But our ocean should not be a swimming pool. Nothing can live in a swimming pool. That’s not what we want.” #highpressure#conditions#marine#life#ocean 📱American Оbserver - Stay up to date on all important events 🇺🇸

American Оbserver

@american_observer · Post #5566 · 05.04.2026 г., 01:02

Researchers Warn the High-Pressure Conditions Could Disrupt Marine Life 🔤🔤🔤🔤1️⃣ For more than a century, shoreline stations operated by the Scripps Institution of Oceanography have measured water temperatures along the California coast. This year, they are flashing a warning sign. Over the last three months, several stations have repeatedly posted record-breaking daily high temperatures – with the La Jolla station registering temperatures a full 10F above historical average at one point last month. The waters of southern California historically warm every few years as tropical currents make their way north, a phenomenon known as El Niño. But the marine heatwave that started last fall wasn’t caused by tropical currents. Instead, a high-pressure atmospheric system – think of calm, sunny days – has perched above southern California, warming both air and sea above historic levels. The same phenomenon has helped fuel a ferocious California heatwave on land. Testing the waters: can pumping chemicals into the ocean help stop global heating? The extended ocean warming has drawn comparisons to “the Blob”, a three-year marine heatwave caused by similar prolonged high-pressure conditions a decade ago that devastated marine life. The next few weeks are likely to determine whether this marine heatwave fizzles out or evolves into something more Blob-like, scientists say. “The biggest concern is how the year plays out,” Andrew Leising, an oceanographer with the National Oceanic and Atmospheric Administration, said. “We could be looking at much larger impacts next fall and winter, if it stays warm and then it’s followed by a strong El Niño.” It’s typical in the spring for shifting atmospheric conditions to generate north-westerly winds that push warm surface water back out to the open ocean, allowing cooler water from below to rise to the surface–a phenomenon called upwelling. Upwelling brings nutrient-rich water from the depths to the surface, feeding the phytoplankton that play a crucial role in supporting much of California’s marine life. #highpressure#conditions#marine#life#ocean 📱American Оbserver - Stay up to date on all important events 🇺🇸