Lazy Diary @ Hatena Blog

PowerShell / Java / miscellaneous things about software development, Tips & Gochas. CC BY-SA 4.0/Apache License 2.0

労働と挨拶のどちらが大切か

  • (A) 挨拶より労働の方が大切。
  • (B) 挨拶と労働が同じくらい大切。
  • (C) 労働より挨拶よ方が大切。

中井久夫「治療文化論」p.104より引用。

東京においては「あいさつ」のできることが、「はたらくこと」と並んでかなり重要であり、名古屋においては「あいさつ」よりも「はたらけること」である。

How to extract non-MS932 (Shift_JIS) compliant characters from string

function Get-NonMS932CompliantCharacter {
  Param(
    [Parameter(ValueFromPipeline=$true,Mandatory=$true)]
    [string] $TargetString
  )
  process {
    $TargetStringBytes = [Text.Encoding]::UTF32.GetBytes($TargetString);
    for ($i=0; $i -lt $TargetStringBytes.Length; $i+=4) {
        $TargetChar = [Text.Encoding]::UTF32.GetString($TargetStringBytes, $i, 4);
        $MS932Bytes = [Text.Encoding]::GetEncoding(932).GetBytes($TargetChar);
        $MS932Char = [Text.Encoding]::GetEncoding(932).GetString($MS932Bytes,0,$MS932Bytes.Length)
        if ($TargetChar -ne $MS932Char) {
            $TargetChar
        }
    }
  }
}

ex:

PS > "あえうえお①𩸽X𠀋か㐂" | Get-NonMS932CompliantCharacter
𩸽
𠀋
㐂

tr equivalent in PowerShell (Unicode surrogate pair-aware)

There is no straightforward tr equivalent in Windows, so I made an cmdlet that you can use like tr command. This tr cmdlet is aware of Unicode characters including surrogate pairs.

function tr {
  Param(
    [Parameter(ValueFromPipeline=$true,Mandatory=$true)]
    [string] $TargetString,
    [Parameter(Mandatory=$true)]
    [string] $FromString,
    [Parameter(Mandatory=$true)]
    [string] $ToString
  )
  begin {
    # [-split ""] splits a surrogate pair into two invalid characters,
    # so the code below is not suitable for this purpose
    # $FromStringArray = $FromString -split "";
    # $FromStringArray = $FromStringArray[1..($FromStringArray.length-2)];

    # Split string into character array
    $FromStringArray = @();
    $FromStringBytes = [Text.Encoding]::UTF32.GetBytes($FromString);
    for ($i=0; $i -lt $FromStringBytes.length; $i+=4) {
         $FromStringArray += [Text.Encoding]::UTF32.GetString($FromStringBytes, $i, 4);
    }

    $ToStringArray = @();
    $ToStringBytes = [Text.Encoding]::UTF32.GetBytes($ToString);
    for ($i=0; $i -lt $ToStringBytes.length; $i+=4) {
         $ToStringArray += [Text.Encoding]::UTF32.GetString($ToStringBytes, $i, 4);
    }
  }
  process {
    for ($i=0; $i -lt $FromStringArray.Length -and $i -lt $ToStringArray.Length; $i++) {
        $TargetString = $TargetString.Replace($FromStringArray[$i],$ToStringArray[$i]);
    }
    $TargetString
  }
}

ex:

PS > @("𩸽𠀋", "あいうえおあお") | tr -FromString "𩸽𠀋うえお" -ToString "○𡶷ウエオ"

○𡶷
あいウエオあオ

EC-Council ECH (Certified Ethical Hacker)合格後のECEクレジットにカウントできたイベント

EC-Council CEH (Certified Ethical Hacker)試験に合格すると*1、以下のようなイベントが待っています。

  • ECE Membership Fee ($80/year)の支払い(1年間の猶予あり)
  • ECEクレジットの登録(120ポイント/3年)

ECEクレジットというのは、CISSPCPEクレジットや、PMP資格のPDUポイントみたいなもので、研修を受講したり、自主学習をしたりすることでポイントが貯まります……なんですが、どんな研修だったらポイントに算入されるのかはEC-Councilの判断で、判断基準も開示されていません。

