TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #239 · 3 мај

Один из самых удобных способов записать данные это использование готовых форматов, такие как 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

Резултати

Пронајдени 5 слични објави

Пребарај: #january2023

当前筛选 #january2023清除筛选
The Open Platform

@topco · Post #34 · 01.02.2023 г., 09:01

DeFi: January headlines - Lido Finance briefly topped Maker as the largest DeFi protocol, as several liquid staking tokens rallied this month: Lido’s LDO token was up 40% in the first week of January, Rocket Pool’s RPL was up 14%, as was Frax’s FXS. StakeWise’s SWISE token was up almost 70% (source) - Sushi to shutters lending product to focus on DEX, the reasons are low public interest and the significant effort that went into maintaining the two (source) - Balancer DeFi reports "issues," asks LPs to remove liquidity ASAP, the roots of the problem are not unveiled yet (source) - Aave eliminated the bad debt of 2.7 million of curve dao tokens (CRV) from a botched November trade by Mango Markets exploiter Avi Eisenberg (source) - Solana DeFi project Friktion shuts down its user platform: Friktion’s Volts are structured products for DeFi investments, the project’s website will no longer deliver the same services, operating in a withdrawal-only mode (source) - MakerDAO’s community approved Monday a proposal to deploy up to $100 million in USD coin (USDC) from its reserve on DeFi protocol Yearn Finance, where the deposited stablecoin will earn a yield (source) #January2023#DeFi#trends

The Open Platform

@topco · Post #39 · 07.02.2023 г., 09:04

Metaverse: January headlines - South Korea launches metaverse replica of Seoul: Metaverse Seoul will allow users to take their avatars to tax offices, access youth counseling and read e-books (source) - CME Group to launch 3 metaverse reference rates - Axie Infinity, Chiliz and Decentraland will be represented in CME’s new reference rates and real-time indexes (source) - Animoca slashes target for metaverse fund to $1 billion - the chairman of Animoca Brands had previously suggested that its metaverse fund raise could reach as much as $2 billion (source) - Neopets raised $4M to bring 90s classic to the metaverse, Polygon Ventures, Blizzard Avalanche Ecosystem Fund, Hashkey Capital, IDG Capital, and gaming giant, NetDragon Websoft participated in the round (source) - Metahood raised $3M to build the Zillow of the metaverse - seed round was led by crypto VC firm 1confirmation, with participation from Volt Capital, Flamingo DAO, and Neon DAO (source) #January2023#metaverse#trends

The Open Platform

@topco · Post #36 · 03.02.2023 г., 09:04

Crypto Payments: January headlines - Coingate records a 63% increase in crypto payments in 2022, despite an ongoing bear market, its was found that college graduates and high-earners were the biggest drivers of crypto purchases (source) - BitPay announced partnership with MoonPay, the world's leading Web3 infrastructure company, to provide BitPay users with new ways to buy crypto (source) - Internet giant Wix adds CoinGate integration to its crypto payments service (source) - Alchemy Pay wins Web3 Innovation Pioneer Award from Forbes - the Singapore-based payment solutions provider has a major research and development hub across Asia (source) - Crypto payments platform Wyre secures funding - in a quick reversal, crypto checkout gateway Wyre is removing a recently-imposed withdrawal limit and announced it will continue operations as usual (source) #January2023#paymentsolutions#trends

The Open Platform

@topco · Post #37 · 06.02.2023 г., 09:04

Web3 Creator Economy: January headlines - Mastercard debuts web3-based musician accelerator program: Artist Accelerator is designed to give musicians tools to function in a digital economy using the Polygon blockchain (source) - MINTangible takes on NFT intellectual property chaos with the introduction of a revolutionary NFT IP Rights Solution that enables brands and creators to digitally bind IP license and royalty terms to their NFTs (source) - L'Oréal’s NYX makeup brand to launch DAO, Ethereum NFTs to ‘redefine beauty’: "GORJS was created to shine a light on “3D creators” and give them “a path to success within the Web3 ecosystem" (source) - Quantum Temple, the Web3 platform dedicated to preserving cultural heritage, has announced $2 million in pre-seed funding led by Borderless Capital, with participation from Algorand Foundation, Outliers Fund, Shima Capital, New Moon Ventures, and NxGen, as well as other strategic angel investors (source) #January2023#creatoreconomy#trends

The Open Platform

@topco · Post #35 · 02.02.2023 г., 09:04

Wallets: January headlines - Robinhood rolls out its MetaMask competitor called Robinhood Wallet to 1 million users (source) - 1inch launches hardware wallet which supports multiple seed phrases and transparent transaction signing, as opposed to blind signing offered by some other devices (source) - Life DeFi Wallet, a non-custodial digital wallet service, is now available on the Google Play store, making it the first multi-blockchain wallet in the world that allows users to make digital asset transfers to usernames (source) - DeFi protocol Frontier started an in-browser wallet extension that allows crypto users to interact with staking, transactional and non-fungible token (NFT) activities over 35 supported blockchains (source) - MSafe raises $5 million seed for developing multi-signature wallet solutions on Aptos, the round was led by Jump Crypto with participation from Circle Ventures, Coinbase Ventures, Superscrypt (founded by Temasek), Redpoint Ventures, SV Angel, Shima Capital, Spartan Group and more (source) #January2023#wallets#trends