Posts

Showing posts from November, 2022

31. Go - Strings

Strings are a slice of bytes, uint8. They are immutable, cannot change a variable's individual bytes. Declaring variable string: aString := "double quoted" Raw string literal Declaring variable string back ticks: aString := `helllo, "DOG"`

2. Data Science and ML - Section 2: The Problems

Steps to tackle problems as Data Scientist: Formulate Question Not vague, be specific. Find the prediction (target/dependent variable), find what can correlate with the prediction, this will be the feature/independent variable. Gather Data Clean Data Explore/Visualize Data Train Algorithm Evaluate Results

1. Data Science and ML - Section 1

Data Science: study of things related to data. Hierarchy = Collect -> Move/Store -> Explore/Transform -> Aggregate/Label -> Learn/Optimize Data Engineer, Collects and Move/Store Data Scientist, Explore/Transform and Aggregate/Label Machine Learning Expert, Use data to do ML

30. Go - Conversion

Convert one type to another type if there is a similar underlying type.     var xx int     var toddAge variableNameAge = 50     xx = int (toddAge)     fmt. Println (xx) Converted toddAge (type variableNameAge) to an int to be able to declare as xx which is type int.

29. Go - Types Declaring

Declaring a type: type variableNameAge int type variableNamePerson struct {} type variableNameDecimal float64 type variableNameName string type variableNameBig bool var toddAge variableNameAge = 50 var toddName variableNameName = "todd"

1C. Go - Packages

Packages need to be imported before use. Use: package main import "fmt" func main () {     fmt. Println ( "HELLO" ) } Packages are used in a program using the format PACKAGE.IDENTIFIER, fmt.Println(), fmt is PACKAGE, Println() is IDENTIFIER.

1B. Go - Modules/Get

Go Module, allows easier use of dependencies and organization. - go mod init MODULENAME // creates a new go module using a domain name - go get -d PACKAGE // get package but do not build and install using d flag. Packages will be downloaded to GOPATH.

1A. Go - Workspace

Go Workspace, workspace for packages, files for projects, etc. Separate from GO's installation root directory. Setup GO PATHS in environment variables (in system variables). GOROOT // points to Go root folder in C directory. GOPATH // points to the Go workspace folder Go workspace should be define in GO PATH. Go root directory defined by GO ROOT. Use go env to set workspace. Workspace requires: - bin - pkg - src

28. Go - Terminal Commands

- go // lists go commands - go env // lists go environment variables - go env -w GOOS=linux // set go to compile to linux - go fmt // formats the go code into convention standard format. - go get // get packages from internet Compiling/Building Code/Packages: - go install //      For executables: builds/compiles the code and puts it in the GOPATH bin folder     For packages: builds/install the packages in GOPATH pkg folder - go build // builds the code as an executable in the current directory. - go clean // cleans residual build exes

1. Git Bash - Basics

Git Bash, emulator of shell bash for windows. Allows the use of Linux terminal commands. Git Bash included with Git as an exe. Escapes: - \ // backslash escapes spaces Key Shortcuts: - Tab // autocomplete Commands: - ./FILENAME // runs executable file - pwd // prints the working directory of where the terminal is in - ls // list files in the current working directory - ls -la // lists all files with extra details     First column is permissions for [owner, group, world] in rwxrwxrwx format.     the letter in front of rwxrwxrwx indicates whether its hidden, a directory, or windows (l) stuff - cd // change directory     - cd ../ // returns to parent directory - clear // clear the terminal - mkdir // creates a new directory - touch // create files - cat // read files, dumps content into terminal - nano // edit file? - grep // searches - rm // remove file     - rm -rf // remove with force - | // pipe, place after a command to use the output as another input into another command     - ls |