33:
for creating a golang project:
- create a directory with any name (e.g. session33)
- create a file with
.goprefix in it (e.g. main.go) - by typing this command in terminal create a
go.modfile:
33:
for creating a golang project:
.go prefix in it (e.g. main.go)go.mod file:
nodes can take on various roles, including data nodes that store and execute queries, master nodes that manage cluster-wide operations, and coordinating nodes that forward requests to the appropriate nodes. Each node runs independently and communicates with other nodes to form a cluster.
what is elasticsearch?
Elasticsearch is a powerful and popular open source distributed search and analytics engine.
Structured vs. unstructured (full-text) data
Data predominantly comes in two flavors: structured and unstructured. The fundamental differentiator between these two categories is the way the data is stored and
analyzed. Structured data follows a predefined schema/model, while unstructured
data is free-form, unorganized, and schema-free
redis config file:\
/etc/redis.conf
remove all keys in redis:
flushall
array_filter without callback function:In PHP, the array_filter function is used to filter elements of an array using a callback function. However, if no callback function is provided, it will filter out falsy values by default. Behavior of array_filter($categoryIds) without a callback
If array_filter is used without a callback, it removes elements that evaluate to false in a Boolean context. Specifically, it filters out:
false
0 (integer and string "0")
null
test drive development (p. 17)
Alan Kay’s1 concept of objects being similar to biological cells that send each other messages.
let the tests guide development.
We use the tests to clarify our ideas about what we want the code to do. (p. 5)
When we’re implementing a feature, we start by writing an acceptance test, which exercises the functionality we want to build. While it’s failing, an acceptance
AAA (Arrange, Act, Assert) or Given-When-Then
A unit in unit testing is a unit of behavior, not a unit of code. A single unit of behavior can exhibit multiple outcomes, and it’s fine to evaluate them all in one test. (p. 69)
Having that said, you need to watch out for assertion sections that grow too large: it could be a sign of a missing abstraction in the production code. (p. 69)