@neko_poly001 · Post #1041 · 12.03.2023 г., 08:31
https://jvns.ca/blog/2022/12/08/a-debugging-manifesto/#debugging#programming
Hashtags
TGINSIGHT SIMILAR POSTS
Изворен канал @pythonotes · Post #381 · 23 окт.
Установить свойства виджета в PySide можно не только через соответствующие методы и конструктор класса. Можно их изменять с помощью метода setProperty по имени. btn = QPushButton("Click Me") btn.setProperty("flat", True) Это аналогично вызову btn.setFlat(True) Если указать несуществующее свойство, то оно просто создается btn.setProperty("btnType", "super") Получить его значение можно методом .property(name) btn_type = btn.property("btnType") Когда это может быть полезно? ▫️Можно просто хранить какие то данные в виджете и потом их доставать обратно widget = QWidget() widget.setProperty('my_data', 123) print(widget.property('my_data')) ▫️ Назначая эти свойства разным виджетам можно потом отличить виджеты во время итераци по ним. Например, найти все кнопки со свойством my_data="superbtn". Но ведь вместо кастомного свойства можно использовать objectName, будет тот же результат. Да, но y ObjectName есть ограничение - только строки. ▫️ Если нам потребуется не просто поиск а, например, сортировка по числу, то свойства позволяют нам это сделать. Поддерживается любой тип данных widget.setProperty('my_data', {'Key': 'value'}) widget.setProperty('order', 1) all_widgets.sort(key=w: w.property('order')) Но ведь Python позволяет всё вышеперечисленное сделать простым созданием атрибута у объекта widget.order = 1 widget.my_data = 123 Да, но я думаю что не надо объяснять почему не стоит так делать. К тому же, если у виджета нет свойства то метод .property(name) вернет None, а отсутствующий атрибут выбросит исключение. ▫️ Действительно полезное применение кастомным свойствам - контроль стилей. Здесь атрибутами не обойтись, нужны именно свойства. Дело в том, что в селекторах стилей можно указывать конкретные свойства виджетов на которые следует назначать стиль. Просто запустите этот код from PySide2.QtWidgets import * if __name__ == "__main__": app = QApplication([]) widget = QWidget(minimumWidth=300) layout = QVBoxLayout(widget) btn1 = QPushButton("Action 1") btn2 = QPushButton("Action 2") btn3 = QPushButton("Action 3", flat=True) layout.addWidget(btn1) layout.addWidget(btn2) layout.addWidget(btn3) # добавим кастомное свойство одной кнопке btn1.setProperty("btnType", "super") # добавляем стили widget.setStyleSheet( """ QPushButton[btnType="super"] { background-color: yellow; color: red; } QPushButton[flat="true"] { color: yellow; } """ ) widget.show() app.exec_() С помощью селектора мы избирательно назначили стили на конкретные кнопки. Как получить список всех кастомный свойств? Функция получения списка кастомных свойств отличается от получения дефолтных. def print_widget_dyn_properties(widget): for prop_name in widget.dynamicPropertyNames(): property_name = prop_name.data().decode() property_value = widget.property(property_name) print(f"{property_name}: {property_value}") #tricks#qt
Пребарај: #debugging
@neko_poly001 · Post #1041 · 12.03.2023 г., 08:31
https://jvns.ca/blog/2022/12/08/a-debugging-manifesto/#debugging#programming
Hashtags
@dasturlash_hayoti · Post #3951 · 30.08.2025 г., 12:46
#debugging#chatgpt#dasturlash_hayoti ⚡️Debug qilishni osonlashtiradigan oddiy usullar 💻 Kod yozayotganingizda error chiqishi tabiiy. Muhimi — uni tez topish. Mana eng oddiy 3 maslahat: 1️⃣ Print-debugging ◾️ Kod ichiga print() (yoki console.log()) qo‘ying. ◾️ Qayergacha kod ishlayotganini kuzating. ➡️Eng tez va sodda usul. 2️⃣ Debugger’dan foydalaning ◾️VS Code, PyCharm yoki boshqa IDE ichida debugger mavjud. ◾️ Breakpoint qo‘yib, qadam-baqadam kodni ko‘ring. ➡️Murakkab xatolarni aniqlash uchun zo‘r. 3️⃣Error xabarini diqqat bilan o‘qing ◾️ Error chiqsa, ko‘pchilik avval GPT’dan maslahat oladi, keyin xabarni o‘qiydi 😁 ◾️ Aslida, xabarning o‘zi nimani noto‘g‘ri qilganingizni aytib turadi 😅 Error — bu dushman emas, yo‘lboshchi. Uni to‘g‘ri o‘qisangiz, vaqt va asabni tejaysiz. ❓ Siz ko‘proq qaysi usulda xatolarni topasiz? print() qo‘yibmi yoki debugger bilanmi? 💻@dasturlash_hayoti— xatosiz kod bo‘lmaydi😅
@dasturlash_hayoti · Post #4046 · 07.11.2025 г., 12:17
O'rganish tezligini oshirish: 1% yaxshiroq bo'lish qoidasi Ko‘pchilik dasturlashda "super yulduz" bo‘lishni xohlaydi, lekin bunga qisqa muddatda erishib bo‘lmaydi. Men sizga juda oddiy, ammo kuchli bo'lgan "1% yaxshiroq bo'lish qoidasi" ni taklif qilaman. Qoida mohiyati: Har kuni o‘tgan kundan ko‘ra o‘zingizni atigi 1% ga yaxshilang. Dasturlashda bu nima degani? — Har kuni 15 daqiqa davomida bitta yangi JavaScript Array Method'ini o‘rganing. — Har kuni Git buyruqlaridan bittasini chuqurroq tushunib oling. — Har kuni o‘zingiz yozgan kodning bir qismini Refactoring qilib, uni 1% ga tozalang. Bu kichik qadamlar boshida sezilmasligi mumkin, lekin bir yildan so‘ng siz 37 barobar kuchliroq bo‘lasiz! 1.01³⁶⁵ taxminan 37.78 Muhimi: Katta maqsadlarni emas, balki doimiy va kichik harakatlarni ustuvor qiling. Katta o‘sish doimiy o‘sishdan kelib chiqadi. #Debugging#DasturchiMaslahati#JavaScript 👉@jonibek_turapov
@awesomeopensource · Post #149 · 31.07.2018 г., 10:02
ndb 使用 Chrome DevTools 调试 node 代码。 Tags: #debugging#devtools Languages: #NodeJS
Hashtags
@djangoproject · Post #174 · 22.09.2016 г., 19:16
gc — #Garbage#Collector interface This module provides an interface to the #optional garbage collector. It provides the ability to disable the collector, tune the collection frequency, and set #debugging options. It also provides access to unreachable #objects that the collector found but cannot free. Since the collector supplements the reference counting already used in Python, you can disable the collector if you are sure your program does not create reference cycles. https://docs.python.org/3/library/gc.html
@githubtrending · Post #15329 · 13.12.2025 г., 11:30
#typescript#browser#chrome#chrome_devtools#debugging#devtools#mcp#mcp_server#puppeteer Chrome DevTools MCP lets your AI coding tools like Gemini, Claude, or Cursor control a live Chrome browser for automation, debugging, and performance checks. Install it easily with npx chrome-devtools-mcp@latest in your MCP config, then prompt "Check performance of a site" to auto-record traces, take screenshots, analyze networks, and fix issues reliably. This benefits you by making AI smarter at web coding—verifying changes in real-time, spotting bugs fast, and boosting site speed without manual work. https://github.com/ChromeDevTools/chrome-devtools-mcp
@githubtrending · Post #14848 · 21.06.2025 г., 00:00
#typescript#blockchain#dapps#debugging#ethereum#javascript#smart_contracts#solidity#task_runner#tooling#typescript Hardhat is a powerful Ethereum development tool that helps you write, test, and deploy smart contracts easily and efficiently. It includes a local Ethereum network for testing without real money, advanced debugging tools to find and fix errors quickly, and a flexible plugin system to add extra features. This makes your development faster, safer, and more convenient, especially if you want to build decentralized applications. You can install it with npm, follow simple setup steps, and access many guides and plugins to customize your workflow. Hardhat is widely used by professionals to streamline Ethereum programming and improve code quality. https://github.com/NomicFoundation/hardhat
@githubtrending · Post #15488 · 13.02.2026 г., 12:30
#swift#analysis#analytics#cocoapods#crashlytics#debug#debugger#debugging#hacktoberfest#layout_debugger#leak_detection#log#logs_analysis#networking#performance_analysis#sandbox#swift#swift6#ui#uikit#view DebugSwift is a comprehensive toolkit that simplifies debugging for Swift iOS apps by providing real-time monitoring of network requests, performance metrics (CPU, memory, FPS), crash reports, and app resources like keychain and user defaults. It includes interface tools for visualizing layouts with grid overlays and touch indicators, plus memory leak detection and console logging. The main benefit is that you can quickly identify and fix issues during development without leaving your app—just shake your device to toggle the debug panel, making troubleshooting faster and more efficient. https://github.com/DebugSwift/DebugSwift