In Python, funcy.collecting refers to a module provided by the Funcy library. Funcy is a functional programming library for Python that aims to enhance and simplify common programming tasks. The funcy.collecting module provides functions for working with collections, such as lists, dictionaries, and other iterable objects. It offers various utilities to collect, transform, and manipulate […]
Read MoreIn DBeaver, you cannot directly run psql meta-commands, such as \l, as part of your SQL query. The \l command is specific to the psql command-line tool and is not recognized by DBeaver. However, you can achieve the same result in DBeaver by executing a regular SQL query against the PostgreSQL database information schema. The […]
Read MoreTo avoid typing passphrase for a specific key over and over again, like when git pull from github, can use this command It will store the key as long as the session is live. Using ps command, we can see the process of /usr/bin/ssh-agent, the ssh-agent will handle passphrase for us.
Read MoreRedis is an in-memory data store that is known for its fast read and write performance. While it can handle frequent reads efficiently, it may not be the optimal choice for batch hourly writes due to its design characteristics. Redis is primarily optimized for low-latency operations and real-time data processing. It excels at handling small, […]
Read MoreGCP counterpart The counterpart for Amazon DynamoDB in Google Cloud Platform (GCP) is Google Cloud Bigtable. Both DynamoDB and Cloud Bigtable are NoSQL databases designed for handling large-scale, high-performance workloads. They provide key-value storage with automatic scaling and built-in fault tolerance. Cloud Bigtable is a fully managed, highly scalable NoSQL database service offered by GCP. […]
Read MoreIn Python, you can escape the opening curly brace ‘{‘ in a formatted string by using double curly braces ‘{{‘ to represent a single curly brace. Here’s an example: Output: In the above example, {{ represents the escaped opening curly brace, {something} is the placeholder for the variable, and }} represents the closing curly brace. […]
Read MoreIn the movie “Social Network”, Mark asked Eduardo for the formula to “rank girls” in facemesh.com. The formula above is commonly known as the Elo rating system. It is used to calculate the relative skill levels of players or teams in competitive games, such as chess or sports. In the formula: The Elo rating system […]
Read MoreHere’s a simple example of a Python FastAPI application: In this example, we create a FastAPI instance called app. We define two routes: the root route (“/”) and an item route (“/items/{item_id}”). The root route returns a simple JSON response of {“Hello”: “World”}, while the item route takes an item_id as a path parameter and […]
Read MoreExample In the above example, A is renamed as A1, B and C are not changed. Why do we want to rename the class/object? There are several reasons:
Read MoreIn Python, the time.monotonic() function returns the value of a monotonic clock. It is used to measure elapsed time in a way that is not affected by system clock adjustments or changes due to time synchronization. The monotonic clock is not affected by system time adjustments, such as changes made by the user or by […]
Read More