convert INPUT.png -density 72 -units PixelsPerInch OUTPUT.png
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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' | |
| sound = AudioSegment.from_file(path, format='m4a') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [net] | |
| # Testing | |
| # batch=1 | |
| # subdivisions=1 | |
| # Training | |
| batch=24 | |
| subdivisions=12 | |
| width=608 | |
| height=608 | |
| channels=3 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| https://stackoverflow.com/questions/34348669/mapping-a-texture-onto-a-quad-with-opengl-4-python-and-vertex-shaders | |
| Open a window that displays a quad with an image on it. | |
| """ | |
| from OpenGL.GL import * | |
| from OpenGL.GLU import * | |
| from OpenGL.GLUT import * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| vertex_shader = glCreateShader(GL_VERTEX_SHADER) | |
| glShaderSource(vertex_shader, vertex_shader_text) | |
| glCompileShader(vertex_shader) | |
| if not glGetShaderiv(vertex_shader, GL_COMPILE_STATUS): | |
| print('Vertex shader is not OK') | |
| print(glGetShaderInfoLog(vertex_shader)) | |
| sys.exit(1) | |
| else: | |
| print('Vertex shader is OK') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from OpenGL.GL import * | |
| import glfw | |
| import numpy as np | |
| glfw.init() | |
| window = glfw.create_window(640, 480, 'My Window', None, None) | |
| glfw.make_context_current(window) | |
| # These parameters need to be changed according to your environment. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set shiftwidth=4 | |
| set tabstop=4 | |
| set expandtab | |
| "set number | |
| set cursorline | |
| set smartindent | |
| set laststatus=2 | |
| syntax enable | |
| set hlsearch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://qiita.com/waka424/items/bc77b6e8bd4f25760e58 | |
| export BASH_SILENCE_DEPRECATION_WARNING=1 | |
| # https://qiita.com/lemtosh469/items/81919186611ac68b11c8 | |
| # default:cyan / root:red | |
| if [ $UID -eq 0 ]; then | |
| PS1="\[\033[31m\]\u@\h\[\033[00m\]:\[\033[01m\]\w\[\033[00m\]\\$ " | |
| else | |
| PS1="\[\033[36m\]\u@\h\[\033[00m\]:\[\033[01m\]\w\[\033[00m\]\\$ " | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from django.db import connection | |
| import schedule | |
| def do_keep_alive(): | |
| print('Sending keep alive query to DB.') | |
| with connection.cursor() as cur: | |
| cur.execute('SELECT 0') # dummy query to keep mysql connection alive | |
| schedule.every(30).minutes.do(do_keep_alive) |