Date calculations can overflow with webkit times (microseconds since Jan 1 1601).
This works in go1.17
| def solve01b(fname: str): | |
| with open(fname, 'r') as f: | |
| pos = 50 | |
| zeroCount = 0 | |
| n = 0 | |
| for line in f: | |
| direction = line[0] | |
| distance = int(line[1:].strip()) |
| package waitlist | |
| import "sync" | |
| type waitChanList []chan struct{} | |
| type WaitList struct { | |
| m map[string]waitChanList | |
| sync.RWMutex | |
| } |
Date calculations can overflow with webkit times (microseconds since Jan 1 1601).
This works in go1.17
| # This is an example only. I no longer use it and hope to update it eventually. | |
| # If you are starting from scratch you should be using the users table not the teachers view | |
| # for creating a PK for your staff. If you don't, teachers who teach at multiple schools will | |
| # not work correctly. My fix was to just keep using the schoolstaff id's (that is what the | |
| # teacher view uses) but make sure it is always the users homeschool's sschoolstaff id. It'd be | |
| # cleaner to have just used the users table to begin with though. I have a much better understanding | |
| # of mysql and ps tables then I was when I first wrote this. | |
| <queries> | |
| <query name="org.yourschool.clever.schools.all" coreTable="SCHOOLS" flattened="true"> |
| package main | |
| import ( | |
| "bytes" | |
| "fmt" | |
| "io" | |
| "io/ioutil" | |
| "sync" | |
| ) |
| package main | |
| import ( | |
| "bufio" | |
| "fmt" | |
| "os" | |
| "time" | |
| ) | |
| type point struct { |
| package main | |
| import ( | |
| "bufio" | |
| "fmt" | |
| "os" | |
| "strconv" | |
| "strings" | |
| "time" | |
| ) |
| package main | |
| import ( | |
| "aoc/vm" | |
| "fmt" | |
| ) | |
| type jump struct { | |
| pos int | |
| op string |
| package vm | |
| import ( | |
| "bufio" | |
| "fmt" | |
| "io" | |
| "strconv" | |
| "strings" | |
| ) |
| package main | |
| import ( | |
| vm "aoc/vm" | |
| "fmt" | |
| "os" | |
| ) | |
| func main() { | |
| if len(os.Args) < 2 { |