Один из самых удобных способов записать данные это использование готовых форматов, такие как 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
💥Massive: Humanity Protocol closed another $20M funding round
💯 FreeAirdrop
💰Funding - $50M
💰Valuation - $1.1B
✅👇Steps:
🔗Sign-up Link:testnet.humanity.org
✅Enter the referral code below to receive a bonus:
airdropgold
⭕️How to Participate:
1️⃣ Click the link above.
2️⃣ Sign in using your email or wallet.
3️⃣ Complete your account details.
4️⃣ Connect your social networks (10% bonus per social).
5️⃣ Claim RWA tokens daily.
⭕️Discord Task:
1️⃣ Join their Discord
2️⃣ Go to the Human-ID section.
3️⃣ Click Submit and enter your wallet address.
4️⃣ Confirm to receive the Human role.
#Humanity
文化正在回归
https://x.com/dioscuri/status/2043661976534950323
Henry Shevlin 加入 DeepMind 作为哲学研究员。据我所知,Anthropic 和谷歌是目前哲学家含量最高的 AI 公司,Amanda Askell 一直在参与和推动 Claude Code,Mythos 系统卡明确引用马克·费舍尔;自然哲学家 Richard Ngo 参与过 Deepmind 和 OpenAI 的研究工作;作家 Steven Johnson 一直在 Notebooklm 幕后工作。
Midjourney, Linear, Every 这些科技公司都曾公开招聘哲学家、作家和记者。
#humanity
文化正在回归
https://x.com/dioscuri/status/2043661976534950323
Henry Shevlin 加入 DeepMind 作为哲学研究员。据我所知,Anthropic 和谷歌是目前哲学家含量最高的 AI 公司,Amanda Askell 一直在参与和推动 Claude Code,Mythos 系统卡明确引用马克·费舍尔;自然哲学家 Richard Ngo 参与过 Deepmind 和 OpenAI 的研究工作;作家 Steven Johnson 一直在 Notebooklm 幕后工作。
Midjourney, Linear, Every 这些科技公司都曾公开招聘哲学家、作家和记者。
#humanity
1983 年,乔布斯给一位索要签名的人写了这封信。
https://x.com/JonErlichman/status/1996653675755065399
Dear M. Varon:
I'm honored that you'd write, but I'm afraid I don't sign autographs.
#humanity
#qidirilmoqda
#humanity
📢DIQQAT! SHOSHILINCH E’LON!
🆘 Suratdagi, 2007-yilda tug‘ilgan, bundan ikki oy avval Turkiyaga kelgan Turkmaniston fuqarosi Nurana Gurbangeldiyeva ismli 18 yoshli qiz, 1-oktyabr kuni İstanbul’dagi uydan chiqib ketib, hanuz qaytib kelmagan. Onasi juda tashvishda.
🔎 U haqida biror ma’lumotga ega bo‘lgan, ko‘rgan yoki eshitgan insonlardan zudlik bilan quyidagi telefon raqamlariga qo‘ng‘iroq qilib xabar berishlarini so‘raymiz.
🛑 Har biringizning e’tiboringiz va hamjihatligingiz biz uchun juda muhim. Bir insonning taqdiri befarqlikda qolmasin!
📞Aloqa uchun telefon raqamlari:
📞 0552 612 22 54
📞 0501 488 54 56
🤝 Yordam va xabaringiz uchun oldindan minnatdorlik bildiramiz.
🆘
🆘
🆘
🆘
🆘
🆘
🆘
📢DİKKAT! ACİL DUYURU!
🆘 Fotoğraftaki, 2007 doğumlu, iki ay önce Türkiye’ye gelen Türkmenistan vatandaşı Nurana Gurbangeldiyeva isimli 18 yaşındaki genç kız, 1 Ekim günü İstanbul’daki evinden çıkmış ve hâlâ geri dönmemiştir.Annesi perişan durumda.
🔎 Kendisi hakkında herhangi bir bilgiye sahip olan, gören veya duyanların derhal aşağıdaki telefon numaralarına ulaşarak haber vermelerini önemle rica ediyoruz.
🛑
Her birinizin dikkati ve dayanışması bizim için çok değerlidir.
Bir insanın kaderi ilgisizlikte kaybolmasın!
📞İletişim numaraları:
📞 0552 612 22 54
📞 0501 488 54 56
🤝 Yardımınız ve vereceğiniz bilgi için şimdiden teşekkür ederiz.
🌎 In Sulawesi’s limestone caves, ancient hand stencils date back over 39,000 years—among the oldest known art made by humans anywhere on Earth. ✨
#archaeology⚡#caveart⚡#humanity
👉subscribe Interesting Planet
🔤🔤🔤🔤🔤🔤🔤
Guys, some of you already heard about testnets, some of you not.
We would like to introduce you the first one called, Humanity protocol.
You need to claim your reward every 6 hours without clicking, entering combo and etc.
$RWT token is already trading.
Join humanity protocol👉link
#Testnet#Humanity#Protocol
"In 2014, my son was battling cancer.
At one point, we were desperately looking for O-negative blood, a rare type, and time was not on our side. It was the first time I turned to social media. Until then, it was just a page. Nothing more.
But that day, it became something else. People responded. People shared. People prayed. And it meant more to me than I can ever express.
Among all the moments I witnessed, and one day I may write about that chapter of my life, there is one I will never forget.
A woman came from the South of Lebanon. From Bint Jbeil, from the heart of the South. Her son drove her for hours, 5 hours, just to reach us.
I remember them walking into that small salon where we were sitting. I was with my brother. She looked at me and said: “I know you are looking for this blood type. I have it. I asked my son to bring me. We searched for you in Beirut’s hospitals … and now we found you. I am here to give my blood to your son”.
She came to give life … to my son.
And this is the first time, I talk about it, even to my wife.
These are the people of the South.
Today, the South is being destroyed, villages are being erased. And I cannot help but think of her and of so many others like her.
This is my country. These are my people. From every region, every village, every belief. And in my own way, as a human being, and through my voice, I will always stand by every suffering, every pain, every cry for help.
To the Lebanese South and to every family living through this agony today, I send my love. May God save your beautiful hearts ❤️🇱🇧
#lebanon#humanity#unity#لبنان"
https://x.com/RicardoRKaram/status/2043399704487100506?t=78lhBlcqqGnk1SNOsxtYDQ&s=19
🕊 The Philosophy of Ubuntu
Ubuntu is a core concept in the cultures of southern Africa, including South Africa🇿🇦
Rooted in the Bantu languages, it is often translated as:
“I am because we are.”
Ubuntu is about humanity, compassion, mutual support, and the ability to forgive🤝
👐Nelson Mandela believed that everyone has the power to change the world — starting with respect for others:
💬 “Ubuntu does not mean that people should not enrich themselves. The question is: are you going to do so in order to enable the community around you to be able to improve?”
— Nelson Mandela
🌍 On Mandela Day 🗓 July 18, supporters of the Ubuntu philosophy around the world dedicate 67 minutes to acts of kindness, honoring 67 years of Nelson Mandela’s service to society ❤️
#Ubuntu#NelsonMandela#SouthAfrica#Philosophy#Humanity#MandelaDay