Documentation ¶
Index ¶
- func Abs(a int) int
- func ArithmeticProgression(first int, last int) int
- func Binary_to_decimal(decimalValue string) int64
- func Bitwisenot(value int) int
- func Check(e error)
- func CheckErr(err error)
- func Console(msg ...string)
- func Contains(a string, list []string) bool
- func Convert_strings_to_ints(input []string) []int
- func Decimal_to_binary(value int64) string
- func DirExists(filename string) bool
- func EvaluateFilename(filename string) string
- func Factorial(a uint64) uint64
- func FileExists(filename string) bool
- func Intify(value string) int
- func Isint(value string) bool
- func LPad(original string, padding string, repeat int) string
- func LPadToFixedLength(original string, padding string, maxLength int) string
- func Load_file_to_ints(filename string) []int
- func Load_file_to_strings(filename string) []string
- func Make_map_of_inty_list(data []int) map[int]int
- func MaskPermutations(maskData string, position int, results []string) []string
- func Max(v1 int, v2 int) int
- func Max64(a int64, b int64) int64
- func MaxU64(a uint64, b uint64) uint64
- func Min(v1 int, v2 int) int
- func Min64(a int64, b int64) int64
- func MinU64(a uint64, b uint64) uint64
- func RPad(original string, padding string, repeat int) string
- func RPadToFixedLength(original string, padding string, maxLength int) string
- func RandStringRunes(n int) string
- func Repeatstring(s string, times int) string
- func ReverseString(s string) string
- func StripWhitespace(line string) string
- func TokenswitchEnvironmentVariables(original string) string
- type Align
- type Bin
- type BitSet
- type Column
- type Counter
- type FileScanner
- type IntMap
- type Logger
- type Mask
- type Point2D
- type Point2DF
- type Point3D
- type Point4D
- type ProbabilityStore
- func (store *ProbabilityStore) BinarySearch(value float64, bins []*Bin) int
- func (store ProbabilityStore) Debug(totalRows int)
- func (store *ProbabilityStore) Indexof(value float64) int
- func (store ProbabilityStore) Length() int
- func (store *ProbabilityStore) Search_o_log_n(value float64) int
- func (store *ProbabilityStore) Search_on(value float64) int
- type Stopwatch
- func (s *Stopwatch) Clear()
- func (s *Stopwatch) DebugMilliseconds() string
- func (s *Stopwatch) DebugNanoseconds() string
- func (s *Stopwatch) End()
- func (s *Stopwatch) First() *StopwatchEntry
- func (s *Stopwatch) Last() *StopwatchEntry
- func (s *Stopwatch) Size() int
- func (s *Stopwatch) Split(msg string) *StopwatchEntry
- func (s *Stopwatch) Start()
- type StopwatchEntry
- type SysInfo
- type Table
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArithmeticProgression ¶
https://en.wikipedia.org/wiki/Arithmetic_progression also: https://www.youtube.com/watch?v=uACt9OntiLo
func Binary_to_decimal ¶
func Bitwisenot ¶
func Convert_strings_to_ints ¶
func Decimal_to_binary ¶
func EvaluateFilename ¶
EvaluateFilename replaces ~ with os.Getenv("HOME") on the filename
func FileExists ¶
FileExists indicates if a file already exists... or not
func LPadToFixedLength ¶
func Load_file_to_ints ¶
func Load_file_to_strings ¶
func Make_map_of_inty_list ¶
make_map_of_inty_list helper makes a map[int]int of a []int to give me whatever go's maps key algorithm performance is, at the cost of the memory
func MaskPermutations ¶
func RPadToFixedLength ¶
func RandStringRunes ¶
func Repeatstring ¶
func ReverseString ¶
func StripWhitespace ¶
Types ¶
type Bin ¶
type Bin struct { Index int // position in original array Probability float64 // chance of this event occurring Count int // number of times it has occurred in this run LowerBound float64 // lvalue in range of 0 .. 1 to accept UpperBound float64 // rvalue in range of 0 .. 1 to accept }
Bin helper to hold the probability and number of times it has occured
type BitSet ¶
func (*BitSet) ToBinaryString ¶
type Counter ¶
func NewCounter ¶
func NewCounter() *Counter
type FileScanner ¶
func BuildScanner ¶
func BuildScanner(filename *string) *FileScanner
type Logger ¶
type Mask ¶
type Mask struct {
Data string
}
func (*Mask) DeriveNewMask ¶
address: 000000000000000000000000000000101010 (decimal 42) mask: 000000000000000000000000000000X1001X result: 000000000000000000000000000000X1101X
func (*Mask) GetVariations ¶
type Point2D ¶
func (*Point2D) RotateAroundOrigin ¶
RotatesAroundOrigin rotates this point around the specified origin
type ProbabilityStore ¶
ProbabilityStore helper struct holds all Bins and methods
func NewProbabilityStore ¶
func NewProbabilityStore(values []float64) *ProbabilityStore
NewProbabilityStore factory function creates a store and allocates the Bins against the array of probabilities
func (*ProbabilityStore) BinarySearch ¶
func (store *ProbabilityStore) BinarySearch(value float64, bins []*Bin) int
BinarySearch performs a binary serach to find the appropriate bin for the passed value
func (ProbabilityStore) Debug ¶
func (store ProbabilityStore) Debug(totalRows int)
Debug prints the results to stdout
func (*ProbabilityStore) Indexof ¶
func (store *ProbabilityStore) Indexof(value float64) int
Indexof return the position in the array of the Bin that serves the value or -1 if it does not exist
func (ProbabilityStore) Length ¶
func (store ProbabilityStore) Length() int
Length returns integer number of Bins in the store
func (*ProbabilityStore) Search_o_log_n ¶
func (store *ProbabilityStore) Search_o_log_n(value float64) int
Search_o_log_n performs a search in o(n) time to find the appropriate bin for the passed value
func (*ProbabilityStore) Search_on ¶
func (store *ProbabilityStore) Search_on(value float64) int
Search_on performs a search in o(n) time to find the appropriate bin for the passed value
type Stopwatch ¶
type Stopwatch struct { Prefix string Splits []*StopwatchEntry }
func NewStopwatch ¶
func (*Stopwatch) DebugMilliseconds ¶
func (*Stopwatch) DebugNanoseconds ¶
func (*Stopwatch) First ¶
func (s *Stopwatch) First() *StopwatchEntry
func (*Stopwatch) Last ¶
func (s *Stopwatch) Last() *StopwatchEntry
func (*Stopwatch) Split ¶
func (s *Stopwatch) Split(msg string) *StopwatchEntry
type StopwatchEntry ¶
type SysInfo ¶
type SysInfo struct { Hostname string `bson:hostname` Platform string `bson:platform` CPU string `bson:cpu` RAM uint64 `bson:ram` Disk uint64 `bson:disk` }
SysInfo saves the basic system information
func NewSysInfo ¶
func NewSysInfo() *SysInfo