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 on Trending Technologies
Technical articles with clear explanations and examples
Creating 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 MoreHow to prevent XSS with HTML/PHP?
Cross-Site Scripting (XSS) is a major threat to web application security because it allows attackers to inject malicious scripts into reputable websites. This attack depends on innocent consumers, exposing important information or potentially gaining control of their accounts. Understanding and combating XSS threats is critical for maintaining a strong security posture as web applications become more complex and dynamic. What are XSS Attacks? Cross-Site Scripting (XSS) attacks are a common security risk in web applications. Attackers take advantage of vulnerabilities in web pages to inject and execute malicious scripts on the browsers of unaware users. The Different ...
Read MoreGet and Set the stack size of thread attribute in C
To get and set the stack size of thread attribute in C, we use the pthread_attr_getstacksize() and pthread_attr_setstacksize() functions. These functions allow us to query and modify the minimum stack size allocated to a thread's stack. Syntax int pthread_attr_getstacksize(const pthread_attr_t *attr, size_t *stacksize); int pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize); pthread_attr_getstacksize() This function retrieves the current stack size from a thread attribute object. It returns 0 on success, otherwise returns an error number. Parameters: attr − Pointer to the thread attribute object stacksize − Pointer to store the retrieved stack size in bytes ...
Read MoreOctal literals in C
In C, we can use octal literals by typing a zero before the actual number. For example, if an octal number is 25, then we have to write 025. Octal literals use base-8 numbering system and contain only digits 0-7. Syntax 0octal_digits Where octal_digits are valid octal digits (0-7). Example The following example demonstrates how to use octal literals in C − #include int main() { int a = 025; /* Octal 25 = Decimal 21 */ int b = ...
Read MoreDifference Between JSP and PHP
Both JSP and PHP are two popular technologies that serve to create dynamic web pages. Both are similar in the ways that they allow developers to embed code within an HTML document that can interact with databases, sessions, cookies, and other web features. However, they also have some significant differences that may affect the choice of which one to use for a web project. In this article, we will explore the difference between JSP and PHP in terms of their syntax, performance, scalability, security, and compatibility. What is JSP? JSP stands for Java Server Pages and is used ...
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 MoreInstall Lighttpd with PHP and MariaDB on RockyAlmaLinux
RockyAlmaLinux is a robust and secure Linux distribution that serves as a perfect replacement for CentOS. This article will guide you through installing a complete web server stack with Lighttpd, PHP, and MariaDB, providing detailed instructions with examples and expected output for each command. Prerequisites: Administrative access to your RockyAlmaLinux system and an active internet connection. Step 1: Update the System First, update the system's package repositories and upgrade installed packages to their latest versions − sudo dnf update $ sudo dnf update Last metadata expiration check: 0:20:47 ago on ...
Read MoreInstall LAMP - Apache, PHP, MariaDB and PhpMyAdmin in OpenSUSE
The LAMP stack, which stands for Linux, Apache, MySQL/MariaDB, and PHP, is a powerful combination of open−source software widely used for web development and hosting. In this tutorial, we will guide you through the process of installing and configuring the LAMP stack on openSUSE, a popular Linux distribution. Step 1: Update System Packages Before we begin, it is essential to update the system packages to ensure that we have the latest software versions and security patches ? sudo zypper refresh sudo zypper update Step 2: Install Apache Apache is a widely used web ...
Read MorePHP Program for Converting Roman Numerals to Decimal Lying Between 1 to 3999
Roman numerals are characters used in a numeric notation system based on the ancient Roman system. In this tutorial, we'll convert Roman numeral strings to decimal values in the range 1 to 3999. Roman Numeral System Roman numerals follow descending order but use subtractive notation to avoid four consecutive characters. Here are the main symbols − SYMBOL VALUE M 1000 CM 900 D 500 CD 400 C 100 XC 90 L 50 XL 40 X 10 ...
Read MoreHow to Disable root Login Access to PhpMyAdmin?
PhpMyAdmin is a popular web−based tool for managing MySQL databases through a browser interface. By default, it allows root user login, which grants complete administrative control over the entire database system. While convenient for initial setup, root access poses significant security risks if compromised. Why Disable Root Login Access? The MySQL root user has unrestricted privileges to create, modify, or delete any database, user, or configuration. If an attacker gains root credentials, they can cause irreversible damage or steal sensitive data. Additionally, root accounts are often shared among multiple users, increasing the risk of unauthorized access. Method ...
Read More