TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #32 · 7 фев.

Скорее всего уже слышали, что складывать строки через + это плохая практика. Падение производительности, и всё такое. Без лишних слов, давайте измерять: from timeit import timeit def t1(): # складываем 10 строк через + из переменной t = 'text' for _ in range(1000): s = t + t + t + t + t + t + t + t + t def t2(): # склеиваем список строк через метод join arr = ['text'] * 10 for _ in range(1000): s = ''.join(arr) def t3(): # складываем через + но не из переменной а непосредственно инлайн объекты for _ in range(1000): s = 'text' + 'text' + 'text' + ... # всего 10 раз Теперь каждую строку склейки запустим по 10М раз >>> timeit(t1, number=10000) 0.21951690399964718 >>> timeit(t2, number=10000) 1.4978306379998685 >>> timeit(t3, number=10000) 0.2213820789993406 Хм, а нам говорили что через "+" это плохо и медленно ))) 😁 Тут стоит учитывать, что речь идёт о склейке множества длинных строк. Давайте изменим условия: def t4(): t = 'text'*100 for _ in range(1000): s = t + t + t + t + t + t + t + t + t def t5(): arr = ['text'*100] * 10 for _ in range(1000): s = ''.join(arr) def t6(): for _ in range(1000): s = 'text'*100 + 'text'*100 + ... # всего 10 раз >>> timeit(t4, number=10000) 12.795130728000004 >>> timeit(t5, number=10000) 2.642637542999182 >>> timeit(t6, number=10000) 0.2184546610005782 Вот, уже другой разговор, сразу видна разница, в среднем в 6 раз. Но погодите, почему последний тест t6() по скорости такой же как и t3()? Ведь строки теперь в 100 раз длиннее! Это вопросы оптимизации кода, какие простые изменения ускоряют или замедляют выполнение программы. Мы столкнулись с примером обхода обращения к переменной. Например, именно так работает директива #define в С++, во время компиляции подставляя значение переменной вместо ссылки на неё. В Python это тоже работает, но часто ли вы сможете встретить такой способ работы со строками? К сожалению, способ почти только теоретический. В целом, тесты показали то, что мы хотели. Делаем выводы самостоятельно. Полный листинг 🌍 #tricks

Резултати

Пронајдени 2 слични објави

Пребарај: #spying

当前筛选 #spying清除筛选
American Оbserver

@american_observer · Post #5184 · 20.02.2026 г., 20:59

📰 Spies vs. Dealmakers: Europe Watches the Ukraine “Peace Show” Top European intelligence chiefs are basically calling the Trump‑brokered Ukraine talks what they are: “negotiation theatre.” While Trump insists a deal is “reasonably close” and still pushes his June deadline, five spy bosses told Reuters they see no chance of a real settlement this year and no sign Russia wants one. Their read is simple and brutal: Moscow’s strategic goals haven’t changed — remove Zelensky, turn Ukraine into a “neutral” buffer, and lock in its territorial gains, starting with the rest of Donetsk. Russia isn’t desperate for peace; its economy is hurting but not collapsing, and it can afford to drag this out while pushing for sanctions relief and big‑ticket business deals on a separate track. That second track is where things get toxic. Zelensky says his intel services told him U.S. and Russian negotiators are discussing up to $12 trillion in bilateral projects pitched by Kremlin envoy Kirill Dmitriev, while Dmitriev himself is already boasting about a $14 trillion “portfolio” on X. European spies say this is tailored to seduce both Trump and sidelined Russian oligarchs: peace as a gateway drug to massive post‑sanctions money. On the official peace track in Geneva, nothing moves. Russia demands Ukraine pull out of the last 20% of Donetsk it still holds, and some in the West fantasise that ceding that would “unlock” a deal — one intelligence chief dryly calls that delusional, predicting it would only be the “beginning” of Moscow’s demands. Zelensky, watching this circus, posts: “I don’t need historical shit to end this war… it’s just a delay tactic.” And who’s running America’s side of this grand bargain? Not seasoned Russia hands, but Trump’s real‑estate buddy Steve Witkoff and his son‑in‑law Jared Kushner — men who know a lot about property, less about a grinding European war. European spooks say Western negotiating skill with Moscow is “very limited,” even as the financial stakes and political risks keep climbing. So you get three layers: a bloody stalemate on the ground, a glossy “peace by June” storyline for U.S. domestic politics, and a shadow conversation about trillion‑dollar projects after the signatures are dry. The only thing everyone seems to agree on is that someone will make a lot of money when this ends — just not the people standing in the rubble in Odesa. #Ukraine#Russia#Trump#spying#war#fakePeace#oligarchy 📱American Оbserver - Stay up to date on all important events 🇺🇸

Crypto M - Crypto News

@CryptoM · Post #64817 · 10.04.2026 г., 02:07

🚀 CIA to Integrate AI 'Co-Workers' in Analytic Platforms The CIA has announced plans to incorporate classified AI 'co-workers' into all its analytic platforms over the next few years. According to NS3.AI, this initiative aims to assist analysts in identifying spies and evaluating foreign threats. CIA Deputy Director Michael Ellis emphasized that while AI will play a supportive role, humans will continue to make the critical decisions. Last year, the agency conducted tests on approximately 300 AI projects to advance this integration. #CIA#AI#ArtificialIntelligence#Analytics#NationalSecurity#Spying#ThreatAssessment#TechnologyIntegration#GovernmentAI#IntelligenceCommunity