🙄Разминка для ума!
Треугольник Серпинского, интересная фигура которую построить достаточно просто.
Алгоритм такой:
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
An #FBI Boston investigation has resulted in charges against 30 individuals for their roles in a global insider trading scheme that netted tens of millions in illicit profits.
The #FBI executed arrests in AL, CA, FL, NJ, and NY today for individuals who are accused of capitalizing on confidential information stolen from leading corporate law firms advising on mergers & acquisitions in Massachusetts and elsewhere.
Two subjects, located in Israel and Russia, are actively being sought.
1:11 PM · May 6, 2026
X LINK
Read more about today's takedown: https://ow.ly/tyCh50YVHRu
Now do CONGRESS...
Excongresista y lobista estadounidense condenado por actuar como agente no registrado de Venezuela en relación con un contrato de 50 millones de dólares.
Un jurado federal en Miami declaró culpable al excongresista estadounidense David Rivera de ejercer presión en secreto en nombre del gobierno venezolano y de lavar millones de dólares vinculados a ese trabajo, en violación de la Ley de Registro de Agentes Extranjeros.
Obtenga más información sobre la investigación realizada por #FBI y nuestros socios encargados de hacer cumplir la ley:
https://www.justice.gov/usao-sdfl/pr/former-us-congressman-and-lobbyist-convicted-acting-unregistered-agents-venezuela
Panic and protests at the #FBI😮
“According to an email from acting Director Brian Driscoll and reviewed by The Gateway Pundit, each field office is required to submit a list of all personnel, current and former, who were involved in January 6th investigations/prosecutions by noon on Tuesday, February 4th.”
Politics, retribution behind FBI purge, agents allege in new lawsuit against Patel, Bondi
Three senior FBI officials who were abruptly fired last month by Kash Patel, the FBI director, are claiming in a new lawsuit against the Trump administration that they were illegally terminated at the direction of the White House for purely political reasons.
The complaint, filed in U.S. District Court in Washington, D.C., Wednesday, alleges Patel told one of the agents that his job as FBI director depended on firing agents involved in past investigations of President Trump.
Patel allegedly said "he had to fire the people his superiors told him to fire, because his ability to keep his own job depended on the removal of the agents who worked on cases involving the President," the lawsuit alleges.
"Patel explained that there was nothing [anyone] could do to stop these or any other firings, because 'the FBI tried to put the President in jail and he hasn't forgotten it,'" the complaint claims. According to the complaint, former FBI agent Brian Driscoll indicated he believed Patel was referring to his superiors at the White House and the Justice Department which "Patel did not deny."
#Trump#FBI
👂More on Trump's Ear ⚠️
🔍🏛️EXCLUSIVE: FBI DIVERTS 25% OF AGENTS TO IMMIGRATION — CHILD CRIMES LEFT UNDERSTAFFED
🔹 Over six thousand FBI agents (quarter of all staff) reassigned to immigration cases in Trump's first 9 months 👮
🔹 Massive 23X increase from previous levels — agents pulled from child exploitation, terrorism, corporate fraud 🚨
🔹 ICE death toll hits 18 in 2026 as Cuban immigrant dies in Georgia detention — suspected suicide 💀
🔹 Federal charges filed against Salvadoran man shot by ICE in California traffic stop gone wrong 🚔
When immigration becomes top priority, who's protecting kids from predators? Priorities matter 🔥⚖️
#Immigration#FBI
@america