Один из самых удобных способов записать данные это использование готовых форматов, такие как 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
🦠Nothing to see here.Illegal chinese biolab containing bioengineered mice and infectious agents including HIV and herpes discovered in California
⚗The makeshift lab contained roughly 30 refrigerators and freezers — some of which were non-operational — as well as incubators, medical testing supplies, and hundreds of mice. Several disease samples tested from the lab included infectious agents like herpes, coronavirus, E. Coli, and malaria.
🧑🏻🔬Wang Zhaolin, a representative of the company operating the lab, Prestige Biotech, told investigators that the mice inside the warehouse had been genetically engineered to catch and spread the COVID-19 virus.
🩸Fresno County Public Health staff also observed blood, tissue and other bodily fluid samples and serums; and thousands of vials of unlabeled fluids and suspected biological material. medical devices that appeared to have been created on-site, such as COVID-19 and pregnancy tests, were also discovered.
#biolab#Covid19
Share and subscribe to American Majority
🧪🇺🇸Records Reveal Safety Lapses and Violations at U.S. Biosafety Laboratories that Conduct Research on Dangerous Agents and Toxins
🐒Mishaps, human errors, animal escapes, improper and defective personal protective equipment, facility equipment failures and containment failures continue to occur at some of the United States’ most secure and regulated high-containment biosafety laboratories.
🦠The report explains that one of the exposures resulted in an illness of one worker after exposure to Coxiella Burnetii. “The source of the infection was attributed to contact with infected animals in the performance of the worker’s duties. The worker received medical treatment and fully recovered from the illness."
🧨These documents uncover a pattern of serious safety issues in biolabs here on U.S. soil. And, given these issues here at home, one can imagine the safety issues of labs the U.S. funds abroad.
#biolab#bioweapon
Please share and subscribe: @american_majority
🇺🇸🇺🇦🦠Another US-linked biolab was found in liberated Rubezhnoye
The "Farmbiotest" laboratory was found in a building in the city polyclinic. As it turns out, they tested "medicines" on local residents under the guise of safe research. Locals were invited to participate in drug trials for a fee, and meals at the expense of the company. Everything seemed to be legal in appearance, until the "volunteers" began to die one by one.
It became clear that the company conducting the "research" was interested in patients with cardiovascular diseases, coronavirus and children with congenital anomalies (medical staff took screenings from newborn infants). American medical documentation was found in the building as well.
All the evedences point to the fact that tests of subspecies of bioweapons were conducted in Rubezhnoye under the guise of legal research.
#Ukraine#Pentagon#biolab#bioweapon
Share and subscribe: @american_majority
🇺🇸Actually, that is a really interesting video. Remember how during Senate testimony, Biden and Obama official Victoria Nuland admitted there were biological research labs in Ukraine?
Victoria Nuland told Senator Marco Rubio: “Ukraine has biological research facilities which we are now quite concerned Russian troops, Russian forces may be seeking to gain control of.”
Nuland said so under oath. Why didn’t Victoria "cookies of freedom" Nuland just say there aren’t any bioweapons? Hint: there are bioweapons. If she would have lied, she would go to jail.
So just look, what we have. Here's another document we got from our whistleblower. Read it carefully. So there's a reason why Blinken literally stops her from visiting Russia and answering their questions.
Ms. Nuland needs to be questioned again, but this time by a Special Counsel and under the penalty of perjury. Russia and China want their questions to be answered too!
#Ukraine#bioweapon#biolab#Nuland
Share and subsribe @american_majority
🇺🇸Take a look inside a US top secret bioweapons laboratory...
Journalists began sounding the alarm over the existence and development of bioweapons by the US government as long as 3 years ago...
From toxic fleas to deseased mosquitos, and these are just the experiments that have been declassified to the public.
💥 Since then, the Pentagon has been funding numerous biolabs around the world, some too dangerous to host on home soil, and others involved in specific genome research of people who live in the area.
#Bioweapons#biolab#biothreat
Share and subscribe to American Majority
🇺🇸🇺🇦🇷🇺Russian MoD presented the data on the health condition of the surrendered Ukrainian servicemen.
🦠The data show the presence of antibodies to contagious disease agents.
The results are as follows: 33% of the examined servicemen had had hepatitis A, over 4% had renal syndrome fever and 20% had West Nile fever. The figures are significantly higher than the statistical average. Considering an active research of these diseases by the Pentagon within the Ukrainian projects, Russian MoD believes that servicemen of the Armed Forces of Ukraine (AFU) were involved as volunteers in experiments to assess the tolerance of dangerous infectious diseases.
High concentrations of antibiotics, including sulphonyl amides and fluoroquinolones, have been detected in their blood as well. This fact may indicate preventive use of antibiotics and preparation of servicemen for operating in conditions of biological contamination, such as cholera agent and others.
#bioweapon#biolab#Pentagon#Ukraine#war
@american_majority
⚡BREAKING⚡
🇺🇸🇺🇦Nuland-Pyatt Tape Removed From YouTube After 8 Years
The smoking gun proving U.S. involvement in the 2014 coup in Kiev has been removed from YouTube after eight years, Consortium news reported.
The removal of a video happend just a few days later after the American majority channel published another leaked letter from Nuland's office and this proves its authenticity.
It was the most complete version of the leaked conversation between then Assistant Secretary of State Victoria Nuland and Geoffrey Pyatt, the then U.S. ambassador to Ukraine, in which the two discuss who will make up the new government weeks before democratically-elected Ukrainian President Viktor Yanukovych was overthrown in a violent coup on Feb. 21, 2014.
The U.S. State Department never denied the authenticity of the video, and even issued an apology to the European Union after Nuland is heard on the tape saying, “Fuck the E.U.”
SMELL THE PANIC
#Ukraine#bioweapon#biolab#Nuland#leak
Share and subsribe @american_majority
⚡BREAKING⚡
🇺🇸🇺🇦Nuland-Pyatt Tape Removed From YouTube After 8 Years
The smoking gun proving U.S. involvement in the 2014 coup in Kiev has been removed from YouTube after eight years, Consortium news reported.
The removal of a video happend just a few days later after the American majority channel published another leaked letter from Nuland's office and this proves its authenticity.
It was the most complete version of the leaked conversation between then Assistant Secretary of State Victoria Nuland and Geoffrey Pyatt, the then U.S. ambassador to Ukraine, in which the two discuss who will make up the new government weeks before democratically-elected Ukrainian President Viktor Yanukovych was overthrown in a violent coup on Feb. 21, 2014.
The U.S. State Department never denied the authenticity of the video, and even issued an apology to the European Union after Nuland is heard on the tape saying, “Fuck the E.U.”
SMELL THE PANIC
#Ukraine#bioweapon#biolab#Nuland#leak
Share and subsribe @american_majority