Skip to content

Instantly share code, notes, and snippets.

View owulveryck's full-sized avatar

Olivier Wulveryck owulveryck

View GitHub Profile
@owulveryck
owulveryck / AAAReadme.md
Last active November 6, 2020 11:27
Turtle ref parsing

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 .
@owulveryck
owulveryck / index.html
Last active November 8, 2020 22:24
Execution of the tiny-yolo v2 with Gorgonia an the gomachine visualised with d3js
<!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:
@owulveryck
owulveryck / broadcast.go
Created July 22, 2020 06:08
Concurrence
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
}
@owulveryck
owulveryck / app.yaml
Created February 5, 2020 10:36
Service static files with GAE (google app-engine)
runtime: python37
service: website
handlers:
- url: /(.*)/
static_files: www/\1/index.html
upload: www/(.*)
- url: /
static_files: www/index.html
@owulveryck
owulveryck / iris.csv
Last active December 6, 2024 13:55
Linear regression on iris dataset with Gorgonia and gota
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
@owulveryck
owulveryck / kafka_test.go
Created October 17, 2019 15:09
kafka connect from Go with certificates
package main
import (
"context"
"crypto/tls"
"crypto/x509"
"io/ioutil"
"log"
"os"
"testing"
@owulveryck
owulveryck / compare_tensor.go
Last active August 17, 2019 09:34
yolo testing material
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
@owulveryck
owulveryck / keybase.md
Created May 16, 2019 08:20
keybase verification

Keybase proof

I hereby claim:

  • I am owulveryck on github.
  • I am owulveryck (https://keybase.io/owulveryck) on keybase.
  • I have a public key whose fingerprint is CA7D BBE2 A8D3 41AD 5419 D40F 2503 3D41 B2EA 07D5

To claim this, I am signing this object:

@owulveryck
owulveryck / main.go
Last active April 16, 2019 14:29
terraform tfvars diff: do a diff against two tfvars and returns an error if they do not contain the same variables.
package main
import (
"flag"
"fmt"
"io/ioutil"
"log"
"os"
"github.com/hashicorp/hcl"
@owulveryck
owulveryck / main.go
Created April 11, 2019 12:40
Simple snake_case to camel case converter (https://play.golang.org/p/RtAzmSgnnvM)
package main
import (
"fmt"
"regexp"
"strings"
)
func main() {
fmt.Println(toCamelCase("blo_bla_Di_bla"))