φ(・ω・ )かきかき

ここはnanamasuhoshiの雑多なメモです。
作成途中のスクリプトでも何の注記もなしに載せたりします。
この日記に書かれている事を実行して受けたいかなる被害にも nanamasuhoshiは責任持ちませんよ。

五反田時刻表はあっち
http://q.hatena.ne.jp/ranking
人気エントリー
注目エントリー
サブ本当はBigapleだたw
LINK  [keyboard]タグ 新着/注目  [キーボード]タグ 新着/注目  Qwerters Clinic  ShopU
 Engadget Japanese  GIGAZINE  Wikipedia  TV番組 livedoor Yahoo!TV ONTV Japan
今日は平成何年? 今日は平成何年? 「200x年」は「平成○年」を即座に把握する

私がIE11で使用しているユーザーCSS

@charset "utf-8";
/*	Name: 1490680842
	Accessibility layout
	Copyright 2012 Opera Software */

/*
	text-align: left !important;
	text-transform: none !important;
	text-decoration: none !important;
	color: white !important;
	background: black !important;
	width: auto !important;
	max-width: none !important;
	min-width: 0px !important;
	height: auto !important;
	max-height: none !important;
	min-height: 0px !important;
*/
* {
	font-family: "Noto Serif CJK JP", "MS UI Gothic","Noto Sans CJK JP", "Meiryo UI", sans-serif !important;
	font-size: 17px !important;
	word-spacing: 0.4mm !important;
	letter-spacing: 0.2mm !important;
	line-height: 1.4em !important;
}
/*
html *::before, html *::after {display: none !important}
html q::before {content: open-quote !important;}
html q::after {content: close-quote !important;}
body {
	padding-bottom: 2em !important;
	margin: 10px auto !important;
	max-width: 55em !important;
}
*/
a[href] {text-decoration: underline !important;}
/*
a[href]:hover {
	color: black !important;	
	background: white !important;
}
a[href]:active {
	background: transparent !important;
	text-decoration: none !important;
}
*/
img, object[type^="image"] {border: none !important;}
a[href] img, a[href] object[type^="image"] {border: medium solid black !important;}
/*
input, textarea, select {
	color: Black !important;	
	background: White !important;
}
input[type="text"], input[type="password"] {min-height: 1.2em !important;}
textarea {min-height: 4em !important;}
button, input[type="file"], input[type="submit"], input[type="button"], input[type="reset"], 
input[type="image"] {
	text-align: center !important;	
	color: black !important;
	background: silver !important;
	padding: 2px !important;
	min-width: 2em !important;
	height: 1.2em !important;
}
a[accesskey]:after, button[accesskey]:after, input[accesskey]:after, label[accesskey]:after, 
legend[accesskey]:after, textarea[accesskey]:after {
	content: "(" attr(accesskey) ")";
	margin-left: 0.3em;
	display: inline !important;
}
*/
b, strong, em, h1, h2, h3, h4, h5, h6 {font-weight: bold !important;}
h1 {
	font-size: 160% !important;
	line-height: 1.0em !important;
}
h2 {
	font-size: 140% !important;
	line-height: 1.2em !important;
}
h3 {
	font-size: 120% !important;
	line-height: 1.4em !important;
}
h4 {
	font-size: 110% !important;
	line-height: 1.4em !important;
}
h5 {
	font-size: 100% !important;
	line-height: 1.2em !important;
}
h6 {
	font-size: 90% !important;
	line-height: 1.2em !important;
}
hr {
	color: white !important;
	background-color: white !important;
	border: none !important;
	height: 5px !important;
}
@media print {
	* {
		color: black !important;
		background: white !important;	
		font-size: 5.6mm !important;
	}
}
pre, code {
	word-spacing: normal !important;
}
/*
img, object[type^="image"], a[href] img, a[href] object[type^="image"] {
	min-width: 3px !important;
	max-width: 800px !important;
}
a[href]:link {
	color: DeepSkyBlue  !important;
}
a[href]:visited {
	color: MediumSlateBlue  !important;
}
*/

メモ

sqlcmd -S サーバー名 -U ユーザー名 -P パスワード -d データベース名 -Y20 -y 12
:help
:out stdout
:out hoge.txt
set showplan_all on
rollback
go

BEGIN TRANSACTION
go

select object_id, name  from sys.synonyms order by name

select object_id, name from sys.views order by name;
select object_id, type_desc, name from sys.tables order by name;

select name, database_id, create_date from sys.databases

sp_help 'テーブル名'

