TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #76 · 27 апр.

Ранее я делал серию постов про битовые операторы. Вот вам ещё один наглядный пример как это используется в Python в модуле re. Чтобы указать флаг для компилятора нам надо указать его после передаваемой строки. Например, добавляем флаг для игнорирования переноса строки. pattern = re.compile(r"(\w+)+") words = pattern.search(text, re.DOTALL) А как указать несколько флагов? Ведь явно будут ситуации когда нам потребуется больше одного. Кто читал посты по битовые операторы уже понял как. pattern.search(text, re.DOTALL | re.VERBOSE) А теперь смотрим исходники, что находится в этих атрибутах? Не удивительно, степени двойки. Почему? Потому что каждое следующее значение это сдвиг единицы влево. >>> for n in [1, 2, 4, 8, 16, 32, 64, 128, 256]: >>> print(bin(n)) 0b1 0b10 0b100 0b1000 0b10000 0b100000 0b1000000 0b10000000 0b100000000 Чтобы было понятней, давайте напишем тоже самое но иначе, добавим ведущие нули: 000000001 000000010 000000100 000001000 000010000 000100000 001000000 010000000 100000000 Не понятно что тут происходит? Читай три поста про битовые операторы начиная с этого ➡️https://t.me/pythonotes/45 В общем, это пример применения побитовых операций в самом Python. Теперь вы знаете Python еще немного лучше) #tricks#regex#libs

Резултати

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

Пребарај: #bsd

当前筛选 #bsd清除筛选
Solidot 纯净版

@SolidotR · Post #4520 · 11.02.2026 г., 14:35

NetBSD 11.0 RC1 释出 #BSD NetBSD 项目释出了 NetBSD 11.0 的首个 RC 版本。主要新特性包括:支持 64 位 RISC-V 平台;增强对 POSIX.1-2024 和 C23 编程接口标准的兼容性;增强对 compat_linux(8) 中 Linux 系统调用的支持;初步支持高通骁龙 X Elite 平台;改进 npf(7) 防火墙;新 MICROVM kernel for x86,专为实现极速虚拟机启动设计,在 2020 年时代 x86 CPU 上启动仅需 10 毫秒;新 virt68k,等等。 https://www.netbsd.org/releases/formal-11/NetBSD-11.0.html

Hashtags

GitHub Trends

@githubtrending · Post #14667 · 03.05.2025 г., 12:30

#rust#bsd#gpu#linux#macos#opengl#rust#terminal#terminal_emulators#vte#windows Alacritty is a fast, cross-platform terminal emulator that uses OpenGL for smooth performance, works on BSD, Linux, macOS, and Windows, and offers customizable settings while keeping things simple. It’s lightweight, integrates well with tools like window managers or terminal multiplexers, and is already reliable enough for daily use despite being in beta, making it ideal for users who want speed and flexibility without unnecessary features. https://github.com/alacritty/alacritty

GitHub Trends

@githubtrending · Post #15567 · 17.03.2026 г., 11:30

#cplusplus#apple_silicon#bsd#c_plus_plus#cmake#floss#game#gplv2#json#linux#lua#macos_app#python#strategy#windows Widelands is a free, open-source real-time strategy game like Settlers II, where you lead a small clan to build roads, gather resources like wood and gold, manage four unique tribes, trade, or fight in single-player campaigns and multiplayer. Download it easily for Windows, Mac, or Linux, or compile from source with simple scripts and tools like CMake on various systems. This lets you enjoy deep, replayable empire-building fun at no cost, anytime with friends or AI. https://github.com/widelands/widelands

GitHub Trends

@githubtrending · Post #15000 · 27.07.2025 г., 12:00

#markdown#android#bsd#cheatsheet#cheatsheets#command_line#console#documentation#examples#hacktoberfest#help#linux#macos#man_page#manpages#manual#osx#shell#terminal#tldr#windows The tldr-pages project offers simple, easy-to-understand help pages for command-line tools, focusing on practical examples rather than long, complex manuals. It’s great if you’re new to the command line or forget command options, as it shows the most useful commands clearly. You can access these pages through various clients or online without installing anything. This saves you time and frustration by giving quick, clear guidance on common tasks, making it easier to learn and use command-line tools effectively. Plus, you can contribute by adding or improving pages yourself. This helps you and others get fast, practical help with commands[1][4]. https://github.com/tldr-pages/tldr