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

Пребарај: #march2023

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

@topco · Post #51 · 03.04.2023 г., 09:01

DeFi: March headlines - DeFi sees its biggest hack in 2023 as Euler loses $197M: Euler Finance faced a flash loan attack on March 13, the attacker stole millions in DAI, USDC, staked Ether (StETH) and wrapped Bitcoin (WBTC) (source) - CFTC’s tech committee gathered in DC to talk DeFi: most of the participants agrees that they can "no longer ignore decentralization", and that its "benefits “far outweigh” the challenges, which they believe will “self-resolve”. Members unanimously voting for creating a Digital Assets and Blockchain Technology Subcommittee. (source) - The U.S. Treasury Department is close to releasing a risk assessment analyzing criminal use of DeFi: the department has reviewed decentralized finance’s role in such incidents as North Korean ransomware attacks, and will issue a risk assessment (source) - DeFi TVL Reaches 2023 Highs as Lido Liquid Staking Expands Its Lead: given that stakers will be able to withdraw their Ethereum after the upcoming Shanghai upgrade, demand for Lido liquid staking is surging (source) - DWF Labs Invests $20M in Derivatives Trading Platform Synthetix, Synthetix's perpetual futures product will be integrated into DWF Labs' trading business with the aim of boosting Synthetiix's trading volume (source) #DeFi#March2023#trends

The Open Platform

@topco · Post #56 · 07.04.2023 г., 09:02

Metaverse: March headlines - NVIDIA and Microsoft to Bring the Industrial Metaverse and AI to Hundreds of Millions of Enterprise Users via Azure Cloud: NVIDIA today announced a collaboration with Microsoft to provide hundreds of millions of Microsoft enterprise users with access to powerful industrial metaverse and AI supercomputing resources via the cloud (source) - Disney cuts metaverse division under Iger’s restructuring as part of the layoffs set to begin in March (source) - Animoca Brands Cuts Metaverse Fund Target to $800M, the fund previously announced in November 2022 that it was working on a new Animoca Capital fund with a target of $2 billion (source) - Meta says its single largest investment is now in ‘advancing AI’, analysts mention that Zuckerberg "altered the narrative of the company to one focused on efficiencies rather than looking to grow the metaverse at any cost" (source) - South Korea invests $51M into metaverse projects, South Korea’s Ministry of Science said the earmarked funds will be used to prop up 13 new projects leveraging virtual worlds in the health, tourism, and education industries (source) #metaverse#March2023#trends

The Open Platform

@topco · Post #53 · 05.04.2023 г., 09:02

Crypto Payment Solutions: March headlines - Telegram's Wallet Bot @wallet Integrates Tether (USDT) Payments on Tron Network: users can now send and receive USDT directly from their chats, as well as buy, swap, and make P2P trades with the stablecoin (source) - Silvergate suspends crypto payments network; shares fall after-hours: Silvergate on Wednesday warned in a filing that it was evaluating its ability to operate as a going concern, Coinbase Global Inc, Galaxy Digita, Paxos, Circle, Bitstamp and Gemini suspended their partnerships with Silvergate after the warning (source) - Visa, Mastercard Halt Crypto Initiatives Pending Industry And Regulatory Recovery, previously both companies forged multiple partnerships with crypto firms and dedicated teams to explore blockchain technology (source) - U.S. Federal Reserve’s Real-Time Payments System FedNow Coming in July, FedNow has been seen as a potential precursor to a central bank digital currency (CBDC) (source) - Bybit Launches Debit Card for Crypto Payments: the Bybit card will operate on the Mastercard network and will initially allow fiat-based transactions by debiting cryptocurrency balances when used to pay for goods and services (source) #paymentsolutions#March2023#trends

The Open Platform

@topco · Post #54 · 06.04.2023 г., 09:00

Web3 Creator Economy: March headlines - Animoca Brands Japan invests in global entertainment company Rainshine Global Inc., the two companies aim to build a gateway for Japanese intellectual properties (IPs) to reach new global markets (source) - Instagram scraps its Web3-related initiatives for now, previously Instagram tested the idea of limited-edition NFTs or digital collectibles minted from photos that users could create and sell (source) - NEAR Protocol is Taking a Step Towards Web3 Social Networking: NEAR Discovery, "the easiest point of entry into Web3", is meant to make it easier to create Web3 social networks. Many of the blockchain operating system’s building blocks already exist, like NEAR Crowd, a gig economy platform, and NEAR Social. They aim to address the drawbacks of centralized platforms like Facebook, Instagram, Snapchat and TikTok, including little to no anonymity or privacy, few rewards for content creators, no community input and censorship concerns (source) - Epic Games announced updates this week to Unreal Engine 5.2, including MetaHuman technology and procedural generation tools that allow creators to design custom maps and experiences within the game (source) #creatoreconomy#March2023#trends

The Open Platform

@topco · Post #52 · 04.04.2023 г., 09:00

Wallets: March headlines - EU Lawmakers Vote in Favor of Payment Limits on Anonymous Crypto Wallets: Damien Carême, the French lawmaker who leads the parliament’s negotiations on the overhaul, earlier told reporters that the plans wouldn’t prevent crypto payments, because the cap of 1,000 euros won’t apply if a regulated wallet provider is involved or the identity of the payer is known (source) - Elizabeth Warren is back with an Anti-Money Laundering act that would is likely to drive wallet providers overseas and weaken consumer choice: the act prohibits the use of digital asset mixers and requires self-hosted wallets, along with miners and validators to have AML policies (source) - Crypto Wallet Prototype Discovered Inside Microsoft Edge Browser - the unreleased features suggest the tech giant is considering a deeper move into Web3 (source) - Coinbase is starting a “wallet as a service” business that will allow companies to customize blockchain wallets for their own customers - the service could be used by gaming apps where tokens or NFT are part of the game, or by companies that might want to incorporate a wallet into an app and make that “almost invisible to the end user,” Patrick McGregor, Coinbase’s head of product for Web3 developer platforms, said in an interview (source) #wallet#March2023#trends