perm

package module
v0.0.0-...-83f3738 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2026 License: GPL-3.0, LGPL-3.0 Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const ActiveTasksFactor = 2
View Source
const AvgTimeFactor = 5
View Source
const ByeMsg = 9
View Source
const DataMsg = 1
View Source
const FinalByeMsg = 10
View Source
const HelloMsg = 1
View Source
const RescindMsg = 4
View Source
const ResultMsg = 3
View Source
const ShutdownMsg = 8
View Source
const StatsMsg = 6
View Source
const TaskMsg = 2
View Source
const ThreadMsg = 5

Variables

This section is empty.

Functions

func ConvertMap

func ConvertMap(invertedLayout map[string]int) (map[int]rune, error)

func DoTick

func DoTick() tea.Cmd

func FillTerminal

func FillTerminal(strList []string, height int) string

func SuffixedNumber

func SuffixedNumber(number float64) string

func TableStrings

func TableStrings(tableList []StatsRow) [][]string

func Ticker

func Ticker(
	p *tea.Program,
	finish chan bool)

can be replaced with tea's built-in ticker

Types

type BaseMessage

type BaseMessage struct {
	MessageID   string
	ClientID    string
	MessageType int
}

type BestLayout

type BestLayout struct {
	Layout    map[int]rune
	Score     float64
	Username  string
	Timestamp int64
}

func (*BestLayout) Update

func (bl *BestLayout) Update(
	layout map[string]int,
	score float64,
	username string,
	timestamp int64) error

type BigramList

type BigramList struct {
	Bigrams map[string]float64 `json:"bigrams"`
	Letters map[string]float64 `json:"letters"`
}

func ParseBigramsFile

func ParseBigramsFile(path string) (BigramList, error)

func (*BigramList) Print

func (bl *BigramList) Print()

type ByeMessage

type ByeMessage struct {
	MessageID   string
	MessageType int
}

type Finished

type Finished bool

type HelloMessage

type HelloMessage struct {
	MessageID   string
	ClientID    string
	MessageType int
	Threads     int
}

type KeyPos

type KeyPos struct {
	X int
	Y int
}

type KeyScores

type KeyScores struct {
	Scores map[int]map[int]float64
}

func ParseScoresFile

func ParseScoresFile(path string) (KeyScores, error)

func (*KeyScores) Print

func (s *KeyScores) Print()

func (*KeyScores) RankedKeys

func (s *KeyScores) RankedKeys() []int

type LayoutGrid

type LayoutGrid struct {
	Positions map[KeyPos]int
	Width     int
	Height    int
}

func ParseGridFile

func ParseGridFile(path string) (LayoutGrid, error)

func (LayoutGrid) ToString

func (grid LayoutGrid) ToString(layout map[int]rune) []string

type LetterData

type LetterData struct {
	Bigrams map[string]float64
	Scores  KeyScores
	Allowed map[int]string
	Letters string
	Keys    []int
}

func CreateLetterData

func CreateLetterData(
	bigrams BigramList,
	scores KeyScores,
	upperLimit int,
	lowerLimit int) LetterData

type LetterMessage

type LetterMessage struct {
	MessageID   string
	MessageType int
	Allowed     map[int]string          // which letters are allowed in which key position
	Bigrams     map[string]float64      // occurrence of a bigram per 1M words
	Scores      map[int]map[int]float64 // score of a key combination
	Letters     string                  // order of most common letter
	Keys        []int                   // order of most valuable position
	Grid        LayoutGrid              // physical layout grid
}

type Quitting

type Quitting bool

type StatsMessage

type StatsMessage struct {
	MessageID   string
	MessageType int
	Stats       StatsTables
}

type StatsRow

type StatsRow struct {
	Username     string
	Computations int
	Rate         float64
	Cores        int
	GPUs         int
}

func SortTables

func SortTables(tables []StatsRow) []StatsRow

func (StatsRow) CompString

func (t StatsRow) CompString() string

func (StatsRow) CoresString

func (t StatsRow) CoresString() string

func (StatsRow) GPUsString

func (t StatsRow) GPUsString() string

func (StatsRow) OutputStrings

func (t StatsRow) OutputStrings() []string

func (StatsRow) RateString

func (t StatsRow) RateString() string

type StatsTables

type StatsTables struct {
	Overall []StatsRow
	Session []StatsRow
}

func (StatsTables) OverallStrings

func (st StatsTables) OverallStrings() [][]string

func (StatsTables) SessionStrings

func (st StatsTables) SessionStrings() [][]string

type SubResult

type SubResult struct {
	SubID int

	Computations int
	TimeElapsed  int64
	Layout       map[rune]int
	Score        float64
	// contains filtered or unexported fields
}

func (*SubResult) GetChunkSize

func (s *SubResult) GetChunkSize() int

func (*SubResult) GetMap

func (s *SubResult) GetMap() map[rune]int

func (*SubResult) ReverseMap

func (s *SubResult) ReverseMap() map[int]rune

type SubTask

type SubTask struct {
	SubID        int
	Chunk        map[int]rune
	Computations int
	TimeElapsed  int64
	Layout       map[rune]int
	Score        float64
}

func (SubTask) GetChunkSize

func (s SubTask) GetChunkSize() int

func (SubTask) GetMap

func (s SubTask) GetMap() map[rune]int

func (*SubTask) RecordDuration

func (s *SubTask) RecordDuration(duration int64)

func (*SubTask) SaveLayout

func (s *SubTask) SaveLayout(layout map[rune]int)

func (*SubTask) SaveScore

func (s *SubTask) SaveScore(score float64)

type Task

type Task struct {
	TaskID   int
	SubTasks []SubTask

	BeginTime int64
	EndTime   int64
	// contains filtered or unexported fields
}

func (Task) BestScore

func (t Task) BestScore() (float64, map[string]int)

func (Task) Computations

func (t Task) Computations() int

func (*Task) Received

func (t *Task) Received(timestamp int64)

func (*Task) RecordEnd

func (t *Task) RecordEnd(timestamp int64)

func (*Task) RecordStart

func (t *Task) RecordStart(timestamp int64)

func (Task) TimeElapsed

func (t Task) TimeElapsed() int64

func (Task) Ts

func (t Task) Ts() int64

type TaskMessage

type TaskMessage struct {
	MessageID   string
	MessageType int
	Tasks       []Task
}

type Tick

type Tick bool

type TickMsg

type TickMsg time.Time

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL