Shell Conception
Shell ConceptionA shell is a command-line interface that allows users to interact with the operating system. It provides a way to execute commands, run scripts, and manage files and processes. The shell acts as an intermediary between the user and the operating system, interpreting user input and executing the corresponding commands. 12345678cat /etc/shells# List of valid login shells:/bin/sh/bin/bash/bin/rbash/bin/dash/bin/zsh/bin/ksh example:1234# Check the current shellecho $SHELL # Change...
Python - Basic Syntax Cheat Sheet
Python Basic Syntax Cheat SheetA concise reference for Python beginners and developers coming from languages like JavaScript, Java, or C++. 1. Variables & Data Types12345678x = 10 # inty = 3.14 # floatname = "Alice" # stringis_valid = True # booleanitems = [1, 2, 3] # listdata = {"a": 1} # dictnums = (1, 2, 3) # tupleunique = {1, 2, 3} # set Type Checking12type(x) # <class 'int'>isins...
Greedy Algorithms
Greedy AlgorithmsGreedy algorithms are a class of algorithms that make locally optimal choices at each step with the hope of finding a global optimum. They are often used for optimization problems where the solution can be built incrementally by making a series of choices. Maximun SwapMaximum Swap CandyCandy
MySQL Index
MySQL IndexIndexes are data structures that improve the speed of data retrieval operations on a database table at the cost of additional storage space and maintenance overhead. In MySQL, indexes are used to quickly locate and access the data in a table without having to scan the entire table. There are several types of indexes in MySQL, including: B-Tree Indexes: This is the most common type of index in MySQL. It organizes the data in a balanced tree structure, allowing for efficient searchi...
MySQL Log System
MySQL Log SystemMySQL provides a comprehensive logging system that allows you to record and analyze database activity. The system includes the following components: General Log: This is the main log file that records all database activity. It is written to disk and can be accessed using the SHOW LOGS statement. Error Log: This log file records errors that occur during database operations. It is written to disk and can be accessed using the SHOW ERRORS statement. Slow Query Log: This log file...
MySQL Storage Engine
MySQL Storage EngineMySQL supports multiple storage engines, each with its own features and use cases. The most commonly used storage engines are InnoDB and MyISAM. InnoDB: This is the default storage engine in MySQL. It supports transactions, foreign keys, and row-level locking, making it suitable for high-concurrency applications. InnoDB is designed for reliability and performance, and it is the recommended storage engine for most applications. MyISAM: This storage engine is older and does...
MySQL Transaction
TransactionA transaction in MySQL is a sequence of one or more SQL operations that are executed as a single unit of work. Transactions ensure that either all operations are completed successfully or none of them are applied, maintaining the integrity of the database. This is particularly important in scenarios where multiple operations need to be performed together, such as transferring funds between accounts. DDL (Data Definition Language) statements like CREATE, ALTER, and DROP are not par...
MySQL Query
Join QueryA JOIN query is used to combine rows from two or more tables based on a related column between them. There are several types of JOINs in MySQL, including INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL OUTER JOIN. INNER JOINThe INNER JOIN returns only the rows that have matching values in both tables.1234SELECT columnsFROM table1INNER JOIN table2ON table1.common_column = table2.common_column; LEFT JOINThe LEFT JOIN returns all rows from the left table and the matched rows from the right...
MySQL Functions
MySQL FunctionsMySQL provides a wide range of built-in functions that can be used to perform various operations on data. These functions can be categorized into several types, including string functions, numeric functions, date and time functions, and aggregate functions. String FunctionsString functions are used to manipulate and analyze string data. Some common string functions include: CONCAT(): Concatenates two or more strings. COMPARE(): Compares two strings and returns 0 if they are eq...
Replication Support in MongoDB
OverviewMongoDB is a document-oriented NoSQL database that stores data in flexible, JSON-like documents (Wikipedia Contributors 2019). Unlike traditional relational databases, MongoDB does not require a predefined schema, allowing for dynamic and hierarchical data structures. This flexibility makes it particularly suitable for applications that handle diverse and evolving data formats, such as content management systems, real-time analytics platforms, and Internet of Things (IoT) applications...







