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

Резултати

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

Пребарај: #dobroye

当前筛选 #dobroye清除筛选
DruschbaFM - English

@druschbaFm_en · Post #51966 · 12.03.2025 г., 08:02

⚡️🇷🇺🇺🇦⚡️ Two Majors #Summary for the Morning of 12 March 2025; 06:27 (GMT+3)⚡️ 🔹 The Russian Army continues its #Kursk offensive with decisive objectives. Yesterday, #KazachyaLoknya, #Zamostye, #Makhnovka, #Mirny, #Bondarevka, #Dmitryukov, and #Knyazhy1st and #Knyazhy2nd hamlets were liberated. Russian forces are advancing from #Sudzha’s industrial zone and central market, with reports of movement in the built-up areas. Footage has emerged of Ukrainian infantry retreating westward. Russian troops are also active in the #Sumy region near #Zhuravka. The #Sudzha – #Yunakovka Motorway is under Russian fire control, and AFU reinforcements attempting to enter the #Kursk region have been repelled. Heavy battles for the region’s liberation continue. 🎯 Russian Forces struck targets in #Odessa region overnight, with the enemy claiming a 'cargo ship carrying grain' was damaged. Confirmed strikes hit infrastructure in #Dnepropetrovsk, with explosions reported in #Kiev, #Pavlograd, #Kramatorsk, #SnakeIsland, as well as in the #Cherkassy, #Kharkov, #Sumy, and #Khmelnitsky regions. 🛡 Russian Air Defences repelled a night-time attack on the #Bryansk region. 🔹 In #Seversk Sector, Russian forces continue difficult advances west of #Belogorovka, facing fierce and organised 👉resistance. 🔹 In #Toretsk, reports persist of AFU units being deployed deeper into urban areas. 🔹 In #Pokrovsk Direction, clashes continue in #Shevchenko, #Peschanoye, #Kotlino, and #Uspenovka. On the far right flank, east of #Pokrovsk, Russian forces are attacking near #Tarasovka. 🔹 On the #Vremyevka Ledge, north of #VelikayaNovosyolka, the 'East Group of Troops' has secured #Dneprenergiya. The enemy claims successful counterattacks in #Novosyolka. 🔹 On the #Zaporozhye Front, Russian forces raised the flag over #Pyatikhatki after prolonged heavy battles.🎬👆The village, situated in a low-lying area, has been in ruins since summer 2023 and lacks underground shelters, making long term consolidation uncertain. 💥 In #Belgorod Region, the AFU continues to target civilians. In Shebekino district, a UAV attack damaged equipment at a commercial facility in #Dobroye. In #Shamino, an FPV drone struck a civilian car. Another drone hit a private residence in #NizhneyeBeryozovo2nd. In Grayvoron district, a UAV detonation in a private residence in #Glotovo caused an attic fire. In #Valuyki, an FPV drone damaged a car and shattered windows. In #Shelayevo, a drone exploded on the ground. 💥 In the #DPR, a 2001-born woman was injured in #Gorlovka following a Nazi artillery strike, with further damage to civilian infrastructure. In #KrasnayaPolyana, Volnovakha district, a 1966-born man sustained injuries from an explosive device detonation. 💬Welcome to Military Chat; 🇬🇧Battle Maps 📱 Join GLOBAL DEPTH to boost your TG Feed GLOBAL DEPTH from #HK This channel aims to unite interested individuals from around the world in an attempt to connect the dots. Subscriber participation is always welcome here and in the channel's Chat Group.