开源项目介绍-02 Aubio【1】环境配置和使用 @ Ubuntu + Pycharm + Python

前言:

aubio 是一组算法和工具,用于标记和变换音乐和声音。它扫描或监听音频信号,并尝试识别音乐事件。例如,当鼓被击打时,它能检测到音符的频率,或者一个有节奏的旋律的节拍是多少。

aubio 的功能包括:

  • 在每次打击前对声音文件进行分割
  • 进行音高检测
  • 敲击节奏
  • 从现场音频产生 MIDI 流

  • Python版本的配置和使用:

  • 按照官网的说法,异常简单,但是,。。。。。

笔者的工作目录:github,下载后解压,

K:\Prj_EDU\Sw_Proj\Aubio_python

 1 python + pycharm 版本@windows:【失败】

$ python -c "import aubio; print(aubio.version, aubio.float_type)"

 如果没有安装:

1.1 安装AUBIO

1.1.0 用pip安装aubio,错误,笔者没有实现:

错误如下:

Looking in indexes: https://pypi.mirrors.ustc.edu.cn/simple/, https://pypi.mirrors.ustc.edu.cn/simple/, https://mirrors.aliyun.com/pypi/simple/, https://pypi.tuna.tsinghua.edu.cn/simple/, http://pypi.mirrors.ustc.edu.cn/simple/, https://pypi.org/simple/
Collecting aubio
  Using cached aubio-0.4.9.tar.gz (479 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy in k:\prj_edu\sw_proj\aubio_python\aubio_python\.venv\lib\site-packages (from aubio) (1.26.4)
Building wheels for collected packages: aubio
  Building wheel for aubio (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [42 lines of output]

      K:\Prj_EDU\Sw_Proj\Aubio_python\Aubio_Python\.venv\lib\site-packages\setuptools\__init__.py:81: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
      !!

              ********************************************************************************
              Requirements should be satisfied by a PEP 517 installer.
              If you are using pip, you can try `pip install --use-pep517`.
              ********************************************************************************

      !!
        dist.fetch_build_eggs(dist.setup_requires)
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-39
      creating build\lib.win-amd64-cpython-39\aubio
      copying python\lib\aubio\cmd.py -> build\lib.win-amd64-cpython-39\aubio
      copying python\lib\aubio\cut.py -> build\lib.win-amd64-cpython-39\aubio
      copying python\lib\aubio\midiconv.py -> build\lib.win-amd64-cpython-39\aubio
      copying python\lib\aubio\slicing.py -> build\lib.win-amd64-cpython-39\aubio
      copying python\lib\aubio\__init__.py -> build\lib.win-amd64-cpython-39\aubio
      running build_ext
      checking for aubio = 0.4.9
      Running "pkg-config --libs --cflags aubio = 0.4.9" failed: FileNotFoundError(2, '系统找不到指定的文件。', None, 2, None)
      Info: aubio 0.4.9 was not found by pkg-config

      Info: looking for *optional* additional packages
      checking for libavcodec
      Running "pkg-config --libs --cflags libavcodec" failed: FileNotFoundError(2, '系统找不到指定的文件。', None, 2, None)
      checking for libavformat
      Running "pkg-config --libs --cflags libavformat" failed: FileNotFoundError(2, '系统找不到指定的文件。', None, 2, None)
      checking for libavutil
      Running "pkg-config --libs --cflags libavutil" failed: FileNotFoundError(2, '系统找不到指定的文件。', None, 2, None)
      checking for libswresample
      Running "pkg-config --libs --cflags libswresample" failed: FileNotFoundError(2, '系统找不到指定的文件。', None, 2, None)
      checking for libavresample
      Running "pkg-config --libs --cflags libavresample" failed: FileNotFoundError(2, '系统找不到指定的文件。', None, 2, None)
      checking for sndfile
      Running "pkg-config --libs --cflags sndfile" failed: FileNotFoundError(2, '系统找不到指定的文件。', None, 2, None)
      checking for samplerate
      Running "pkg-config --libs --cflags samplerate" failed: FileNotFoundError(2, '系统找不到指定的文件。', None, 2, None)
      Info: libaubio was not installed or built locally with waf, adding src/
      error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for aubio
  Running setup.py clean for aubio
Failed to build aubio
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (aubio)
 

尝试用,python-pip的包管理

(.venv) PS K:\Prj_EDU\Sw_Proj\Aubio_python\Aubio_Python> pip install python-pip
Looking in indexes: https://pypi.mirrors.ustc.edu.cn/simple/, https://pypi.mirrors.ustc.edu.cn/simple/, https://mirrors.aliyun.com/pypi/simple/, https://pypi.tuna.tsinghua.edu.cn/simple/, http://pypi.mirrors.ustc.edu.cn/simple/, https://pypi.org/simple/
Collecting python-pip
  Downloading python_pip-1.1.1-py3-none-any.whl.metadata (1.9 kB)
Downloading python_pip-1.1.1-py3-none-any.whl (4.7 kB)
Installing collected packages: python-pip
Successfully installed python-pip-1.1.1
(.venv) PS K:\Prj_EDU\Sw_Proj\Aubio_python\Aubio_Python> 
 

结果和上面错误一样,没有用。

1.1.1 用conda安装:【笔者安装了,但是不知道为何,无法使用,或者不知道如何实验,未来在研究吧】
(.venv) PS K:\Prj_EDU\Sw_Proj\Aubio_python> conda config --add channels conda-forge
(.venv) PS K:\Prj_EDU\Sw_Proj\Aubio_python> conda install -c conda-forge aubio

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    aubio-0.4.9                |   py37hdcea730_5         256 KB  conda-forge
    ffmpeg-4.3.1               |       ha925a31_0        26.2 MB  conda-forge
    ------------------------------------------------------------
                                           Total:        26.4 MB

The following NEW packages will be INSTALLED:

  aubio              conda-forge/win-64::aubio-0.4.9-py37hdcea730_5 None
  ffmpeg             conda-forge/win-64::ffmpeg-4.3.1-ha925a31_0 None
  python_abi         conda-forge/win-64::python_abi-3.7-2_cp37m None


Proceed ([y]/n)?


Downloading and Extracting Packages
aubio-0.4.9          | 256 KB    | ############################################################################################################################################################################################ | 100%
ffmpeg-4.3.1         | 26.2 MB   | ############################################################################################################################################################################################ | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
Retrieving notices: ...working... done
 

1.1.2 pip安装
$ pip install pytest

 在    Pycharm的调试如下:

$ git clone https://git.aubio.org/aubio/aubio
$ cd aubio
$ pytest

参考: 

Python documentation — aubio 0.4.9 documentation


 2 Python版本 pycharm @Linux  Ubuntu的版本 【成功】


项目地址:

frank@frank-virtual-machine:~/Projects/PythonAubio/PrjAubio$ 

2.1 在ubuntu上安装pycharm(略)

2.2 配置环境:

2.2.1 安装numpy

 pip install numpy

遇到问题:

(.venv) frank@frank-virtual-machine:~/Projects/PythonAubio/PrjAubio$ pip install numpy

ERROR: Could not find a version that satisfies the requirement numpy (from versions: none)
ERROR: No matching distribution found for numpy

解决:

1 安装 python-pip
sudo apt-get install python-pip
2 用pip安装numpy,并采用清华的安装包源:
pip install numpy -i https://pypi.tuna.tsinghua.edu.cn/simple

【案]如果直接用pip install numpy 会报错:

2.2.2 直接安装:aubio

pip install aubio

Collecting aubio
  Downloading aubio-0.4.9.tar.gz (479 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 479.0/479.0 kB 21.6 kB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy in ./.venv/lib/python3.10/site-packages (from aubio) (1.26.4)
Building wheels for collected packages: aubio
  Building wheel for aubio (setup.py) ... done
  Created wheel for aubio: filename=aubio-0.4.9-cp310-cp310-linux_x86_64.whl size=380355 sha256=cabcdaf2ab3bffd631e1fa78608ec6b7857393070e7eebb68108a886c960741a
  Stored in directory: /home/frank/.cache/pip/wheels/00/30/30/a06fe7e9c7fe740486c219851b2bc1c7ed4a97e9c257efd3d7
Successfully built aubio
Installing collected packages: aubio
Successfully installed aubio-0.4.9
 

2.3 使用aubio:

2.3.1 进入aubio/python/demo目录:

2.3.2 使用python版本的工具:

2.3.2.1 py确认系统安装的python的可用版本
 2.3.2.2 运行一个demo

(.venv) frank@frank-virtual-machine:~/Projects/aubio/aubio/python/demos$ python3 demo_pitch.py
Usage: demo_pitch.py <filename> [samplerate]
 

【会给出使用技巧】

python3 demo_pitch.py TestAudio/1.wav 48000

 0.000000 0.000000 0.000000
0.010667 0.000000 0.000000
0.021333 0.000000 0.000000
0.032000 0.000000 0.000000
0.042667 0.000000 0.000000
0.053333 0.000000 0.000000
0.064000 0.000000 0.000000
0.074667 0.000000 0.000000
0.085333 0.000000 0.000000
0.096000 0.000000 0.000000
0.106667 0.000000 0.000000
0.117333 0.000000 0.000000
0.128000 20.157473 0.000000
0.138667 25.830223 0.000000
0.149333 34.323399 0.000000
0.160000 51.689980 0.000000
0.170667 162.232635 0.000000
0.181333 162.232635 0.000000
0.192000 162.232635 0.000000
0.202667 162.232635 0.000000
0.213333 138.269699 0.270921
0.224000 138.326996 0.249590
0.234667 138.321472 0.244399
0.245333 162.232635 0.000000

报错,audio的图像画的时候,确实python, matplotlib包:

  2.3.2.3  安装matplotlib

(.venv) frank@frank-virtual-machine:~/Projects/aubio/aubio/python/demos$ pip install matplotlib
ERROR: Could not find a version that satisfies the requirement matplotlib (from versions: none)
ERROR: No matching distribution found for matplotlib

[notice] A new release of pip is available: 23.2.1 -> 24.0
[notice] To update, run: pip install --upgrade pip
 

提升pip的版本有点低,

解决,先sudo apt update更新包的List,

然后,sudo apt install python3-pip

【案] linux 系统的好处,就是配置开源环境的时候,比windows的系统,方便太多,

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libpython2-stdlib libpython2.7-minimal libpython2.7-stdlib python-pkg-resources python-setuptools python2 python2-minimal python2.7 python2.7-minimal
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  python-pip
The following NEW packages will be installed:
  python3-pip
0 upgraded, 1 newly installed, 1 to remove and 113 not upgraded.
Need to get 1,305 kB of archives.
After this operation, 2,153 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://us.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 python3-pip all 22.0.2+dfsg-1ubuntu0.4 [1,305 kB]
Fetched 1,305 kB in 2s (524 kB/s)      
debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend requires a screen at least 13 lines tall and 31 columns wide.)
debconf: falling back to frontend: Readline
(Reading database ... 187860 files and directories currently installed.)
Removing python-pip (20.3.4+dfsg-4) ...

