Ранее я делал серию постов про битовые операторы.
Вот вам ещё один наглядный пример как это используется в 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
Lunaris OS | CLO | Android 15 | Nothing Phone (2)
✍️ Details:
- Version: 2.13
- Released: 28/06/25
🔽 Download: Here
🆘 Support : TG
⚙️ Installation: Here
📓 Kernel: Here
📸 Screenshots : Here
🔩 Beta builds : Here
💰 Donation: BMC | steinsgate007@axl
❗️ Tags : #ROM#CLO#V#LunarisOS#NothingPhone2
✍️ Note:
- Recommended to use this kernel
- Dolby and nothing camera support available
- Latest nothing firmware required
- Found bugs! Report in group with proper logs
🔖 Changelog
- Merged System LA.QSSI.15.0.r1-16100 (June Patch)
- Add Per-app refresh rate selector
- Add keybox spoofing (Thanks to HELLBOY017)
- Add LMO SystemClocks
- Forcefully enable hotspot speed settings
- Add support for omni statusbar weather logo
- Improvements to performance and system stability
🏆 Credits:
- Nothing Phone 2 community for their support
- All testers and beta users
- For source and features AOSPA team, axionAOSP, risingOS, TenXOS etc
😎 Maintainer : @Ghosutox
🔔 Updates : @NothingPhone2Updates
💬 Chat : @NothingPhone2
Lunaris OS | Radahn - CLO | Android 15 | Nothing Phone (2)
✍️ Details:
- Version: 2.12
- Released: 25/05/25
🔽 Download: Recovery | Fastboot | Mirror
🆘 Support : TG
⚙️ Installation: Here
📓 Kernel: Here
📸 Screenshots : Here
🔩 Beta builds : Here
💰 Donation: BMC | steinsgate007@axl
❗️ Tags : #ROM#CLO#V#LunarisOS#NothingPhone2
✍️ Note:
- Recommended to use this kernel
- Latest nothing firmware required
- Found bugs! Report in group with proper logs
🔖 Changelog
- Add back NOS camera sepolicy
- Merged System LA.QSSI.15.0.r1-15600-qssi.0
- Configurable Nothing OS inspired doze animation
- Add experimental SDK 32 play store spoof switch for integrity
- Switch to adreno-t drivers
- Some bugs and NPE fixes
- Improvements to performance and system stability
🏆 Credits:
- Nothing Phone 2 community for their support
- All testers and beta users
- For source and features AOSPA team, axionAOSP, risingOS, TenXOS etc
😎 Maintainer : @Ghosutox
🔔 Updates : @NothingPhone2Updates
💬 Chat : @NothingPhone2
Lunaris OS | Twilight - CLO | Android 15 | Nothing Phone (2)
✍️ Details:
- Version: 2.11
- Released: 14/05/25
🔽 Download: Recovery & Fastboot | Mirror
🆘 Support : TG
⚙️ Installation: Here
📓 Kernel: Here
📸 Screenshots : Here
🔩 Beta builds : Here
💰 Donation: BMC | steinsgate007@axl
❗️ Tags : #ROM#CLO#V#LunarisOS#NothingPhone2
✍️ Note:
- Clean flash recommended from ver.2.6, dirty possible from beta builds
- Recommended to use this kernel
- Latest nothing firmware required
- Use Ofox to flash recovery build
- Device may heat up during the first dexopt
🔖Device changelog
- Improve dolby dax config
- Unlock additional Aperture camera frame rate
- Checkout fstab from nos
- Improve haptics
- Improve audio
- Improvements to performance and system stability
🏆 Credits:
- Nothing Phone 2 community for their support
- All testers and beta users
- For source and features AOSPA team, axionAOSP, risingOS, TenXOS etc
😎 Maintainer : @Ghosutox
🔔 Updates : @NothingPhone2Updates
💬 Chat : @NothingPhone2
Lunaris OS | Optimus - CLO | Android 15 | Nothing Phone (2)
✍️ Details:
- Version: 2.2
- Codename: #Pong
- Released: 27/11/24
🔽 Download: Recovery | Fastboot | Mirror
🆘 Support : TG
⚙️ Installation: Here
📖 Changelogs: Here
📸 Screenshots : Here
🔩 Beta builds : Here
💰 Donation: steinsgate007@axl
❗️ Tags : #ROM#CLO#V#LunarisOS#NothingPhone2
✍️ Note:
- Dirty flash possible from previous build (read installation process)
- Circle to search available in both Pixel launcher and Launcher3
- Both fastboot and recovery build available
- Dolby Atmos available
- Recommended to flash this kernel for better experience (KSU included)
🏆 Credits:
- Nothing Phone 2 community for their support
- All testers and beta users
- For source and features AOSPA team, risingOS, crDroid, TenXOS etc
😎 Maintainer : @Ghosutox
🔔 Updates : @NothingPhone2Updates
💬 Chat : @NothingPhone2
Lunaris OS | Ember - CLO | Android 15 | Nothing Phone (2)
✍️ Details:
- Version: 2.1
- Codename: #Pong
- Released: 17/11/24
🔽 Download: Recovery | Fastboot | Mirror
🆘 Support : TG
⚙️ Installation: Here
📸 Screenshots : Here
💰 Donation: steinsgate007@axl
❗️ Tags : #ROM#CLO#V#LunarisOS#NothingPhone2
✍️ Note:
- Initial public release
- Both fastboot and recovery build available
- Dolby Atmos available
- Clean flash must (Dirty possible from previous beta)
- If face You tube lag flash this kernel (KSU included)
🏆 Credits:
- Nothing Phone 2 community for their support
😎 Maintainer : @Ghosutox
🔔 Updates : @NothingPhone2Updates
💬 Chat : @NothingPhone2