This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static readonly string URL = @"http://www8.cao.go.jp/chosei/shukujitsu/syukujitsu.csv"; | |
public Dictionary<DateTime, string> GetHolidays() | |
{ | |
var str = DownloadHolidaysStr(URL); | |
var dic = new Dictionary<DateTime, string>(); | |
// 行区切りが改行のため、改行毎に分割 | |
string[] rows = str.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries); | |
// 考え得るフォーマットで変換できるようにしておく |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function psmore | |
{ | |
begin | |
{ | |
$scriptCmd = { Out-Host -Paging } | |
$steppablePipeline = $scriptCmd.GetSteppablePipeline() | |
$steppablePipeline.Begin($true) | |
} | |
process |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 不足しているINDEXを調査します。 | |
-- SQLServerが起動してから、運用している間に不足していると判断されたINDEXです。 | |
-- INDEXを追加する場合は、挿入、更新、削除のクエリで処理速度が悪化するため | |
-- システム全体の影響を確認した上で採用するか判断してください。 | |
SELECT user_seeks * avg_total_user_cost * (avg_user_impact * 0.01) AS index_advantage, | |
migs.last_user_seek AS [前回のseek日時], | |
mid.statement AS [テーブル名], | |
migs.unique_compiles, | |
migs.user_seeks, | |
migs.avg_total_user_cost AS [平均コスト], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import os | |
import datetime | |
import pyauto | |
from keyhac import * | |
# 追加モジュール | |
import time | |
import re |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace EmailNet | |
{ | |
public class Config | |
{ | |
public EmailConfiguration EmailConfiguration{ get; set; } | |
public EmailMessage EmailMessage{ get; set; } | |
public EmailAddress EmailAddress { get; set; } | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT [テーブル名] = o.name, | |
[レコード数] = i.rows | |
FROM sysindexes i | |
INNER JOIN | |
sysobjects o | |
ON o.id = i.id | |
WHERE o.xtype = 'U' | |
AND i.indid < 2 | |
AND i.rows > 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// JANコードの13桁タイプのチェックデジットを算出 | |
/// </summary> | |
/// <param name="code">JANコード</param> | |
/// <returns></returns> | |
private int calcJAN13CheckDigit(string code) | |
{ | |
if (!Regex.IsMatch(code, @"^[0-9]{12,13}$")) | |
{ | |
throw new Exception("対象のJANコードが数字12桁または数字13桁になっていません。"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static public IDictionary<TKey, TValue> Marge<TKey, TValue>( | |
this IDictionary<TKey, TValue> first, IDictionary<TKey, TValue> second, | |
Func<TKey, TValue, TValue, TValue> valueSelector = null) | |
{ | |
if (valueSelector == null) valueSelector = (key, firVal, secVal) => firVal; //判定条件を省略するとfirst優先 | |
return first.Concat(second) | |
.GroupBy(pair => pair.Key, | |
(key, pairs) => | |
pairs.Count == 1 ? pairs.First() //重複なし | |
: new KeyValuePair<TKey, TValue>(key, valueSelector(key, pairs.First().Value, pairs.Last().Value)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/******************************************************************************* | |
文字列の全角/半角チェック | |
@param input String チェック対象文字列 | |
@param charType String チェック種別 | |
・"zenkaku" : 全角文字(ひらがな・カタカナ・漢字 etc.) | |
・"hiragana" : 全角ひらがな | |
・"katakana" : 全角カタカナ | |
・"alphanumeric" : 半角英数字(大文字・小文字) | |
・"numeric" : 半角数字 | |
・"alphabetic" : 半角英字(大文字・小文字) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using ClosedXML.Excel; | |
using System.Data; | |
using System.IO; | |
namespace ExcelReport | |
{ | |
public class Program | |
{ | |
static readonly int firstDtilRow = 16; |
NewerOlder