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
DO WHAT THE HECK YOU WANT TO PUBLIC LICENSE | |
Version 4, October 2019 | |
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net> | |
Copyright (C) 2013 Ben McGinnes <ben@adversary.org> | |
Copyright (C) 2019 Hexawolf <hexawolfie@gmail.com> | |
Everyone is permitted to copy and distribute verbatim or | |
modified copies of this license document, and changing it is | |
allowed as long as the name is changed. |
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
// WGS84 EPSG identifier | |
const WGS84 = 4326 | |
const DEG_TO_RAD = math.Pi / 180.0 | |
const RAD_TO_DEG = 180.0 / math.Pi | |
// DecodeUTF16 converts a UTF-16 string to a UTF-8 string. | |
func DecodeUTF16(b []byte) (string, error) { | |
if len(b)%2 != 0 { | |
return "", errors.New("must have even length byte slice") |
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
// mqttc.go - Simple MQTT client application for testing purposes. | |
// Copyright (c) 2019 Hexawolf | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining | |
// a copy of this software and associated documentation files | |
// (the "Software"), to deal in the Software without restriction, | |
// including without limitation the rights to use, copy, modify, merge, | |
// publish, distribute, sublicense, and/or sell copies of the Software, | |
// and to permit persons to whom the Software is furnished to do so, | |
// subject to the following conditions: |
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 | |
import "sort" | |
// ByteSlice attaches the methods of sort.Interface to []byte, sorting in | |
// increasing order. | |
type ByteSlice []byte | |
func (s ByteSlice) Len() int { return len(s) } | |
func (s ByteSlice) Less(i, j int) bool { return s[i] < s[j] } |
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
# DO WHAT THE HECK YOU WANT TO PUBLIC LICENSE | |
# Version 4, October 2019 | |
# | |
# Copyright (C) 2004 Sam Hocevar <sam@hocevar.net> | |
# Copyright (C) 2013 Ben McGinnes <ben@adversary.org> | |
# Copyright (C) 2019 Hexawolf <hexawolfie@gmail.com> | |
# | |
# Everyone is permitted to copy and distribute verbatim or | |
# modified copies of this license document, and changing it is | |
# allowed as long as the name is changed. |