Entries from 2015-05-19 to 1 day

go で binary.Write してるところで速度が欲しい場合は binary.ByteOrder interface を直に使う

go で binary package の Write は毎回 allocate しているのでもし速度が必要な場合は binary.ByteOrder interface ( binary.BigEndian, binary. LittleEndian ) を直に使うと改善出来る。 もちろん binary.Write の方が使いやすいので速度とかを気にする場…

NSStatusBar にあるアイコンをクリックした際に NSPopover を表示し、フォーカスが外れたら自動で閉じる

import Cocoa @NSApplicationMain class AppDelegate: NSObject, NSApplicationDelegate { let statusItem = NSStatusBar.systemStatusBar().statusItemWithLength(-2) let popover = NSPopover() func applicationDidFinishLaunching(aNotification: NSNoti…