Ранее я делал серию постов про битовые операторы.
Вот вам ещё один наглядный пример как это используется в 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
#microg Release v0.3.7.250923
https://github.com/microg/GmsCore/releases/tag/v0.3.7.250932
New Features and changes:
Work Profile
You can now sign into various work accounts that setup a work profile when using microG. As microG does not comply with all functionality imposed by organization administrators, you need to enable this feature manually in microG Settings > Work profile. Together with this comes functionality to view and install apps suggested by the organization administrator through the Play Store.
Play Feature Delivery
Apps can request installation of additional languages or features from split packages. You can activate this from microG Settings > Play Store
Face detection
This release ships with initial support for Google's Face Detection API. This functionality is still very incomplete, but works for some apps using it.
Changelog
Maps: Various fixes for HMS Maps (#2737, #2754, #2778, #2825). Thanks @DaVinci9196.
Vision: Improve Barcode Scanning APIs (#2735, #2787). Thanks @DaVinci9196.
Vision: Add initial support for face detection API (#2793). Thanks @DaVinci9196.
Location: Add support for moving WiFis in Eurostar trains (#2821). Thanks @TimoWilken.
Fitness: Add dummy for Recording API (#2760). Thanks @DaVinci9196.
Auth: Various fixes for quick login and third-party Google sign-in (#2660, #2698, #2798). Thanks @DaVinci9196.
Auth: Add support for work accounts (#2553). Thanks @fynngodau.
DroidGuard: Disable access to hardware attestation.
Vending: Fix handling of IAP for multi-account setups (#2681). Thanks @DaVinci9196.
Vending: Add work app store (#2553). Thanks @fynngodau.
Vending: Disable access to hardware keys for play integrity (#2740). Thanks @DaVinci9196
Vending: Add dummys (#2759, #2791). Thanks @DaVinci9196.
Various fixes to improve support for Google Apps (#2652, #2654, #2684, #2738, #2767, #2779, #2780). Thanks @DaVinci9196.
Various fixes for dynamic links (#2662), Fido (#2811), SmsRetriever API (#2786), AppSet dummy (#2781), web view handling (#2836, #2862). Thanks @DaVinci9196, @ale5000-git.
Version bumps (#2813, #2829). Thanks @DaVinci9196, @ale5000-git
String and location infrastructure fixes (#2693, #2755, #2781). Thanks @lucasmz-dev, @Fs00.
New/Updated translations
FakeGAppsmicroG InstallerStableRelease(v1.6)
* Updated #microG to v0.3.2.240913
* Fixed Google Maps crash
* Fixed location settings crash
* Uninstaller is now available
* See latest microG setup here.
🏆 Thanks for @nift4 for UnifiedNLP overlay.
✅ Get it from https://fakegapps.github.io
💬 Join us @FakeGAppsChat
#microg v0.2.28.231657
https://github.com/microg/GmsCore/releases/tag/v0.2.28.231657
Changelog
Entirely new, rewritten location stack
Major update to maps implementation. Thanks fynngodau
Support for reCAPTCHA Enterprise API
Various compatibility improvements
Notes
The new location stack does not support UnifiedNlp modules anymore. This was a step necessary to take to get locations properly working on latest Android versions. This means that some features previously available through UnifiedNlp modules do no longer exist. The goal is to merge the most important of those features into GmsCore. For now, the new locations stack is relying exclusively on Mozilla Location Service for network based location.
microG GmsCore now requests a few additional privileged permissions. As always, privileged permissions are optional for microG and you can continue using microG as an unprivileged app with only minor downsides. The new privileged permissions are:
android.permission.LOCATION_HARDWARE
android.permission.MODIFY_PHONE_STATE
android.permission.NETWORK_SCAN
android.permission.UPDATE_DEVICE_STATS
android.permission.WATCH_APPOPS
Be careful for #MicroG users: Current version is NOT secure for login with your Google Account. It will show your email/password in cleartext in logcat.
It doesn't matter if you have root or not, you only need logcat access to exploit it.
Check the issue here
https://github.com/microg/GmsCore/issues/1567