Ранее я делал серию постов про битовые операторы.
Вот вам ещё один наглядный пример как это используется в 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
🆓REDEEM CODES🆓
🎁🔗#Genshin #Code This WeekNEW!!
A new code introduced to Genshin:
🎈A0NBWRZZI3XJ🎈
✨20 primogems and 160 geodes of replication
Genshin Impact v6.5 Codes (Full List)
Add @APKFreeDownloader_Bot to get any apk you want.
🆓REDEEM CODES🆓
🚀💎Genshin Impact 6️⃣.3️⃣#Code
🌟📌The 6.3 version "Luna IV" update is finally arrived, with a new version launch code for all players:
🌙【 MoonInvitationLunaIV 】🌙NEW!!
Enter it in the code redemption box and you'll receive 40 primogems, 20 thousand mora, and 3 hero's wit!
🕹️Join Columbina in Genshin Impact 6.3
🎁#Genshin Impact New Codes (Complete List)
Add @APKFreeDownloader_Bot to get any apk you want.
🆓REDEEM CODES🆓
🏰Cookie Run Kingdom 6️⃣.1️⃣🎁#Code
🍪🚩November 2025
✨🍪Redeem Code: 【 HOTY2025 】
Redeem it and you'll receive:
✅💎3k Crystals
✅🌈1.5k Rainbow cubes
✅🍪1k Choco Chalks
🔎🎁#CRK Codes: All the Latest Codes & How To Redeem
Add @APKFreeDownloader_Bot to get any apk you want.
🆓REDEEM CODES🆓
#🐉🕹️Dragon Raja : ReRise🎁#Code
🎉📍SEA Server Opens on 8/14!!
6GB+ Free Space Is Required!!⬇️
Launch Code: 🎁【 LZHX66】🎁
(The code can be redeemed on 8/14 at 10 AM)
Use this EXCLUSIVE code to get 1x Starter Pack of 20x Chalice Supply Box.
⌛ Code can EXPIRE FAST‼️ Claim it AS SOON AS you see this!
[MORE REWARDS]
*Launch to get 🎡400 DRAWS!!
*Complete the Dragon Raja × Life Makeover Collaboration Event for an additional 💎500 DIAMOND rewards!
About 🎮Dragon Raja : ReRise]
[Customization] Design Your INKMANCER in Casual/Retro/Street/Futuristic style.
[Time Combat] PvE Training. PVP Duels. Club Matches.
[Life Sim] Romantic Relationship. Motorbike City Tour. Party Fun.
[Narrative] Immersive NPC Interactions.
Add @APKFreeDownloader_Bot to get any apk you want.
🆓REDEEM CODES🆓
🎁🕵️YuYu Hakusho:Slugfest Gift Codes
Redemption Begins 🎉on 7/23, at 7 PM (GMT+8)!!🔥✨
Use the exclusive codes below after the official release for amazing launch gifts: 200x Crystal Bead 💎, 20,000x Currency💰, 10x Omamori Enhancer🔮, and 1x Intermediate Enhancer🔮.
🎁#CODE 1:【 apkpure0723 】 (US Server)
🎁#CODE 2:【 apkpure2507 】 (US Server)
📍Pre-download begins on 7/22, at 6 PM (GMT+8)!
🕹Pre-register Now!!!
About YuYu Hakusho:Slugfest
Play as Yusuke (a young spirit detector) to track down and eliminate all evil demons and their human helpers and safeguard the human world from supernatural threats.
Add @APKFreeDownloader_Bot to get any apk you want.
#code
To me, high cognitive load reduces my code quality. In thoery, there are many tricks to reduce cognitive load, e.g., better modularity. In practice, they are not always carried out. Will chatGPT help? Let’s see.
https://www.caitlinhudon.com/posts/programming-beyond-cognitive-limitations-with-ai
Internet do'kon qilishda eng ko'p kerak bo'ladigan fungsiyalardan biri. Narxlarni foydalanuvchiga formatlab ko'rsatish fungsiyasi
const formatPrice = (price) => {
return price?.toString().replace(/\B(?=(\d{3})+(?!\d))/g, " ");
};
#code
☑️@valisherbotirov
🆓REDEEM CODES🆓
#Genshin Impact ✨October New #Code
👀Last Check: ⏳10/30!!!
Enter the Genshin Impact latest code 🎁【 GS61RD26W966 】🎁 for 20,000 moras✨🎁 and TONS MORE!!!
Genshin Impact October Codes: (All Active Codes!!)
👉【 MBEYNDLU3WGZ 】- 2K moras 💰💰💰
👉【 4S5RTSV3P5CC 】- 60 Primogems 💎💎💎
...
🔗#Genshin Active Codes (October 2025).
Add @APKFreeDownloader_Bot to get any apk you want.