Skip to content

Instantly share code, notes, and snippets.

View trickkiste's full-sized avatar

DI FH Markus Kienast trickkiste

View GitHub Profile
#!/usr/bin/python
# -*- coding: utf-8 -*-
import datetime
import numpy as np
#Anzahl der Möglichkeiten berechnen:
#https://de.numberempire.com/combinatorialcalculator.php
#(n + m - 1)! / ((n - 1)! * m!) = 4183713304
# Anzahl der Fälle einer prozentuellen Abweichung
package main
import (
"time"
"strconv"
"sync"
"fmt"
"log"
"os"
"bufio"
package main
import (
"time"
"strconv"
"sync"
"fmt"
"log"
"os"
"bufio"
201 OK
5467
0 "audio-bbc.xml" 0 2255 2256 2256 25.00
1 "afasdfasdfasdf" 0 2255 2256 2256 25.00
2 "one two" 0 2255 2256 2256 25.00
3 "one two three" 0 2255 2256 2256 25.00
bash-4.4# cat melted-playlist.txt | gawk -f melted-simple.awk
{"payload":["index":"0","filename":"audio-bbc.xml","in":"0 2255 2256 2256 25.00","out":"","length":"","calculated_length":"","fps":"0.000000"],["index":"1","filename":"afasdfasdfasdf","in":"0 2255 2256 2256 25.00","out":"","length":"","calculated_length":"","fps":"0.000000"],["index":"2","filename":"one two","in":"0 2255 2256 2256 25.00","out":"","length":"","calculated_length":"","fps":"0.000000"],["index":"3","filename":"one two three","in":"0 2255 2256 2256 25.00","out":"","length":"","calculated_length":"","fps":"0.000000"]}
#!/usr/bin/awk -f
BEGIN {
FS=" *\" *";
ORS="";
OFS="";
print "{\"payload\":["
}
\
(NR>2) { printf "%s\
$awk -f main.awk
{"payload":["index":"0","filename":""audio-bbc.xml"","in":"0","out":"2255","length":"2256","calculated_length":"2256","fps":"25.00
"],["index":"1","filename":""afasdfasdfasdf"","in":"0","out":"2255","length":"2256","calculated_length":"2256","fps":"25.00
"],["index":"2","filename":""onetwo"","in":"0","out":"2255","length":"2256","calculated_length":"2256","fps":"25.00
"],["index":"3","filename":""onetwothree"","in":"0","out":"2255","length":"2256","calculated_length":"2256","fps":"25.00"]}
bash-4.4# cat melted-playlist.txt | gawk -f melted-simple.awk
"],["index":"3","filename":""onetwothree"","in":"0","out":"2255","length":"2256","calculated_length":"2256","fps":"25.00"]}:"25.00
BEGIN {
ORS=""
OFS=""
print "{\"payload\":["
}
/[^\s"]+|"([^"]*)"/g && (NR>2) {
ORS=""
OFS=""
printf "%s\"index\":\"%d\",\"filename\":\"%s\",\"in\":\"%d\",\"out\":\"%d\",\"length\":\"%d\",\"calculated_length\":\"%d\",\"fps\":\"%s\"", sep, $1, $2, $3, $4, $5, $6, $7; sep="],["
}
/go/src/test-worker-ffmpeg # go version
go version go1.8.4 linux/amd64
/go/src/test-worker-ffmpeg # go test
scannerStderr
scannerStdout
writerStdin
----------------- 1. Iteration -----------------
Empty message sent:
sending message