MCPcopy Create free account

hub / github.com/ardanlabs/practical-go / functions

Functions75 in github.com/ardanlabs/practical-go

↓ 4 callersFunctionRelu
T is a "type constraint" (not a new type)
stats/stats.go:78
↓ 3 callersMethodFound
* Exercise: - Add a "Keys" field to Player with is a slice of strings - Add a "Found(key string)" method to player - It should err if key is not one
game/game.go:127
↓ 3 callersFunctionTokenize
Tokenize returns tokens (lower case) found in text.
nlp/nlp.go:16
↓ 2 callersFunctionMax
(values []T)
stats/stats.go:28
↓ 2 callersMethodMove
(int, int)
game/game.go:111
↓ 2 callersFunctionNewItem
* Types of "new" or factory functions. func NewItem(x, y int) Item func NewItem(x, y int) *Item func NewItem(x, y int) (Item, error) func NewItem(x, y
game/game.go:174
↓ 2 callersFunctionSHA1Sig
SHA1Sig returns SHA1 signature of uncompressed file. Exercise: Decompress only if file name ends with ".gz" cat http.log.gz| gunzip | sha1sum
sha1/sha1.go:20
↓ 2 callersFunctionbanner
(text string, width int)
banner/banner.go:23
↓ 2 callersFunctionhealth
()
nlp/cmd/httpd/main.go:116
↓ 2 callersFunctionmedian
* median - sort values - if odd number of values: return middle - return average of middles */
cart/cart.go:86
↓ 2 callersFunctionsafeDiv
* Using named return values: - defer/recover to change return error value - documentation */
div/div.go:16
↓ 2 callersFunctionurlLog
(url string)
urls/urls.go:80
↓ 1 callersMethodAt
Exercise: Write Max function for ints or floats Don't use the built-in max function
stats/stats.go:47
↓ 1 callersFunctionKillServer
(pidFile string)
kill_server/kill_server.go:25
↓ 1 callersMethodMove
Move moves i by delta x & delta y. "i" is called "the receiver" i is a pointer receiver * Value vs pointer receiver - In general use value semantics -
game/game.go:159
↓ 1 callersFunctionUserInfo
UserInfo return name and number of public repos from GitHub API.
github/github.go:49
↓ 1 callersFunctionappendInt
(s []int, v int)
cart/cart.go:108
↓ 1 callersFunctionbestBid
Written by Algo team, time to completion varies
rtb/rtb.go:41
↓ 1 callersFunctionbidOn
If algo didn't finish in time, return a default bid
_extra/rtb.go:20
↓ 1 callersFunctionbidOn
If algo didn't finish in time, return a default bid
rtb/rtb.go:20
↓ 1 callersFunctionconcat
(s1, s2 []string)
cart/cart.go:101
↓ 1 callersFunctiondiv
(a, b int)
div/div.go:33
↓ 1 callersFunctionfanOutPool
(urls []string)
urls/urls.go:32
↓ 1 callersFunctionfileSig
(path string)
_extra/taxi_check.go:33
↓ 1 callersFunctionfileSig
(path string)
taxi_check/taxi_check.go:100
↓ 1 callersMethodhealthHandler
(w http.ResponseWriter, r *http.Request)
nlp/cmd/httpd/main.go:106
↓ 1 callersFunctionloadTokenizeCases
(t *testing.T)
nlp/nlp_test.go:32
↓ 1 callersFunctionmoveAll
(ms []Mover, dx, dy int)
game/game.go:114
↓ 1 callersFunctionparseResponse
(r io.Reader)
github/github.go:68
↓ 1 callersFunctionparseSigFile
Parse signature file. Return map of path->signature
_extra/taxi_check.go:50
↓ 1 callersFunctionparseSigFile
Parse signature file. Return map of path->signature
taxi_check/taxi_check.go:117
↓ 1 callersFunctionsigWorker
(fileName, signature string, ch chan result)
taxi_check/taxi_check.go:88
↓ 1 callersFunctionsleepSort
* Channel semantics - send/receive to/from a channel will block until opposite operation(*) - guarantee of delivery - buffered channel has "n" non b
go_chan/go_chan.go:78
↓ 1 callersFunctiontopN
topN returns the "n" most common words in freq.
freq/freq.go:50
↓ 1 callersFunctionurlCheck
(url string)
urls/urls.go:113
FunctionExampleStem
()
_extra/stemmer_test.go:9
FunctionExampleStem
()
nlp/stemmer/stemmer_test.go:9
FunctionExampleTokenize
()
nlp/example_test.go:9
FunctionFuzzTokenizer
(f *testing.F)
nlp/nlp_test.go:97
FunctionNewMatrix
(rows, cols int)
stats/stats.go:52
FunctionStem
Stem returns the stem of word. e.g. "working" -> "work"
_extra/stemmer.go:13
FunctionStem
Stem returns the stem of word. e.g. "working" -> "work"
nlp/stemmer/stemmer.go:13
MethodString
Rule of thumb: Accept interface, return types go install golang.org/x/tools/cmd/stringer@latest In ~/.zshrc export PATH="$(go env GOPATH)/bin:${PATH}"
game/game.go:65
FunctionTestInCI
(t *testing.T)
nlp/nlp_test.go:91
FunctionTestTokenize
(t *testing.T)
nlp/nlp_test.go:12
FunctionTestTokenizeTable
Exercise: Read test cases from tokenize_cases.toml instead of in-memory slice
nlp/nlp_test.go:48
FunctionTest_healthHandler
(t *testing.T)
nlp/cmd/httpd/main_test.go:12
FunctionTokenize
(text string)
_extra/nlp.go:13
FunctionbestBid
Written by Algo team, time to completion varies
_extra/rtb.go:31
Functiondemo
()
github/github.go:20
FunctionfanOutResult
(urls []string)
urls/urls.go:89
FunctionfanOutWait
(urls []string)
urls/urls.go:61
Functionmain
()
game/game.go:8
Functionmain
()
banner/banner.go:9
Functionmain
()
urls/urls.go:11
Functionmain
Code that runs before main - var expressions - init function
freq/freq.go:23
Functionmain
()
kill_server/kill_server.go:11
Functionmain
()
_extra/taxi_check.go:71
Functionmain
()
_extra/rtb.go:9
Functionmain
()
div/div.go:5
Functionmain
()
taxi_check/taxi_check.go:38
Functionmain
()
sha1/sha1.go:12
Functionmain
()
cart/cart.go:8
Functionmain
Given a github user login, return name and number of public repos
github/github.go:14
Functionmain
()
rtb/rtb.go:9
Functionmain
()
hw/hw.go:7
Functionmain
()
stats/stats.go:9
Functionmain
()
nlp/cmd/httpd/main.go:36
Functionmain
()
select/select.go:9
Functionmain
()
count/count.go:10
Functionmain
()
go_chan/go_chan.go:8
Functionmain
()
empty/empty.go:5
FunctionmapDemo
()
freq/freq.go:62
MethodstemHandler
(w http.ResponseWriter, r *http.Request)
nlp/cmd/httpd/main.go:71
MethodtokenizeHandler
(w http.ResponseWriter, r *http.Request)
nlp/cmd/httpd/main.go:78