Ранее я делал серию постов про битовые операторы.
Вот вам ещё один наглядный пример как это используется в 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
Released in North America on 29th November 1972 by Atari, Pong was one of the earliest video games. The game became popular both at home on consoles and at video arcades.
[Play it here] [read more]
Send your high-scores in the comments. 😉
@googlefactss
#pong#games#computer
New update available!
Nothing Phone (2)
Version: Pong-B4.0-251119-1654
⬇️OTA & Factory Images
🧑💻Installation Guide
📔 Changelogs:
You’re now upgrading to the official release of Nothing OS 4.0, powered by Android 16. Please back up your user data (photos, call logs, contacts, etc.) before proceeding with the upgrade. Take a look at what's included in this update:
New Features
🕶 Hiding apps directly from the home screen and App drawer is now supported. Find hidden apps via: Home screen > App drawer > Hidden icons.
🔍 Managing the search scope is now supported in App drawer to display results within a specific scope.
📏 Added more size options for Weather, Pedometer, Screen Time widgets.
↔️ 2x2 size is now supported for most QuickSettings tiles.
🟢 Pop-up view now supports two floating icons for easier switching.
⚡️ System upgrade supports app optimisation to improve startup speed. Path: Settings > Apps > App optimisation.
Essential Innovations
🛝 Introducing Playground (Alpha) — come to experience unique creations from the Community, including Essential Apps, Camera Presets, and EQ Profiles.
🪀 Essential Apps (Alpha) are now open for download. Enjoy the AI-powered, community-crafted apps that blend creativity with efficiency.
Notes:
For more details of Playground & Essential Apps, please visit https://playground.nothing.tech.
Visual Enhancements
🌠 Nothing app icons have been redesigned with an all-new, fresh look.
📶 Updated status bar icons with a more intuitive look.
🎴 Updated the lock screen password page with wallpaper blur effect.
⏱️ Added 2 new lock screen clock faces in Customisation.
🌑 Extra dark mode is now available, bringing a more immersive dark style. Path: Settings > Display > Dark theme > Extra dark mode.
🌌 Improved transition animations in certain scenarios for a smoother, more fluid experience.
Glyph Interface
🤫 Added a setting to choose whether Flip to Glyph switches your phone to Silent or Vibrate mode.
💡 Glyph Progress now uses Android 16 Live Update notifications for improved compatibility with third-party apps.
Camera Enhancements
🎛 Presets: Updated default list with new popular styles.
🎨 Filters: Added intensity adjustment and exclusive 'Stretch' styles.
🎞 Motion Photos: Supports longer recording times and audio capture.
🖼 Watermarks: Introduced new Nothing brand watermarks and artistic frames.
📱 Interface: Refreshed camera UI design with optimised interactions.
💬 Chat: @NothingPhone2
🔔 Updates: @NothingPhone2Updates
🫂 Community: @Nothing_Archive
#Pong#OTA
New update available!
Nothing Phone (2)
Version: Pong-V3.2-250828-1921
⬇️OTA & Factory Images
🧑💻Installation Guide
📔 Changelogs:
New Features:
📷Preset is now available in the Camera app settings.
🎨 Introduced the new “Stretch” preset, created in collaboration with photographer Jordan Hemingway. The preset features rich shadows and extended highlights for unique results. (Missing)
✅ Default gallery options for previewing photos in Camera app settings are updated.
🚶 Pedometer and Screentime Widgets now support sharing.
📱 Shared Widgets now support more sticker types.
General Improvements and Bug Fixes:
🔧 Fixed tiles display errors in Quick Settings.
🗃 Resolved the issue of failing to open PDFs in Cloned apps.
📊 Optimised the display of VoNR icon in the status bar.
⛔️ Fixed the issue of failing to block connected devices in Hotspot and tethering.
🔋 Optimised battery usage when connecting watches to the phone.
🔤 Fixed Inter font display issues in Instagram, Subito and other apps.
⚙️ Enhanced system stability and improved network connection.
🛡 Updated to the September security patch.
💬 Chat: @NothingPhone2
🔔 Updates: @NothingPhone2Updates
🫂 Community: @Nothing_Archive
#Pong#OTA
New update available!
Nothing Phone (2)
Version: Pong-V3.2-250708-2227
⬇️Incremental & OTA Images
🧑💻Installation Guide
📔 Changelogs:
New Feature
📶 Hotspot Manager: Easily manage devices connected to your hotspot.
General Improvements and Bug Fixes
🖼 Fixed rare issue causing the Gallery to crash when opening videos.
📱 Fixed issues where the apps’ UIs sometimes displayed incorrectly in certain situations.
🛡 Updated to Android security patch for June.
🔧 Enhanced overall system stability.
💬 Chat: @NothingPhone2
🔔 Updates: @NothingPhone2Updates
🫂 Community: @Nothing_Archive
#Pong#OTA
New update available!
Nothing Phone (2)
Version: Pong-V3.0-250304-1717
OTA Size: 78.8 MB
⬇️Incremental & OTA Images
🧑💻Installation Guide
📔 Changelogs:
🔒 Introduced Power off verify. You can now enable a security check before your phone shuts down when locked. Go to Settings > Security and privacy > More security and privacy > Power off verify.
🖼 Updated the design of title bar in the pop-up view, for a cleaner and more intuitive look.
🛡 Updated to the latest March 2025 security patch for improved protection.
Bug fixes & stability improvements:
📡 Enhanced stability for network and bluetooth connections, ensuring a more reliable experience.
📷 Resolved certain issues to improve camera performance.
🔧 Fixed several issues affecting overall system stability.
💬 Chat: @NothingPhone2
🔔 Updates: @NothingPhone2Updates
🫂 Community: @Nothing_Archive
#Pong#OTA
New update available!
Nothing Phone (2)
Version: Pong-V3.0-250113-1723
OTA Size: 171.2 MB
⬇️Incremental & OTA Images
🧑💻Installation Guide
📔 Changelogs:
General Improvements
🔦 You can now long-press the Torch tile in Quick Settings to activate the Glyph torch.
📶 Optimised network selection to improve connection stability.
📱 Enhanced response speed for pulling down Quick Settings in landscape mode.
🛡 Updated security patch to 2025-01.
Bug fixes
💡 Fixed abnormal Glyph effects in specific scenarios.
🎧 Fixed issues with connected earbuds for better performance and stability.
🔧 Resolved system stability for a more reliable experience.
💬 Chat: @NothingPhone2
🔔 Updates: @NothingPhone2Updates
🫂 Community: @Nothing_Archive
#Pong#OTA