This is a quick'n'dirty code to test the turtle parsing of schema.org and the graph generation
Usage:
curl https://schema.org/version/latest/schemaorg-current-http.ttl | go run .| func hasSlept(ctx context.Context, healthCheck time.Duration, sleptTime time.Duration) <-chan struct{} { | |
| signalC := make(chan struct{}) | |
| go func(chan<- struct{}) { | |
| tick := time.NewTicker(healthCheck) | |
| last := time.Now() | |
| for { | |
| select { | |
| case <-ctx.Done(): | |
| return | |
| case <-tick.C: |
This is a quick'n'dirty code to test the turtle parsing of schema.org and the graph generation
Usage:
curl https://schema.org/version/latest/schemaorg-current-http.ttl | go run .| <!DOCTYPE html> | |
| <head> | |
| <title>My chart</title> | |
| <meta charset="UTF-8"> | |
| <script src="https://unpkg.com/timelines-chart@2"></script> | |
| </head> | |
| <body> | |
| <div id="myPlot"></div> | |
| <script> | |
| const data = [{"group":"gorgonia.org/gorgonia/x/vm.receiveInput","data":[{"label":"Reshape(16, 27)(%0)","data":[{"timeRange":["2020-08-10T16:38:17.77308+02:00","2020-08-10T16:38:17.773081+02:00"],"val":"11"}]},{"label":"Reshape(1024, 4608)(%6)","data":[{"timeRange":["2020-08-10T16:38:17.773053+02:00","2020-08-10T16:38:17.773143+02:00"],"val":"103"}]},{"label":"+ false(%79, %7a)","data":[{"timeRange":["2020-08-10T16:38:17.773056+02:00","2020-08-10T16:38:17.773149+02:00"],"val":"123"}]},{"label":"Reshape(512, 2304)(%5)","data":[{"timeRange":["2020-08-10T16:38:17.773048+02:00","2020-08-10T16:38:17.773153+02:00"],"val":"88"}]},{"label":"+ false(%5c, %5d)","data":[{"timeRange":["2020-08-10T16:38:17.773011+02:00","2020-08-10T16:38:17.773176+02:00"],"val":"94"}]},{"label":"+ false(%4d, %4e)","data":[{"timeRange":["2020-08-10T16: |
| func broadcast(ctx context.Context, ch <-chan gorgonia.Value, cs []chan gorgonia.Value) { | |
| for { | |
| select { | |
| case msg := <-ch: | |
| for _, c := range cs { | |
| select { | |
| case c <- msg: | |
| case <-ctx.Done(): | |
| return | |
| } |
| runtime: python37 | |
| service: website | |
| handlers: | |
| - url: /(.*)/ | |
| static_files: www/\1/index.html | |
| upload: www/(.*) | |
| - url: / | |
| static_files: www/index.html |
| sepal_length | sepal_width | petal_length | petal_width | species | |
|---|---|---|---|---|---|
| 5.1 | 3.5 | 1.4 | 0.2 | setosa | |
| 4.9 | 3.0 | 1.4 | 0.2 | setosa | |
| 4.7 | 3.2 | 1.3 | 0.2 | setosa | |
| 4.6 | 3.1 | 1.5 | 0.2 | setosa | |
| 5.0 | 3.6 | 1.4 | 0.2 | setosa | |
| 5.4 | 3.9 | 1.7 | 0.4 | setosa | |
| 4.6 | 3.4 | 1.4 | 0.3 | setosa | |
| 5.0 | 3.4 | 1.5 | 0.2 | setosa | |
| 4.4 | 2.9 | 1.4 | 0.2 | setosa |
| package main | |
| import ( | |
| "context" | |
| "crypto/tls" | |
| "crypto/x509" | |
| "io/ioutil" | |
| "log" | |
| "os" | |
| "testing" |
| func eqInDelta(a,b tensor.Tensor, delta float32) bool { | |
| outputValue := outputT[0].Data().([]float32) | |
| expectedValue := expectedOutput.Data().([]float32) | |
| if ! outputT[0].Shape().Eq(expectedOutput.Shape()) { | |
| return false | |
| } | |
| for i := 0; i < len(outputValue); i++ { | |
| if math.Abs(float64(outputValue[i]-expectedValue[i])) > delta { | |
| return false |
I hereby claim:
To claim this, I am signing this object:
| package main | |
| import ( | |
| "flag" | |
| "fmt" | |
| "io/ioutil" | |
| "log" | |
| "os" | |
| "github.com/hashicorp/hcl" |