Wednesday, July 19, 2017

dict words, regex, suffix and prefix, dwl


wc -l /usr/share/dict/words

need to separate into suffixes and prefix based on regexes

for example:

starting in words length 5
cross

ending in words length 6
stitch

Wednesday, June 21, 2017

Mac keyboard symbols in unicode

⌘ – ⌘ – ⌘ – the Command Key symbol
⌥ – ⌥ – ⌥ – the Option Key symbol
⇧ – ⇧ – ⇧ – the Shift Key symbol
⎋ – ⎋ – ⎋ – the ESC Key symbol
⇪ – ⇪ – ⇪ – the Capslock symbol
⏎ – ⏎ – ⏎ – the Return symbol
⌫ – ⌫ – ⌫ – the Delete / Backspace symbol

Tuesday, June 20, 2017

mojibake mongon

# -*- coding: utf-8 -*-

jstr = u"日本語"

print jstr.encode('iso-2022-jp')
print jstr.encode('euc-jp')
print jstr.encode('euc-jisx0213')
print jstr.encode('euc-jis-2004')
print jstr.encode('iso-2022-jp')
print jstr.encode('iso-2022-jp-1')
print jstr.encode('iso-2022-jp-2')
print jstr.encode('iso-2022-jp-3')
print jstr.encode('iso-2022-jp-ext')
print jstr.encode('iso-2022-jp-2004')

print jstr.encode('utf-7')
print jstr.encode('utf-8')
print jstr.encode('utf-16')
print jstr.encode('utf-16-be')
print jstr.encode('utf-16-le')

print jstr.encode('cp932')          #文字化けしない。
print jstr.encode('shift-jis')      #文字化けしない。
print jstr.encode('shift-jisx0213') #文字化けしない。
print jstr.encode('shift-jis-2004') #文字化けしない。

Tuesday, June 13, 2017

Japanese Characters & Strings in Python

hiragana
for i in range(0x3040, 0x30a0): print(chr(i), end='')
katakana
for i in range(0x30a0, 0x3100): print(chr(i), end='')
kanji
for i in range(0x4e00, 0x4f00): print(chr(i), end='')
morpho!

import sys
import codecs
sys.stdout = codecs.getwriter('utf8')(sys.stdout)
sys.stderr = codecs.getwriter('utf8')(sys.stderr)
export PYTHONIOENCODING=UTF-8

Monday, June 12, 2017

Japanese Character & String conversions in terminal

Unicode blocks for Japanese characters

  • 3000-303F is CJK Symbols and Punctuation.
  • 3040-309F is Hiragana.
  • 30A0-30FF is Katakana.
  • 4E00-9FFF is CJK Unified Ideographs.
  • FF00-FFEF is Half-width and Full-width Forms.
To convert between hiragana and katakana, shift code points by 0x60:
$ echo ひらがな|tr  $'[\u3040-\u309f]' $'[\u30a0-\u30ff]'
ヒラガナ
$ echo カタカナ|tr  $'[\u30a0-\u30ff]' $'[\u3040-\u309f]'
かたかな
To convert between full width and half width, use hyphen and tilde:
$ echo example|tr ' -~' $'\u3000\uff01-\uff5e'
example
$ echo example|tr $'\u3000\uff01-\uff5e' ' -~'
example

morpho!

Tuesday, April 4, 2017

GitHub Keyboard shortcuts

Site wide shortcuts
sFocus search bar
g nGo to Notifications
g dGo to Dashboard
?Bring up this help dialog
jMove selection down
kMove selection up
xToggle selection
o / enterOpen selection
Repositories
g cGo to Code
g iGo to Issues
g pGo to Pull Requests
g wGo to Wiki
Source code browsing
tActivates the file finder
lJump to line
wSwitch branch/tag
yExpand URL to its canonical form
iShow/hide all inline notes

Monday, April 3, 2017

Desktop Software


  1. 7-zip
  2. AutoHotKey
  3. BlueJ
  4. BootRacer
  5. DiskBoss
  6. DiskSavvy
  7. Everything Search
  8. FileZilla
  9. Google Chrome
  10. GrepWin
  11. HeidiSQL
  12. Hipchat
  13. Jabber
  14. Microsoft Office
  15. Mozilla Firefox
  16. Notepad++
  17. Opera
  18. Poderosa
  19. RLogin
  20. Sakura
  21. SourceTree
  22. Spotify
  23. Sublime
  24. Telegram
  25. TortoiseGit
  26. Viber
  27. Visual Studio Code
  28. WinDirStat
  29. WinMerge
  30. WinSCP

Thursday, March 2, 2017

choose your words carefully

Going one step further with Kotlin & gRPC

Recently, I tried using Quarkus with Kotlin for grpc. I have worked with grpc for communication between microservices in Java & Golang. ...