Один из самых удобных способов записать данные это использование готовых форматов, такие как JSON или YAML.
Из плюсов такого подхода стоит отметить вот что:
🔸 готовый, повсеместно используемый и поддерживаемый формат
🔸 простой и понятный файл, удобочитаемый для человека
🔸 можно легко редактировать в любом текстовом редакторе без специальных программ и библиотек
Но есть и минусы
🔹 затраты времени при записи файла (кодирование данных в нужный формат строки)
🔹 затраты времени при чтении файла (декодирование данных в Python объекты)
🔹 размер файла увеличивается из-за разметки данных (скобки, запятые, переносы, отступы...)
🔹 перед записью все данные должны быть помещены в память в полном объёме (не всегда)
🔹 при чтении необходимо считать весь файл в память и только потом декодировать данные
Если нужно писать немного данных в несколько файлов, то затраты по времени не ощутимы. Обычно это файлы конфига или какие-либо метаданные. Это отличный вариант под такие задачи.
Есть и другой поход к записи файлов - это бинарные файлы. Используется, когда данных достаточно много и никто их не собирается читать глазками😳.
🔸 очень быстрая запись
🔸 чтение значительно быстрей чем JSON, YAML итд
🔸 размер файла значительно меньше, так как нет разметки
🔸 можно записывать данные по мере поступления не загружая всё в память
🔸 можно извлечь любую часть данных независимо
Из минусов
🔹 нужно определить свой формат записи данных (если не используете готовую спецификацию определённого формата)
🔹 не получится открыть файл и визуально понять что там записано, а для чтения файла потребуется знать его спецификацию.
🔹 не так-то просто создать такой файл без специальной библиотеки
В таком виде удобно записывать большой массив любых однородных данных. Например, мониторинг валютной биржи или кэшированная анимация 3D геометрии.
(Это не означает что нельзя записать данные разного типа, просто это будет не так удобно)
Представьте себе JPG-картинку. По сути это немного мета-информации и большой массив пикселей. Тоже самое со звуком или видео файлом. Поэтому, если вы попробуете открыть картинку в текстовом редакторе вы увидите что-то вроде такого
f15d cd29 a564 4578 ...
09e2 9bc4 a696 1253 ...
84e9 4de1 3b23 c24a ...
2534 5161 28e0 709d ...
...
Это и есть записанные байтики. И для их чтения требуется определённый софт который знает что с ними делать. Под каждый тип файла.
К чему это я? Читайте в следующем посте...
#tricks#basic
🤓Крипто-глоссарий
В web3 вы будете встречать много непонятных слов. Мы поможем разобраться!
Нажимайте на карточки и узнавайте о новых терминах.
Больше крипто-слов можете найти в одной из наших кампаний.
❤️🔥 – Если было полезно
#basic | NotGuide
@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
🤫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