OpenCV FullScreen Window

Python - PythonのOpenCVでフルスクリーン表示|teratail import cv2 cv2.namedWindow('screen', cv2.WINDOW_NORMAL) cv2.setProperty('screen', cv2.WND_PROP_FULLSCREEN, cv2.WINDOW_FULLSCREEN) This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. python-opencvでQt plugin “cocoa"が見つからないというエラー - Qiita 黒画面 import cv2 import numpy as np # Change here WIDTH = 1920 HEIGHT = 1080 # For secondary monitor, LEFT = 0 TOP = 0 screen = np.zeros((HEIGHT, WIDTH), dtype=np.uint8) cv2.namedWindow('screen', cv2.WINDOW_NORMAL) cv2.moveWindow('screen', LEFT, TOP) cv2.setWindowProperty('screen', cv2.WND_PROP_FULLSCREEN, cv2.WINDOW_FULLSCREEN) cv2.imshow('screen', screen) cv2.waitKey(0) For dynamic image size, ...

2020年3月20日 · aoirint

Remote editing with Atom (rmate, sshfs)

rmate AtomでSSH越しのファイルを編集する - Qiita Install rmate in remote. Install remote-atom as Atom package in local. Configure “remote forwarding” of rmate port in local (local:port -> remote:port). Open Atom in local. Execute rmate file.txt in remote (ssh). Atom in local will show the file, and you can edit it. rmate cannot be used for Atom Tree View (Project View). But tree command in ssh is useful for viewing project file entries. ...

2020年3月19日 · aoirint

PortAudio, pyaudio

PortAudio: PortAudio API Overview Host API ALSA (Ubuntu) Core Audio (Mac) Device Speaker Mic Stream sample rate (num of samples per second) sample format (num of bytes of a sample, integer or float) PyAudio Documentation — PyAudio 0.2.11 documentation Audio device detection w/ pyaudio brew install portaudio pip3 install pyaudio macOSにpyaudioをインストールする - Qiita Check Host APIs import pyaudio pa = pyaudio.PyAudio() api_count = pa.get_host_api_count() print('Host API:', api_count) for i in range(api_count): api_info = pa.get_host_api_info_by_index(i) print(api_info) device_count = api_info['deviceCount'] for j in range(device_count): device_info = pa.get_device_info_by_host_api_device_index(i, j) print(device_info) pa.terminate() Host API: 1 {'index': 0, 'structVersion': 1, 'type': 5, 'name': 'Core Audio', 'deviceCount': 2, 'defaultInputDevice': 0, 'defaultOutputDevice': 1} {'index': 0, 'structVersion': 2, 'name': 'Built-in Microphone', 'hostApi': 0, 'maxInputChannels': 2, 'maxOutputChannels': 0, 'defaultLowInputLatency': 0.0029478458049886623, 'defaultLowOutputLatency': 0.01, 'defaultHighInputLatency': 0.01310657596371882, 'defaultHighOutputLatency': 0.1, 'defaultSampleRate': 44100.0} {'index': 1, 'structVersion': 2, 'name': 'Built-in Output', 'hostApi': 0, 'maxInputChannels': 0, 'maxOutputChannels': 2, 'defaultLowInputLatency': 0.01, 'defaultLowOutputLatency': 0.007800453514739229, 'defaultHighInputLatency': 0.1, 'defaultHighOutputLatency': 0.017959183673469388, 'defaultSampleRate': 44100.0} Check Devices import pyaudio pa = pyaudio.PyAudio() device_count = pa.get_device_count() print('Device:', device_count) for i in range(device_count): device_info = pa.get_device_info_by_index(i) print(device_info) pa.terminate() Device: 2 {'index': 0, 'structVersion': 2, 'name': 'Built-in Microphone', 'hostApi': 0, 'maxInputChannels': 2, 'maxOutputChannels': 0, 'defaultLowInputLatency': 0.0029478458049886623, 'defaultLowOutputLatency': 0.01, 'defaultHighInputLatency': 0.01310657596371882, 'defaultHighOutputLatency': 0.1, 'defaultSampleRate': 44100.0} {'index': 1, 'structVersion': 2, 'name': 'Built-in Output', 'hostApi': 0, 'maxInputChannels': 0, 'maxOutputChannels': 2, 'defaultLowInputLatency': 0.01, 'defaultLowOutputLatency': 0.007800453514739229, 'defaultHighInputLatency': 0.1, 'defaultHighOutputLatency': 0.017959183673469388, 'defaultSampleRate': 44100.0} Stream ※ waveだけ鳴らせればいい場合はwaveモジュールを使ってください(参照) ...

2020年3月19日 · aoirint

systemd service