-- desc
select coalesce(cast(i1.key_ordinal as char(2)), '') as PK, coalesce(cast(i2.key_ordinal as char(2)), '') as UQ, y1.name, c1.max_length, c1.precision, c1.scale,
       case when c1.is_nullable = 0 then 'NOT NULL' else '' end as nullable, coalesce(cast(d1.definition as nvarchar(20)), '') as [default], c1.collation_name, c1.name
  from sys.columns as c1
  left join sys.types as y1 on c1.user_type_id = y1.user_type_id
  left join sys.key_constraints as k1 on k1.parent_object_id = c1.object_id and k1.type = 'PK'
  left join sys.index_columns as i1 on c1.object_id = i1.object_id and c1.column_id = i1.column_id and k1.parent_object_id = i1.object_id and k1.unique_index_id = i1.index_id
  left join sys.key_constraints as k2 on k2.parent_object_id = c1.object_id and k1.type = 'UQ'
  left join sys.index_columns as i2 on c1.object_id = i2.object_id and c1.column_id = i2.column_id and k1.parent_object_id = i2.object_id and k1.unique_index_id = i2.index_id
  left join sys.default_constraints as d1 on c1.object_id = d1.parent_object_id and c1.column_id = d1.parent_column_id
 where c1.object_id = object_id('テーブル名', 'U')
 order by c1.column_id

select @@version

SET TRANSACTION ISOLATION LEVEL REPEATABLE READ
SET TRANSACTION ISOLATION LEVEL READ COMMITTED
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE


SELECT CASE transaction_isolation_level 
WHEN 0 THEN 'Unspecified' 
WHEN 1 THEN 'ReadUncommitted' 
WHEN 2 THEN 'ReadCommitted' 
WHEN 3 THEN 'Repeatable' 
WHEN 4 THEN 'Serializable' 
WHEN 5 THEN 'Snapshot' END AS TRANSACTION_ISOLATION_LEVEL 
FROM sys.dm_exec_sessions 
where session_id = @@SPID


SELECT
  resource_type as オブジェクトの種類,
  (CASE 
    WHEN resource_type = N'ALLOCATION_UNIT' THEN 
      (SELECT 
        OBJECT_NAME(sp.object_id) + N':' +  si.name
        FROM 
          sys.allocation_units 
          LEFT JOIN 
            sys.partitions sp 
            ON 
              container_id = hobt_id 
          LEFT JOIN 
            sys.indexes si 
            ON 
              sp.object_id = si.object_id 
              AND sp.index_id = si.index_id
        WHERE 
          allocation_unit_id = resource_associated_entity_id)  
    WHEN  resource_type = N'OBJECT' THEN 
      OBJECT_NAME(CONVERT(bigint, resource_associated_entity_id))
    WHEN resource_type IN(N'HOBT', N'KEY', N'PAGE') THEN 
      (SELECT 
        OBJECT_NAME(sp.object_id) + N':' +  si.name
      FROM 
        sys.partitions sp 
        LEFT JOIN 
          sys.indexes si 
          ON 
            sp.object_id = si.object_id 
            AND sp.index_id = si.index_id 
      WHERE 
        hobt_id = resource_associated_entity_id) 
    ELSE    
      CONVERT(nvarchar(40), resource_associated_entity_id) 
  END) as エンティティID,
  request_mode as ロックの種類,
  request_type as 要求の種類,
  request_status as 状態
 From sys.dm_tran_locks
 WHERE [resource_type]<>'DATABASE'


次の例では、ロック タイムアウトの待ち時間を 1800 ミリ秒に設定します。
SET LOCK_TIMEOUT 1800
GO

この例では、LOCK_TIMEOUT 値が設定されていない場合の結果セットを表示します。
SELECT @@LOCK_TIMEOUT AS [Lock Timeout]
GO

2013私がクイックアクセスツールバーに設定している内容

開く(FileOpenUsingBackstage)
上書き保存(FileSave)<区切り>(CustomControl)
印刷プレビュー(全画面表示)(PrintPreviewFullScreen)
ページ設定(PageSetupPageDialog)
ページ設定(GroupPageSetup)<区切り>(CustomControl)
元に戻す(Undo)
やり直し(Redo)
形式を選択して貼り付け...(PasteSpecialDialog)
値の貼り付け(PasteValues)<区切り>(CustomControl)
ズーム...(ZoomDialog)
ズーム(ZoomClasic)<区切り>(CustomControl)
フォント(Font)
フォントサイズ(FontSize)
塗りつぶしの色(CellFillColorPicker)
フォントの色(FontColorPicker)
罫線(BordersGallery)
フォント(GroupFont)<区切り>(CustomControl)
フィル(FillMenu)
連続データ(FillSeries)<区切り>(CustomControl)
条件付き書式(ConditionalFormattingMenu)<区切り>(CustomControl)
リンクの編集(EditLinks)
名前の管理(NameManager)<区切り>(CustomControl)
オブジェクトの選択(ObjectsSelect)
カギ線コネクタ(ShapeElbowConnector)
カギ線矢印コネクタ(ShapeElbowConnectorArrow)
図形(ShapeInsertGallery)<区切り>(CustomControl)
並べ替えとフィルター(SortFilterMenu)
フィルター(Filter)
可視セルの選択(TableSelectVisibleCells)<区切り>(CustomControl)
ウィンドウ(GroupWindow)
ウィンドウ枠の固定(ViewFreezePanesGallery)
全画面表示の切り替え(ViewFullScreenView)<区切り>(CustomControl)
枠線の表示(ViewGridlinesToggleExcel)
マクロの表示(PlayMacro)

