Один из самых удобных способов записать данные это использование готовых форматов, такие как 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
🌐The Internet's History
The #Internet's history goes back some decades by now – #Email has been around since the 1960s, file sharing since at least the 1970s, and TCP/IP was standardized in 1982. But it was the creation of the world wide web (www) in 1989 that revolutionised our history of communication. The inventor of the world wide web was the English scientist Tim Berners-Lee who created a system to share information through a network of computers. At the time he was working for the European physics laboratory CERN in the Swiss Alps.
The chart below shows the share and number of people that are using the Internet, which in these statistics refers to all those who have used the Internet in the last 3 months.
Read more on OurWorldInData and see the full-size chart here.
🚀@PerspectiveIX
Eppie — open protocol encrypted p2p email
=> https://eppie.io
=> https://github.com/Eppie-io
Eppie is a next-gen providerless email that allows its users to own their accounts, addresses and data. In addition to its own p2p network Eppie can communicate with other popular decentralized networks, like Ethereum, and is capable of interacting with conventional IMAP/SMTP email. It is beautiful and easy to use, just like a normal email client.
Features:
🌎 Works on all platforms: Windows, MacOS, Linux, iOS, Android
🕶 Privacy-first: there's no such thing as optional encryption
🚀 P2P messaging: without servers nobody's holding your hand anymore
🔑 Identity manager: key management is a breeze
💾 Decentralized backup: your data is safe and only yours
🤙 Ultimate interoperability: Eppie can communicate with Ethereum, Bitcoin and more
📬 IMAP/SMTP compatible: connect to Gmail, Microsoft Outlook etc.
🦄 Proton Mail Authentication: Eppie is the first native desktop client capable of that
🔐 PGP encryption: stay safe even with conventional email
🤖 Local AI agents
NOTE: the project is early in development, not all of the features are publicly availabe
via @dcntr
#email#p2p
📩 Не пропускаем почту вместе с @GmailBot
Бот для уведомлений, быстрых действий и отправки почты с вашего Gmail ящика
Немного советов для удобства:
- СоблюдайтеInbox Zero(не пожалеете..)
- Настройте пересылку писем с других ваших ящиков на основной Gmail
- Отпишитесь от ненужных рассылок.. в конце то концов ._.
Inbox Zero - начал применять очень давно не замечая, позже узнал как это называется. На самом деле здесь ничего сложного, просто нужно следить за чистотой вкладки входящих.
Наверное многие уже давно пользуются им, даже в последней новости об обновлении 5.13 он упоминался, но надеюсь будет кому-то ещё в новинку.
#bot#email
💌EMAIL by the Digits
3.7 billion: Number of email accounts worldwide
269 billion: Emails sent daily in 2017
121: Number of emails the average office worker gets per day
6: Average seconds within which people reply to a work email
45%: Percentage of spam in email traffic
95: Percentage of spam that gets delivered
3.1%: Average click-through rate for emails in North America
1.2 billion: Number of Gmail users
70 million: Amount of emails that Slack likes to boast it has “saved the world from”
775%: Percent increase in emojis in emails from 2015–2016
43%: Percentage of people that check email in the bathroom
#FunFact#Email
🚀@PerspectiveIX
🌀 http://prs.pctvix.co/TelegramIX
📱Email & Mobile Notifications in Driving Loyalty
Generating more direct traffic to websites and apps is an important priority for publishers, with #email#newsletters a particularly favoured tactic for retaining subscribers but also for attracting new users. The Washington Post operates around 70 different newsletters & has found that recipients consume around three times as much content as those who don’t use email news. RI’s own data this year show that 42% of US digital subscribers have used one or more email newsletters in the last week compared with 35% in the UK but just 17% in Norway and 19% in Sweden. It is clear this is one area where Nordic publishers could learn a few tricks from the United States.
via The Reuters Institute.
🔗 Read more & download the RI's Digital News Report 2019 in yesterday's Pulse - don't forget to subscribe.
Country analysis for: 🇬🇧🇦🇹🇧🇪🇧🇬🇭🇷🇨🇿🇩🇰🇫🇮🇫🇷🇩🇪🇬🇷🇭🇺🇮🇪🇮🇹🇳🇱🇳🇴🇵🇱🇵🇹🇷🇴🇸🇰🇪🇸🇸🇪🇨🇭🇹🇷| 🇺🇸🇦🇷🇧🇷🇨🇦🇨🇱🇲🇽| 🇦🇺🇭🇰🇯🇵🇲🇾🇸🇬🇰🇷🇹🇼| 🇿🇦
🚀@PerspectiveIX