Despite having seen all these concepts more than a thousand times, I’m still getting confused sometimes. Is there a good way to think about all these concepts so that they start making sense?
In this post, I will focus on how to remember them. If you’re not familiar with them, please read the following posts first.
A confusion matrix is a table used to evaluate the performance of a classification model. It summarizes the count combinations of every predicted and actual class.
Let’s understand this concept in a simple example. Below…
Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache and message broker. It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs and geospatial indexes with radius queries.
Redis is the world’s most popular in-memory data structure server. In order to make good use of it, we need to understand its basic data structures first.
The Redis String type is the simplest type of value you can associate with a Redis key. …
When talking about string, bytes, and runes, many entry-level Golang developers feel confused. In this post, I’d like to give some explanations from an application developer standpoint.
If you prefer thorough explanations from Rob Pike, who is the partner invertor of Go language. Please be free to have a pause here and read the following post.
A byte in Go is an unsigned 8-bit integer. That means it has a limit of 0–255 in the numerical range.
type byte = uint8
According to Go documentation, Byte is an alias for uint8 and is the same as uint8 in all ways…
Have you struggled to decide which programming language is worth learning in the next 10 years?
In this post, I will list 5 reasons to tell why you should start to learn Go Programming Language.
In Go, the data types divide into four categories which are as follows:
In this post, we will discuss four composite types: arrays, slices, and maps, structs.
As we start to scale an application horizontally, we may run into a problem that requires distributed locking.
In this post, I will show you how to implement a distributed lock step by step based on Redis and python.
Building a mostly correct lock in Redis is easy. It consisted of three steps:
def acquire_lock(conn, lock_name, acquire_timeout=10): identifier = str(uuid.uuid4())
end = time.time() + acquire_timeout
while time.time() < end:
if conn.setnx("lock:"+lock_name, identifier)
Most database systems use Read Committed is the default isolation level (MySQL using Repeatable Read instead).
Choosing the isolation level is about finding the right balance of consistency and scalability for our current application requirements.
In this post, we will deep into the MySQL Transaction Isolation Levels.
Let’s first create a fake
CREATE TABLE `users` (
`id` int(2) NOT NULL AUTO_INCREMENT,
`username` varchar(25) COLLATE utf8mb4_unicode_ci NOT NULL,
`password` varchar(25) COLLATE utf8mb4_unicode_ci DEFAULT 'password01',
PRIMARY KEY (`id`)) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
Then, add some data records.
INSERT INTO `users` (`id`, `username`, `password`)
(2, 'tom', 'wysiwyg77'),
The Hamming distance between two integers is the number of positions at which the corresponding bits are different.
In this post, we are gonna discuss how to calculate the total Hamming distance
Given an integer array
nums, return the sum of Hamming distances between all the pairs of the integers in
Input: nums = [4,14,2]
In binary representation, the 4 is 0100, 14 is 1110, and 2 is 0010 (just
showing the four bits relevant in this case). …
Indexes are used to find rows with specific values quickly.
If a table has an index for the column in question, MySQL can quickly determine the position to seek in the middle of the data file without having to look at all the data. It is much faster than reading every row sequentially.
In this post, we’ll look at some of the important concepts behind indexing.
Let’s first create a MySQL table.
CREATE TABLE Customer(
);ALTER TABLE `Customer` ADD PRIMARY KEY (`custId`);ALTER TABLE `mobileNo` ADD UNIQUE INDEX (`MobileNo`);
Assume we have a…
In this post, we are gonna discuss multiple solutions for sliding window maximum problem.
If you prefer to learn through videos, please have a look at the following video.
You are given an array of integers, there is a sliding window of size
k which is moving from the very left of the array to the very right. You can only see the
k numbers in the window. Each time the sliding window moves right by one position.
Return the max sliding window.
Input: nums = [1,3,-1,-3,5,3,6,7], k = 3
Developer in China, AI and machine learning enthusiast