Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles by Nitya Raut
Page 5 of 16
How to select elements with a specified attribute and value with CSS
The CSS [attribute="value"] selector is used to select elements that have a specific attribute with an exact matching value. This attribute selector is particularly useful for targeting elements based on their HTML attributes like rel, type, class, or custom data attributes. Syntax element[attribute="value"] { /* CSS properties */ } Example: Selecting Links with Specific rel Attribute The following example demonstrates how to select and style anchor elements that have a rel attribute with the value "nofollow" − ...
Read MoreRotate Out Down Left Animation Effect with CSS
The CSS rotate out down left animation effect creates a rotating exit animation where an element rotates 90 degrees clockwise around its bottom-left corner while fading out. This animation is commonly used for dramatic exit effects in web interfaces. Syntax @keyframes rotateOutDownLeft { 0% { transform-origin: left bottom; transform: rotate(0deg); opacity: 1; } 100% { ...
Read MoreHow to Count Variable Numbers of Arguments in C?
In C programming, the ellipsis (...) allows functions to accept a variable number of arguments. To count these arguments, C provides three common approaches − passing the count as the first parameter, using NULL as a sentinel value, or parsing format specifiers like printf() does. Syntax #include return_type function_name(fixed_params, ...); va_list ap; va_start(ap, last_fixed_param); type value = va_arg(ap, type); va_end(ap); Method 1: Using Count Parameter The most straightforward approach is to pass the number of arguments as the first parameter − #include #include int get_sum(int count, ...) ...
Read MoreCreating multiple process using fork() in C
In this section we will see how to use the fork() system call to create child processes in C. The fork() function creates a new process by duplicating the calling process, allowing both parent and child processes to execute different tasks. When fork() is called, it returns different values to distinguish between processes: a positive value (child's PID) to the parent process, 0 to the child process, and -1 if the fork failed. Syntax #include pid_t fork(void); Note: This program requires a Unix-like operating system (Linux, macOS) to compile and run. The ...
Read Morelvalue and rvalue in C
An lvalue (locator value) represents an object that occupies some identifiable location in memory (i.e. has an address). An rvalue is defined by exclusion − every expression is either an lvalue or an rvalue, so an rvalue is an expression that does not represent an object occupying some identifiable location in memory. Syntax lvalue = rvalue; // Valid assignment rvalue = lvalue; // Invalid assignment (compilation error) Example 1: Valid lvalue Assignment An assignment expects an lvalue as its left operand. Here's a valid example − #include int ...
Read MoreImplement your own itoa() in C
In C programming, the itoa() function converts an integer to a string representation. However, itoa() is not part of the C standard library. Here we'll implement our own version using both the sprintf() approach and a manual conversion method. Syntax char* itoa(int value, char* str, int base); Method 1: Using sprintf() The sprintf() function formats and stores data in a string buffer instead of printing to console − #include #include char* my_itoa_sprintf(int number, char* str) { sprintf(str, "%d", number); return str; ...
Read MoreSum of array using pointer arithmetic in C
In C programming, we can calculate the sum of array elements using pointer arithmetic. This approach uses pointers to traverse the array and access elements without using array indexing notation. Pointer arithmetic allows us to navigate through memory addresses. When we use *(a + i), it accesses the element at position i from the base address a. This is equivalent to a[i] but demonstrates direct memory manipulation. Syntax int sum = sum + *(pointer + index); Example Here's a complete program that calculates the sum of array elements using pointer arithmetic − ...
Read MoreAn Uncommon representation of array elements in C/C++
In C, array elements can be accessed in several ways. While the most common method is using the subscript operator (array[i]), we can also use pointer arithmetic to access elements in an uncommon but valid representation. Syntax *(array + index) // Equivalent to array[index] Example: Pointer Arithmetic Array Access This example demonstrates how to access array elements using pointer arithmetic instead of the traditional subscript notation − #include int main() { int array[5] = {7, 7, 7, 6, 6}; ...
Read MoreHow can we delete an existing MySQL table by using PHP script?
In PHP, you can delete an existing MySQL table using the DROP TABLE SQL statement with PHP's database connection functions. Modern PHP applications should use MySQLi or PDO instead of the deprecated mysql_* functions. Using MySQLi (Procedural) Here's how to delete a MySQL table using MySQLi with proper error handling ? Using PDO PDO provides a more secure and object-oriented approach ? With Safety Check It's good practice to check if the table exists before attempting to delete it ? Key ...
Read MoreInserting new line to the output using WS_Download in ABAP
First of all, don't use WS_DOWNLOAD as this function module is obsolete and deprecated in modern ABAP development. Using cl_abap_char_utilities for Line Breaks You can use a character type field and set it to cl_abap_char_utilities=>cr_lf. This utility class provides constants for various character operations, including carriage return and line feed combinations. Now use this field at places where you want to insert the new line. Example Here's how to implement line breaks when downloading data using modern ABAP approaches − ...
Read More