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

Резултати

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

Пребарај: #positivity

当前筛选 #positivity清除筛选
Quiet World 🍁

@QuietWorld · Post #6627 · 02.10.2019 г., 03:53

It's an absolutely naive to say or think that humans are perpetually happy. Even the most positive person will meet his own dark side. Everyone has a shadow; toxic positivity is the recipe to create thick, dense shadow – because you must always wear the mask of happiness to hide other negative emotions and kick them into unconsciousness until it rots and fester into a monster that will come to the surface when you least expect it. Remember that positivity is not about pretending and not about happiness – it's a mindset; it's about assessing the situation, accepting and understanding your feelings and looking to see if there's anything you can do to make the most of the situation. 🤗 Source: Einzelganger & Positively Present #positivity#selfreminder @quietworld🍃

Quiet World 🍁

@QuietWorld · Post #7241 · 29.03.2020 г., 08:12

Today, Tomorrow or Yesterday? You can't avoid conflicts or problems. In fact, they're ESSENTIAL parts of life. Live today. If you worry about what may go wrong in the future, it might not even happen anyway 🤷🏻‍♀. If you keep on thinking about the past, there's no way to bring you back to the past🙍🏻‍♀. It's okay to look into the future to plan, but not okay to simply worry. It's okay to look back in the past and reflect, but it's not okay to stay stucked in the past. Live. Today. 😊 #life#reminder#positivity @quietworld🍃

Quiet World 🍁

@QuietWorld · Post #6626 · 02.10.2019 г., 03:53

"Positive vibes only 🌸" - oh really? good luck with that! I've been using the word positivity and shared lots of positivity quotes – little that I know that the word 'positivity' can mean differently to different people. So, if you haven't heard it yet, let me introduce you to Toxic Positivity – in which I've also been guilty of at times too🥺 Toxic positivity encourages ignoring negative emotions, but true positivity is about accepting all emotions and doing whatever is possible to work through them, understand them and garner more self-awareness. Toxic positivity presents itself as something anyone can do at any time, but positivity is actually a mindset that doesn't often come easily & must be worked at for most people - IT'S A SKILL. In short, toxic positivity is an attempt to force happiness by rejecting any form of undesirable aspect of an event - but be aware that rejecting either good or bad is similar to rejecting 50% of the universe, because the world isn't good vibes only, it's just vibes. I hope these provide you with a clear understanding of what is toxic positivity and what's true positivity is - and in case you need more clarity, I'd post a few more quotes related in my next posts. 😉 Source: Positively Present & Einzelganger #positivity#afterthoughts#selfreminder @quietworld🍃

12
ПретходнаСтраница 1 од 2Следна