Windows の PowerShellから、強制再起動
PS> Restart-Computer -Force
-Force
を指定することで、確認ダイアログなどを出さずに、容赦なく再起動。
Windows の PowerShellから、強制再起動
PS> Restart-Computer -Force
-Force
を指定することで、確認ダイアログなどを出さずに、容赦なく再起動。
Windows の PowerShellから、マルチスクリーンの解像度を取得する方法。
PS> Add-Type -AssemblyName System.Windows.Forms PS> [System.Windows.Forms.Screen]::AllScreens BitsPerPixel : 32 Bounds : {X=0,Y=0,Width=2560,Height=1440} DeviceName : \\.\DISPLAY1 Primary : True WorkingArea : {X=0,Y=0,Width=2560,Height=1400} BitsPerPixel : 32 Bounds : {X=2560,Y=0,Width=1344,Height=840} DeviceName : \\.\DISPLAY2 Primary : False WorkingArea : {X=2560,Y=0,Width=1344,Height=800}
Add-Type -AssemblyName System.Windows.Forms
で、PowerShell以外のAPIにアクセスできるようにして、WPFのライブラリを叩けるようにするのが肝。
Via! https://stackoverflow.com/questions/7967699/get-screen-resolution-using-wmi-powershell-in-windows-7
あとから、.gitignoreを設置したけど、一発で.gitignoreを全体に反映させる。
以下のコマンドで、.gitignoreから除外を反映させる
$ git rm --cached `git ls-files --full-name -i --exclude-from=.gitignore`
$ git status $ git commit -m 'Reflected .gitignore'
センサーの結線で必要だったので、新規に圧着チューブとヒートガンをAmazonで手に入れる。
(STRAIGHT/ストレート) 熱収縮チューブ セット ブラック 100ピース 35-311
φ1.5mm、φ2.5mm、φ4.0mm、φ6.0mm、φ10.0mm、φ13.0mmの6種類が一気にセットになっているので、ちまちまとφと合わせて買わなくて便利。
ヒートガン 1800W 強弱2段階切り替え可能 アタッチメント付き
ヒートガンは、ピンキリで出ていますが、ベストセラーになっていた程良い値段のものを。意外とサイズが大きいです。吹き出し口のアタッチメントが数種類付いていて、便利。
UniRxでTimer処理を行う方法
Observable.Interval(TimeSpan.FromMilliseconds(1000)).Subscribe(l => { //Something Do }).AddTo(this);
TimeSpan.FromMilliseconds(1000)で、ミリ秒で待ち時間を設定する。
c#で、時計表記などで、”1″を”01″などと2桁表示する方法
int num = 1; string str = num.ToString("00"); // 01となる
Edit Modeでも、GameObjectの状態を確認したり、パラメーターで生成/変化させるのに便利。
using UnityEngine; using System.Collections; [ExecuteInEditMode] public class ExampleClass : MonoBehaviour { void Update() { } }
https://docs.unity3d.com/jp/540/ScriptReference/ExecuteInEditMode.html
半径1の球体の中でランダムな位置を取得できる
transform.position = Random.insideUnitSphere
zip -r -e {zipファイル名} {圧縮するファイル/ディレクトリ名}
と実行すると、
Enter password: Verify password:
と、パスワードを聞かれるので、2度同じフレーズを打ち、圧縮する。