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

Резултати

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

Пребарај: #trust

当前筛选 #trust清除筛选
Илья AGI TV 🤖

@ilia_plasma · Post #221 · 16.10.2023 г., 15:14

Новый нахваленный дизайн #Trust Wallet Теперь понятно почему #TWT токен упал. Глаза немного болят 😡

Hashtags

Airdrop3 LTD

@airdrop3ltd · Post #157 · 16.07.2021 г., 17:30

DUSD NETWORK #AIRDROP#TRUST WALLET #AIRDROP#META MASK Free 🎁 200 (DUSD) Tokens Reward 🎁 for a referral 50% = 100 (DUSD) ✅Open Trust wallet ✅Go to DApps ✅Copy & Paste Airdrop link below in Dapp Search Box: 👇 Project Link : https://dusd.network/ 👇 Airdrop Link : https://dusd.network/airdrop/index.html 🔹Change network to Smart chain 🔹Click Claim Airdrop (Little $0.18 Fee Required in BNB) Listing Pancakeswap 30th October, 2021. LISTING PRICE: 1 DUSD = 0.3 USD ✅To be listed at coinmarketcap ✅Add custom token: Contract Address: 0x5eba288f8833071ba7cd5c2b356754811c0ce8fb ✅BSCSCAN https://bscscan.com/token/0x5eba288f8833071ba7cd5c2b356754811c0ce8fb ✅TELEGRAM GROUP LINK: https://t.me/dusd_network ✅Twitter LINK https://twitter.com/DusdNetwork ✅Reddit Link https://www.reddit.com/user/DUSD_Network ✅discord.com https://discord.gg/m62cgWbP ✅Youtube https://www.youtube.com/channel/UCKlGuOEocIIwIGh8V2H8DFg ✅Medium https://medium.com/@dusd.network

Mexc Dex Spread Tracker Alerts

@mexcdex · Post #24040 · 15.04.2026 г., 09:21

🟢 LONG? #TRUST Spread 8.16% detected 💥 Origin: MEXC (DUMP) [M: -10% VS D: -3%] 💎 Intuition #TRUST_USDT (COPY: TRUST) 🌐 Price DEX $0.09270 🎰 Price MEXC $0.08571 ️⚖️ Max Size: 23K $TRUST ($2K) 💹️ Funding Rate: -0.4395% 🏦 Market Cap: $16.7M 💰 Liquidity: $383K 💸 Vol DEX/MEXC: $243K / $525K ⛓️#BASE Dep: 🟢 (1800) W/d: 🟢 0x6cd905dF2Ed214b22e0d48FF17CD4200C1C6d8A3 ⏳Avg Align Time: 94s 📊Avg Spread / Max / Change: ±5% / ±5% / ±3% 📈Win / Draw / Lose: 1 / 0 / 1 💰Total / Week / 24H Profit: -0% / -3% / -3%

AI & Law

@ai_and_law · Post #96 · 28.08.2023 г., 07:04

Twilio Introduces "Nutrition Labels" to Boost Trust in AI Hello AI&Law society! Twilio, a communication tool services company, is taking a proactive step to enhance transparency and trust in its artificial intelligence services. The company is introducing "nutrition labels" for its AI models, providing information about the data used for training, the purpose of data collection, and more. The labels aim to offer users a clear understanding of how their data will be utilized. The "nutrition labels" highlight key aspects such as which AI models are being employed, whether customer data is used for training, and whether human involvement is integrated. Additionally, Twilio offers an online tool that enables other companies to generate similar labels for their AI products. Twilio's initiative aligns with broader industry efforts to ensure responsible and transparent AI practices. Salesforce, for instance, is also unveiling an acceptable use policy for its generative AI technologies, specifying prohibited practices and emphasizing responsible AI usage. #AI#Transparency#DataPrivacy#Trust#ResponsibleAI#Twilio#Salesforce

AI & Law

@ai_and_law · Post #29 · 15.06.2023 г., 07:04

Cybersecurity and AI: mapping key issues in the EU The European Union Agency for Cybersecurity (ENISA) has released a comprehensive report highlighting key cybersecurity issues in the field of artificial intelligence. The report aims to shed light on potential risks and provide guidance for policymakers, businesses, and AI developers. The report identifies several critical areas that require attention. One key concern is the security and integrity of AI systems, emphasizing the need for robust safeguards against unauthorized access, data breaches, and malicious attacks. It also highlights the importance of ensuring the privacy and protection of personal data used in AI processes. Additionally, the report emphasizes the significance of transparent and explainable AI algorithms. Clear accountability and understandable decision-making processes are vital to building trust in AI systems and avoiding potential biases or discrimination. #AI#Cybersecurity#EU#DataProtection#Privacy#Transparency#Trust#Cyberthreats

12
ПретходнаСтраница 1 од 2Следна