🙄Разминка для ума!
Треугольник Серпинского, интересная фигура которую построить достаточно просто.
Алгоритм такой:
1. создаём любые 3 точки на плоскости
2. из этих точек случайно выбираем любую, как начальную
3. случайно выбираем любую точку из этих же трёх точек как цель
4. перемещаемся в сторону цели на половину расстояния
5. повторяем бесконечно с пункта 3
Если сделать достаточно много итераций то вырисовывается интересная фигура. Треугольник, в который вписаны более мелкие треугольники. Это самый настоящий фрактал!
Я собрал пример построения такой фигуры на базе Qt.
🌎 Код можно посмотреть здесь.
С помощью paintEvent я рисую точки по озвученному алгоритму. Каждые 10 секунд либо по клику на виджете строится следующий треугольник.
Особенности примера:
🔸 Атрибут Qt.WA_OpaquePaintEvent позволяет сохранить то, что было нарисовано в прошлой итерации. Таким образом мы видим постепенное наполнение точек а не мелькающую одну точку.
🔸QTimer позволяет создавать отложенные вызовы один раз или с повторением через интервал.
🔸QColor.fromHsv() позволяет создать рандомный но предсказуемый цвет с помощью HSV схемы. Не слишком светлый и не слишком тёмный но всегда с разный. Рандомизации подвергается только смещение по цветовому кругу (Hue), яркость (Value) и насыщенность (Saturation) можно контролировать отдельно в своих пределах или оставить статичными. Обычный рандом цвета по RGB не даёт такой предсказуемый результат.
🔸 Каждый новый цикл с новым треугольником предварительно затемняет предыдущие через этот вызов
painter.fillRect(rec, QColor(0, 0, 0, 100))
То есть полупрозрачный цвет. Таким образом, чем старше треугольник, тем он темней.
Если сделать виджет фулскрин, то у нас получится некий ScreenSaver)))
🔸 Да, я знаю, что рисование в Qt не самый лучший способ сделать этот пример) Скорее всего самый НЕподходящий. Попробуйте сделать тоже самое но другими средствами.
#qt#source#tricks
Morphe
https://morphe.software
https://github.com/MorpheApp
Morphe is an Android app modification tool.
It allows you to change how apps work, look, and behave beyond their original design.
Build new functionality, remove limitations, and tailor apps to your needs.
For now it supports these censored apps: YouTube, YouTube Music or Reddit.
You should boycott them, but if you are used by those propaganda apps, at least you could remove the unwanted ads
Morphe is an independent project based on prior work from ReVanced.
#yt
⚡️You-Get: Download video, audio, images from the web easily!
Ever wanted to pull a bunch of content down so you can watch later?
You-Get is a CLI (command line interface) utility that makes it easy to download videos, audio, and images from the web.
https://you-get.org
you-get 'https://www.youtube.com/watch?v=jNQXAC9IVRw'
You Get supports an impressive array of sites: Youtube, Twitter, VK, Tumblr, Soundcloud, Instagram, Facebook, and countless others!
It supports downloading YouTube playlists as well, it'll go through each video in the playlist.
Downloads can be very slow though, I recommend you use the —info flag before downloading to see what formats are available. Then you can run the command again with the —i-tag flag at whichever quality level is right for you.
You can download videos off of big tech platforms / paywalls by using the '—cookies' flag and pointing to a Firefox cookies database (cookies.sqlite).
Alternative: https://ytdl-org.github.io/youtube-dl/
🫶@takebackourtech
#yt
#NewPipe on #Linux, Using Android_translation_layer
https://flathub.org/apps/net.newpipe.NewPipe
Comments
https://news.ycombinator.com/item?id=41963932
#yt
yt-fts - YouTube Full Text Search
https://github.com/NotJoeMartinez/yt-fts
yt-fts is a command line program that uses yt-dlp to scrape all of a #YouTube channels #subtitles and load them into a sqlite database that is searchable from the command line. It allows you to query a channel for specific key word or phrase and will generate time stamped YouTube urls to the video containing the keyword.
It also supports semantic search via the OpenAI embeddings API, Gemini embedding API and using chromadb.
Blog Post
LLM/RAG Chat Bot
Video Summaries
Semantic Search
CHANGELOG
Installation:
pip install yt-fts
#yt
SmartTube
Advanced player for set-top boxes and tvs running Android OS
Features
No Ads
Designed for TV screens
Up to 8K video resolution
Login into your account
Cast from the phone
Support tv box remote controller
Support external software keyboard
Support devices without Google Services
Open source
https://smarttubeapp.github.io
https://github.com/yuliskov/SmartTube
https://github.com/yuliskov/SmartTube/releases
WARNING NOT FULLY OPEN SOURCE
There are at least 5 proprietary libraries in the app.
https://github.com/yuliskov/SmartTube/issues/471
* Crashlytics (/com/crashlytics): Tracking
* Firebase Data Transport (/com/google/android/datatransport): NonFreeNet
* Google Mobile Services (/com/google/android/gms): NonFreeDep
* Firebase (/com/google/firebase): NonFreeNet,NonFreeDep
* Firebase Analytics (/com/google/firebase/analytics): Tracking
IzzySoft:
The 5 offenders are not permitted at F-Droid (and before you ask: I wouldn't take it into my repo either unless at least Crashlytics and Firebase Analytics are removed; 5 non-free libraries is a bit much for free/libre software).
#video#yt#androidtv
Latest release Freetube - An electron Youtube client that blocks ads (but can't avoid Google's YouTube censorship) now comes with support for sponsorblock
https://github.com/FreeTubeApp/FreeTube/releases/tag/v0.13.0-beta
#freetube#yt#YouTube