Один из самых удобных способов записать данные это использование готовых форматов, такие как 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
➡️ UXUY Wallet
✅ PLAY NOW: https://t.me/UXUYbot/app?startapp=A_452308012_inviteEarn
Invested by BinanceLab 👈
Ends on January 10 ⛔️
$10.2M in funding successfully raised 🟢
1️⃣Securely store your private key
2️⃣Complete all tasks
3️⃣ Claim rewards every 3 hours
👍 UXUY: Don’t forget to back up your seed phrase!
❓ "Not your keys, not your crypto!"
👉 The Seed Phrase Backup Task is live!
Complete the backup and claim your reward of 800 $UP!
#UXUY
🪙UXUY Wallet: Mysterious Airdrop
When? TOMORROW, March 11, the project on Binance Labs investments #UXUY Wallet launches distribution, but there is an important condition:
✅UXUY wallet in Telegram needs to be created today!🔥
What needs to be done?
✔️ Hurry up to create a wallet before March 11 00:00 UTC.
✔️ Tell your friends — let them get a drop too!
✔️Follow the news!
☝️Create UXUY wallet now!
🥰Good morning fams! We are pleased to announce that UXLINK Mini App is live on LINE , now invite your friends on Line to join #UXLINK can get 10,000,000 #UXUY points reward!
In UXLINK's "One Account, One Gas" roadmap, $UXLINK will be the universal gas token for users who interact with different blockchains, and LINE and Kakao Talk will be important pillars of social platforms, will keep build and keep our community updated.
Super Airdrop from UXUY Wallet
#UXUY, incubated and supported by 🤑 Binance Labs, is launching the 2025 UXUY Points ($UP) #Airdrop!
🗓️ Dec 27, 2024 — Jan 10, 2025
How to join?
Invite three or more friends using your unique referral link
✅Go to the UXUY Earn Center
✅ Click on Tasks
✅ Complete them to earn UXUY Points ($UP)
🎁Join the event now and earn 2,025 $UP per user!
🔠🔠2025 New Year Special Airdrop Event ends in just 2 days!
🔣 Users who successfully invite 3 friends during the event period (December 27, 2024 — January 10, 2025) will receive an exclusive bonus of 2,025 $UP!
🔠🔠 Don’t miss out — get in there and rack up more $UP before it’s over!
#UXUY#wallet#airdrop
UXUY Wallet: Redefining Cross-Chain DeFi
UXUY is a platform (wallet and DEX) that provides tools and solutions for DeFi, focusing on multi-chain transactions and interoperability.
The main focus of the project is to facilitate the process of exchanging assets between different blockchains (cross-chain), with an emphasis on security, speed and convenience.
The project raised $10.2M in a funding round from well-known funds such as Binance Lab, KuCoin Ventures, MEXC and others.
Key features of UXUY:
1. Multi-chain compatibility: The platform supports interoperability between multiple blockchains, including Ethereum, BNB Chain, Polygon, Arbitrum, Avalanche and 🤑 TON.
2. Decentralization: Users retain full control over their assets as transactions are conducted directly through smart contracts, eliminating intermediaries.
3. Intuitive Interface: UXUY is focused on making DeFi easier for users, including a simplified asset exchange process.
4. Focus on Security: State-of-the-art security mechanisms, including multi-layered transaction verification architecture, are used to protect user funds.
UXUY Wallet Token – $UP
The $UP token is a key element of the UXUY ecosystem. It will be used to pay exchange fees, provide access to premium platform features, serve as collateral in staking programs, and will also become a tool for DAO governance.
The reward program has allocated 100 million UP, which will be distributed among the most active UXUY Wallet users.
🎁Complete tasks in the mini-app
#uxuy#dex#airdrop#binance
#Reminder UXUY WALLET
💎A project followed and supported by #Binance laps.
👀It has received high investments and its infrastructure is solid. The listing will probably not be extended.
It conflicts with the logic of Claim Every 3 Hours.
Link:⤵️
JOIN NOW https://t.me/UXUYbot/app?startapp=A_452308012_inviteEarn
⛏#uxuy#wallet#binancelaps
January Listing 🔥
✅#Nodepay: 6 January
✅#MomoAi: 6 January
✅#Xterio: 8 January
✅#Sidekick : 8 January
✅ $Vertus :13 January
✅#Seed : 15 January
✅#Xcoin : 20 January
✅#Tapswap : 23 January
✅#Wcoin : 25 January
✅#CommunityGaming : 28 January
Unofficial Listing
✅#PAWS
✅#UXUY
✅#Yuligo
✅#MemeWar
✅#DuckChain
✅#Celia
Stay connected