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
-- 試し割り | |
isPrime :: Int -> Bool | |
isPrime 2 = True | |
isPrime n | |
| n < 2 = False | |
| (n `mod` 2) == 0 = False | |
| otherwise = testDiv 3 n | |
where testDiv :: Int -> Int -> Bool | |
testDiv i n | |
| i * i > n = True |
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
last' :: [a] -> a | |
last' [] = error "list must be `length list > 0`" | |
last' [x] = x | |
last' (x:xs) = last' xs | |
last'' :: [a] -> a | |
last'' [] = error "list must be `length list > 0`" | |
last'' xs = xs !! ((length xs) - 1) |
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
tail' :: [a] -> [a] | |
tail' [] = [] | |
tail' [a] = [] | |
tail' (_:xs) = xs |
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
Option Explicit | |
MsgBox Format(Date, "yyyyMMdd") | |
Function Format(DateTime, Pattern) | |
Dim command, wshShell, wshShellStatus, Stream | |
command = "PowerShell -Command Get-Date """ & DateTime & """ -Format """ & Pattern & """" | |
Set wshShell = CreateObject("WScript.Shell") |
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
ポップアップのメニュー選択 | |
http://www.moug.net/faq/viewtopic.php?t=64934 | |
モーグのフリーソフト | |
http://www.moug.net/cgi-bin/softwaredl.cgi?excel+SI2012111501 |
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
モーグの詳細検索を例に説明します。 | |
http://www.moug.net/faq/search.php | |
1. IE9で詳細検索画面を開く。 | |
2. IE9の開発者ツールを開く(F12キー)。 | |
3. [ネットワーク]タブを開く。 | |
4. [キャプチャの開始]ボタンをクリック。 | |
5. 詳細検索画面で適当に検索する。 | |
6. 結果が表示されたら[キャプチャの停止]ボタンをクリック。 | |
7. 開発者ツールに表示されるURLの内、http://www.moug.net/faq/search.php?mode=results をクリック。 |
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
https://docs.google.com/open?id=0B_dAu5x064QTWW5TQ2p0NzRPZTQ | |
https://docs.google.com/open?id=0B_dAu5x064QTZ1lZaXpmS3ZMQ0U |
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
Option Explicit | |
Sub test() | |
Const MAX_NUM As Long = 65535 | |
Dim num As Long | |
Dim row As Long | |
Dim col As Long | |
Dim result As Long | |
Dim table(0 To MAX_NUM, 0 To 15) As Long | |
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
Option Explicit | |
Sub test() | |
Dim WmiDateTime As WmiDateTime | |
Set WmiDateTime = New WmiDateTime | |
WmiDateTime.Value = "20121004010446.000000-000" | |
Debug.Print WmiDateTime.LocalDateTime | |
' 2012/10/04 10:04:46 |
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
Option Explicit | |
' 参照設定 | |
' Microsoft XML, v6.0 | |
Sub test() | |
Debug.Print getLocation("http://nec.www.yahoo.co.jp") | |
End Sub | |
Function getLocation(url As String) As String |