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

Резултати

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

Пребарај: #dca

当前筛选 #dca清除筛选
Host Testing and evaluation

@HostEvaluate · Post #871 · 13.08.2023 г., 12:21

#crunchbits#DCA Host Provider: crunchbits Location: Liberty Lake, Washington, USA Specification: 2vCore (E5-2696 v4) | 3GB RAM | 25GB SSD | 4TB @ 250Mbps | $11.69 / Yearly (Promo code: PATIENCE) 性能上来讲,能用。IP 已不能解锁 Netflix 但仍然算比较干净。现在以 he 为主不像以前基本走 WSI. https://pastebin.com/L2Ja8XjS 流媒体报告 https://pastebin.com/dmMVgQ8r

SLEX NEWS

@slex_io · Post #87 · 08.09.2023 г., 13:34

🎉Check out DCA Strategy page on SLEX🎉 🌈Hey, SLEXians, do you know something about one of the most influential and profitable investment and trading strategies — Dollar-Cost Averaging (DCA)? 📊 DCA investment strategy is: ✅Minimum Risk; ✅ Maximum Returns; ✅ Simplifying Decision-Making. 📚We've prepared the whole page on the SLEX platform to ensure you have comprehensive guides, real-life examples, and pro tips for trading successfully!🎯 📈 Explore DCA — this is Your Path to Profitable Trading on SLEX👉slex.io/dca #SLEX#DCA#CryptoTrading#ProfitableInvesting Email | Telegram | Reddit | Facebook | Instagram | Medium | Linkedin | Twitter

Артур Хуснуллин | Блог

@husnullinartur · Post #643 · 04.03.2025 г., 09:38

🔥 Батя в крипте – доллар косит 🔥 Сидим мы тут, братцы, в баньке, парок гоняем, пивком запиваем… И вот зашел разговор: а что, если бы ты, как умный, пять лет назад по соточке баксов в Биток закидывал каждый месяц? 🤔 Ну, считай сам: всего-то вложил 6 000 баксов. Мелочь, а приятно. А сейчас бы на балансе уже 16 657 баксов красовалось! Х2.7 на ровном месте! 🔥 Вот это я понимаю – тема! 🔥 Пацаны, пока кто-то ноет, что рынок скачет, другие просто стабильно кидают бабки и не парятся. DCA – это как отложенный жирок перед зимой, только в битке. 📊 График есть – всё по красоте! 💡 Вывод: Хочешь, чтобы через 5 лет в бане ты уже не просто пивко пил, а вискарь наливал? Просто инвестируй регулярно! 🚀 #Крипта#ПацанскийИнвест#ДелаемБабки#DCA#Bitcoin

Crypto M - Crypto News

@CryptoM · Post #64661 · 09.04.2026 г., 13:04

🚀 Bitcoin's Current Volatility May Present a Generational Buying Opportunity Cryptocurrency analyst Ali Martinez recently shared an analysis on the X platform, suggesting that instead of debating whether Bitcoin has hit its bottom, attention should be focused on whether the current volatility presents a 'generational buying opportunity.' According to Odaily, Martinez identifies key 'value zones' for the current cycle based on long-term trend lines, on-chain liquidity, and cost distribution indicators. The UTXO Realized Price Distribution (URPD) indicates a significant concentration of holdings between $63,111 and $70,685, forming the primary support band. If Bitcoin falls below $63,111, the market may enter a liquidity vacuum. From a long-term perspective, Bitcoin is nearing a critical ascending trend line from the past decade, approximately between $56,000 and $60,000. Historically, this position has often marked the accumulation phase before significant price increases. In more extreme scenarios, the CVDD indicator suggests a structural bottom around $47,960, while the MVRV 0.8 range at approximately $43,647 indicates a market in an 'extreme pain' phase, typically associated with exhaustion of selling pressure. In the event of a black swan event, prices could briefly dip to an extreme range of around $36,657. Based on these zones, Martinez employs a dollar-cost averaging (DCA) strategy, gradually increasing positions across different support bands to reduce overall holding costs. He believes the market is currently in a phase of low sentiment, but potential opportunities are gradually emerging. #Bitcoin#Cryptocurrency#CryptoTrading#MarketAnalysis#Volatility#InvestmentOpportunity#DCA#OnChainAnalysis#CryptoMarket#TradingStrategy#BTC

Addis Standard

@addisstandardeng · Post #21605 · 04.03.2026 г., 08:32

News: #Ethiopia, #Kenya agree to launch joint military operations to secure border corridor, #LAPSSET Ethiopia and Kenya have agreed to strengthen security coordination along the #Moyale–#Marsabit–#Turkana corridor, endorsing structured joint military operations aimed at addressing cross-border threats and safeguarding key infrastructure linking the two countries. The agreement is part of renewed efforts to operationalise the existing Defence Cooperation Agreement (#DCA) between the two neighbours. Under the arrangement, the Ethiopian National Defence Force (#ENDF) and the Kenya Defence Forces (#KDF) are expected to undertake phased and coordinated operations targeting vulnerable border areas and strategic assets. In a related development, Ethiopia’s defence ministry also held bilateral talks with a delegation from the #Rwanda Defence Force (#RDF) on the margins of the Adwa anniversary celebrations. According to RDF, discussions focused on deepening.... Read more: https://addisstandard.com/?p=55528