@CPFBoard · Post #533 · 13.06.2022 г., 10:01
#Retirement#CPFFlashQuiz How much do you know about boosting your retirement savings? P.S. Tap on the lightbulb 💡 after each question to learn more!
Hashtags
TGINSIGHT SIMILAR POSTS
Изворен канал @pythonotes · Post #121 · 20 јул.
Регулярно требуется преобразовать какой-либо текст в максимально совместимый текст для URL, имени файла, имени объекта в каком-то софте и тд. Требования совместимости простые: в тексте должны быть только допустимые символы. Обычно это a-z, 0-9 и "_" или "-". То есть, только прописные буквы латинского алфавита и цифры (как пример). Допустим, нам нужно название статьи в блоге преобразовать в slug для добавления его в URL этой статьи. Как это лучше всего сделать? В Django по умолчанию есть готовая функция slugify для таких случаев. Но я её никогда не использую. Почему? Потому что её недостаточно! Приведём пример >>> from django.utils.text import slugify >>> slugify('This is a Title') 'this-is-a-title' Пока всё отлично >>> slugify('This is a "Title!"') 'this-is-a-title' Спец символы удалились, всё хорошо. >>> slugify('Это заголовок статьи') '' Вот и приехали 😢. Если текст не английский то буквы просто игнорируются. Можно это поправить >>> slugify('Это заголовок статьи', allow_unicode=True) 'это-заголовок-статьи' Но тогда мы не вписываемся в условие. У нас появилась кириллица в тексте. Так как я часто пишу сайты для русскоязычных пользователей эта проблема весьма актуальна. Я не использую стандартную функцию и всегда пишу свою. Оригинал я не беру в расчёт и пишу полностью свою функцию. И так, по порядку: 🔸1. Исходный текст: >>> text = 'Мой заголовок №10 😁!' Взял специально посложней со специальными символами. 🔸2. Транслит Необходимо сделать транслит всех символов в латиницу. Здесь очень выручает библиотека unidecode. Помимо простого транслита кириллицы в латиницу она умеет преобразовывать спец символы и иероглифы в текстовые аналоги. from unidecode import unidecode >>> unidecode("Ñ Σ ® µ ¶ ¼ 月 山") 'N S (r) u P 1/4 Yue Shan' Очень крутая библиотека, советую👍 В нашем случае получаем такое преобразование: >>> text = unidecode(text) >>> print(text) 'Moi zagolovok No. 10 !' Отличный транслит. Смайл просто удалился, хотя я ждал что-то вроде :). Ну и ладно, всë равно невалидные символы. А еще наш код уже поддерживает любой язык, будь то хинди или корейский. 🔸4. Фильтр символов Unidecode не занимается фильтрацией по недопустимым символам. Это мы делаем в следующем шаге через regex. Просто заменим все символы на "_" если они вне указанного диапазона. >>> text = re.sub(r'[^a-zA-Z0-9]+', '_', text) >>> print(text) 'Moi_zagolovok_No_10_' Символ "+" в паттерне выручает когда несколько недопустимых символов идут рядом. Все они заменяются на один символ "_". 🔸5. Slugify Осталось удалить лишние символы по краям и сделать нижний регистр >>> text = text.strip('_').lower() >>> print(text) 'moi_zagolovok_no_10' Получаем отличный slug! 😎 🌎 Полный код в виде функции. ______________ PS. Проверку что в строке остался хоть один допустимый символ я бы вынес в отдельную функцию. #libs#tricks#django
Пребарај: #retirement
@CPFBoard · Post #533 · 13.06.2022 г., 10:01
#Retirement#CPFFlashQuiz How much do you know about boosting your retirement savings? P.S. Tap on the lightbulb 💡 after each question to learn more!
Hashtags
@CPFBoard · Post #496 · 30.04.2022 г., 10:01
#Retirement#CPFFlashQuiz How much do you know about your CPF contributions? P.S. Tap on the lightbulb after each question to learn more!
Hashtags
@abmedia_news · Post #23679 · 06.04.2026 г., 10:07
【🚀台灣|油價上揚推升通膨危機,你的退休金足夠嗎?該如何計算和規劃? 】 #Inflation#Financial#Retirement 📍請見報導: https://abmedia.io/oil-push-inflation-how-to-reach-financial-retirement 📍訂閱鏈新聞頻道:https://linktr.ee/abmedia.io
Hashtags
@venturevillagewall · Post #3652 · 21.12.2024 г., 10:24
RiverWoods Exeter Raises $39.68M RiverWoods Exeter Continuing Care Retirement Community in Exeter, New Hampshire, has raised $39.68 million as of December 18, 2024. For more information visit their website. #Funding#Retirement#Community#Healthcare#NewHampshire#Investment
@venturevillagewall · Post #3375 · 18.12.2024 г., 12:08
Sunset Raises $500K for Support Sunset has announced a funding round of $500K on December 4, 2024. The platform supports users in funding retirement accounts after losing a loved one. #Funding#Retirement#Finance#Support#Sunset#Investment
@irassg · Post #702 · 06.12.2023 г., 04:02
Is delulu the solulu? At least, she gained some tax tips on Supplementary Retirement Scheme (SRS) contributions! 💰🤣 Grow your savings by contributing to your SRS Account today! You will be eligible for tax reliefs in Year of Assessment 2024 if you make contribution to your SRS Account by 31 Dec 2023*. SRS contributions are capped yearly at $15,300 for Singapore Citizens and Permanent Residents and $35,700 for foreigners. Do note that there is an overall cap of $80,000 on the total amount of all tax reliefs that can be claimed (including any relief on SRS contributions) for a year. Details and qualifying conditions: https://www.iras.gov.sg/taxes/individual-income-tax/basics-of-individual-income-tax/special-tax-schemes/srs-contributions *You are advised to check with your SRS bank operator about the cut-off date for SRS contributions. #taxtips#retirement#invest#skit#girlsvsguys#irassg#iras
@irassg · Post #328 · 23.12.2022 г., 02:01
#TaxTip Grow your savings by contributing to your Supplementary Retirement Scheme (SRS) Account! You will be eligible for tax reliefs in Year of Assessment 2023 if you make contribution to your SRS Account by 31 Dec 2022. SRS Contributions are capped yearly at $15,300 for Singapore Citizens and Permanent Residents and $35,700 for foreigners. Do note that there is an overall cap of $80,000 on the total amount of all tax reliefs that can be claimed (including any relief on SRS contributions) for a year. Details and qualifying conditions: https://www.iras.gov.sg/taxes/individual-income-tax/basics-of-individual-income-tax/special-tax-schemes/srs-contributions #iras#sg#taxes#taxtip#retirement#invest#reliefs
@irassg · Post #312 · 16.12.2022 г., 02:02
#TaxTip It is never too early to prepare for your (and your loved ones’) retirement needs. Top up your own and/or those of your family members’ CPF Special/Retirement or Medisave Account by 31 Dec 2022 to enjoy the CPF Cash Top-up Relief in Year of Assessment 2023! Do note that there is an overall cap of $80,000 on the total amount of all tax reliefs that can be claimed (including any relief on CPF cash top-ups) for a year. Details and qualifying conditions: www.iras.gov.sg/taxes/individual-income-tax/basics-of-individual-income-tax/tax-reliefs-rebates-and-deductions/tax-reliefs/central-provident-fund-(cpf)-cash-top-up-relief #iras#sg#taxes#taxtip#cpf#relief#retirement
@irassg · Post #711 · 13.12.2023 г., 05:09
Yasss to being a financially savvy kween! 🙌👑 It’s never too soon to secure the bag for your (and your fam’s) retirement 🌟 Top up your own and/or those of your family members’ CPF Special/Retirement or Medisave Account by 31 Dec 2023 to enjoy the CPF Cash Top-up Relief in Year of Assessment 2024. Do note that there is an overall cap of $80,000 on the total amount of all tax reliefs that can be claimed (including any relief on CPF Cash Top-ups) for a year. Details and qualifying conditions: https://www.iras.gov.sg/taxes/individual-income-tax/basics-of-individual-income-tax/tax-reliefs-rebates-and-deductions/tax-reliefs/central-provident-fund-(cpf)-cash-top-up-relief #taxtips#retirement#cpf#skit#asianmums#giftideas#irassg#iras
@venturevillagewall · Post #3380 · 18.12.2024 г., 12:09
Mirabelle Secures $1.05M Funding Mirabelle, specializing in mortgage life financing for seniors, has secured $1.05 million in funding as of December 3, 2024. The service aims to enhance retirement experiences by valuing wealth while allowing seniors to remain in their homes. #Funding#Mortgage#LifeFinance#Seniors#Retirement#Housing#Wealth#FinancialServices#Mirabelle#Finance
@venturevillagewall · Post #3666 · 21.12.2024 г., 11:00
Funding Rounds Update: December 2024 Recent funding announcements highlight significant investments across various industries: - ATC Managers, LLC: $14M on Dec 19, 2024 - Nationwide private lender. - Boon: $15.5M on Dec 20, 2024 - AI solutions provider. - Accelergen Energy: $20M on Dec 19, 2024 - Clean power asset management. - Backflip AI: $30M on Dec 19, 2024 - AI content creation. - Justt: $30M on Dec 19, 2024 - Chargeback automation. - Decart: $32M on Dec 19, 2024 - Consumer AI platform. - Instant Transport Solution: $35M on Dec 20, 2024 - Transportation technology. - TBC Bank Uzbekistan: $37M on Dec 20, 2024 - Banking services. - RiverWoods Exeter: $39.68M on Dec 18, 2024 - Retirement community. - EPTME: $44M on Dec 16, 2024 - Lifestyle management. - JET Charge: $44.93M on Dec 19, 2024 - EV charging solutions. - Pasadena Private Lending: $50M on Dec 19, 2024 - Non-bank lending. - Earli: $60M on Dec 19, 2024 - Cancer early detection. - ALLO: $100M on Dec 19, 2024 - Real-world asset trading. - DP World Group: $100M on Dec 19, 2024 - Logistics management. - InoBat: $103.62M on Dec 20, 2024 - Sustainable battery production. - ŌURA: $200M on Nov 19, 2024 - Health monitoring technology. - Metsä Group: $208.40M on Dec 19, 2024 - Renewable products. - Collectivus Holdings: $250M on Dec 19, 2024 - Investment management. - Nigerian National Petroleum Corporation (NNPC): $1B on Dec 17, 2024 - Petroleum services. #Funding#Investment#AI#Lending#Logistics#CleanEnergy#HealthTech#Batteries#ConsumerAI#EV#Retirement#Finance#Cancer#Sustainability#Transport#Renewables#RealEstate#Tech#NonBank#Petroleum#Automation