본문 바로가기

전체 글346

[Excel] MATCH Function MATCH 함수는 주어진 행 혹은 열에서 내가 찾고 싶은 값이 있는 셀의 위치를 알려주는 함수입니다. MATCH(lookup_value, lookup_array, [match_type]) lookup_value에 찾고자 하는 값을 넣어주고, lookup_array에 찾을 대상이 되는 행이나 열을 배열 형태로 넣어줍니다. match_type을 통해 원하는 값을 어떻게 찾을 것인지를 명시해줄 수도 있는데, 자세한 것은 아래를 참고해 주세요. match_type 1 or 생략 : 찾고자 하는 값보다 작거나 같은 값 중 최대값이 있는 위치 행 혹은 열의 값이 오름차순으로 되어야 한다. 0 : 정확히 일치하는 값이 있는 위치 -1 : 찾고자 하는 값보다 크거나 같은 값 중 최소값이 있는 위치 행 혹은 열의 값이 .. 2020. 11. 4.
[Excel] OFFSET Function OFFSET 함수는 주어진 표에서 원하는 행과 열에 위치한 셀의 값을 얻는 함수입니다. OFFSET(reference, rows, cols, [height], [width]) reference에 표의 좌상단을 넣어주고, 원하는 행과 열을 각각 rows와 cols에 명시해줍니다. 추가로 표의 크기를 height와 width에 넣어줄 수도 있습니다. Usage 2020. 11. 4.
[Go] User-Defined Type Primitive Type based User-Defined Type type liters float64 type gallons float64 func main() { gasoline := liters(12.5) diesel := gallons(32.7) fmt.Println(gasoline, diesel) // 12.5 32.7 } You can create your own type based on primitive type. When converting a type, Go considers only the value itself. fmt.Println(gallons(liters(3.14))) // 3.14 So this example is not wrong, because they are all th.. 2020. 11. 2.
[Go] Package bufio Package bufio implements buffered I/O. Methods type Scanner 더보기 NewScanner NewScanner returns a new Scanner to read from r. func NewScanner (r io.Reader) *Scanner Err Err returns the first non-EOF error that was encountered by the Scanner. func (s *Scanner) Err() error Scan Scan advances the Scanner to the next token, which will then be available through the Bytes or Text method. It returns fals.. 2020. 10. 31.
[Go] Package errors Package errors implements functions to manipulate errors. Methods New New returns an error that formats as the given text. Each call to New returns a distinct error value even if the text is identical. func New(text string) error Usages package main import ( "errors" "log" ) func main() { err := errors.New("error: my error") if err != nil { log.Fatal(err) } } // error: my error 2020. 10. 29.
[Go] Package math Package math Package math provides basic constants and mathematical functions. Package rand Package rand implements pseudo-random number generators. Methods Seed Seed uses the provided seed value to initialize the default Source to a deterministic state. Seed values that have the same remainder when divided by 2^31 - 1 generate the same pseudo-random sequence. Seed, unlike the Rand.Seed method, .. 2020. 10. 27.
[Go] Package strconv Package strconv implements conversions to and from string representations of basic data types. Methods Atoi Atoi equivalent to ParseInt(s, 10, 0), converted to type int. func Atoi(s string) (int, error) Itoa Itoa is equivalent to FormatInt. func Itoa(i int) string ParseBool, ParseUInt, ParseInt, ParseFloat ParseBool, ParseUInt, ParseInt, and ParseFloat convert strings to values. func ParseBool(s.. 2020. 10. 26.
[Go] Package strings Package strings implements simple functions to manipulate UTF-8 encoded strings. Methods TrimSpace TrimSpace returns a slice of the string, with all leading and trailing white space removed, as defined by Unicode. func TrimSpace(s string) string Usages package main import ( "fmt" "strings" ) func main() { greeting := "\n Hi, nice to meet you \t\n" fmt.Println(strings.TrimSpace(greeting)) // Hi, .. 2020. 10. 26.
[Go] Basic Go is a statically typed language. Let me show you a very default Go program. package main import "fmt" func main() { fmt.Println("Hello, Go!") } The first line declares which package to use. We run the program directly in the terminal, so the main package is needed. The next line imports fmt package. The example program prints the message through Println function in the fmt package. Then finall.. 2020. 10. 26.