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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #164 · 14 окт.

🙄Разминка для ума! Треугольник Серпинского, интересная фигура которую построить достаточно просто. Алгоритм такой: 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

Резултати

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

Пребарај: #know

当前筛选 #know清除筛选
Business Lessons™

@business_idea4 · Post #4733 · 27.01.2026 г., 17:26

Here are 5 key takeaways from the book "STRATEGIZE TO WIN" - 1. #Know your strengths and weaknesses. This is the foundation of any successful strategy. Once you know what you're good at and what you're not so good at, you can start to build a strategy that plays to your strengths and minimizes your weaknesses. 2. #Set clear goals. What do you want to achieve? What are your long-term and short-term goals? Once you know what you want to achieve, you can start to develop a strategy to get there. 3. #Understand your competition. Who are your competitors? What are their strengths and weaknesses? What are their goals? Once you understand your competition, you can start to develop a strategy that will give you an edge. 4. #Be flexible. The world is constantly changing, so your strategy needs to be flexible enough to adapt to change. Be prepared to adjust your strategy as needed. 5. #Execute your strategy. This is the most important step of all. Once you have a strategy, you need to execute it. This means taking action and making sure that your strategy is working. Here are some additional key takeaways from the book: A. #Strategy is not a one-time event. It is an ongoing process that needs to be reviewed and updated regularly. B. #Strategy is not about perfection. It is about progress. You will never have a perfect strategy, but you can always improve your strategy by learning from your mistakes and by making adjustments as needed. C. #Strategy is about execution. It is not enough to have a good strategy. You also need to be able to execute your strategy effectively. I hope these key takeaways help you on your journey to strategizing to win. 💠Join 🔺 Share @Business_Idea4💠

MONEY SECRETS

@businessideas101 · Post #1247 · 14.06.2025 г., 06:23

Here are 5 key takeaways from the book "STRATEGIZE TO WIN" - 1. #Know your strengths and weaknesses. This is the foundation of any successful strategy. Once you know what you're good at and what you're not so good at, you can start to build a strategy that plays to your strengths and minimizes your weaknesses. 2. #Set clear goals. What do you want to achieve? What are your long-term and short-term goals? Once you know what you want to achieve, you can start to develop a strategy to get there. 3. #Understand your competition. Who are your competitors? What are their strengths and weaknesses? What are their goals? Once you understand your competition, you can start to develop a strategy that will give you an edge. 4. #Be flexible. The world is constantly changing, so your strategy needs to be flexible enough to adapt to change. Be prepared to adjust your strategy as needed. 5. #Execute your strategy. This is the most important step of all. Once you have a strategy, you need to execute it. This means taking action and making sure that your strategy is working. Here are some additional key takeaways from the book: A. #Strategy is not a one-time event. It is an ongoing process that needs to be reviewed and updated regularly. B. #Strategy is not about perfection. It is about progress. You will never have a perfect strategy, but you can always improve your strategy by learning from your mistakes and by making adjustments as needed. C. #Strategy is about execution. It is not enough to have a good strategy. You also need to be able to execute your strategy effectively. I hope these key takeaways help you on your journey to strategizing to win. Thank you for reading 📖

搜书神器 读书动态

@BookLogSFW · Post #91115 · 18.05.2026 г., 06:03

书名:crash course for the new gre 4th editio - princeton review 文件:英文 · MOBI · 2MB · 4万字 · 0R 统计:308热度 | 5下载 | 1点赞 | 0收藏 评级:0分 (0人) 💬 质量:5分 (0人) 标签:#answer#question#Quantity#one#choices#two#number#choice#get#passage#re#time#word#like#questions#sentence#know#problem#GRE#first#find 上传:👤Swof #预览#SFW#收藏书籍 📜我喜欢的书籍[1本]