@WorldNews · Post #73870 · 04.04.2026 г., 18:24
Iran targets US public opinion with online information war [Read FullArticle] @WorldNews#IranNews#InfoWar#PublicOpinion
Hashtags
TGINSIGHT SIMILAR POSTS
Изворен канал @pythonotes · Post #241 · 5 мај
Можно ли в Python создавать бинарные файлы? Конечно можно. Для этого в Python есть следующие инструменты: ▫️ тип данных bytes и bytearray ▫️ открытие файла в режиме wb (write binary) или rb (read binary) ▫️ модуль struct Про модуль struct поговорим в первую очередь. Файл в формате JSON или Yaml внутри себя содержит разметку данных. Всегда можно определить где список начался а где закончился. Где записана строка а где словарь. То есть формат записи данных содержит в себе элементы разметки данных. В binary-файле данные не имеют визуальной разметки. Это просто байты, записанные один за другим. Правила записи и чтения находятся вне файла. Модуль struct как раз и помогает с организацией данных в таком файле с помощью определения форматов записи для разных частей файла. Модуль struct преобразует Python-объекты в массив байт, готовый к записи в файл и имеющий определённый вид. Для этого всегда следует указывать формат преобразования (или, как оно здесь называется - запаковки). Формат нужен для того, чтобы выделить достаточное количество байт для записи конкретного типа объекта. В последствии с помощью того же формата будет производиться чтение. При этом следует помнить что мы говорим о типах языка С а не Python. Именно формат определяет, что записано в конкретном месте файла, число, строка или что-то еще. Вот какие токены формата у нас есть. Помимо этого, первым символом можно указать порядок байтов. На разных системах одни и те же типы данных могут записываться по-разному, поэтому желательно указать конкретный способ из доступных. Если этого не сделать, то используется символ '@', то есть нативный для текущей системы. В строке формата мы пишем в каком порядке и какие типы собираемся преобразовать в байты. Запакуем в байты простое число, токен "i". >>> import struct >>> struct.pack('=i', 10) b'\n\x00\x00\x00' Теперь несколько float, при этом нужно передавать элементы не массивом а последовательностью аргументов. >>> struct.pack('=fff', 1.0, 2.5, 4.1) b'\x00\x00\x80?\x00\x00 @33\x83@' Вместо нескольких токенов можно просто указать нужное количество элементов перед одним токеном, результат будет тот же. >>> struct.pack('=3f', 1.0, 2.5, 4.1) b'\x00\x00\x80?\x00\x00 @33\x83@' Теперь запакуем разные типы >>> data = struct.pack('=fiQ', 1.0, 4, 100500) я запаковал типы float, int и unsigned long long (очень большой int, на 8 байт) b'\x00\x00\x80?\x04\x00\x00...' Распаковка происходит аналогично, но нужно указать тот же формат, который использовался при запаковке. Результат возвращается всегда в виде кортежа. >>> struct.unpack('=fiQ', data) (1.0, 4, 100500) Как видите, ничего страшного! #lib#basic
Пребарај: #publicopinion
@WorldNews · Post #73870 · 04.04.2026 г., 18:24
Iran targets US public opinion with online information war [Read FullArticle] @WorldNews#IranNews#InfoWar#PublicOpinion
Hashtags
@ai_and_law · Post #97 · 29.08.2023 г., 07:04
Majority of Americans Call for Federal AI Regulation Hello, everyone! A recent poll conducted by the Artificial Intelligence Policy Institute has unveiled a strong desire among Americans for federal regulation of artificial intelligence. The poll surveyed 1,001 registered US voters, revealing that 62% expressed varying levels of concern about AI, with a remarkable 86% believing that AI could inadvertently lead to a catastrophic event. Interestingly, the majority of respondents (56%) support the idea of a federal agency overseeing AI regulation, while a striking 82% voiced their skepticism about leaving the task to tech executives. Additionally, 72% of participants expressed a preference for slowing down AI development, emphasizing caution over haste. The sentiments expressed in the poll echo the concerns raised by experts in the field, including figures like OpenAI CEO Sam Altman, Tesla CEO Elon Musk, AI pioneer Geoffrey Hinton, and even President Joe Biden, who have all highlighted the importance of addressing AI's potential risks and advocating for regulation. #AI#Regulation#AIrisks#PublicOpinion#Technology#OpenAI#RegulatoryFramework#SafetyMeasures
@american_observer · Post #5423 · 19.03.2026 г., 23:04
Netanyahu finally got his dream war with US backing — and may have picked the perfect moment to lose America for good. Bloomberg’s analysis calls Trump’s decision to launch a joint campaign with Israel against Iran the “crowning achievement” of Netanyahu’s decades-long project: ditch bipartisan consensus, bind Israel’s fate to the hard‑right base of the Republican Party, and turn US–Israel relations into a culture‑war brand. But like the attack on Iran itself, it’s a short‑term win glued to long‑term damage. Support for Israel has already cratered among US Democrats and is sliding even among Republicans; new polls show Democratic voters now tilting more toward Palestinians, with generational numbers that are devastating for Israel’s image. Among younger Americans, especially under 35, “unfavorable” is fast becoming the default setting. The Iran war pours gasoline on this trend. It sharpens the generational split inside the GOP, where older evangelicals still see Israel as sacred, while younger conservatives are tired of endless wars and trillion‑dollar guarantees. On the fringes of both parties, criticism of Israel slides into open antisemitism, and Bloomberg warns that this conflict is already raising the risk of attacks on Jewish institutions in the US. That’s the poisoned dividend of Netanyahu’s strategy: by turning support for Israel into a partisan loyalty test and wrapping it around Trumpism, he also ties Jewish safety and legitimacy to the most polarizing current in American politics. Meanwhile the material cost of this “victory” is brutal. The US–Israel war with Iran is rattling global markets and investors, driving up energy prices, disrupting trade routes and threatening global growth with tens of billions in losses; for the US and Israel, the military tab alone is running into the billions, day after day. For now, Netanyahu can boast on friendly Israeli TV that he got America into the war from day one and out‑Churchilled Churchill by dragging his superpower patron in at the start. But as US public support erodes, Democrats harden, young voters radicalize and even some Republicans flinch at the cost, that triumph looks more like a Pyrrhic win: he beat Trump in the room — and may end up sacrificing Israel’s standing in the country that bankrolls his wars. #Israel#Netanyahu#Trump#IranWar#USA#Democrats#Republicans#publicOpinion#antisemitism#geopolitics#warCost 📱American Оbserver - Stay up to date on all important events 🇺🇸