Ранее я делал серию постов про битовые операторы.
Вот вам ещё один наглядный пример как это используется в 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
⚖️ Основатели проекта Dropil (DROP) Джереми Макалпин и Захари Матар согласились признать вину в мошенничестве с ICO на сумму почти $1,9 млн
Их обвинили в «серии ложных заявлений инвесторам» для «продвижения успеха криптовалюты». По данным Министерства юстиции США, основатели Dropil выплатили себе и партнерам как минимум $1,6 млн из привлеченных средств.
#ICO
Bought for $15.5k, sold for $122 million
#ETH holder purchased 50k$ETH at #ICO for $15.5k 9 years ago, and today he has 10 thousand coins ($24.37 million) on Kraken. In total, his coins are now valued at $122 million.
I waited for my chance🔥🔥🔥
💸Blockchain ICOs
This artist finally made me realize why all my money seem to vanish over time...
#Blockchain#ICO
🚀@PerspectiveIX via Reddit/u/nichlaes.
❓Have you invested in any ICOs?
An #Ethereum#ICO participant returned to sell 2,000 $ETH for 6M $USDC at $2,997 6 hours ago.
Notably, the whale received 33,213 $ETH at #Ethereum Genesis on Jul 30, 2015, at an ICO price of ~$0.31. So far, 5,110 $ETH has been deposited to #Kraken or sold via DEX at ~$2,545.
Currently, the whale still holds around 29.7K $ETH ($89.4M) across 3 wallets, mostly within staking platforms.
Follow @spotonchain and set alerts for the addresses of the ETH ICO participant via this entity now: https://platform.spotonchain.ai/en/entity/2098
An #Ethereum#ICO participant just woke up after 8.7 years of dormancy and transferred all 2,000 $ETH ($6.71M) to several new wallets!
The whale received 2,000 $ETH at #Ethereum Genesis on Jul 30, 2015, at the ETH ICO price of ~$0.31.
So far, 25 $ETH ($84.1K) has been deposited to #ChangeNOW at ~ $3,363.
Token flow: https://platform.spotonchain.com/en/visualizer?id=87887&thresholdOption=4
Follow @spotonchain and set alerts for the addresses of the $ETH ICO participant now!
An #Ethereum#ICO participant returned after 1.12 years to deposit 1,069 $ETH ($3.56M) to #Kraken at $3,329 3 hours ago.
The whale received 12,566 $ETH at #Ethereum Genesis in Jul 2015, at an ICO price of ~$0.31,
And then distributed the $ETH across 12 wallets in 2017, of which 4,847 $ETH have been deposited to #Kraken and #Gemini at ~$1,637.
Now still holds 7,719 $ETH ($25.7M) across 8 wallets.
Token flow: https://platform.spotonchain.ai/en/visualizer?id=99906
Follow @spotonchain and set alerts for the addresses of the $ETH ICO participant now!
🦄🦄Telegram is raising $1.7 billion in funding - and they're not even done!
#Telegram raised $850 million from 94 investors in March in addition to $850 million it gained in February. That's almost two whole unicorns in the largest #ICO (Initial Coin Offering) to date.
The company, founded by self-exiled Russian Pavel Durov, plans to use the ICO proceeds to develop the Telegram Open Network #blockchain, which includes the cryptocurrency #Gram.
Interest in the Telegram ICO has recently helped the company surpass the threshold of 200 million monthly active users, “with over 700,000 new users signing up each day.”
🚀@PerspectiveIX
🌀 http://prs.pctvix.co/TelegramIX
UK Regulator Takes Action Against Snap Over AI Chatbot
Hello, everyone! The UK Information Commissioner's Office (ICO) has issued a preliminary enforcement notice to Snap, the parent company of Snapchat. This notice could compel Snap to halt the processing of data associated with its AI chatbot, "My AI," for UK users unless an adequate risk assessment is carried out.
The ICO's provisional investigation revealed that the initial risk assessment conducted before the launch of My AI did not sufficiently evaluate its data protection risks, especially concerning children. As a result, Snap may be required to suspend its My AI product in the UK until these concerns are addressed.
#Snap#AI#DataProtection#ICO#UKRegulation