paulgorman.org

< ^ txt

Fri Mar 2 09:23:37 EST 2018 Slept from eleven-thirty to seven-thirty. Woke briefly around five-thirty. High of thirty-six and partly cloudy today. We did get two or three inches of wet snow yesterday. It's still sticking to the trees and utility poles this morning, winter wonderland style. Stopped at Starbucks on my way into work. Work: - Update unit pricing for Kelly Done. - Change backup cartridge Done. - Work on MECS Done. Scott took the day off. Julie and Jamie returned from West Virginia. The sale is complete, although we'll have a couple more things to do later in the month. https://utcc.utoronto.ca/~cks/space/blog/programming/GoVendoringAndVgo > We are never going to be doing ongoing Go development, with a nice collection of Go programs and tooling that we work on regularly and build frequently. Instead, we're going to have a few programs written in Go because Go is the right language (enough so to overcome our usual policy against it). If we're going to have local software in a compiled language, we need to be able to rebuild it on demand, just in case (otherwise it's a ticking time bomb). More specifically, we want people who aren't Go specialists to be able to reliably rebuild the program following some simple and robust process. The closer the process is to 'copy this directory tree into /tmp, cd there, and run a standard <something> build command', the better. Indeed. Ten-minute walk at lunch. The roads and sidewalks have mostly dried. Kristen picked up lunch from 2941 Street Food. Tinkering with Asterisk-compatible file locking: ``` // LockPathFlock locks a directory using the `flock` system call. func LockPathFlock(dir string) error { var err error for { f := path.Join(dir, "lock") fd, err := unix.Open(f, unix.O_WRONLY|unix.O_CREAT, 0600) if err != nil { log.Println(err) } err = unix.Flock(fd, unix.LOCK_EX|unix.LOCK_NB) if err != nil { log.Println(err) } // Avoid the race condition where another process flocks our lock file first! var st0, st1 unix.Stat_t err = unix.Fstat(fd, &st0) if err != nil { log.Println(err) } err = unix.Stat(f, &st1) if err != nil { log.Println(err) } if st0.Ino == st1.Ino { log.Println(st0.Ino) log.Println(st1.Ino) break } unix.Close(fd) time.Sleep(500 * time.Millisecond) } return err } // UnlockPathFlock unlocks a directory locked by `Ast_lock_path_flock`. func UnlockPathFlock(dir string) error { var err error f := path.Join(dir, "lock") fd, err := unix.Open(f, unix.O_WRONLY|unix.O_CREAT, 0600) if err != nil { log.Println(err) } unix.Unlink(f) unix.Flock(fd, unix.LOCK_UN) return err } ``` Home: https://arstechnica.com/science/2018/03/how-could-ice-age-tundra-feed-a-mammoth/ Mom called, and invited me to dinner tomorrow night. Breakfast: cafe latte, sausage and egg sandwich Lunch: falafel bowl, coffee Dinner: left-over pizza, cookies

< ^ txt