@NEASingapore · Post #1171 · 19.11.2025 г., 01:00
Clean recyclables belong in the blue recycling bin. But used batteries? They’re not that girl. 💅 Let’s #RecycleRight and avoid explosive drama.
Hashtags
TGINSIGHT SIMILAR POSTS
Изворен канал @pythonotes · Post #32 · 7 фев.
Скорее всего уже слышали, что складывать строки через + это плохая практика. Падение производительности, и всё такое. Без лишних слов, давайте измерять: from timeit import timeit def t1(): # складываем 10 строк через + из переменной t = 'text' for _ in range(1000): s = t + t + t + t + t + t + t + t + t def t2(): # склеиваем список строк через метод join arr = ['text'] * 10 for _ in range(1000): s = ''.join(arr) def t3(): # складываем через + но не из переменной а непосредственно инлайн объекты for _ in range(1000): s = 'text' + 'text' + 'text' + ... # всего 10 раз Теперь каждую строку склейки запустим по 10М раз >>> timeit(t1, number=10000) 0.21951690399964718 >>> timeit(t2, number=10000) 1.4978306379998685 >>> timeit(t3, number=10000) 0.2213820789993406 Хм, а нам говорили что через "+" это плохо и медленно ))) 😁 Тут стоит учитывать, что речь идёт о склейке множества длинных строк. Давайте изменим условия: def t4(): t = 'text'*100 for _ in range(1000): s = t + t + t + t + t + t + t + t + t def t5(): arr = ['text'*100] * 10 for _ in range(1000): s = ''.join(arr) def t6(): for _ in range(1000): s = 'text'*100 + 'text'*100 + ... # всего 10 раз >>> timeit(t4, number=10000) 12.795130728000004 >>> timeit(t5, number=10000) 2.642637542999182 >>> timeit(t6, number=10000) 0.2184546610005782 Вот, уже другой разговор, сразу видна разница, в среднем в 6 раз. Но погодите, почему последний тест t6() по скорости такой же как и t3()? Ведь строки теперь в 100 раз длиннее! Это вопросы оптимизации кода, какие простые изменения ускоряют или замедляют выполнение программы. Мы столкнулись с примером обхода обращения к переменной. Например, именно так работает директива #define в С++, во время компиляции подставляя значение переменной вместо ссылки на неё. В Python это тоже работает, но часто ли вы сможете встретить такой способ работы со строками? К сожалению, способ почти только теоретический. В целом, тесты показали то, что мы хотели. Делаем выводы самостоятельно. Полный листинг 🌍 #tricks
Пребарај: #recycleright
@NEASingapore · Post #1171 · 19.11.2025 г., 01:00
Clean recyclables belong in the blue recycling bin. But used batteries? They’re not that girl. 💅 Let’s #RecycleRight and avoid explosive drama.
Hashtags
@NEASingapore · Post #1167 · 12.11.2025 г., 01:02
Only fully emptied aerosol cans should go in the blue recycling bins. Partially filled ones pose fire hazards and can cause explosions or fires. 💡Tip: Press until you can no longer hear a hissing sound! Visit go.gov.sg/recycling-guide to learn how to #RecycleRight and prevent fires in recycling bins and trucks.
Hashtags
@NEASingapore · Post #1052 · 05.06.2025 г., 00:06
Make the switch to reusables and make sure to #RecycleRight. Together, we can reduce plastic waste and protect our environment.
Hashtags
@NEASingapore · Post #706 · 29.11.2023 г., 01:00
Items that contain food or drink residue cannot be recycled. They may even contaminate other recyclables, putting everyone’s good effort to waste! Remember to empty and rinse your bottles or drink cans before recycling them. Let's #RecycleRight! ♻️🌟
Hashtags
@NEASingapore · Post #695 · 30.10.2023 г., 04:31
Explore refreshing new adventures in the world of sustainability by joining us on Lemon8. Let’s leave a trail of green footprints as we learn together, discover useful hacks and crafts, #RecycleRight guides and tips, and much more! Follow us at go.gov.sg/nea-lemon8 (or search for nea_sg), and let's sprinkle some citrusy eco magic together!
Hashtags
@NEASingapore · Post #557 · 01.06.2023 г., 01:02
Missed the nationwide Bloobox distribution? Good news! You can collect it at selected libraries on weekends this June, and learn more about how you can start a recycling corner at home and #RecycleRight. While stocks last!
Hashtags
@NEASingapore · Post #534 · 04.04.2023 г., 03:30
Planning to collect a Bloobox? Don’t forget to check the stock levels before heading down: https://www.gowhere.gov.sg/bloobox Together, let’s #RecycleRight: https://www.go.gov.sg/recycleright
Hashtags
@NEASingapore · Post #518 · 18.03.2023 г., 01:15
It’s Global Recycling Day, so let’s be reminded to #RecycleRight! If you’re not sure whether an item can be recycled, check with Bloobin: www.cgs.gov.sg/recycleright/check-my-item
Hashtags
@NEASingapore · Post #517 · 17.03.2023 г., 02:22
From 19 Mar to 30 Apr 2023, all households can collect a free Bloobox to start the habit of recycling at home. It also comes with guidelines on what can be recycled. Let’s #RecycleRight! More info at www.gowhere.gov.sg/bloobox
Hashtags
@NEASingapore · Post #502 · 05.02.2023 г., 02:01
As the Lunar New Year festivities come to an end, let’s recycle what we can! Instead of throwing away plastic containers that were used to contain the goodies, reuse or recycle them. Not sure whether an item can be recycled? Find out at www.cgs.gov.sg/recycleright/check-my-item #RecycleRight
Hashtags
@NEASingapore · Post #473 · 09.12.2022 г., 00:20
Are they friend or foe? Bloobin and the E-Waste Recycling Bin are working towards the same goal – to minimise waste and helping Singapore become a Zero Waste Nation. Here’s a quick guide to get to know them, so that you can #RecycleRight! go.gov.sg/recycleright
Hashtags
@NEASingapore · Post #380 · 12.07.2022 г., 07:05
Not sure what to do with your e-waste? Check out the infographics below to find out what you can recycle, and how to recycle. More information at https://go.gov.sg/e-waste#RecycleRight
Hashtags