Ранее я делал серию постов про битовые операторы.
Вот вам ещё один наглядный пример как это используется в 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
🇺🇸US soldier arrested for betting on Maduro’s capture — won over $400 000💰
A U.S. Army Special Forces master sergeant, Gannon Ken Van Dyke, has been arrested and charged after allegedly using classified military information to place bets on an online prediction market and win more than $400 000 based on the outcome of a covert operation that captured Venezuelan president Nicolás Maduro.
Van Dyke, who was involved in Operation Absolute Resolve — the U.S. military mission that led to Maduro’s capture on January 3 — reportedly placed about 13 bets on the platform Polymarket, wagering that Maduro would be removed from power. Prosecutors say he used nonpublic knowledge of the operation to make strategic trades that paid off once the raid became public.
Federal authorities have indicted him on multiple counts, including unlawful use of confidential information for personal gain, commodities fraud, wire fraud, and illegal use of classified data. Van Dyke allegedly tried to conceal his identity and the proceeds by using foreign cryptocurrency accounts and requesting deletion of his Polymarket account after the operation was announced.
Officials and lawmakers have condemned the case as a serious breach of trust and a form of insider trading in prediction markets, highlighting concerns about the misuse of secret information for profit.
#Military#DOJ#InsiderTrading
👂More on Trump's Ear ⚠️
Quiver Quantitative | 𝕏
You can track Cantor Fitzgerald's stock portfolio on Quiver:
https://www.quiverquant.com/institutions/CANTOR%20FITZGERALD,%20L.%20P./
~
₿izFeed#⃣:#stockmarketdata#stockmarketnews#insidertrading
Quiver Quantitative | 𝕏
BREAKING: Cantor Fitzgerald, run by the children of Commerce Secretary Howard Lutnick, just filed a portfolio update.
They bought up huge amounts of Bitcoin, Trump Media stock, and stock in the Chinese company Alibaba.
Full portfolio below.
~
₿izFeed#⃣:#stockmarketdata#stockmarketnews#insidertrading
Quiver Quantitative | 𝕏
You can track Jane Street's stock portfolio on Quiver:
https://www.quiverquant.com/institutions/JANE%20STREET%20GROUP,%20LLC/
~
₿izFeed#⃣:#stockmarketdata#stockmarketnews#insidertrading
Quiver Quantitative | 𝕏
JUST IN: Jane Street just filed a holdings update.
They added approximately $1B of Bitcoin to their portfolio.
It is now their largest holding.
Full portfolio below.
~
₿izFeed#⃣:#stockmarketdata#stockmarketnews#insidertrading
Quiver Quantitative | 𝕏
You can track Michael Burry's portfolio here:
https://www.quiverquant.com/institutions/Scion%20Asset%20Management,%20LLC/
~
₿izFeed#⃣:#stockmarketdata#stockmarketnews#insidertrading
Quiver Quantitative | 𝕏
BREAKING: Michael Burry, of "The Big Short" fame, just filed a portfolio update.
He added:
- UnitedHealth, $UNH
- Lululemon, $LULU
- Bruker, $BRKR
- Regeneron, $REGN
- MercadoLibre, $MELI
Track his full portfolio on Quiver.
~
₿izFeed#⃣:#stockmarketdata#stockmarketnews#insidertrading
Quiver Quantitative | 𝕏
We received this data just 15 minutes ago.
Since then:
$UNH +7%
$NUE +6%
$LEN +4%
$DHI +3%
$ALL +0.5% https://twitter.com/QuiverQuant/status/1956086663156830469
~
₿izFeed#⃣:#stockmarketdata#stockmarketnews#insidertrading
Quiver Quantitative | 𝕏
We expect to have an update on Warren Buffet's portfolio in the next hour.
This might reveal the identify of the mystery stock that he has been buying up.
Turn on post notifications!
~
₿izFeed#⃣:#stockmarketdata#stockmarketnews#insidertrading
Quiver Quantitative | 𝕏
BREAKING: We just received new data on Senator Dave McCormick's portfolio.
He has up to $5M in Bitcoin, $IBIT.
He also has to $1M in Ethereum, $ETHW.
McCormick sits on the Senate Subcommittee on Digital Assets.
Full portfolio up on Quiver.
~
₿izFeed#⃣:#stockmarketdata#stockmarketnews#insidertrading