Progress: [  0%] [.....................................................................................................................................................................................................................................................................................] 
Progress: [ 14%] [#######################################..............................................................................................................................................................................................................................................] 
Selecting previously unselected package python3-pip.#############################################......................................................................................................................................................................................................] 
(Reading database ... 187359 files and directories currently installed.)
Preparing to unpack .../python3-pip_22.0.2+dfsg-1ubuntu0.4_all.deb ...

Unpacking python3-pip (22.0.2+dfsg-1ubuntu0.4) ...######################################################################################...............................................................................................................................................................] 

Setting up python3-pip (22.0.2+dfsg-1ubuntu0.4) ...#############################################################################################################################.......................................................................................................................] 

Progress: [ 71%] [#####################################################################################################################################################################################################................................................................................] 
Processing triggers for man-db (2.10.2-1) ...##################################################################################################################################################################################################################........................................] 
 

然后,安装matplotlib

(.venv) frank@frank-virtual-machine:~/Projects/aubio/aubio/python/demos$ pip3 install matplotlib

【案,由于源的问题,会报错】

改为,

pip3 install -i https://pypi.mirrors.ustc.edu.cn/simple/ matplotlib

2.3.3 使用demo_notes。py 找到一段音乐的音调:

【案,笔者先录制了一段D4调号的钢琴音乐,然后,用识别软件进行测试,结果如下]

(.venv) frank@frank-virtual-machine:~/Projects/aubio/aubio/python/demos$ python3 demo_notes.py TestAudio/1_D4.wav 
    time [ start vel last ]
1.578957 [ 62. 110.  -1.]
D4
4.620771 [ 62. 110.   0.]
D4
7.407166 [ 62. 110.   0.]
D4
 

由此,LINUX环境下的配置成功完结。


参考:

GitHub - aubio/aubio: a library for audio and music analysis


问题:

1 下载aubio的问题:

(.venv) PS K:\Prj_EDU\Sw_Proj\Aubio_python> git clone https://git.aubio.org/aubio/aubio
程序“git.exe”无法运行: 拒绝访问。所在位置 行:1 字符: 1
+ git clone https://git.aubio.org/aubio/aubio
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~。
所在位置 行:1 字符: 1
+ git clone https://git.aubio.org/aubio/aubio
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (:) [], ApplicationFailedException
    + FullyQualifiedErrorId : NativeCommandFailed
 

 【解决】如果不能自动下载,我们手动下载,然后,把源码Copy到对应的文件夹也可。

2 Python包的问题:

(.venv) PS K:\Prj_EDU\Sw_Proj\Aubio_python> pytest
========================================================================================================= test session starts =========================================================================================================
platform win32 -- Python 3.9.5, pytest-8.2.0, pluggy-1.5.0
rootdir: K:\Prj_EDU\Sw_Proj\Aubio_python
collected 0 items / 29 errors                                                                                                                                                                                                          

=============================================================================================================== ERRORS ================================================================================================================ 
_____________________________________________________________________________________________ ERROR collecting python/tests/test_aubio.py _____________________________________________________________________________________________ 
ImportError while importing test module 'K:\Prj_EDU\Sw_Proj\Aubio_python\python\tests\test_aubio.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
D:\Programs\Python\Python39\lib\importlib\__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
python\tests\test_aubio.py:3: in <module>
    from numpy.testing import TestCase
E   ModuleNotFoundError: No module named 'numpy'
 

___________________________________________________________________________________________ ERROR collecting python/tests/test_aubio_cut.py ___________________________________________________________________________________________ 
ImportError while importing test module 'K:\Prj_EDU\Sw_Proj\Aubio_python\python\tests\test_aubio_cut.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
D:\Programs\Python\Python39\lib\importlib\__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
python\tests\test_aubio_cut.py:3: in <module>
    import aubio.cut
E   ModuleNotFoundError: No module named 'aubio'
 

【案】大部分报了aubio,和 numpy的包的错误 ,正确安装即可

3  pip install aubio问题:

3.1 pip install aubio报错:

 解决办法,

(.venv) PS K:\Prj_EDU\Sw_Proj\Aubio_python> .\setup.py clean

4 本地编译器版本太低:

      Running "pkg-config --libs --cflags samplerate" failed: FileNotFoundError(2, '系统找不到指定的文件。', None, 2, None)
      Info: libaubio was not installed or built locally with waf, adding src/
      error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for aubio
  Running setup.py clean for aubio
Failed to build aubio
ERROR: Could not build wheels for aubio, which is required to install pyproject.toml-based projects
 

 


参考:

 1 安装aubio:

Installing aubio — aubio 0.4.9 documentation

@python

Installing aubio for Python — aubio 0.4.9 documentation

2 下载aubio

https://aubio.org/download

3 Python的包安装管理手册: PyPA的基本使用:

PYPI下的aubio项目地址:

aubio · PyPI

Installing Packages - Python Packaging User Guide

4 aubio 开源仓库:

https://github.com/aubio/aubio

@python

aubio/python at master · aubio/aubio · GitHub

各个版本列表:

Index of /pub

aubio

=====

aubio is a collection of tools for music and audio analysis.

This package integrates the aubio library with [NumPy] to provide a set of

efficient tools to process and analyse audio signals, including:

- read audio from any media file, including videos and remote streams

- high quality phase vocoder, spectral filterbanks, and linear filters

- Mel-Frequency Cepstrum Coefficients and standard spectral descriptors

- detection of note attacks (onset)

- pitch tracking (fundamental frequency estimation)

- beat detection and tempo tracking

aubio works with both Python 2 and Python 3.

Links

-----

- [module documentation][doc_python]

- [installation instructions][doc_python_install]

- [aubio manual][manual]

- [aubio homepage][homepage]

- [issue tracker][bugtracker]

Demos

-----

Some examples are available in the [`python/demos` folder][demos_dir]. Each

script is a command line program which accepts one ore more argument.

**Notes**: installing additional modules is required to run some of the demos.

### Analysis

- `demo_source.py` uses aubio to read audio samples from media files

- `demo_onset_plot.py` detects attacks in a sound file and plots the results

  using [matplotlib]

- `demo_pitch.py` looks for fundamental frequency in a sound file and plots the

  results using [matplotlib]

- `demo_spectrogram.py`, `demo_specdesc.py`, `demo_mfcc.py` for spectral

  analysis.

### Real-time

- `demo_pyaudio.py` and `demo_tapthebeat.py` use [pyaudio]

- `demo_pysoundcard_play.py`, `demo_pysoundcard.py` use [PySoundCard]

- `demo_alsa.py` uses [pyalsaaudio]

### Others

- `demo_timestretch.py` can change the duration of an input file and write the

  new sound to disk,

- `demo_wav2midi.py` detects the notes in a file and uses [mido] to write the

  results into a MIDI file

### Example

Use `demo_timestretch_online.py` to slow down `loop.wav`, write the results in

`stretched_loop.wav`:

    $ python demo_timestretch_online.py loop.wav stretched_loop.wav 0.92

Built with

----------

The core of aubio is written in C for portability and speed. In addition to

[NumPy], aubio can be optionally built to use one or more of the following

libraries:

- media file reading:

    - [ffmpeg] / [avcodec] to decode and read audio from almost any format,

    - [libsndfile] to read audio from uncompressed sound files,

    - [libsamplerate] to re-sample audio signals,

    - [CoreAudio] to read all media formats supported by macOS, iOS, and tvOS.

- hardware acceleration:

    - [Atlas] and [Blas], for accelerated vector and matrix computations,

    - [fftw3], to compute fast Fourier Transforms of any size,

    - [Accelerate] for accelerated FFT and matrix computations (macOS/iOS),

    - [Intel IPP], accelerated vector computation and FFT implementation.

[ffmpeg]: https://ffmpeg.org

[avcodec]: https://libav.org

[libsndfile]: http://www.mega-nerd.com/libsndfile/

[libsamplerate]: http://www.mega-nerd.com/SRC/

[CoreAudio]: https://developer.apple.com/reference/coreaudio

[Atlas]: http://math-atlas.sourceforge.net/

[Blas]: https://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms

[fftw3]: http://fftw.org

[Accelerate]: https://developer.apple.com/reference/accelerate

[Intel IPP]: https://software.intel.com/en-us/intel-ipp

[demos_dir]:https://github.com/aubio/aubio/tree/master/python/demos

[pyaudio]:https://people.csail.mit.edu/hubert/pyaudio/

[PySoundCard]:https://github.com/bastibe/PySoundCard

[pyalsaaudio]:https://larsimmisch.github.io/pyalsaaudio/

[mido]:https://mido.readthedocs.io

[manual]: https://aubio.org/manual/latest/

[doc_python]: https://aubio.org/manual/latest/python.html

[doc_python_install]: https://aubio.org/manual/latest/python_module.html

[homepage]: https://aubio.org

[NumPy]: https://www.numpy.org

[bugtracker]: https://github.com/aubio/aubio/issues

[matplotlib]:https://matplotlib.org/

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/609180.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

java 文件表创建及前后端使用

表结构task_file 前端具体到业务表单 <el-form-item label"任务附件" prop"taskAttachment"><el-upload ref"upload" accept".jpg, .png, .txt, .xlsx, .doc, .docx, .xls, .pdf, .zip, .rar":action"upload.url" …

C语言例题39、输入一个正整数,将其反方向逆序输出

#include <stdio.h>void main() {int x;int ge; //个位int result 0;printf("请输入一个正整数&#xff1a;");scanf("%d", &x);while (x > 0) {//解题原理ge x % 10;//每次分解取得个位的数字result result * 10 ge;//个十百千万顺序向左…

限购仅剩6地,透过房价地图看楼市行情!

同一天&#xff0c;两地取消限购&#xff01; 5月9日&#xff0c;继杭州取消限购之后&#xff0c;西安也宣布全面取消住房限购&#xff01; 现在&#xff0c;我们透过几幅楼市数据的分布地图&#xff0c;来看看5月的楼市行情&#xff01; 楼市限购&#xff0c;仅剩6地&#…

YOLOv9改进策略 :一种新颖的通用倒瓶颈(UIB)搜索块助力检测| 轻量化之王MobileNetV4

💡💡💡创新点:轻量化之王MobileNetV4 开源 | Top-1 精度 87%,手机推理速度 3.8ms,原地起飞! 最主要创新:引入了通用倒瓶颈(UIB)搜索块,这是一个统一且灵活的结构,它融合了倒瓶颈(IB)、ConvNext、前馈网络(FFN)以及一种新颖的额外深度可分(ExtraDW)变体技…

【iOS】事件传递与响应机制

文章目录 前言事件UIEvent一、事件传递遍历顺序 二、手势识别三、响应机制UIResponder&#xff08;响应者&#xff09;响应者链 四、相关应用扩大button点击范围穿透事件 总结 前言 提到响应者链与事件传递&#xff0c;如果看过其他人的博客&#xff0c;经常能看到这经典的三张…

《探索信息技术中心一体化系统架构:提升企业数字化转型的效率与能力》

在当今数字化时代&#xff0c;信息技术中心&#xff08;IT Center&#xff09;扮演着至关重要的角色&#xff0c;它不仅是企业的技术支撑&#xff0c;更是推动数字化转型的引擎。为了更好地应对日益复杂的业务需求和技术挑战&#xff0c;许多企业开始探索一体化系统架构&#x…

引用数据类型 栈内存 堆内存

let m { a: 10, b: 20 }; let n m; n.a 15; console.log(m.a) // 15 原因&#xff1a;基本数据类型存储在栈内存中&#xff0c;引用数据类型存储在堆内存中 &#xff0c;引用数据类型存储在堆内存中会在栈内存中创建一个指针&#xff0c;栈内存中的这个指针指向堆内存中的地…

英语学习笔记9——How are you today?

How are you today? 你好吗&#xff1f; 词汇 Vocabulary well adj. 好的 n. 井 fine adj. 美好的 两个方面&#xff1a;天气、身体。 搭配&#xff1a;a fine day 晴朗的一天    It’s a fine day today. 今天很晴朗。 good adj. 好的 口语偏多 搭配&#xff1a;Good jo…

基于光纤技术的新能源汽车电池安全监测--FOM²系统

为什么要进行动力电池包的温度监测&#xff1f; 新能源电动汽车的动力电池包的工作温度&#xff0c;不仅会影响电池包性能&#xff0c;而且直接关系到车辆安全。时有发生的新能源汽车电池包起火事件&#xff0c;对电池包、冷却系统以及电池管理系统&#xff08;BMS&#xff09…

初阶C语言(8) - 实用的调试技巧

1. 什么是bug? bug 是计算机领域专业术语&#xff0c;是计算机在硬件、软件、协议和系统安全策略上存在的缺陷&#xff0c;攻击者能够在未授权情况下访问的危害&#xff0c;世界最早的一批程序设计师之一&#xff0c;美国的葛丽丝霍波在调试设备时出现故障&#xff0c;拆开继电…

Java基础教程 - 6 方法

更好的阅读体验&#xff1a;点这里 &#xff08; www.doubibiji.com &#xff09; 更好的阅读体验&#xff1a;点这里 &#xff08; www.doubibiji.com &#xff09; 更好的阅读体验&#xff1a;点这里 &#xff08; www.doubibiji.com &#xff09; 6 方法 方法也可以称之为…

算法day03

第一题 179. 查找总价格为目标值的两个商品 本题采用前后指针和单调性规律可解&#xff1b; 解题思路如下&#xff1a; 1、设置前后指针 2、前后指针所指的两数之和大于目标数&#xff0c;右指针左移&#xff1b; 前后指针所指的两数之和小于目标数&#xff0c;左指针右移&…

软件工程复习之软件定义时期

1.什么是软件&#xff1f; 答&#xff1a;软件是程序&#xff0c;数据和文档的集合。 程序是完成指定功能的计算机可执行的指令序列。 数据是程序进行信息处理的数据结构。 文档是开发&#xff0c;使用&#xff0c;维护的图文资料。 2.软件有何特点&#xff1f; 答&#…

2024年小沙弥小视频,轻松吸引中老年观众,上手简单,轻松月入了万

利用人工智能工具制作小沙弥主题的抖音内容&#xff0c;已成为网络赚钱的新途径。这个项目主要吸引中老年人群体&#xff0c;尤其是对智慧和人生哲理感兴趣的观众。小沙弥以其温馨且启发性的内容&#xff0c;引起中老年用户的共鸣&#xff0c;为他们提供心灵慰藉。 项 目 地 …

上传自己的项目到PyPI

准备工作 已注册pypi账号pypi账号已经配置了双重验证pypi账号的token令牌&#xff08;最后上传到pypi需要这个&#xff09;pip install twine&#xff08;上传需要用到的工具&#xff09; 操作步骤 1、准备好工程2、编写setup.py3、开始上传 大功告成 在pypi查看自己包的…

Linux—— 任务规划、SELinux、ACL、磁盘介绍

任务规划&#xff1a; 未来任务的一次性调度 atatqatrm服务&#xff1a; atd周期性任务的调度 crontab 所有用户的任务列表都以文件的形式存在于系统 /var/spool/cron/用户名-l -e-u-r时间 需要执行的任务服务&#xff1a; crond系统维护任务&#xff1a; yum软件仓库缓存的…

MySQL数据库基础(数据库操作,常用数据类型,表的操作)

MySQL数据库基础&#xff08;数据库操作&#xff0c;常用数据类型&#xff0c;表的操作&#xff09; 前言 数据库的操作1.显示当前数据库2.创建数据库3.使用数据库4.删除数据库 常用数据类型1.数值类型2.字符串类型3.日期类型 表的操作1.查看表结构2.创建表3.删除表 总结 前言 …

5. 分布式链路追踪TracingFilter改造增强设计

前言 在4. 分布式链路追踪客户端工具包Starter设计一文中&#xff0c;我们实现了基础的Starter包&#xff0c;里面提供了我们自己定义的Servlet过滤器和RestTemplate拦截器&#xff0c;其中Servlet过滤器叫做HoneyTracingFilter&#xff0c;仅提供了提取SpanContext&#xff0…

等保测评技术方案

等保&#xff0c;即“网络安全等级保护”&#xff0c;是中国实施的一项信息安全保护制度&#xff0c;旨在对不同重要性的信息和信息系统实行分等级保护&#xff0c;保障国家安全、社会秩序以及公共利益。等保技术方案是指为了达到国家网络安全等级保护标准要求&#xff0c;针对…

Linux的并发与竞争

文章目录 一、并发二、竞争三、保护内容是什么四、解决并发与竞争的几种常用方法1.原子操作原子整型API函数原子位操作 API 函数 2.自旋锁自旋锁格式如下&#xff1a;自旋锁 API 函数自旋锁的使用注意事项 3.信号量信号量 API 函数信号量格式如下&#xff1a; 4.互斥体API函数如…