본문 바로가기

전체 글343

[Go] Constant A constant is an unchanged value. Only primitive type can be defined as constant. Boolean Rune Integer Real Number Complicated Number String The type that is not a primitive type like Structure, Array can't be defined as constant. Constant Definition const Name Type = Value If the name starts with a capital letter, the constant is exposed to out of the file. Constant Usage package main func main.. 2021. 10. 5.
[Go] The Error of Floating Point Number Like most programming languages, Go also has the floating point error problem. Problem Please look at the below code. package main import ( "fmt" ) func main() { a := 0.1 b := 0.2 c := a + b fmt.Println(c) } // 0.30000000000000004 c was not a 0.3! Therefore, we are hard to compare floating point numbers. a := 0.1 b := 0.2 c := 0.3 d := a + b if c == d { fmt.Println("It's the same!") } else { fmt.. 2021. 10. 4.
[Go] Operator Operator Precedence Unary operators have the highest precedence. As the ++ and -- operators form statements, not expressions, they fall outside the operator hierarchy. Go supports only post-increment and post-decrement operators, not pre-increment and pre-decrement. There are five precedence levels for binary operators. Binary operators of the same precedence associate from left to right. Preced.. 2021. 10. 4.
[Go] Package fmt Package fmt implements formatted I/O with functions analogous to C's printf and scanf. Description General %v : the value in a default format (when printing structs, adds the plus symbol to field names ) %#v : a Go-syntax representation of the value %T : a Go-syntax representation of the type of value Integer %b : base 2 %d : base 10 %x : base 16, with lower-case letters for a-f %X : base 16, wi.. 2021. 10. 4.
[VS Code] Extensions 추천 - (2021.09.17) 제가 현재 사용하는 것들 소개 및 추천 드려보고자 합니다. 저도 필요에 따라 골라 쓰고 있으니 맘에 드는 것들 골라 쓰시면 되요. ^^ Extensions 메뉴를 열려면 단축키(⇧⌘X)를 사용하시거나 좌측 메뉴에서 아이콘을 클릭하시면 되요. Appearance Material Theme 더보기 요 확장은 칼라 테마를 변경할 수 있게 해줍니다. ⌘K⌘T 키를 눌러 원하는 테마를 선택할 수 있습니다. 기분따라 쓸 때도 있고, 기본을 쓸 때도 있어요. 예전에 Vim이나 eclipse를 썼을 때는 좋아하는 테마가 있어서 그런 것들 사용하거나 직접 만들어 썼었는데... 지금은 그냥 기본이나 요 테마 를 번갈아가며 써요. Material Icon Theme 더보기 요 확장은 아이콘 테마를 변경할 수 있게 해줍니다... 2021. 9. 17.
[Svelte] Using TailwindCSS on Svelte TailwindCSS is my favorite CSS framework. Let's use TailwindCSS on Svelte. Create an Application Create a svelte application via a template. Please see Create an Application section on the below post. 2021.09.14 - [Web/Etc] - [Svelte] Getting Started with VSCode Add TailwindCSS Add dependencies for TailwindCSS. $ yarn add -D tailwindcss postcss autoprefixer or $ npm install -D tailwindcss postcs.. 2021. 9. 14.
[Svelte] Getting Started with VSCode Svelte is a framework that aims to "write less code", "no virtual dom", and "truly reactive". Therefore, the application code and result of svelte are simple and tiny. Create an Application Let's create a svelte application using the template. $ npx degit sveltejs/template getting-started Move to the application folder. $ cd getting-started Enable TypeScript. $ node scripts/setupTypeScript.js In.. 2021. 9. 14.
[Python] Running Python with Docker In this posting, we will be looking into running python with docker. Install Docker I will use docker on MAC with homebrew. $ brew install --cask docker Please refer to the official site for installing docker if you want to use it another way or use another OS. https://docs.docker.com/get-docker/ Get Docker docs.docker.com Now, run the docker. Then docker is automatically downloaded and you can .. 2021. 8. 28.
[PyQt6] Getting Started In this posting, we will learn how to create the desktop application using PyQt6. Installation $ pip install pyqt6 Now, we prepared for using PyQt6. Create Application Using Function import sys from PyQt6.QtWidgets import QApplication, QWidget def main(): w = QWidget() w.resize(320, 240) w.setWindowTitle('PyQt6 Example') w.show() sys.exit(app.exec()) if __name__ == '__main__': app = QApplication.. 2021. 8. 10.