Skip to content

Instantly share code, notes, and snippets.

View jca02266's full-sized avatar

Koji Arai jca02266

View GitHub Profile
@jca02266
jca02266 / EmbulkRunner.java
Created November 29, 2017 06:47
EmbulkEmbedサンプル
import org.embulk.EmbulkEmbed;
import org.embulk.EmbulkEmbed.Bootstrap;
import org.embulk.config.ConfigLoader;
import org.embulk.config.ConfigSource;
import java.io.File;
import java.io.IOException;
public class EmbulkRunner {
public static void main(String[] args) throws IOException {
@jca02266
jca02266 / PoiUtils.java
Created November 8, 2020 14:35
Apache POI Utilities
package jca02266;
import java.util.Date;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.DateUtil;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.ss.util.CellUtil;
@jca02266
jca02266 / Module1
Last active February 17, 2021 03:03
VBA Packager
' 利用手順
'
' 事前準備
' Excel等のMS Office アプリケーションにて
' オプション → セキュリティセンター → セキュリティセンターの設定 → マクロの設定
' より、
' □ VBAプロジェクト オブジェクト モデルへのアクセスを信頼する
' にチェックをつける
'
' 1. このテキストの内容を標準モジュールに貼り付ける
@jca02266
jca02266 / east_asian_width.py
Last active February 21, 2021 12:11
Detect string width on screen
import unicodedata
# https://www.unicode.org/reports/tr11/tr11-14.html
EAW_WIDTH = {
'F': 2, # Full-width
'H': 1, # Half-width
'W': 2, # Wide
'Na': 1, # Narrow
'A': 2, # Ambiguous
'N': 1 # Not East Asian (Neutral)
@jca02266
jca02266 / qtsample.py
Created February 21, 2021 16:08
PyQt programming (transparency window)
import sys
import random
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
class MainWindow(QWidget):
def __init__(self, parent=None):
super(MainWindow, self).__init__(parent)
// return random intger value: [min, max)
function getRandomInt(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min) + min);
}
// return (size m) array picked from 0..<n (n >= m)
// Modified Fisher-Yates Shuffle (derived from <https://qiita.com/hmito/items/9f4bdc8442b6f6b3c7bc>)
function randomPick(n, m) {
Function re_match(re As Object, s As String) As Variant
Dim ms As Object
Set ms = re.Execute(s)
Dim arr() As String
If ms.Count = 0 Then
Exit Function
End If
Dim m As Object
@jca02266
jca02266 / result.txt
Last active March 14, 2021 19:50
Dump Windows-31J extended chars
< NEC特殊漢字 >
00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15
0x8740 ① ② ③ ④ ⑤ ⑥ ⑦ ⑧ ⑨ ⑩ ⑪ ⑫ ⑬ ⑭ ⑮ ⑯
0x8750 ⑰ ⑱ ⑲ ⑳ Ⅰ Ⅱ Ⅲ Ⅳ Ⅴ Ⅵ Ⅶ Ⅷ Ⅸ Ⅹ ㍉
0x8760 ㌔ ㌢ ㍍ ㌘ ㌧ ㌃ ㌶ ㍑ ㍗ ㌍ ㌦ ㌣ ㌫ ㍊ ㌻ ㎜
0x8770 ㎝ ㎞ ㎎ ㎏ ㏄ ㎡ ㍻
0x8780 〝 〟 № ㏍ ℡ ㊤ ㊥ ㊦ ㊧ ㊨ ㈱ ㈲ ㈹ ㍾ ㍽ ㍼
0x8790 ≒ ≡ ∫ ∮ ∑ √ ⊥ ∠ ∟ ⊿ ∵ ∩ ∪
< NEC選定IBM拡張文字 >
@jca02266
jca02266 / ComparePDFFiles.sct
Last active September 30, 2021 03:47
WinMerge Plugin (convert PDF file to image file)
' Install:
' Download poppler-0.68 from Poppler for Windows (http://blog.alivate.com.au/poppler-windows/)
' and extract it on the "C:\Program Files\WinMerge\MergePlugins\poppler-0.68" folder.
'
<scriptlet>
<implements type="Automation" id="dispatcher">
<property name="PluginEvent">
<get/>
</property>
<property name="PluginDescription">
@jca02266
jca02266 / morningCheckList.bat
Last active November 3, 2021 23:57
朝やることリスト(powershell) (BOM付UTF-8かShift_JISで保存すること)
powershell -WindowStyle Hidden -ExecutionPolicy RemoteSigned -File "%~dpn0.ps1" morningCheckList