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

Резултати

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

Пребарај: #nextcloud

当前筛选 #nextcloud清除筛选
Libreware

@libreware · Post #1207 · 14.11.2023 г., 15:58

Nextcloud now offers AI integration for your Nextcloud server. Apps aren't installed by default, except Smart Mail, Background Images & Sus Login. AI comes with risk, so #Nextcloud rates their #AI apps at 4 levels, based on 3 conditions. Conditions 1. Is it open source? 2. is the trained model free for self-hosting? 3. is the training data available and free to use? Rating levels 🟢 = All condition met 🟡 = 2 conditions met 🟠 = 1 condition met 🔴 = 0 conditions met The AI apps are listed below w/their ratings. 👇 IMAGE GENERATION 🟡Online StableDiffusion 🟡Self-Hosted StableDiffusion 🔴Online DALL-E 2 TEXT GENERATION 🟡LocalAI 🔴ChatGPT SPEECH-2-TEXT DICTATION 🟢OpenAI Whisper 🟡External Whisper SPEECH-2-TEXT TRANSCRIPTION 🟢OpenAI Whisper 🟢LocalAI SMART INBOX 🟢 Built-In (can be disabled in low-left settings) FACE/OBJECT RECOGNITION 🟢Recognize BACKGROUND IMAGES/BLUR 🟢 Built-In TRANSLATION 🟢Opus 🟢LibreTranslate 🔴DeepL SUSPICIOUS LOGIN 🟢 Built-In ⚡️@LinuxTechIndex

Libreware

@libreware · Post #1223 · 11.02.2024 г., 23:51

. You can log and track the phone locations of your family and friends in complete privacy, using your Nextcloud server. To do this you need to install the Nextcloud PhoneTrack App on your Nextcloud server, and the Android PhoneTrack App on every DeGoogled phone you want to track. The F-Droid version is old and buggy. To get the newer Dev Android version, you: 1. Go to the PhoneTrack Dev GitLab page, scroll down and click the "APK Direct Download" link 2. At top "Pipeline" option, click the Download arrow and select "AssembleDevDebug:archive" 3. This downloads a zip file. Extract the zip and install the APK. CONNECT ALL PHONES AND TRACK 4. On Nextcloud create a dedicated account for PhoneTracking. 5. Create a PhoneTrack "Session" in the Nextcloud PhoneTrack app. 6. Sign each phone into the Nextcloud PhoneTrack account, and on the phone, add a "PhoneTrack log job" to the Session on Nextcloud. ⚡️@LinuxTechIndex #PhoneTrack#Tracker#Nextcloud

AIGC

@aigcrubbish · Post #50 · 14.05.2025 г., 01:56

Nextcloud claims Google is being anticompetitive Nextcloud 指控谷歌存在反竞争行为 开源协作平台 Nextcloud 近日发表声明,称谷歌以"安全担忧"为由撤销了其 Android 客户端的关键文件同步权限。Nextcloud 指出该功能自2016年上线以来从未收到安全投诉,且包括谷歌自家应用在内的多个主流应用仍保留该权限。 Nextcloud 认为谷歌利用平台优势进行自我优待。尽管自2024年中旬多次申诉,谷歌仍拒绝恢复权限,导致数百万用户无法使用自动文件上传功能。 值得注意的是,通过 F-Droid 分发的 Nextcloud 客户端不受此限制,但官方表示这对多数用户并非可行替代方案。 原文链接:https://lwn.net/Articles/1021016/ #开源#反垄断#云计算#Android#Nextcloud #AIGC Read more