試してみたところ、教育コースを提供する会社が主催していて、受講証明書も発行してもらえる研修なら、日本語のコースであってもポイントに算入できるようです。 その他にも、有志が行っている勉強会のたぐいも、やってみたら登録できました*2

この記事では、どんな研修や勉強会が登録できたかを記録しておきます。

法人等による研修

情報処理安全確保支援士オンライン講習

Event Description
教材が6つあるので、それぞれのタイトルを「/」で区切って列挙(半角「/」は入力できないので注意)。
Event Location
「eラーニング」と書いたらOKでした。
受講証明
集合講習向けに、eラーニングのサイトから受講証明書がダウンロードきるので、それを送付。

BrightTALKのwebinar

URL
https://www.brighttalk.com/mybrighttalk/knowledge-feed/
Event Description
Webinarの説明文をそのまま転記。コピペはできないのでがんばる
Event Location
「eラーニング」と書いたらOKでした。
受講証明
BrightTALKのKnowledge feedのページから「My viewing history」を選択すると、これまでに見たwebinarの一覧が表示される。そこから「Viewing Certificate」を桜花すると受講証明書がダウンロードできるので、それを送付。

有志による勉強会

Shibuya.XSS techtalk

URL
https://shibuyaxss.connpass.com/
Event Description
connpassのイベント画面から、「スピーカー」の内容(発表者とタイトル)を転記。英数字以外はコピペできないので気合でがんばる
受講証明
connpassのイベント画面のスクリーンショットを送付。開催日を過ぎてしまうと、イベント画面から「参加できます」的な表示が消えてしまうようなので、遅くとも開催日中にスクリーンショットを採っておいた方がいいかも。

Becks Japan

URL
https://becks.doorkeeper.jp/
Event Description
Doorkeeperのイベント画面から「トーク一覧」(発表者とタイトル)を転記。英数字以外はコピペできないので気合でがんばる
受講証明
Doorkeeperのイベントページで「申し込みの確認」ボタンを押すと、QRコード付きの参加票が表示されるので、そのスクリーンショットを送付。開催日を過ぎても表示できる。

#ssmjp

URL
https://ssmjp.connpass.com/
Event Description
connpassのイベント画面から「スケジュール」の内容(発表者とタイトル)を転記。英数字以外はコピペできないので気合でがんばる
受講証明
connpassのイベント画面から、受付番号を表示したページのスクリーンショットを送付。開催日を過ぎてしまうと、イベント画面から「参加できます」的な表示が消えてしまうので、遅くとも開催日中にスクリーンショットを採っておいた方がいいかも。

*1:研修や試験のときに説明された覚えがないんだけど、あります。会社のお金で研修や試験を受ける場合、会社側に伝えておいた方がいいかも。

*2:「Education Seminar/Conference/Event - 1 credit per hour」として登録

Bad designs in EC-Council ASPEN

Some of EC-Council ASPEN page designs are very annoying...

"Reset Password" screen

Detail:
The instruction says: "Password length should be 8-20, should consist a lower case letter(a-z), an uppercase letter(A-Z), a number(0-9) and a special character".
Expected Behavior:
The password like "Red-Sort-Ice-1" should not acceptable.
Actual Behavior:
The password like "Red-Sort-Ice-1" is not acceptable.
Note
I had to contact the support chat to reset my password.

"Manage My Events" screen

Detail:
The format string of "Event Date" and "Event Submission Date" should be congruous.
Expected Behavior:
Both of "Event Date" and "Event Submission Date" should be "2019-05-16" or "05-17-2019".
Actual Behavior:
"Event Date" looks like "2019-05-16", while "Event Submission Date" looks like "05-17-2019".

"Add Event" screen

Detail:
You should put event detail in "Add Event" screen.
Expected Behavior
You can use special characters like doller, slash, exclamation mark, question mark, hash sign, ampersand, etc.
Actual Behavior
You can use only minus(-), at(@), underscore(_), period(.), and comma(,) as special characters. You cannot use other special characters. YOU EVEN CANNOT USE NEWLINE! Note: also you cannot pasete non-ascii characters (e.g. Japanese) from clipboard, but you can put them from IME.