This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package geojsonreader | |
import ( | |
"encoding/json" | |
"fmt" | |
"github.com/murphy214/mercantile" | |
"github.com/paulmach/orb" | |
gj2 "github.com/paulmach/orb/geojson" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package tickpool | |
import ( | |
"sync" | |
"time" | |
) | |
func init() { | |
mu = &sync.Mutex{} | |
pool = &sync.Pool{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package asyncio | |
import ( | |
"io" | |
"log" | |
"sync" | |
) | |
type AsyncMultiWriter struct { | |
mu *sync.Mutex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (p *audioPlayer) Play(session *rtsp.Session) { | |
log.Logger.WithField("category", "AirPlay Player").Warnf("Starting new session") | |
p.curSession = session | |
decoder := codec.GetCodec(session) | |
go func(dc *codec.Handler) { | |
var ok bool | |
for { | |
select { | |
/* Is using a pre-allocated buffer for a chan receiver more ideal than: | |
[buf, ok := <- session.DataChan]? */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Read reads structured binary data from r into data. | |
// Data must be a pointer to a fixed-size value or a slice | |
// of fixed-size values. | |
// Bytes read from r are decoded using the specified byte order | |
// and written to successive fields of the data. | |
// When decoding boolean values, a zero byte is decoded as false, and | |
// any other non-zero byte is decoded as true. | |
// When reading into structs, the field data for fields with | |
// blank (_) field names is skipped; i.e., blank field names | |
// may be used for padding. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package fastbinary | |
import ( | |
"bytes" | |
"encoding/binary" | |
"io" | |
"testing" | |
) | |
func BenchmarkInternalBinary_Read(b *testing.B) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package bm | |
import "bytes" | |
func BoyerMooreIndex(s, substr []byte) int { | |
d := CalculateSlideTable(substr) | |
return IndexWithTable(&d, s, substr) | |
} | |
func IndexWithTable(d *[256]int, s, substr []byte) int { |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A | |
a | |
aa | |
aal | |
aalii | |
aam | |
Aani | |
aardvark | |
aardwolf | |
Aaron |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<domain type='kvm'> | |
<name>Syslog-Aggregator</name> | |
<uuid>71d383a1-05bc-4cdd-9439-8440f248eec2</uuid> | |
<metadata> | |
<libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0"> | |
<libosinfo:os id="http://centos.org/centos/8"/> | |
</libosinfo:libosinfo> | |
</metadata> | |
<memory unit='KiB'>14336000</memory> | |
<currentMemory unit='KiB'>14336000</currentMemory> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
type systemMetrics struct { | |
Domains []struct { | |
UUID string `json:"UUID"` | |
CPUCores int64 `json:"cpu_cores"` | |
CPUOtherSteal int64 `json:"cpu_other_steal"` | |
CPUOtherTotal int64 `json:"cpu_other_total"` | |
CPUSteal int64 `json:"cpu_steal"` | |
CPUTotal int64 `json:"cpu_total"` |
NewerOlder