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

Резултати

Пронајдени 7 слични објави

Пребарај: #spinning

当前筛选 #spinning清除筛选
Hedera's Homestead

@HederasHomestead · Post #1373 · 22.01.2022 г., 04:29

Respect the Spindle by Abby Franquemont Download Enjoying a resurgence in popularity thanks to the current trend of DIY crafts, the hand spindle remains one of the most productive, versatile, and convenient tools for creating stunning fiber arts from home, as this beautifully illustrated guide from a veteran spinner and spindle aficionado demonstrates. With step-by-step instructions, this essential manual details the basic steps of spinning and then advances to the more complicated spinning wheel, showing how to use the spindle to make specific types of yarn, explaining traditional spindle spinning techniques, and detailing five simple projects designed to instill confidence in creating a variety of yarns with this simple tool. Combining fascinating historical narratives, traditions, and cultures from around the globe with vivid photography, this all-encompassing tour of the spindle also boasts easy-to-follow, contemporary techniques and styles that affirm the tool's enduring legacy. #spinning

Hashtags

Hedera's Homestead

@HederasHomestead · Post #1365 · 20.01.2022 г., 23:27

More thoughts on spinning. I hope you'll indulge me with this detour/personal journey of mine. Processing and spinning wool seems an unnecessary and tedious task when there is everything else to worry about. However, some animals, like sheep, can be dual purpose. Why not learn to utilize what else they have to offer? For some of us, the fiber is so worthwhile that we'd keep animals just for that purpose alone! (Hence my alpaca obsession - plus they are cheap therapy!) The reason why I'm starting to love spinning is because it is a mindful, yet mindless task that you can simply pick up and tend to without thought. Just feeling, stretching, twirling. With knitting, you must actively think. Processing and spinning fiber is a perfect complement to the art, a duty to put thoughts to rest and focus only on how the fiber feels. It's not about getting it done quickly, it's not about profit. It's about enjoying your time and feeling empowered in what you're able to create with your own hands. #spinning#alpaca

Hedera's Homestead

@HederasHomestead · Post #1364 · 20.01.2022 г., 00:34

Elaborating on the Removal of Vegetable Matter (specifically when there's a lot of it) And thoughts on your environment's impact on how dirty your fleece gets #spinning#alpaca

Hedera's Homestead

@HederasHomestead · Post #1361 · 19.01.2022 г., 06:05

How things are going. This is a Golding top whorl drop spindle. They kindly sent me some kind of hideous fiber to experiment with, which I gladly did, although I found it awful to work with. Probably not the best intro to spinning. I skirted and clouded a small portion of Obsidian's fleece to see how it does in comparison. My hand carders are still sitting in my PO box, so I still have to wait for that - it makes the fluffing easier. No wash, just taking bits of vegetable matter out, and I gotta tell ya, it is really messy. Fluffing and picking seemed to get a lot of dust out, so spinning isn't that dirty, actually. It may even be giving it more grip. It is far easier to spin that I expected. People say alpaca is not a good wool to start with because it's too slippery, but I found it extremely easy to draft and spin evenly. It may have something to do with the generous 3" of staple length. I will try to record a short video of the skirting process tomorrow. Still new, but learning. #spinning#alpaca

Hedera's Homestead

@HederasHomestead · Post #1359 · 19.01.2022 г., 00:00

Thus begins the processing of raw alpaca wool for the first time - just so you know what my time is occupied by. Once I master this, I will be happy to share the process. I am learning to spin as well, and hopefully will produce a skein in not too much time. This comes from our alpaca Obsidian, a gentle fellow who's very intelligent and sensitive. #spinning#alpaca