Skip to content

Instantly share code, notes, and snippets.

@igeta
igeta / Houganshi.bas
Created March 21, 2018 02:21
罫線で囲まれたセル範囲を取得する。これを直接マクロに組み込むのではなく、Excel方眼紙/帳票の分析に使用して、その分析結果をもとにVBA書くのがよいかと。
Option Explicit
Sub TestRun()
Dim wf As WorksheetFunction: Set wf = WorksheetFunction
Dim rng As Range, r As Range, arr As Variant
For Each rng In BorderedCells(Sheet1.UsedRange)
Debug.Print "[" & rng.Address(False, False) & "] ";
For Each r In rng.Rows
If r.Cells.Count > 1 Then

PowerShell Gives You Wrongs

三年半の格闘の末に僕が見たもの、あるいは試行錯誤の覚書、すなわち二番煎じ。

はじめに

PowerShell 3.0以上のバージョンを使用すること。2.0以下のバージョンは、書き捨ては仕方ないとしても、保守対象のスクリプトを書くべきではないし、あらゆる言及に値しない。全力でバージョンアップをしろ。

式と文の常識を超えて

@igeta
igeta / Start-HelloRealWorld.ps1
Created September 26, 2017 10:23
Hello world script in PowerShell. Should save with UTF-16 BE encoding.
param(
[ValidateSet("CUI", "GUI")]
[string]$RunningStyle,
[string]$Text
)
### bootstrap
if (-not $RunningStyle) {
if ((Get-Host).Name -eq "ConsoleHost") {
Write-Host "Loading..."
@echo off
set sln=SampleApp
set proj=SampleApp
set conf=Release
set plat=x86
set publisher=Dummy Inc.
set product=Sample Application
set version=0.1.2.3
@igeta
igeta / setup-perl-on-windows.md
Last active December 21, 2015 11:08
Windows で Perl 使うときの取っ掛かりのメモ。

Strawberry Perl をインストール。インストール先はデフォルトとする。

http://strawberryperl.com/

毎度おなじみインストール確認。

perl -v

F# コンパイラを改造して GenericMaxValue< ^T > を実装する

System.Int32.MaxValue と書きたくないのです。GenericMaxValue<int> と書きたいのです。

> let inline GenericMaxValue< ^T when ^T : (static member MaxValue : ^T) > : ^T =
-     (^T : (static member MaxValue : ^T) ())
- ;;

> type Foo(n : int) =
  • member x.Value = n