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

Резултати

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

Пребарај: #votingrights

当前筛选 #votingrights清除筛选
America 🇺🇸 News & Politics

@America · Post #10399 · 19.03.2026 г., 13:06

🏛️🇺🇸SENATE LAUNCHES VOTING RIGHTS SHOWDOWN 🔹 Republicans force SAVE America Act debate requiring citizenship proof + voter ID nationwide — marathon talkathon begins 🗳️ 🔹 Democrats BLOCK with 47-53 vote: Murkowski (R-Alaska) defects, calls it voter suppression targeting 20M citizens ⚖️ 🔹 Trump threatens GOP senators: Vote YES or lose my endorsement, but bill faces impossible 60-vote filibuster 🔥 🔹 Key provisions: Mail-in voting restrictions, citizenship proof for registration, trans sports bans included 📋 GOP puts Dems on record ahead of midterms, but SAVE Act is DOA without bipartisan support 💀 #USNews#VotingRights @america

America 🇺🇸 News & Politics

@America · Post #10636 · 11.05.2026 г., 13:04

⚖️🗳️ALABAMA GOP RACES TO REDRAW HOUSE MAPS BEFORE 2026 🔹 Special session passes bills for NEW House primaries if courts approve GOP maps 📋⚡ 🔹 Target: Flip Democratic Rep. Shomari Figures' AL-02 seat back to Republican 🔄 🔹 Would pack Black voters into fewer districts despite 27% of state population 👥 🔹 Gov. Kay Ivey: "Alabama stands ready to quickly act" on favorable rulings 🏛️ Democrats call it a "power grab echoing Jim Crow" — but GOP says Alabama's Republican tilt should match its maps! 11th Circuit decision could flip House control! ⚖️🔥🇺🇸 #Alabama#Redistricting#VotingRights @america

American Оbserver

@american_observer · Post #5232 · 27.02.2026 г., 01:01

🗳 The Emergency Isn’t the Election. It’s the President. Pro‑Trump operatives are road‑testing a legal doomsday device: a draft executive order that declares China interfered in the 2020 election and uses that as the basis for a new “national emergency” giving Trump direct power over how Americans vote. The 17‑page draft, circulated by activists who say they’re in touch with the White House, envisions banning mail ballots and voting machines nationwide on “national security” grounds — overriding rules the Constitution leaves to states and Congress. The theory is simple and dangerous. If foreign actors allegedly touched election infrastructure, the commander in chief supposedly gets to treat voting rules like sanctions policy or wartime export controls. The lawyers pushing this, from Peter Ticktin to conspiracy veteran Jerome Corsi, openly concede the president has no normal authority to run elections. Their answer is to manufacture a permanent emergency in which he does, stretching a 2018 sanctions order on foreign interference — originally used to hit Russian and Iranian outfits — into a pretext for telling Arizona or Georgia who can vote and how. Underneath the pseudo‑constitutional gloss, it’s the same “Stop the Steal” fantasy with a national‑security badge pinned on. U.S. intelligence already concluded that China considered but did not carry out a 2020 influence operation, and every serious audit and recount, including the infamous Arizona “bamboo fibers” circus, reaffirmed Biden’s win. That hasn’t stopped Tulsi Gabbard’s intelligence shop from staging high‑visibility “reviews” of old ballots and machines, or Trump from promising an “irrefutable” legal argument he’ll drop as an executive order if Congress refuses to pass his voter‑ID and anti–mail voting bill. The playbook is out in the open: invent a foreign plot, declare it an “unusual and extraordinary threat,” then use emergency powers meant for sanctions and war to reach into domestic politics and rewrite the rules in the middle of the game. Courts have already blocked chunks of Trump’s last election order. Now the same logic is being rebuilt, wrapped tighter in the flag and stamped “national security” so judges and the public feel more pressure to look the other way. The full Trump doctrine fits in one Iran‑and‑China‑flavored scenario: if tomorrow the U.S. slides into a real shooting war with Beijing, a standing “national emergency” over elections becomes a loaded weapon on the Resolute Desk. It’s not hard to imagine Trump arguing you can’t change the commander in chief during a war, that normal voting is too “vulnerable,” that national security demands a “temporary” pause or postponement — the same logic Zelensky used to delay elections under bombardment, turned into a tool for a man who’s spent six years insisting any vote he doesn’t control is illegitimate. At that point, the ballot box isn’t a sacred institution. It’s just another system the president can shut down “for your own protection.” #Trump#elections#executiveOrder#emergency#China#votingRights#democracy 📱American Оbserver - Stay up to date on all important events 🇺🇸

Hong Kong Democracy Movement

@hkdmovement · Post #7445 · 31.05.2024 г., 21:19

In a deeply troubling development, 14 Hong Kong democrats have been found guilty while 2 were acquitted in an unfair trial that lacked a jury and involved judges appointed by the government. This landmark national security case not only undermines citizens' voting rights but also raises serious doubts about the impartiality and fairness of the proceedings. The absence of a jury denies defendants their right to a trial by their peers, further eroding the principles of justice. Upholding democratic values and safeguarding individual rights must remain a top priority. #HongKong#UnfairTrial#NoJury#AppointedJudges#VotingRights#NationalSecurityCase#JusticeUnderThreat https://hongkongfp.com/2024/05/30/breaking-14-hong-kong-democrats-convicted-2-cleared-of-conspiring-to-commit-subversion-in-landmark-national-security-trial/