Skip to content

Instantly share code, notes, and snippets.

View devlights's full-sized avatar
🤧
hay fever....

devlights devlights

🤧
hay fever....
View GitHub Profile
@devlights
devlights / netsh_command_tips.md
Created April 21, 2017 14:18
netsh コマンドを使用してLANアナライズ

使い方

管理者モードでコマンドプロンプト起動

以下のコマンドを打ち込むとLANキャプチャ開始

netsh trace start capture=yes report=no persistent=no maxSize=0 fileMode=single correlation=no traceFile=c:\tmp\xxxxx.etl
@devlights
devlights / MulticoreJITSamples01.cs
Created April 9, 2017 10:05
System.Runtime.ProfileOptimizationクラスのサンプルです。 Monoには存在しない。
namespace Sazare.Samples
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime;
using Sazare.Common;
#region MulticoreJITSamples-01
@devlights
devlights / Program.cs
Created April 4, 2017 10:56
インストールされている .NET Framework のパッチを調べる (C#, VisualStudio, Show Installed Updates of .NET Framework)
// -------------------------------------------------------------------------
// 以下のURLから拝借
// https://msdn.microsoft.com/ja-jp/library/hh925567(v=vs.110).aspx
// -------------------------------------------------------------------------
namespace ShowInstalledDotNetPatches
{
using System;
using Microsoft.Win32;
@devlights
devlights / mac_backslash.md
Last active February 9, 2017 08:49
[Mac] バックスラッシュの入力方法
@devlights
devlights / pathlib_glob_rglob.py
Created February 7, 2017 05:57
[Python] pathlib の glob と rglob のサンプル
# coding: utf-8
import pathlib
from pprint import pprint as pp
file_path = r'/Users/xxxxx/anaconda'
p = pathlib.Path(file_path)
if not p.exists():
print('存在しない')
@devlights
devlights / chunks.py
Last active February 3, 2017 12:13
[python] chunk 処理
# coding: utf-8
from typing import Iterable, Iterator, Any
def chunks(sequence: Iterable, chunk_size: int = 1) -> Iterator[Any]:
"""
指定されたシーケンスを指定されたチャンクに分割します.
:param sequence: シーケンス
@devlights
devlights / requirements_for_pip_and_conda.md
Last active February 7, 2017 05:58
[python] pip と conda の requirements.txt の作り方

Pip

pip freeze > requirements.txt

Conda

conda list -e > conda_requirements.txt
@devlights
devlights / int_to_binary_to_hex_to_binary_to_int.md
Last active December 7, 2018 07:41
Pythonで 数値 -> バイナリ -> 16進文字列 -> バイナリ -> 数値への変換。
In[28]: # 数値からバイナリへ
In[29]: a_number = 1024
In[30]: a_number.to_bytes(4, byteorder='big')
Out[30]: 
b'\x00\x00\x04\x00'
In[31]: # バイナリから16進文字列へ
In[32]: _.hex()
Out[32]: 
'00000400'
@devlights
devlights / Python_Anaconda_PyQt5_QtDesigner.md
Last active August 20, 2018 08:49
[Python] AnacondaとPyQt5でQt Designerについて

AnacondaとPyQt5

Qt Designerについて

スタートメニューにはQt Designerが見当たらないが、以下の場所にEXEがある。

%ANACONDA_INSTALL_PATH%\Library\bin\designer.exe
@devlights
devlights / node-version-manage-on-windows.md
Last active December 22, 2016 07:36
node-jsのバージョン管理(Windows環境)
  • Windowsでは nodist というツールがある
  • Chocolatey経由でインストールする
  • インストールする前に、事前にインストールされているnode-jsをアンインストールしておく
  • コマンドプロンプトで choco install nodist を打ち込む
  • コマンドプロンプトで nodist latest を打ち込む
  • node -v して最新バージョンなのを確認