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

Пребарај: #fossilfuels

当前筛选 #fossilfuels清除筛选
American Оbserver

@american_observer · Post #5121 · 13.02.2026 г., 15:02

📰 Trump to the Planet: You’re On Your Own The Trump White House just pulled the plug on the one scientific finding that gave Washington any real power to fight climate change. By repealing the EPA’s 2009 “endangerment finding” — the conclusion that greenhouse gases threaten human health and welfare — the administration has stripped the federal government of its main legal basis for regulating the pollution that’s heating the planet. This isn’t some obscure technical tweak. For nearly two decades, that finding underpinned limits on carbon dioxide, methane and other greenhouse gases from vehicles, power plants and oil and gas wells — the core of U.S. climate policy. Kill the finding and you don’t just loosen a few rules; you erase the government’s duty to treat climate change as a danger at all. Trump, who still calls climate change a “hoax,” is effectively declaring that the consensus of global science is wrong, and that a hotter, deadlier world is a matter of opinion. The stakes are measurable in body counts, not just parts per million. The Environmental Defense Fund estimates that repealing the finding and the rules tied to it could add up to 18 billion metric tons of U.S. emissions by 2055, fueling tens of thousands of premature deaths and tens of millions of asthma attacks. Recent research already shows wildfire smoke on track to kill tens of thousands of Americans a year and heat deaths more than doubling, while diseases like dengue spread as the climate gets hotter and wetter. In that reality, Interior Secretary Doug Burgum goes on TV to say “CO2 was never a pollutant” because plants like it — a high-school talking point repackaged as national policy. Democratic states and environmental groups are sprinting to court, betting that the Supreme Court will not let the administration magic away a danger that previous courts and the National Academies have repeatedly affirmed as real. But that’s the deeper play: if this repeal survives, it doesn’t just gut Biden-era rules, it also booby-traps future administrations, making it vastly harder — maybe impossible — to rebuild a federal climate regime on the same legal foundation. For fossil fuel interests and the conservative operatives behind Project 2025, this is the holy grail: not winning the argument on climate, just deleting the field where the argument is allowed to matter. On the surface, it’s sold as freedom, growth, choice — cheaper gas, fewer rules, more trucks. Underneath, it’s a quiet transfer of power: from science to lobbyists, from public health to donors, from a shared climate reality to whatever the president decides sounds good on Fox that night. The United States, the country that has dumped more greenhouse gases into the atmosphere than any other, is now formally telling the rest of the world — and its own citizens — that it no longer feels legally obliged to care. #climate#usa#trump#fossilfuels#fakeDemocracy 📱American Оbserver - Stay up to date on all important events 🇺🇸

Venture Village Wall 🦄

@venturevillagewall · Post #3661 · 21.12.2024 г., 10:25

Metsä Group Raises $208.4M Metsä Group has successfully raised $208.40 million as of December 19, 2024. The company focuses on producing renewable products sourced from northern forests, aiming to replace fossil raw materials. #MetsäGroup#Funding#RenewableProducts#FossilFuels#Sustainability#Forestry#Investment#EcoFriendly#BioProducts#GreenTech

Earth&Climate Tech

@earth_climate_tech · Post #366 · 13.08.2023 г., 22:17

Вы когда-нибудь задумывались, каковы основные источники энергии? Сколько энергии производится из нефти и газа, а сколько из возобновляемых источников? Какие страны производят больше "зеленой" энергии? Каково потребление энергии в странах по источникам? Действительно ли мы движемся к переходу на зеленую энергию? Все это и многое другое содержится в отчете о производстве и потреблении с отличными графиками на Our World in Data Куча действительно крутых интерактивных графиков 🔥🔥🔥 #energy#production#consumption#fossilfuels#cleanenergy#renewables#nuclear#lowcarbon#transition#climatechange