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 слични објави

Пребарај: #eubeachcleanupcampaign

当前筛选 #eubeachcleanupcampaign清除筛选
EU in Kazakhstan 🇪🇺🇰🇿

@euinkazakhstan · Post #958 · 21.09.2024 г., 13:23

21 September2024 ASTANA – As part of World Cleanup Day and the #EUBeachCleanup environmental campaign, the Delegation of the European Union to Kazakhstan, in collaboration with the Estonian Embassy in Kazakhstan and with the support of the Akimat of Astana and the environmental movement “We are for a clean country” organized a cleanup event along the banks of the Karasu River in Astana on September 21, 2024. In her address to participants, the Head of the EU Delegation to Kazakhstan, Ms. Aleska Simkic, remarked: “Today's #EUBeachCleanup campaign is more than just picking up litter. It is about taking responsibility for our planet. Each and everyone of us can contribute, by decreasing his/her carbon footprint – at least not litter, by making those close to him/her aware of the importance of individual action and by influencing the politicians of our countries to enforce policies for cleaner environment. Together, we can tackle waste pollution and inspire lasting change. When communities unite, we can build a cleaner, greener future for Kazakhstan and the world.” Ambassador of Estonia to Kazakhstan, Mr. Jaap Ora, extended his gratitude to the Akimat of the City of Astana, local environmental activists, the EU Delegation to Kazakhstan, and all participants of the World Cleanup Day in Kazakhstan. “This shows our joint commitment to preserving the environment. This year is particularly significant, as World Cleanup Day, which originated in Estonia, has been officially added to the UN Calendar of International Days starting from 2024. This recognition will undoubtedly enhance its visibility and impact.” The event brought together around 300 participants, including diplomats and staff from embassies representing countries of Europe, America, Asia, and Africa, as well as representatives from international organizations and the Youth Public Association of the Earth Foundation, local residents and visitors to the Capital alsojoined in, cleaning the banks of the Karasu River of litter and waste. World Cleanup Day and the #EUBeachCleanup campaign were also supported by all regions and cities of Kazakhstan, making it part of the large-scale environmental campaign “Taza Qazaqstan”. This made the campaign part of a nationwide effort to raise awareness about cleanliness and promote the development of ecological culture. On this day, winners of the Instagram Reels contest – which encouraged participants to showcase their eco-friendly habits – were awarded with special prizes. In addition, thanks to the efforts of the participants, a large number of plastic bottles were collected and sent for recycling. To conclude the event, participants took part in a flash mob, forming a large heart to symbolize their love for Planet Earth. As part of this significant environmental initiative, a teleconference was organized between the UN Office in New York and Astana. During a live broadcast, Ms. Heidi Solba, President and Head of the global network Let’s Do It World and World Cleanup Day, discussed the importance of this action and highlighted Kazakhstan’s role in the global environmental movement. The European Union Delegation and the Estonian Embassy in Kazakhstan extend their deepest gratitude to all partners and participants of World Cleanup Day and the #EUBeachCleanupcampaign! Background information: World Cleanup Day is one of the largest global movements that unites millions of volunteers, governments and organisations. With 19,068,786 participants from a new high of 198 countries and territories – which includes a new high of 90% of UN member states – WCD marked a return to pre-Covid engagement levels, with the movement’s second-highest annual turnout. From 2024, World Cleanup Day is declared an official UN Day, on 20 September annually, and has now been added to their Calendar of International Days and Weeks. This world-changing idea began in Estonia, in 2008. #EUBeachCleanup is a more focussed global campaign organised by the EU and the UN to raise awareness about plastic pollution all over the world.