Паттерн Декоратор — специальный способ организации модулей в программе, который позволяет подставить какую-то новую функцию прямо в середину цепочки вызовов, тем самым чуть-чуть подкорректировав поведение.
Например, в реальном мире очки для чтения это декоратор. Вы ставите их между вашими глазами и текстом. Глобально взаимодействие ваших глаз и текста не меняется: отражённые световые лучи от страницы книги попадают в ваши зрачки, что с очками, что без них. Но очки располагаются посередине: они принимают лучи на вход и преломляют их, передавая дальше вам в глаза уже изменёнными.
Важной особенностью является тот факт, что очки можно снять. Они не требуют ни модификации вашего тела, ни модификации книги. Вообще никакие условия не нужны, кроме наличия самих очков. А если вы в линзах, то внешний наблюдатель может даже этого не знать.
Класс-декоратор должен быть спроектирован так, чтобы не требовать никаких изменений в объектах, с которыми он работает. Его можно отключить, чаще всего буквально закомментировав одну строку.
В примере ниже программа выведет текст "Привет, мир, в натуре.", и вот это дополнение в конце как раз дописано декоратором. Можно убрать или закомментировать подчёркнутую строчку, не трогая остальной код, для всех внешних вызовов сигнатуры останутся теми же самыми, но выводиться будет уже просто "Привет, мир".
В декораторы можно прятать логику, которую буквально навешивают поверх основной функции программы. Например, проверку прав на выполнение операции. Перевод на другой язык, логирование, поддержку обратной совместимости при обновлении и так далее.
#dev
@redfoxuz / #basic
🥳 BASIC dasturlash kurslariga qabul boshlandi!
Basic kurslari orqali siz Veb dasturlash sohasini boshlang’ich bilimlarini o’zlashtirasiz. Bulardan tashqari Telegram bot yasash va React Native orqali iOS va Android platformalari uchun dastur yoza olasiz.
Basic kursi davomida HTML, CSS, Web dizayn, jQuerylarni real loyihalar asosida o’z ishining ustalaridan o’rganasiz.
🎁Afzalliklar:
• RedFox bonuslari + Frilansus.com bonusli tizimi;
• Jamoa bilan birga ishlash;
• Real loyihalar;
• Shaxsiy rivojlanish;
• Qisqa muddatda mutaxassis bo'lish.
⚠️online shogird umuman olmaymiz!
Talablar:
🧍♂️ 18-25 yoshgacha
📆 Haftada: 6 kun
⏰ Kuniga: 8 soat
⚠️Shoshiling joylar soni chegaralangan 15 ta shogird qabul qilinadi!
Ro'yhatdan o'tish uchun:
✍️@redfoxsuhbat
🤙 +99871 200 5008
🤓Крипто-глоссарий
В web3 вы будете встречать много непонятных слов. Мы поможем разобраться!
Нажимайте на карточки и узнавайте о новых терминах.
Больше крипто-слов можете найти в одной из наших кампаний.
❤️🔥 – Если было полезно
#basic | NotGuide
🤫Who created Web3?
Today, we will talk about the mysterious figure behind the inception of the cryptocurrency revolution: Satoshi Nakamoto.
Who is Satoshi Nakamoto?
Satoshi Nakamoto is the pseudonym of the individual or group of individuals who wrote and published the Bitcoin white paper. This event marked the starting point for the development of the first cryptocurrency and blockchain technologies.
White paper: a document with detailed information about a project.
Beginnings
The Bitcoin white paper was published in 2008 under the title “Bitcoin: A Peer-to-Peer Electronic Cash System.” In 2009, the first version of the Bitcoin network was launched and began its operation.
We know almost nothing about Satoshi’s identity. He or they maintained anonymity from the beginning and, in 2010, stopped actively working on the project
It is estimated that Satoshi owns between 750,000 and 1.1 million Bitcoin. At the current rate, the fortune is estimated at $70 billion (~5% of the total BTC market capitalization).
Legacy
Satoshi launched a decentralized movement, changed perspectives on finance, and inspired many people to build their lives differently.
#basic | Not Guide
🤓Crypto Glossary
In Web3, you’ll most likely encounter a lot of unfamiliar words. But worry not – we’ll help you make sense of them!
Click on the cards to learn about new terms.
You can find more crypto words in one of our campaigns.
❤️🔥 – If you found this helpful
#basic | Not Guide
🧐Where to store crypto
Custodial CEXs and non-custodial wallets are the main ways to store crypto. Which one should you choose? Let’s break it down.
Storage on CEXs (custodial wallets)
This is a simple and popular method, but it’s not safe because you do not control the wallet’s data. It’s better to withdraw funds after performing the necessary operations.
There are cases when the exchange freezes assets or gets hacked. These are quite high risks.
Examples of CEXs: Binance, Bybit, OKX.
Non-custodial wallets
In crypto wallets, assets are stored on the blockchain and are only accessible to you.
Each wallet has a seed or recovery phrase (a list of 12–24 words) that is used in case you need to restore access. No one can access your wallet unless you share your seed phrase with them.
Be sure to write it down on a piece of paper (only! Do not take photos) and keep it in a secure place. Do not share the phrase with anyone, even if they ask.
Non-custodial wallets come in two types:
1. Apps or browser extensions – On your phone, computer, or browser that work through the internet.
All the data is stored with you, but if you don’t pay close attention to where you’re downloading the app from, you could lose access to the app and all your assets! Therefore, never download unfamiliar applications and only connect to verified sites.
Examples: Tonkeeper, Wallet, MyTonWallet.
2. Hardware wallets – Standalone devices that resemble a regular flash drive and work offline.
This is the securest method; everything is stored on a physical device, and any operation requires confirmation. If your computer gets hacked, the assets in a hardware wallet will remain safe.
Examples: Ledger, SafePal, Tangem.
Safety rules:
⁃ Store the seed phrase in a secure place (only write it on a piece of paper).
⁃ Do not connect your wallet to unverified sites.
⁃ Do not store assets in one wallet – distribute them in multiple wallets.
#basic | Not Guide
How to buy NOT
There are three main ways to purchase NOT:
⁃ Directly in Telegram
⁃ Through centralized exchanges
⁃ Through decentralized exchanges.
Detailed information about each method can be found in our instructions.
Only use reputable platforms when buying crypto and make sure to share the guide with your friends.
Read the instructions here👈
#basic | Not Guide
💹How can I buy cryptocurrency? We’ll break it down for you in simple language.
We have prepared the MOST complete guide on how to buy cryptocurrency with a bank card.
Share our guide with your friends and relatives who want to buy cryptocurrency 🤓
👉You can find the guide here
#basic | Not Guide
#part1fall2020
Всем привет! Сегодня НЕ БУДЕТ вебинара с ответами на вопросы. Зато он будет завтра в 18:00 и состоится для обоих потоков одновременно.
Чтобы задать вопрос, вы можете прокомментировать эту новость с хештегами #basic или #adv.
Занятия продвинутого потока выложены на степик. Занятия базового будут выложены сегодня
API dan foydalanish
Odatiy hayotimizda ko'plab dasturlardan foydalanamiz, xususan ijtimoiy tarmoqlar(facebook, telegram, instagram...)dan. Sizningcha ushbu ma'lumotlar foydalanuvchi oynasiga qanday qilib tezkorlik bilan uzatiladi? Buning javobi oddiy. Bir dastur bilan ikkinchi dastur o'rtasida muloqotni yaxshilash va aniq tartiblangan holatda uzatish API orqali amalga oshiriladi.
👉Batafsil
👨🏫 Mentor: Xondamir Abduxoshimov
#csharp#api#basic#dotnet
.NET Uzbekistan Community
__________
Telegram | Instagram | Youtube