Вторая по частоте future-функция, которую я использовал, это абсолютный импорт
from __future__ import absolute_import
Что она делает?
Изменения, которые вносит эта инъекция описаны в PEP328
Покажу простой пример.
Допустим, есть такой пакет:
/my_package
/__init__.py
/main.py
/string.py
Смотрим код в my_package/main.py
# main.py
import string
Простой пример готов) Вопрос в том, какой модуль импортируется в данном случае? Есть два варианта:
1. модуль в моём пакете my_package.string
2. стандартный модуль string
И вот тут вступает в дело приоритет импортов. В Python2 порядок следующий: помимо иных источников, раньше ищется модуль внутри текущего пакета, а потом в стандартных библиотеках. Таким образом мы импортнём my_package.string.
Но в Python3 это поведение изменилось. Если мы указываем просто имя пакета, то ищется именно такой модуль, игнорируя имена в текущем пакете. Если мы хотим импортнуть именно подмодуль из нашего пакета то, мы должны теперь явно это указывать.
from my_package import string
или относительный импорт, но с указанием пути относительно текущего модуля main
from . import string
Еще одной неоднозначностью меньше 😎
Подробней про импорты здесь:
https://docs.python.org/3/tutorial/modules.html
#2to3#pep#basic
被CMSIS-DSP的FFT创飞 (其实是没仔细读文档
arm官方文档明确指出了 arm_rfft_fast_f32 会原地修改输入缓冲区, 然而咱用库之前没仔细读文档
Due to the use of complex transform internally, the source buffer is modified by the rfft.
看到函数参数有输入和输出指针, 然后就想当然认为函数内部一定不会覆盖输入缓冲区, 再加上输入循环缓冲用的是zero-copy, 调用FFT也是直接传入了缓冲区指针, 所以相当于算了一次FFT后直接污染了整个缓冲区
#Debug
#debug#洋屁
playing Valheim with friends
started a Linux Dedicated Server w/ Azure Playfab Crossplay Support.
can't connect server using IP and Playfab API always connecting
> Unable to preload the following plugins: libparty.so
checking libparty.so using > ldd libparty.so
IT NEEDS libpulse-dev ???????
Why? Audio lib requested SRSLY?
sudo apt install libpulse-dev
all works...
https://pypi.python.org/pypi/django-debug-toolbar
A configurable set of panels that display various #debug information about the current #request/#response.
The #Django_Debug_Toolbar is a configurable set of panels that display various debug information about the current request/response and when clicked, display more details about the panel’s content.
Here’s a screenshot of the toolbar in action:
#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