TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #76 · 27 апр.

Ранее я делал серию постов про битовые операторы. Вот вам ещё один наглядный пример как это используется в Python в модуле re. Чтобы указать флаг для компилятора нам надо указать его после передаваемой строки. Например, добавляем флаг для игнорирования переноса строки. pattern = re.compile(r"(\w+)+") words = pattern.search(text, re.DOTALL) А как указать несколько флагов? Ведь явно будут ситуации когда нам потребуется больше одного. Кто читал посты по битовые операторы уже понял как. pattern.search(text, re.DOTALL | re.VERBOSE) А теперь смотрим исходники, что находится в этих атрибутах? Не удивительно, степени двойки. Почему? Потому что каждое следующее значение это сдвиг единицы влево. >>> for n in [1, 2, 4, 8, 16, 32, 64, 128, 256]: >>> print(bin(n)) 0b1 0b10 0b100 0b1000 0b10000 0b100000 0b1000000 0b10000000 0b100000000 Чтобы было понятней, давайте напишем тоже самое но иначе, добавим ведущие нули: 000000001 000000010 000000100 000001000 000010000 000100000 001000000 010000000 100000000 Не понятно что тут происходит? Читай три поста про битовые операторы начиная с этого ➡️https://t.me/pythonotes/45 В общем, это пример применения побитовых операций в самом Python. Теперь вы знаете Python еще немного лучше) #tricks#regex#libs

Резултати

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

Пребарај: #h2nomics

当前筛选 #h2nomics清除筛选
Decarbonization in Asia

@decarbanization_asia · Post #2141 · 21.04.2026 г., 11:57

Repost of the publication 🇨🇳Hydrogen notes from China: hydrogen is everywhere #H2nomics#international A final travel note from Igor Chausov and Pavel Melnikov from China — on the role of hydrogen in the country’s energy strategy. 🚌 At a bus stop on the outskirts of Shanghai, a bus with green plates and the words “Fuel Cell” on its side pulls up as part of everyday routine, passengers getting on and off. We observed this not only in megacities but also in many county-level cities across China: hydrogen buses, together with the more widespread electric buses, have largely displaced diesel vehicles. 🚜Beyond buses, a wide range of hydrogen-powered equipment is already operating — either in pilot mode or commercially — on Chinese roads: trucks and trailers mining dump trucks bulldozers water trucks street sweepers garbage trucks warehouse forklifts shunting locomotives 👉 This diversity is supported by the rapid development of hydrogen fuel cells and the expansion of industrial-scale production of these next-generation power systems. 🔌Hydrogen is also used in stationary applications: power supply for remote mining and infrastructure sites autonomous ultra-fast EV charging hubs telecom infrastructure off-grid settlements 🏭 While the chemical industry still largely supplies “grey” hydrogen to transport and other sectors, it is simultaneously launching numerous projects to switch from coal and scarce natural gas to green hydrogen — with expectations of cost reductions driven by cheaper renewables and electrolyzers. 🎯Key takeaway China’s energy strategy avoids binary choices and instead follows a “middle path” (中道, Zhong Dao). 👉 It does not choose between electrification and hydrogen. Instead, it treats hydrogen: as a tool for electrifying industry and transport and as a bridge between the world of “molecules” (chemicals, fuels) and the world of “electrons” (powering transport, industry, and utilities) 📌Bottom line: In China, hydrogen is not an alternative to electrification — it is an integral part of a broader, system-level energy transition.