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

OGP / Open Graph Protocol, favicon

<meta property="og:locale" content="ja_JP"> <meta property="og:type" content="website"> <meta property="og:title" content="TITLE"> <meta property="og:description" content="DESCRIPTION"> <meta property="og:image" content="IMAGE_FULL_URL"> Card Validator | Twitter Developers https://qiita.com/kana-t/items/f058f29ddd93e062761c https://qiita.com/kogache/items/9e49c94758be8c1c4d77 <link rel="shortcut icon" href="FAVICON_URL"> https://qiita.com/uraranbon/items/a143d215b7baa3e9d1a0

2020年3月15日 · aoirint

github.io

URL:USERNAME.github.io リポジトリ:USERNAME.github.io ブランチ:master 通常のGitHub Pagesと違ってmasterブランチが使われる https://qiita.com/ryokosuge/items/f929821ba5ae9ba2c32b

2020年3月15日 · aoirint

git, markdown python

Git https://qiita.com/TakesxiSximada/items/ea778bb98b8c057ffd07 https://gitpython.readthedocs.io/en/stable/tutorial.html Markdown convert https://python-markdown.github.io/ https://qiita.com/masakuni-ito/items/593b9d753c44da61937b

2020年3月15日 · aoirint

pydub numpy

from pydub import * import numpy as np import time # https://own-search-and-study.xyz/2017/11/19/numpy%E3%81%AEarray%E3%81%8B%E3%82%89pydub%E3%81%AEaudiosegment%E3%82%92%E4%BD%9C%E6%88%90%E3%81%99%E3%82%8B/ # https://maoudamashii.jokersounds.com/archives/song_kouichi_the_milky_way.html path = 'song_kouichi_the_milky_way.m4a' # https://github.com/jiaaro/pydub/blob/master/API.markdown#audiosegmentfrom_file sound = AudioSegment.from_file(path, format='m4a') # give format explicitly samples = np.array(sound.get_array_of_samples()) print(path) print('Sample width (Num of bytes of a sample):', sound.sample_width) print('Frame rate (Num of samples per second):', sound.frame_rate) print('Channels (Stereo/Mono):', sound.channels) print('Shape (Length):', samples.shape) print('Type:', samples.dtype) print('Min/Max:', samples.min(), samples.max()) output = AudioSegment( samples.astype('int32').tobytes(), sample_width=4, frame_rate=44100, channels=2, ) ts = time.time() output.export('output.m4a') elapsed = time.time() - ts print('Exported as m4a: %f s' % elapsed) ts = time.time() output.export('output.mp3') elapsed = time.time() - ts print('Exported as mp3: %f s' % elapsed) ts = time.time() output.export('output.wav') elapsed = time.time() - ts print('Exported as wav: %f s' % elapsed) song_kouichi_the_milky_way.m4a Sample width (Num of bytes of a sample): 2 Frame rate (Num of samples per second): 44100 Channels (Stereo/Mono): 2 Shape (Length): (22339584,) Type: int16 Min/Max: -32768 32767 Exported as m4a: 6.288757 s Exported as mp3: 6.194534 s Exported as wav: 6.064215 s 出力時間はフォーマットによって変わらない(誤差の範囲)

2020年3月14日 · aoirint

Jetson Nano セットアップとおためし

メモ。 TPLink Wireless Driver 開発ボードにはWi-Fiモジュールが乗ってないので、USBドングルで無線LANにつなぐ(セットアップは有線で)。 TPLink Archer T2U Nanoを使う。 tp-link Archer T2U Nano AC600をLinuxで使う方法 | Shizuka’s Style (Duo) Jetson Nano で TP-LINK Archer T2U Nano を使う - Qiita https://devtalk.nvidia.com/default/topic/1051503/jetson-nano/make-usb-wifi-dongle-rtl8812au-works-on-nano/ NVIDIA Developer Forumsのつい最近(11/27)のポストで、新しいcommitで動かなくなっちゃったからCommit IDd277c36がいいよ、っていってる人がいる。でもT2U NanoのIDが登録されたのは2つ後の4235b0eなので、これを使ってみたけど、これで動いた(OSはr32.2.3)。この1つ後(現在masterの最新commit)のfa68771は接続が確立しなかった(パスワードの入力を何度でも求められる)。警告回避のためにリファクタリングしたらバグったっぽい(コミットコメント、プルリク)。 sudo apt install dkms git clone https://github.com/abperiasamy/rtl8812AU_8821AU_linux.git git checkout 4235b0ec7d7220a6364586d8e25b1e8cb99c36f1 Edit Makefile CONFIG_PLATFORM_I386_PC = n CONFIG_PLATFORM_ARM_JET_NANO = y sudo make -f Makefile.dkms install reboot ibus-mozc sudo apt install ibus-mozc killall ibus-daemon ibus-daemon -x & Python PyTorch使うならシステムのPython 3.6.9を使うのがよさそうだったので、そのまま ...

2019年12月2日 · aoirint

Raspberry Pi 3B+(Raspbian)でNextcloud(Docker)を動かす(MySQL)

※ Dockerは入ってるものとします。あとスワップ領域を用意しておいたほうがいいかな docker run --name ncdb --restart unless-stopped -v NEXTCLOUD_DIR/db:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=MY_ROOT_PASSWORD -e MYSQL_DATABASE=nextcloud -e MYSQL_USER=nextcloud -e MYSQL_PASSWORD=MY_PASSWORD hypriot/rpi-mysql --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci docker run --name ncapp --restart unless-stopped --link ncdb -p MY_PORT:80 -v NEXTCLOUD_DIR/www:/var/www/html -e MYSQL_DATABASE=nextcloud -e MYSQL_USER=nextcloud -e MYSQL_PASSWORD=MY_PASSWORD -e MYSQL_HOST=ncdb:3306 -e NEXTCLOUD_TRUSTED_DOMAINS="MY_DOMAIN" nextcloud NEXTCLOUD_DIR/www/config/config.php overwriteprotocol: 'https' overwritewebroot: '' overwrite.cli.url: 'https://MY_DOMAIN' この設定をしないとhttps環境ではクライアントからログイン(Grant access)できない(webrootはいらないかな)

2019年11月27日 · aoirint