Один из самых удобных способов записать данные это использование готовых форматов, такие как 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
Phrasal verbs with "sleep":
○sleep in
●sleep on
○sleep off
●sleep over
○sleep through
sleep in
Example: I usually sleep in on weekends.
sleep on (it)
Example: I’m not sure about this offer. Let me sleep on it.
sleep off
Example: After the marathon, he slept off his exhaustion.
sleep over
Example: My friend invited me to sleep over at her house.
sleep through
Example: I slept through the storm last night.
••┈┈●•❁❁✹❁❁•●┈┈┈••
#phrasalverbs
#Phrasalverbs
@fluencyinenglish
❇️show up
حضور یافتن در جایی
When you appear somewhere, you show up.
👉Turn up is similar to show up.
Turn up
مترادف show up میباشد
Example:
1. I was supposed to meet my sister for lunch, but she didn't show up.
@fluencyinenglish
2. Over a hundred people showed up for the news conference.
____________________________
show up
ظاهر شدن
When something appears or becomes visible, it shows up.
@fluencyinenglish
Example:
1. It's hard to photograph polar bears because they don't show up well against the snow.
2. The spots won't show up until the last stages of the disease.
@fluencyinenglish
❇️knuckle down
If you knuckle down, you start to take your work or your task seriously and do it properly.
❇️For example:
knuckle down
🔹The exams start next month, so I guess it's time I knuckled down and studied a bit harder.
knuckle down
🔹If Sammy wants to lose weight, he'll have to knuckle down and start exercising more at the gym
🔹knucklehead/n/
UK /ˈnʌk.əl.hed/
US/ˈnʌk.əl.hed/ us informal
A stupid person
@fluencyinenglish
💡Phrasal Verb
"Set out"
🧐Meaning
to explain the details of something, especially in writing
✅Example:
A contract should clearly set out the responsibilities of each party.
#PhrasalVerbs
💡Phrasal Verb
"take in (2)"
🧐Meaning
to fully understand something you hear or read
✅Example:
I had to read the article a second time to really take it all in. It wasn't easy to understand.
#phrasalverbs
💡Phrasal Verb
"grow on"
🧐Meaning
If something grows on you, you gradually start to like it, even though you didn't like it much at first.
✅Example:
I didn't like the music at first, but it's grown on me and I like it a lot now.
#phrasalverbs
#Teamjimmy
#sirjimmy
💡Phrasal Verb
"to get (something) across"
🧐Meaning:
to express (something) clearly so that it is understood:
✅Example:
I don't know if I was able to get my point across to you.
#Phrasalverbs
#Teamjimmy
#sirjimmy
#vocabulary
#phrasalverbs
#advanced_vocabulary
@fluencyinenglish
@fluencyinenglish
@fluencyinenglish
🔹amount to something
/əˈmɑʊnt·tə, -ˌtu/
to add up to, be in total, be equal to, or be the same as
Example: Federal and state costs for building and operating prisons amounted to $25 billion.
Example: The blog amounts to a critique of the U.S. news media.
@fluencyinenglish
@fluencyinenglish
@fluencyinenglish
✴️Cede: To give up control; surrender
(sēd)
Example - "The police officers had to cede control to the FBI agents."
@fluencyinenglish
@fluencyinenglish
@fluencyinenglish
✴️Promenade: Leisurely walk
(prŏm′ə-nād′, -näd′)
Example - "The couple promenaded around town with matching outfits on."
@fluencyinenglish
@fluencyinenglish
@fluencyinenglish
✴️Cornucopia: Abundant supply
(kôr′nə-kō′pē-ə, -nyə-)
Example - "My mother loves to garden, she has a cornucopia of fresh veggies in the backyard."
@fluencyinenglish
@fluencyinenglish
@fluencyinenglish
✴️Inimitable: Unmatched; extremely unique
(ĭ-nĭm′ĭ-tə-bəl)
Example - "No matter how hard I tried, I couldn't recreate the painting of the mountains. It was terribly inimitable, and eventually I gave up."
@fluencyinenglish
@fluencyinenglish
@fluencyinenglish
✴️Coalesce: Fuse together
Example - "The two small fires coalesced and turned into one huge raging forest fire.
✅Sharing is caring
@fluencyinenglish
@fluencyinenglish
@fluencyinenglish
#vocabulary
#phrasalverbs
#advanced_vocabulary
@fluencyinenglish
@fluencyinenglish
@fluencyinenglish
🔹amount to something
/əˈmɑʊnt·tə, -ˌtu/
to add up to, be in total, be equal to, or be the same as
Example: Federal and state costs for building and operating prisons amounted to $25 billion.
Example: The blog amounts to a critique of the U.S. news media.
@fluencyinenglish
@fluencyinenglish
@fluencyinenglish
✴️Cede: To give up control; surrender
(sēd)
Example - "The police officers had to cede control to the FBI agents."
@fluencyinenglish
@fluencyinenglish
@fluencyinenglish
✴️Promenade: Leisurely walk
(prŏm′ə-nād′, -näd′)
Example - "The couple promenaded around town with matching outfits on."
@fluencyinenglish
@fluencyinenglish
@fluencyinenglish
✴️Cornucopia: Abundant supply
(kôr′nə-kō′pē-ə, -nyə-)
Example - "My mother loves to garden, she has a cornucopia of fresh veggies in the backyard."
@fluencyinenglish
@fluencyinenglish
@fluencyinenglish
✴️Inimitable: Unmatched; extremely unique
(ĭ-nĭm′ĭ-tə-bəl)
Example - "No matter how hard I tried, I couldn't recreate the painting of the mountains. It was terribly inimitable, and eventually I gave up."
@fluencyinenglish
@fluencyinenglish
@fluencyinenglish
✴️Coalesce: Fuse together
Example - "The two small fires coalesced and turned into one huge raging forest fire.
✅Sharing is caring
@fluencyinenglish
@fluencyinenglish
@fluencyinenglish
#vocabulary
#phrasalverbs
#advanced_vocabulary
@fluencyinenglish
@fluencyinenglish
@fluencyinenglish
🔹amount to something
/əˈmɑʊnt·tə, -ˌtu/
to add up to, be in total, be equal to, or be the same as
Example: Federal and state costs for building and operating prisons amounted to $25 billion.
Example: The blog amounts to a critique of the U.S. news media.
@fluencyinenglish
@fluencyinenglish
@fluencyinenglish
✴️Cede: To give up control; surrender
(sēd)
Example - "The police officers had to cede control to the FBI agents."
@fluencyinenglish
@fluencyinenglish
@fluencyinenglish
✴️Promenade: Leisurely walk
(prŏm′ə-nād′, -näd′)
Example - "The couple promenaded around town with matching outfits on."
@fluencyinenglish
@fluencyinenglish
@fluencyinenglish
✴️Cornucopia: Abundant supply
(kôr′nə-kō′pē-ə, -nyə-)
Example - "My mother loves to garden, she has a cornucopia of fresh veggies in the backyard."
@fluencyinenglish
@fluencyinenglish
@fluencyinenglish
✴️Inimitable: Unmatched; extremely unique
(ĭ-nĭm′ĭ-tə-bəl)
Example - "No matter how hard I tried, I couldn't recreate the painting of the mountains. It was terribly inimitable, and eventually I gave up."
@fluencyinenglish
@fluencyinenglish
@fluencyinenglish
✴️Coalesce: Fuse together
Example - "The two small fires coalesced and turned into one huge raging forest fire.
✅Sharing is caring
@fluencyinenglish
@fluencyinenglish
@fluencyinenglish
5 phrasal verbs with “PAY”
I shared the questions first on purpose — to make you think before seeing the meanings.
That struggle helps the meanings stick better than passive reading.
If a meaning surprised you, that’s good — it means your brain is actually learning.
#EnglishLearning#PhrasalVerbs#LearnEnglish#RealEnglish