テンプレート(一般ユーザ権限、bashrc使用) [Unit] Description=My Service [Service] Type=simple User=user Group=user Restart=always WorkingDirectory=WORKING_DIR ExecStart=/bin/bash -c "COMMAND" [Install] WantedBy=multi-user.target sudo ln -s my_service.service /etc/systemd/system/ sudo systemctl enable my_service sudo systemctl restart my_service # After you edit service file sudo systemctl daemon-reload # Check log sudo systemctl status my_service If you are using python, maybe you need to set environment PYTHONUNBUFFERED=1 to see log. # In [Service] Section Environment="PYTHONUNBUFFERED=1" Environment="KEY=VALUE" Systemdを使ってさくっと自作コマンドをサービス化してみる - Qiita systemd サービスユニット覚書 - Qiita Systemd メモ書き - Qiita Systemd Unit File チートシート - Qiita

2020年3月19日 · aoirint

Ubuntu, TigerVNC

Setup VNC via ssh on Ubuntu Desktop. Install TigerVNC. # Ubuntu 18.04 sudo apt install tigervnc-scraping-server # Ubuntu 16.04 sudo apt install tigervncserver Set password. vncpasswd startVNC.sh #!/bin/bash x0tigervncserver PasswordFile=~/.vnc/passwd Display=:0 configure LocalForward LOCALPORT localhost:5900 in ~/.ssh/config. TigerVNCのクライアントはあんまり機能が多くない RealVNC社のクライアントはWindows, Linux, Mac, Mobileにリリースされてて便利 https://www.realvnc.com/en/connect/download/viewer/ つまずかない!?TigerVNCでリモートデスクトップ - Qiita

2020年3月18日 · aoirint

tar 圧縮

解凍tar -xfはよく使うので覚えるけど、圧縮のほうが覚えられん.. [Linux]ファイルの圧縮、解凍方法 - Qiita tar.gz tar -zcf compressed.tar.gz FILES extractとcompressかな おまけ zip zip -r compressed.zip DIR unzip compressed.zip

2020年3月17日 · aoirint

Flask, sqlalchemy

Flask ウェブアプリケーションフレームワーク Flask を使ってみる - Qiita Flaskで任意のデータを引数として受け取る方法 - Qiita python - redirect while passing arguments - Stack Overflow #url_for API — Flask 0.10.1 documentation python - How to serve static files in Flask - Stack Overflow python - Unable to retrieve files from send_from_directory() in flask - Stack Overflow python - Flaskで変数を文字列ではなくHTMLのタグとして読み込ませたい - スタック・オーバーフロー sqlalchemy 【PythonのORM】SQLAlchemyで基本的なSQLクエリまとめ - Qiita Object Relational Tutorial — SQLAlchemy 1.3 Documentation Python: SQLAlchemy + mysqlclient (MySQLdb) でマルチバイト文字を扱う - CUBE SUGAR CONTAINER Transactions and Connection Management — SQLAlchemy 1.3 Documentation Object Relational Tutorial — SQLAlchemy 1.3 Documentation SQLAlchemy で Delete するには? - Qiita Basic Relationship Patterns — SQLAlchemy 1.3 Documentation python - How to remove all items from many-to-many collection in SqlAlchemy? - Stack Overflow python - Flask-SQLAlchemy - model has no attribute ‘foreign_keys’ - Stack Overflow python - sqlalchemy dynamic filtering - Stack Overflow tagify Tagify - demo python-markdown Library Reference — Python-Markdown 3.2.1 documentation Extensions — Python-Markdown 3.2.1 documentation MathJax Getting Started — MathJax 2.7 documentation Combined Configurations — MathJax 2.7 documentation highlight.js How to use highlight.js highlight.js demo highlight.js/src/styles at master · highlightjs/highlight.js highlightjs-line-numbers.js - cdnjs.com - The best FOSS CDN for web related libraries to speed up your websites! wcoder/highlightjs-line-numbers.js: Line numbering plugin for Highlight.js Ace Editor Ace - The High Performance Code Editor for the Web ace/lib/ace/theme at master · ajaxorg/ace javascript - How do I get value from ACE editor? - Stack Overflow Unique/Random ID [Python] UUIDを生成するuuid.uuid4()はどうやってUUIDを生成しているのか? | Developers.IO #os.urandom os — 雑多なオペレーティングシステムインタフェース — Python 3.8.2 ドキュメント os.urandom(NUM_BYTES).hex()

2020年3月16日 · aoirint

Python Dockerfile

FROM python:3 RUN mkdir /code WORKDIR /code COPY requirements.txt /code/ RUN pip install -r requirements.txt

2020年3月16日 · aoirint

Install Docker on Ubuntu

Get Docker Engine - Community for Ubuntu | Docker Documentation

2020年3月16日 · aoirint

Ubuntu, add user to group

usermod -aG GROUP USER adduser USER GROUP https://qiita.com/orangain/items/056db6ffc16d765a8187

2020年3月15日 · aoirint