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 слични објави

Пребарај: #february2023

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

@topco · Post #43 · 02.03.2023 г., 09:01

DeFi: February headlines - Liquid Staking Replaces DeFi Lending as Second-Largest Crypto Sector, the value of cryptocurrencies deposited in liquid staking protocols has increased to about $14 billion, trailing just deposits at decentralized exchanges (source), Lido saw a $240 million inflow in the form of 150,000 ether (ETH), "apparently from Justin Sun" (source) - G20 Financial Stability Board Report Flags DeFi 'Vulnerabilities', criticizing the niche's "actual degree of decentralization," the danger of crypto bridges, and bugs found in the smart contracts that underpin DeFi's applications (source) - Forsage Founders Indicted for $340M Ponzi Scheme Masquerading as DeFi Platform, company relied on smart contracts whose coding is consistent with a Ponzi scheme, the U.S. Justice Department says (source) - Solana-Based DeFi Protocol Everlend Announces Shut Down, the project highlighted a lack of liquidity and the overall shrinking of the borrowing and lending market as the causes of its demise (source) - DeFi Pioneer MakerDAO Announces Aave Competitor Spark Protocol, Spark Protocol will “amplify the features of MakerDAO by enabling a liquidity market for supplying and borrowing scalable crypto assets with variable and fixed rates” (source) - Several Leading DeFi Protocols Are Still Controlled by Whales, including Lido, GMX, Frax Finance, and Curve, which leads to the point that they are not decentralized, since VCs and whales can control governance (source) #February2023#DeFi#trends

The Open Platform

@topco · Post #47 · 08.03.2023 г., 09:01

Metaverse: February headlines - Meta Free Cash Surge Clears The Way For More Metaverse Investment: with support from better-than-expected performance across the family of apps, including Facebook breaking into 2 billion daily active users for the first time, the results are likely to limit investor objections to the company’s spending on developing its metaverse (source) - Tencent scraps plans for VR hardware as metaverse bet falters (source) - Pantera Invests $10M in Metaverse Game Worldwide Webb - the Web3 game allows players to use their existing NFT collections as avatars (source) - Colombia’s legal system experiments in the metaverse: a Colombian court recently hosted its first legal trial in the metaverse, with the court magistrate saying it felt “more real than a video call” (source) - Mitsubishi, Fujitsu and Other Tech Firms to Create ‘Japan Metaverse Economic Zone’, the goal of the metaverse alliance is to help build the framework for corporations to tap into Web3 marketing, work reform and consumer experience initiatives (source) #metaverse#February2023#trends

The Open Platform

@topco · Post #45 · 06.03.2023 г., 09:01

Payment Solutions: February headlines - Twitter's payment system prepares for potential crypto integration, Musk's Twitter payment vision is in tune with fiat-crypto gateway Alchemy Pay (source) - Visa Eyes High-Value USDC Settlement Payments on Ethereum, the company reportedly seeks to meet customer requests to convert digital assets into fiat payments, similar to how it converts foreign currencies (source) - Brazil’s Oldest Bank Takes a Leap into the Future with Crypto Tax Payment Options: Banco do Brasil will allow residents to pay their taxes with crypto (source) - UK Banks Blocking Crypto Access Given Fraud, Volatility, bank CEOs appeared more skeptical about the potential benefits of a central bank digital currency – the day after the Treasury and Bank of England said a digital pound was likely to be needed (source) #paymentsolutions#February2023#trends

The Open Platform

@topco · Post #46 · 07.03.2023 г., 09:02

Web3Creator Economy: February headlines - Maximizing Profits Will ‘Kill’ Web3: Animoca Brands Chairman: Yat Siu described royalties as the gas that keep an economy of creators humming, comparing it to the gas fees charged to process each transaction on Ethereum’s network (source) - NFT Royalties Are 'Not Going Away on SuperRare': Co-Founder Jon Perkins - this statement is a response to the OpenSea’s controversial move to change its creator royalty and fee structure earlier this month that has raised serious questions about what the value proposition of NFT marketplaces will be if artists and the original creators are cut off revenue streams (source) - New YouTube CEO Is Bullish on Web3 Tech Like NFTs and the Metaverse: Neal Mohan has said that NFTs could enable “creators to build deeper relationships with their fans” (sources) - The harsh reality fosters dissatisfaction with web2 platforms for creators: the average income for a full-time creator is less than $100,000, the median is $50,000; stiff competition and high costs meant only 4% of creators earn a living from content; 46% made less than $1,000 a year in 2022 (source) #creatoreconomy#February2023#trends

The Open Platform

@topco · Post #44 · 03.03.2023 г., 09:01

Wallets: February headlines - Algorand (ALGO)-Based Crypto Wallet MyAlgo Urges Users To Withdraw Assets After $9,600,000 Attack, Algorand Foundation CTO John Woods says about 25 wallets were affected by the attack (source) - Mastercard Rolls Out System Allowing for Stablecoin Payments Directly From Crypto Wallet, a collaboration between financial services giant Mastercard and web3 tech company Immersve is set to offer a new option for paying physical, digital and metaverse purchases using crypto assets (source) - Multicoin, Sequoia Lead $6M Round in Solana-based Crypto Wallet TipLink, Circle Ventures, Solana Ventures, and Paxos also participated in the round (source) - Addressable raises $7.5M to match crypto wallets to Twitter accounts, the solution allows marketers to promote games or conferences etc. to crypto wallet holders on Twitter, thus increasing the return on ad spend by targeting audiences that are more likely to buy products, and introducing higher efficacy/ROI (source) - Coinbase Adds New Wallet Security Features To Protect Against Phishing and Scams, including transaction previews, token approval alerts, and a new “enhanced layers of protection” (source) #February2023#wallets#trends