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

Резултати

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

Пребарај: #tensions

当前筛选 #tensions清除筛选
Crypto M - Crypto News

@CryptoM · Post #65353 · 13.04.2026 г., 02:04

🚀 Iranian Official Warns of Potential Response to U.S. Naval Blockade An Iranian official has issued a warning regarding Iran's potential response to a U.S. naval blockade. According to NS3.AI, the official indicated that Iran possesses an unused strategy that could be employed if tensions escalate further. This statement comes amid ongoing geopolitical tensions between the two nations, highlighting the complex dynamics at play in the region. #Iran#US#NavalBlockade#Geopolitics#Tensions#Strategy#MiddleEast

Crypto M - Crypto News

@CryptoM · Post #65095 · 11.04.2026 г., 00:45

🚀 Lebanon and Israel to Hold First Meeting on Ceasefire Talks Lebanon and Israel have agreed to hold their first meeting on Tuesday at the U.S. State Department to discuss a ceasefire and set a date for negotiations. According to BlockBeats, this development marks a significant step towards addressing ongoing tensions between the two nations. #Lebanon#Israel#Ceasefire#Negotiations#USStateDepartment#Tensions

Crypto M - Crypto News

@CryptoM · Post #65350 · 13.04.2026 г., 01:55

🚀 U.S. and Iran Maintain Temporary Ceasefire Amid Tensions U.S. President Donald Trump announced that the temporary two-week ceasefire between the United States and Iran is "generally holding well." According to Odaily, this statement comes despite the lack of progress in marathon negotiations held over the weekend in Pakistan. Trump, speaking to reporters upon his return to Washington from Florida, stated, "I think it's generally holding well. Their military has been destroyed. Their entire navy is at the bottom of the sea." He also mentioned that the U.S. would begin a blockade of the Strait of Hormuz at 10 a.m. Eastern Time on Monday. Additionally, Trump noted that two American soldiers rescued in Iran earlier this month are currently in good condition. #US#Iran#Ceasefire#Tensions#Trump#Military#Negotiations#StraitOfHormuz

Crypto M - Crypto News

@CryptoM · Post #65018 · 10.04.2026 г., 14:06

🚀 Iranian Military Maintains High Alert Amid U.S. and Israeli Tensions On April 10, the Iranian Armed Forces announced that they remain on high alert, ready to engage if necessary. According to BlockBeats, a spokesperson from the Khatam al-Anbiya Central Headquarters stated that this stance is due to repeated breaches of trust by the United States and Israel. The statement underscores ongoing tensions in the region, highlighting Iran's preparedness to respond to perceived threats. #Iran#Military#US#Israel#Tensions#MiddleEast#Alert

Crypto M - Crypto News

@CryptoM · Post #65401 · 13.04.2026 г., 05:15

🚀 U.S. to Impose Blockade on Iranian Ports Amid Tensions U.S. President Donald Trump announced on his social media platform that the United States will enforce a blockade on ships entering and exiting Iranian ports at 10 a.m. Eastern Time on April 13. According to BlockBeats, this decision follows unsuccessful negotiations between the United States and Iran. On April 12, President Trump expressed indifference towards Iran's willingness to return to the negotiating table. He reiterated the plan to impose the blockade and voiced disappointment over NATO's lack of support for the U.S. in the conflict involving Iran. #US#Iran#blockade#Trump#NATO#tensions#MiddleEast#sanctions#diplomacy

Crypto M - Crypto News

@CryptoM · Post #65141 · 11.04.2026 г., 11:36

🚀 Russia and Ukraine Conduct Prisoner Swap Mediated by UAE Russia and Ukraine have successfully exchanged 175 prisoners of war, with the United Arab Emirates playing a mediating role in the process. Bloomberg posted on X, highlighting the significance of this exchange amid ongoing tensions between the two nations. The swap marks a notable development in the efforts to address humanitarian concerns arising from the conflict. Both countries have been engaged in a prolonged conflict, and such exchanges are seen as steps towards easing tensions and addressing the humanitarian impact of the war. The involvement of the UAE underscores the international community's interest in facilitating dialogue and resolution between Russia and Ukraine. This exchange is part of ongoing efforts to manage the humanitarian aspects of the conflict, which has drawn widespread international attention. #Russia#Ukraine#PrisonerSwap#UAE#HumanitarianEfforts#ConflictResolution#InternationalDiplomacy#HumanitarianImpact#Tensions#War