๋๋ฉ์ธ ์ฃผ๋ ์ค๊ณ
eric evans ddd
eric evans ddd
์ฉ์ด robustness : ์์์น ๋ชปํ ์ํฉ์ด ๋ฐ์ํด๋ ์ด๋ ์ ๋ ๊น์ง๋ ๋ณ๋ฌธ์ ์์ด ๋์ํ๋๊ฒ resiliency : ์ด๋ ์ ๋ ์๊ฐ์ด ๊ฑธ๋ฆฌ๋๋ผ๋ ๋ค์ ์ ์์ ์ผ๋ก ๋์ํ๋ ๊ฒ ๋ชฉ์ฐจ CHAPTER 1 ์ปค๋งจ๋ ๋ผ์ธ ์ ํ๋ฆฌ์ผ์ด์ ์์ฑ 1.1 ์ฒซ ์ ํ๋ฆฌ์ผ์ด์ $ ./app Invalid number of arguments Usage: ./app <integer> [-h|--help] A greeter application which prints the name you entered <integer> number of times.% โฆ/practical-go/chap01/manual-parse $ echo $? # ๋ง์ง๋ง exit code ํ์ธํ๊ธฐ 1 1.2 ์ ๋ ํ ์คํธ ์์ฑ 1....
Pages [[]]
Books the art of postgresql ์ค๋ฌด์ ๋ฐ๋ก ์ฐ๋ Go ์ธ์ด ํธ์ฆ์จ ๊ฐ์ด๋ Grafana Env dotfiles ํ๋ฒ์ ์ค์น๋๋๋ก ํ๊ธฐ hx ํค๋งคํ, ๊ธฐ๋ฅ ์ ๋ฆฌ hhkb ํค๋งคํ ์ ๋ฆฌ ๋ฑ
Goroutines Goroutine Scheduling in Go Managed by the Go Runtime Scheduler Uses M:N Scheduling Model M goroutines are mapped onto N operating system threads Efficient Multiplexing (switching) Concurrency vs Parellelism Concurrency : multiple tasks progress simultaneously and not necessarily at the same time Parellelism : tasks are executed literally at the same time on mutliple processors Common Pitfalls and Best Practices Avoiding Goroutine Leaks Limiting Goroutine Creation Proper Error Handling Synchronization Channels Why Use Channels?...
ํต์ฌ ์ฐจ์ด์ 1. Python (๋ ํ์ดํ) - ๋๋ฌด ์์ ๋ก์ # ๋ฌธ์ : ์ด๋ค ๋ฉ์๋๊ฐ ํ์ํ์ง ์๊ธฐ ์ด๋ ค์ def program(logic): logic.process(data) # process ๋ฉ์๋๊ฐ ์๊ธฐ๋ฅผ '๊ธฐ๋'๋ง ํจ class Logic: def process(self, data): return "์ฒ๋ฆฌ๋จ" class WrongLogic: def handle(self, data): # process๊ฐ ์๋๋ผ handle! return "์ฒ๋ฆฌ๋จ" program(Logic()) # ์๋ program(WrongLogic()) # ๋ฐํ์ ์๋ฌ! AttributeError ์ด๋ค ๋ฉ์๋๊ฐ ํ์ํ์ง ์ฝ๋๋ง ๋ด์๋ ์ ์ ์์. 2. Java (๋ช ์์ ๊ตฌํ) - ๋๋ฌด ๊ฒฝ์ง๋จ // ์ธํฐํ์ด์ค ๋จผ์ ์ ์ํด์ผ ํจ public interface Logic { String process(String data); } // ๋ฐ๋์ implements ํค์๋๋ก ๋ช ์์ ๊ตฌํ public class LogicImpl implements Logic { public String process(String data) { return "์ฒ๋ฆฌ๋จ"; } } // ์๋ก์ด ์๊ตฌ์ฌํญ: ๋ค๋ฅธ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ํด๋์ค ์ฌ์ฉํ๊ณ ์ถ์ public class ThirdPartyProcessor { public String handle(String data) { // ๋ฉ์๋๋ช ์ด ๋ค๋ฆ!...
๊ธฐ๋ณธ ๊ฐ๋ ์๋ฒ ๋ฉ์ Go์์ ์์๊ณผ ๋น์ทํ ํจ๊ณผ๋ฅผ ๋ด๋ ๋ฐฉ๋ฒ. ํ์ง๋ง ์์์ด ์๋๋ผ ์ปดํฌ์ง์ (composition). ๊ตฌ์กฐ์ฒด ์๋ฒ ๋ฉ ๊ธฐ๋ณธ ์ฌ์ฉ๋ฒ type Person struct { Name string Age int } func (p Person) Greet() string { return "์๋ , ๋๋ " + p.Name } type Employee struct { Person // ์๋ฒ ๋ฉ! ํ์ ๋ง ์ฐ๊ณ ํ๋๋ช ์์ Position string Salary int } func main() { emp := Employee{ Person: Person{Name: "๊น์ฒ ์", Age: 30}, Position: "๊ฐ๋ฐ์", Salary: 5000, } // Person์ ํ๋์ ์ง์ ์ ๊ทผ ๊ฐ๋ฅ fmt....
โ๊ฐ์ด ์์"์ ์ด๋ป๊ฒ ํํํ ๊น? ์๋ฅผ ๋ค์ด ์ฌ์ฉ์ ์ ๋ณด๋ฅผ ๋ด๋ ๊ตฌ์กฐ์ฒด๊ฐ ์์ผ๋ฉด. type User struct { Name string Age int } user := User{Name: "ํ๊ธธ๋"} fmt.Println(user.Age) // 0 ์ฌ๊ธฐ์ ๋ฌธ์ ๊ฐ ์๊ธด๋ค. user.Age๊ฐ 0์ธ๋ฐ, ์ด๊ฒ ์ง์ง 0์ด์ธ์ง ์๋๋ฉด ๋์ด ์ ๋ณด๊ฐ ์๋ ๊ฑด์ง ๊ตฌ๋ถํ ์ ์๋ค. ํด๊ฒฐ์ฑ 1: ํฌ์ธํฐ ์ฌ์ฉ type User struct { Name string Age *int } // ๋์ด๋ฅผ ์๋ ๊ฒฝ์ฐ age := 25 user1 := User{Name: "๊น์ฒ ์", Age: &age} // ๋์ด๋ฅผ ๋ชจ๋ฅด๋ ๊ฒฝ์ฐ user2 := User{Name: "๋ฐ์ํฌ", Age: nil} // ์ฌ์ฉํ ๋ if user1....
C++ PS 1๋จ๊ณ: ๊ธฐ์ด ๋ฌธ๋ฒ ์์ ์ ๋ณต ๐ฏ 0. PS ํ์ ํค๋์ ๋งคํฌ๋ก ๊ธฐ๋ณธ ํค๋ ํ์ผ๋ค // ํ์ ๊ธฐ๋ณธ ํค๋ #include <iostream> // cin, cout #include <vector> // vector ์ปจํ ์ด๋ #include <string> // string ํด๋์ค #include <algorithm> // STL ์๊ณ ๋ฆฌ์ฆ ํจ์๋ค // ์ถ๊ฐ ์ ์ฉํ ํค๋๋ค #include <queue> // queue, priority_queue #include <stack> // stack #include <deque> // deque #include <set> // set, multiset #include <map> // map, multimap #include <unordered_set> // unordered_set #include <unordered_map> // unordered_map #include <utility> // pair, make_pair #include <functional> // greater, less ๋ฑ #include <numeric> // accumulate, gcd, lcm #include <cmath> // pow, sqrt, abs ๋ฑ #include <climits> // INT_MAX, LLONG_MAX ๋ฑ #include <cassert> // assert ๋งคํฌ๋ก // ๋ง๋ฅ ํค๋ (๋ํ์ฉ) #include <bits/stdc++....
๋ฆฌ๋ ์ค ๋ช ๋ น์ด ํ์ต ์ฒดํฌ๋ฆฌ์คํธ 1๋ถ ํต์ฌ ๊ฐ๋ 1์ฅ ๋ฆฌ๋ ์ค ๋ช ๋ น ๊ฒฐํฉํ๊ธฐ 1.1 ์ ๋ ฅ๊ณผ ์ถ๋ ฅ, ๊ทธ๋ฆฌ๊ณ ํ์ดํ 1.2 ๊ธฐ๋ณธ ๋ช ๋ น ์ฌ์ฏ ๊ฐ์ง 1.2.1 ์ฒซ ๋ฒ์งธ ๋ช ๋ น - wc 1.2.2 ๋ ๋ฒ์งธ ๋ช ๋ น - head 1.2.3 ์ธ ๋ฒ์งธ ๋ช ๋ น - cut 1.2.4 ๋ค ๋ฒ์งธ ๋ช ๋ น - grep 1.2.5 ๋ค์ฏ ๋ฒ์งธ ๋ช ๋ น - sort 1.2.6 ์ฌ์ฏ ๋ฒ์งธ ๋ช ๋ น - uniq 1.3 ์ค๋ณต ํ์ผ ์ฐพ์๋ด๊ธฐ 1.4 ์ ๋ฆฌ 2์ฅ ์ ธ๊ณผ ์นํด์ง๊ธฐ 2.1 ์ ธ์ ๊ดํ ์ฉ์ด 2....