PowerShell使用方法メモ

PowerShell使用方法メモ

とりあえず3つ

  • Get-Help
  • Get-Command
  • Get-Menbers

入力補完・ヘルプ

入力補完

  • tabキーで入力候補の表示
  • Ctrl+Spaceで補完候補の一覧

ヘルプ

  • Get-Helpに続けて対象のCmdletを引数に入力

Alias

使用例

空ファイルを作成

# 空ファイルを作成
"" > item.txt
# Cmdletを利用
New-Item -Path item.txt

Outlook - Tips

Outlook tips

検索方法

参考

  • ショートカット - 検索ボックス: Ctrl + E
  • 高度な検索: "検索" > "検索ツール" > "高度な検索"
    • ショートカット: Ctrl + Shift + F

References

Outlookの様々なメール検索方法|Office Hack

R - へルプ入手

Rのヘルプ入手

help()関数

help(log)
?(log)

help.serch()関数

関数の名前を覚えていない時に使う。

help.serch("cross tabulate")
??"cross_tabulate"

example()

ヘルプファイルに含まれる全てのサンプルを実行できる機能。

# 例:logのサンプルを実行
example(log)

References

ソフトウェア関連, 「技術文書の書き方」

技術文書の書き方

リンク

よく書かれる文書の種類

README.md
Design Docs

設計文書

最低限書かれること。 - 解決したい課題とその背景 - 実装することになる予定の機能 - 実装方針

参考:googleでのDesignDocsの書き方

Specifications / API docs

仕様書。利用者にとって必要。自動生成できるツールがあるのが普通。

User guide

プログラムのマニュアル。網羅性よりは利用者が使うであろう機能を中心に実行例をわかりやすく書くことが大事。

Random memo

開発者のメモ。処理が複雑になった時など、他の人や未来の自分が理解しやすい形で解説する。このようなメモ類も大事な技術文書。

Architectual Decision Records (ADR)

なぜ、なにを、どう書くか

  • ソフトウェアの修正にともなって文書類をメンテナンスすることが大事。
  • 部や表は理解を促すのに大変重要。ツールも揃ってきているので慣れるのが大事とのこと。

ツール

References

技術文書の書き方 · GitHub

windows - PC起動時に開くファイルの設定

Windows でPC起動時に開くファイルを設定する。

  1. 対象ファイルのショートカットを作成する。
  2. "スタート">"ファイルを指定して実行" (ショートカット: "winキー" + "R")
  3. "名前"ボックスにshell:startupと入力してOK
  4. "スタートアップ"のフォルダが開くので1.で作成したショートカットをここに移動する。 (アプリの場合はアプリのアイコンをここに入れれば良い)

References

PC起動時に自動で好きなファイルが開く裏技-Windows10 | リリアのパソコン学習記

PCを立ち上げるのと同時にOutlookを自動的に起動させる方法|はじめてのOutlookコラム|NECフィールディング

Matplotlib - GridSpecを使ってグラフを並べる

GridSpecの使い方

GridSpec demo

複数のグラフを並べる。グラフの大きさを変更できるので、大小のグラフを並べるのに便利。

import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec


def annotate_axes(fig):
    for i, ax in enumerate(fig.axes):
        ax.text(0.5, 0.5, "ax%d" % (i+1), va="center", ha="center")
        ax.tick_params(labelbottom=False, labelleft=False)


fig = plt.figure()
fig.suptitle("Controlling subplot sizes with width_ratios and height_ratios")

gs = GridSpec(2, 2, width_ratios=[1, 2], height_ratios=[4, 1])
ax1 = fig.add_subplot(gs[0])
ax2 = fig.add_subplot(gs[1])
ax3 = fig.add_subplot(gs[2])
ax4 = fig.add_subplot(gs[3])

annotate_axes(fig)

subplot2grid demo

import matplotlib.pyplot as plt


def annotate_axes(fig):
    for i, ax in enumerate(fig.axes):
        ax.text(0.5, 0.5, "ax%d" % (i+1), va="center", ha="center")
        ax.tick_params(labelbottom=False, labelleft=False)


fig = plt.figure()
ax1 = plt.subplot2grid((3, 3), (0, 0), colspan=3)
ax2 = plt.subplot2grid((3, 3), (1, 0), colspan=2)
ax3 = plt.subplot2grid((3, 3), (1, 2), rowspan=2)
ax4 = plt.subplot2grid((3, 3), (2, 0))
ax5 = plt.subplot2grid((3, 3), (2, 1))

annotate_axes(fig)

plt.show()

References

GridSpec demo — Matplotlib 3.6.0 documentation

subplot2grid demo — Matplotlib 3.6.0 documentation