Ранее я делал серию постов про битовые операторы.
Вот вам ещё один наглядный пример как это используется в 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
💼Former U.S. Trade Representative Roy Kirk, who served in the Obama administration, has criticized President Donald Trump’s trade negotiations, warning that his aggressive style is creating confusion and hardship for American exporters. 🇺🇸
According to Kirk, Trump's pattern of threatening tariffs and then retreating after market backlash is doing more harm than good. 📉
🗣️“The president will be spooked by something, get a little bit upset, threaten more tariffs,” he said, adding that in the case of a negative reaction in the markets, he will then announce that “we’re on the precipice of a deal.” Kirk said this during his appearance on CNBC’s Squawk Box on Monday. 📺
See Also 👉Ronald Reagan ‘Didn’t Love Tariffs,’ Says Economist Paul Krugman: He Repeatedly Emphasized ‘The Virtues of Free Trade’
Kirk said that the unpredictable nature of U.S. trade policy under Trump is causing a lot of frustration among American companies that are trying to plan for the future. 🏭
⚠️ The consequences of Trump’s “macho” trade tactics are being felt by ordinary exporters.
💬“They're having to pay the price for this macho,” he said, citing examples of soy farmers, cattle farmers, and other small businesses. 🌾🐄
#Trump#Tariffs#SmallBusiness
👂More on Trump's Ear ⚠️
🎓 MBA “Kichik biznes va tadbirkorlik” magistratura dasturi
Dastur turi: Magistratura (MBA — Master of Business Administration)
Yo‘nalish: Kichik biznes va tadbirkorlik (Small Business and Entrepreneurship)
Ta’lim tili: O‘zbek va rus tili.
Diplom: Davlat tomonidan tasdiqlangan magistr diplomi
Dastur innovatsion va amaliy yondashuvga asoslangan bo‘lib, nazariy bilimlar bilan birga real biznes keyslar, tajribali tadbirkorlar bilan uchrashuvlar, mentorlik va loyiha asosidagi o‘qitishni o‘z ichiga oladi. Tinglovchilar o‘z biznes g‘oyalarini amaliyotga tatbiq etish imkoniyatiga ega bo‘ladilar.
❔ Bu kimlar uchun?
✔️ Innovatsion va barqaror biznes g‘oyalarni amaliyotga joriy qilmoqchi bo‘lgan tashabbuskorlar
✔️ Hududiy tadbirkorlikni rivojlantirishga hissa qo‘shmoqchi bo‘lgan yoshlar va mutaxassislar
✔️ Mavjud tadbirkorlik faoliyatini kengaytirishni istaganlar
✔️ Tadbirkorlik subyektlari bilan muntazam ish yurituvchi Davlat va nodavlat tashkilotlar mutaxassislari uchun
❔ Dasturda nimalar o‘rganiladi?
✔️ Moliyaviy savodxonlik va boshqaruv
✔️ Raqobat tahlili va strategik qarorlar qabul qilish
✔️ Innovatsion fikrlash va mahsulot yaratish
✔️ Biznes moliyasi va investitsiyalarni jalb qilish
✔️ Soliq va huquqiy asoslar
✔️ Startaplarni rivojlantirish va inkubatsiya
⭐ Shuningdek, real biznes keyslar, mahalliy va xorijiy ekspertlar ishtirokidagi mahorat darslari orqali bilimlar mustahkamlanadi.
❔Kelajakda qanday foyda beradi?
✔️ Biznesda risklarni boshqarish (Risk management)
✔️ Hududiy va milliy miqyosdagi iqtisodiy rivojlanishda faol ishtirok etish imkonini beradi
✔️ Investitsiya jalb qilish, hamkorlar bilan ishlash tajribasini beradi
✔️ Bozor talabiga mos mahsulot va xizmatlar yaratish ko‘nikmasini shakllantiradi
Mazkur dasturning asosiy maqsadi - O‘zbekistonning har bir hududida o‘z biznesini yurita oladigan, iqtisodiyotni quyi bo‘g‘inlardan boshlab harakatlantira oladigan bilimli, mas’uliyatli va yangicha fikrlaydigan tadbirkorlar avlodini tayyorlashdir.
🇷🇺 Поднобнее
#GSBE#SmallBusiness#Entrepreneurship#MBA#Master
🔝Web-site |🔝Facebook | 🔝Instagram | 🔝Youtube
Navigating AI Opportunities & Threats
Explore how AI presents both challenges and opportunities for small businesses. While larger firms dominate the market, many entrepreneurs can thrive with modest revenue targets. AI could lead to the decline of SaaS businesses due to cost-effective alternatives. However, it allows individuals to quickly replicate and improve existing applications, catering to proven market needs. Though scaling to $500M ARR is tough in niches, a small investment can create meaningful products. Innovators can introduce multiple unique offerings, even in shadow of larger tech giants.
#AI#SaaS#Business#Investment#Tech#Entrepreneurship#Revenue#ProductDevelopment#Innovation#Market#Growth#Web3#Startups#Opportunity#Threats#SmallBusiness#Investors#ExistingMarket#Applications#PMF#CostEfficiency
AI Marketer Launches for $29
Introducing Nikolai's service, MarketOwl, which provides virtual marketing teams for small businesses. The AI-driven platform automates content creation and identifies potential customers. Currently, it supports around 100 users monthly, generating about $3k in revenue. The concept originated from Nikolai's observations of small companies lacking marketing resources, expertise, and time. After initial failures with a marketing strategy MVP, he pivoted to develop the AI marketer. Engagements in a dedicated subreddit led to high conversion rates for subscriptions. Successful products arise from addressing real audience problems. To effectively enter the market, consider using the Plan-Kapkan consisting of 35 steps for launching.
#MarketOwl#AI#Marketing#ContentCreation#SmallBusiness#SaaS#VirtualTeam#Startup#Entrepreneurship#MVP#ProblemSolving#Automation#CustomerAcquisition#AudienceEngagement#Subscription#Revenue#Strategy#PlanKapkan#BusinessGrowth#MarketingTools