CentOS7最新パッケージにアップデート yum -y updateリブート rebootユーザー useradd passwd グループに追加 usermod -G ,
モブがわかないようにする /gamerule doMobSpawning false モブ、ドロップアイテム等を消す チビスライムやスライムボールも消すには何回か行う /kill @e[type=!Player]
>>> import numpy as np 1次元配列 x >>> x = np.array([1, 2, 3]) >>> x array([1, 2, 3]) >>> x.T # 縦ベクトル横ベクトルの区別はない array([1, 2, 3]) スカラー倍 ベクトルの和 各要素にスカラーを加える >>> 2 * x + [10, 20, 30] + 100 array([112, 1…
>>> import numpy as np # ベクトル >>> x = np.matrix([1, 0, 0]) >>> x # 横ベクトル matrix([[1, 0, 0]]) >>> x.T # 縦ベクトル matrix([[1], [0], [0]]) >>> 2 * x + [0, 3, 4] + 10 # スカラー倍とベクトルの和、各要素にスカラーを加える matrix([[12,…
目標と成果 右command 空打ちで日本語入力ON →成功 左command 空打ちで日本語入力OFF →成功 command キーはctrlキーとしても機能する →失敗 左ctrlキーを superキーに割り当てる →未実施 しかし下記の設定してもあまりうまくいっていない というか成功した2…
コマンドラインを使わずに .deb ファイルをダブルクリックしてインストールするのが良さそう
slackware.jp www.ketsuago.com 5.4. Xorg の設定
with 文が使える関数をつくる yield 式のところで with ブロックの内容が実行される #with_openthebook.py from contextlib import contextmanager class Book(): def __init__(self): self.contents = '' self.isopen = False def open(self): self.isopen …
jupyter qtconsole をフォント指定して起動 jupyter qtconsole --ConsoleWidget.font_family="MyricaM M" --ConsoleWidget.font_size=12
対話的デバッガ デバッグしたい部分に次の一文を挿入 import pdb; pdb.set_trace() (Pdb) プロンプトのコマンド(の例) プログラムを調べるコマンド w(here) スタックトレースを表示、矢印は現在のフレームを表す u(p) スコープを関数の呼び出し元に移す (o…
unittest を使う # utils.py def to_hex(integer, length, byteorder, *, signed=False): b = integer.to_bytes(length, byteorder, signed=signed) lst = ['{:02X}'.format(x) for x in b] return ''.join(lst) # test_to_hex.py from unittest import Test…
(signed) int → bytes int.to_bytes を使う >>> (-100).to_bytes(1, byteorder='little', signed=True) b'\x9c' >>> (-1000).to_bytes(2, 'little', signed=True) b'\x18\xfc' >>> (-1000).to_bytes(2, 'big', signed=True) b'\xfc\x18' struct.pack を使う …
str.format を使う >>> '{:08b}'.format(-100 & 0xff) '10011100' >>> '{:02X}'.format(-100 & 0xFF) '9C' >>> '{:02X}'.format(-1000 & 0xFFFF) 'FC18' int.to_bytes を使う >>> b = (-100).to_bytes(1, byteorder='little', signed=True) >>> b b'\x9c' >>…
oyamazemi.wiki.fc2.com
stackoverflow.com import pandas from openpyxl import load_workbookbook = load_workbook('Masterfile.xlsx') writer = pandas.ExcelWriter('Masterfile.xlsx', engine='openpyxl') writer.book = book writer.sheets = dict((ws.title, ws) for ws in bo…
アップデート conda update conda conda update anaconda conda update --all 仮想環境 conda create -n py34 python=3.4 anaconda # -n name
zetcode.com
[tex:-\frac{\hbar^2}{2m}\nabla^2\psi+V(x,y,z)\psi =i\hbar\frac{\partial\psi}{\partial t}]
Python3.4 仮想環境 仮想環境の生成: $ pyvenv /path/to/new/virtual/environment 仮想環境 ON: $ source <venv>/bin/activate 仮想環境 OFF: $ deactivatepip をインストール $sudo apt-get install python-pipPython パッケージをインストール(仮想環境で) $pip </venv>…
Raspberry Pi wi-fi ステルスのとき /etc/wpa_supplicant/wpa_supplicant.conf network{} 内に scan_ssid=1 と記入
てすと テスト スーパーpre記法(シンタックス・ハイライト)のテスト for i in range(100): print('スーパーpre記法(シンタックス・ハイライト)')
# editor ## Atom