Giải quyết 10 vấn đề khó khăn trong cuộc sống bằng thái độ biết ơn
2019-11-27
- Lạc đường khi đi chơi -> sau này nhớ lại mới có chuyện để nói chứ.
- Tắc đường khi đi làm về -> có thời gian để nghĩ về các ý tưởng.
- Làm việc ở nhà -> tiết kiệm thời gian đi trên đường.
- -> có thời gian đón con.
- -> đi ăn trưa cùng bạn bè.
- Thất nghiệp -> có cơ hội để học thứ gì đó.
- Phỏng vấn tạch -> biết kiến thức của mình còn hổng ở đâu.
Những người tốt quanh ta
2019-11-01
On the way go to Sun Yat-sen university.
Xuống xe buýt.
Google Maps chỉ một đường, người dân chỉ đường khác.
Đang phân vân thì:
- Anh chị là người Việt ạ?
- Uh, mình đang tìm đường đến …
- Em cũng đang rảnh, để em dẫn đi
- Cảm ơn bạn
Bạn xuống xe, đi bộ cùng cả nhà. Vừa đi, vừa nói chuyện. Bạn học ĐHQG, đang làm TS toán tối ưu bên này. Bạn vừa dẫn đi vừa giới thiệu lịch sử, … Rồi còn chụp ảnh giúp.
Why my golang docker container exits immediately (code 127)?
2019-10-30
To trim the binary size, I used LDFLAGS='-w -s'
, pack with upx
, then build from scratch. The thing is when starting, it exited immediately with code 127. Why?
My Dockerfile:
1FROM scratch 2 3WORKDIR /app 4 5COPY build/linux/<binary> . 6 7ENTRYPOINT [ "/app/<binary>" ]
When starting:
10fbce782a9bd quantonganh/<binary>:T276-dockerize "/app/<binary>" 6 seconds ago Exited (127) 4 seconds ago relaxed_thompson
go/packages.Load: no packages found
2019-10-22
I have a mono-repo, structure like this:
1repo 2├── service1 3├── service2 4├── go.mod
I often open the root folder from the command line by using code .
. After that I open a file in service1
, and cannot go to definition. Here’s the logs from gopls
:
1[Info - 5:49:28 AM] 2019/10/22 05:49:28 20.675656ms for GOROOT=/usr/local/Cellar/go/1.13/libexec GOPATH=/Users/quanta/go GO111MODULE=auto PWD=/Users/quanta/go/src/github.com/owner/repo go "list" "-e" "-json" "-compiled=true" "-test=true" "-export=false" "-deps=true" "-find=false" "--" "/Users/quanta/go/src/github.com/owner/repo/a/b/c", stderr: <<go: directory a/b/c is outside main module 2>> 3 4[Error - 5:49:32 AM] Request textDocument/definition failed. 5 Message: go/packages.Load: no packages found for /Users/quanta/go/src/github.com/owner/repo/a/b/c/file.go 6 Code: 0
Bằng về sớm với ba
2019-10-21
Bốn giờ con tan học
Ùa ra như bầy ong
Chạy xuống sân đá bóng
Mới năm giờ đã xong.
Bởi lần lượt các bạn
Được bố mẹ đón đi
Còn mỗi con ở lại
Nằm dài xem tivi.
Xem một lúc chán quá
Lang thang đi tìm ba
Gọi mãi mà chẳng thấy
Ba vẫn còn ở xa.
Năm rưỡi ba gập máy
Quyết định nhấc cái mông
Vành đai ba thì tắc
Biết bao giờ mới thông.
Sáu giờ mười đến cổng
Thấy con đang ngóng trông
database/sql: never ignore errors
2019-10-16
I’m reading Building RESTful Web Services with Go. And in chapter 4, there is an example to play around with SQLite:
1db, err := sql.Open("sqlite3", "./books.db") 2if err != nil { 3 log.Fatal(err) 4} 5 6statement, err := db.Prepare("CREATE TABLE IF NOT EXISTS books (id INTERGER PRIMARY KEY, isbn INTEGER, author VARCHAR(64), name VARCHAR(64) NULL)") 7if err != nil { 8 log.Fatal(err) 9} else { 10 log.Println("Created table books successfully") 11} 12statement.Exec() 13 14statement, err = db.Prepare("INSERT INTO books (name, author, isbn) VALUES (?, ?, ?)") 15if err != nil { 16 log.Fatal(err) 17} 18statement.Exec("Life is a joke", "The Javna brothers", 123456789) 19log.Println("Inserted first book into db") 20rows, err := db.Query("SELECT id, name, author FROM books") 21var tempBook Book 22for rows.Next() { 23 rows.Scan(&tempBook.id, &tempBook.name, &tempBook.author) 24 log.Printf("ID: %d, Book: %s, Author: %s\n", tempBook.id, tempBook.name, tempBook.author) 25}
Lên xuống dòng đời
2019-10-14
Wien Hauptbahnhof, Austria.
Vừa đáp chuyến tàu đêm từ Zurich sang. May mà lần này mỗi khi tàu dừng, điều hoà không tắt thì phải. Cuốc bộ tiếp 1,5 km nữa để về khách sạn. Hồn nhiên đưa mail booking cho nhân viên, đang định hỏi xem có cho check in sớm không.
- Ơ, cái này là mày đặt cho đêm mai mà?
- Ặc, mình nhầm ngày à.
- Chỗ mày có cho gửi đồ không?
How do I build this blog?
2019-10-11
Recently, I decided to find a new job as a Golang developer. So, I updated my resume, sent to my friends to ask for review. Then I submitted it enclosed herewith a cover letter to recruiters. Some didn’t reply, and the other replied with a message like this “You are so good, but I’m so sorry…”.
What is the reason?
As you can see in my resume, I started my career as a .NET developer, then my passionate on Linux and open source lead me to a different direction: system administrator. And I followed this nearly in 9 years before switching back to work as a Golang developer 2 years ago.
Resume
2019-09-30
Quan Tong Anh
quantonganh@gmail.com
github.com/quantonganh
Experience
Software Engineer, CIC Data
Oct 2019 - Sep 2021
- Design and build high performance and reliable software with clean code.
- Write scalable RESTful and gRPC-based APIs in Golang for our clients and partners.
- Redesign algorithm of the most important module to improve the performance by 20-30%.
- Refactor code to make it easier to read, simpler to understand, and faster to update.
- Automate integration testing with Drone CI / GitHub Actions and Docker Compose.
Command-line autocomplete for Go documentation
2019-09-26
Go has a great, well documented standard library. You may find yourself spending a fairly significant chunk of your Go programming time digging in stdlib docs, which is reasonable to expect at least for novice Go coders.
https://eli.thegreenplace.net/2018/command-line-autocomplete-for-go-documentation/