Enumに任意の文字列を割り振る

[C#] 何故 enum に拘りたくなるのか? | Moonmile Solutions Blog
http://www.moonmile.net/blog/archives/3666

c# - Extension Methods for IEnumerable? - Stack Overflow
http://stackoverflow.com/questions/5162389/extension-methods-for-ienumerableenum

c# - How can an Enumeration with Descriptions be cast into a Dictionary? - Code Review Stack Exchange
http://codereview.stackexchange.com/questions/12173/how-can-an-enumeration-with-descriptions-be-cast-into-a-dictionary

カスタム属性の記述
https://msdn.microsoft.com/ja-jp/library/84c42s56(v=vs.110).aspx

属性に格納されている情報の取得
https://msdn.microsoft.com/ja-jp/library/71s1zwct(v=vs.110).aspx



VB.NET
既存の属性を使用。Enumならなんでもに改変してある。
便利そう!って思ってやったんだけど使った事はない。

Public Enum MyEnum
    <Description("Army of One")>
    One
    Two
    Three
    Four
    Five
End Enum

Public Module MyEnumExtention
    <Extension()>
    Public Function GetDescription(currentEnum As [Enum]) As String
        Dim fi = currentEnum.GetType().GetField(currentEnum.ToString())
        Dim da = TryCast(Attribute.GetCustomAttribute(fi, GetType(DescriptionAttribute)), DescriptionAttribute)
        Return If(da IsNot Nothing, da.Description, currentEnum.ToString())
    End Function
End Module

エクスプローラのジャンプリストにフォルダを追加する

タスクバーのエクスプローラのアイコンに任意のフォルダをドラッグ&ドロップする。

タスクバーにピン留めされているエクスプローラーの新しいインスタンスを開始する際に指定したフォルダ、ファイル、またはアプリケーションを選択状態にするには
・タスク バーで、エクスプローラのボタンを右クリックします。
・ジャンプ リストで、エクスプローラーを右クリックしてプロパティを表示します。
エクスプローラーのプロパティで、リンク先にselectオプションを指定します。
 例)%windir%\explorer.exe /select,C:\hoge\fuga.txt

項目をジャンプ リストに固定表示するには
・プログラムのジャンプ リストを開き、項目をポイントし、プッシュピン アイコンをクリックして、[いつも表示する] をクリックします。

(注)スタート メニューまたはデスクトップからタスク バーに、ファイルのアイコンやショートカットをドラッグすることもできます。すると、項目がジャンプリストに固定表示され、まだプログラムがタスク バーに固定表示されていなければ、固定表示されます。

フォルダーは Windows エクスプローラーの項目と見なされ、開いたとき、または固定表示されているときに、Windows エクスプローラーのジャンプ リストに表示されます。


キーボードショートカット

[Win]+[数字]
デスクトップを開いて、数字で示す位置にあるタスク バーにピン留めされているアプリを開始する。アプリが既に実行されている場合は、そのアプリに切り替えます。

[Win]+[Shift]+[数字]
デスクトップを開いて、数字で示す位置にあるタスク バーにピン留めされているアプリの新しいインスタンスを開始する

[Win]+[Ctrl]+[数字]
デスクトップを開いて、数字で示す位置にあるタスク バーにピン留めされているアプリの前回の作業中のウィンドウに切り替える


ジャンプ リスト - Microsoft Windows
http://windows.microsoft.com/ja-jp/windows7/products/features/jump-lists

キーボード ショートカット - Windows ヘルプ
http://windows.microsoft.com/ja-jp/windows/keyboard-shortcuts

2つのブックを比較する

Office Professional Plus 2013の場合、アドインが Excel に組み込まれています。

【前準備】(リボンにINQUIREタブがない場合はアドインを追加する)
・適当にExcelを開く
・[ファイル]-[オプション]-[アドイン]-[管理(A):]で「COM アドイン」を選択して[設定(G)...]ボタンを押す。
・「Inquire」をチェック

【ブックの比較】
・比較したいブック二つを開いておく。
・リボンの[INQUIRE]-[ファイルの比較]をクリックする。


他の機能は使った事ありません。

スプレッドシート検査を使ってできること - Office のサポート
https://support.office.com/ja-jp/article/スプレッドシート検査を使ってできること-ebaf3d62-2af5-4cb1-af7d-e958cc5fad42