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
Programming Scripts Articles
Page 2 of 33
How to subtract Python timedelta from date in Python?
The Python datetime module provides various ways for manipulating dates and times. One of its key features is the timedelta object, which represents duration and also the difference between two dates or times. Subtracting a specific amount of time from a date can be done using timedelta. For example, if we want to find the date a day before today, then we create a timedelta object with days=1 and then subtract it from the current date ? Subtracting One Day from Today's Date The basic use case is subtracting a single day from today's date. This can ...
Read MoreProcess Representation in Linux System
Linux manages processes using a fundamental data structure called task_struct, which contains all the information needed to represent a process in the system. This structure is defined in the header file within the kernel source code. Process Data Structure The task_struct is a comprehensive C structure that holds critical information about each process, including: Process state − Current execution state (running, waiting, stopped) Scheduling information − Priority, time slices, and scheduler-specific data Memory management − Virtual memory layout and page tables File descriptors − List of open files and I/O resources Process relationships − Parent, ...
Read MoreHow to create a process in Linux?
A process is a program loaded into memory and currently executing. In simple terms, a process is a program in execution state that the operating system manages and schedules for CPU time. Creating Processes with fork() System Call In Linux, a new process is created using the fork() system call. This system call creates a new process by making an exact copy of the calling process's address space. The original process becomes the parent process, while the newly created process becomes the child process. When fork() is called, both parent and child processes continue execution from the ...
Read Morevolatile keyword in C#
The volatile keyword in C# is used to indicate that a field might be modified by multiple threads that are executing at the same time. It ensures that the most recent value of a field is present on each read operation, preventing certain compiler optimizations that could lead to unexpected behavior in multithreaded environments. When a field is marked as volatile, the compiler and runtime ensure that reads and writes to that field are not cached or reordered, providing thread-safe access without explicit locking mechanisms. Syntax Following is the syntax for declaring a volatile field − ...
Read MoreWhat are top JavaScript animation libraries?
JavaScript animation libraries offer powerful alternatives to CSS animations, providing greater flexibility and advanced features that CSS alone cannot achieve. These libraries enable developers to create complex animations, 3D graphics, particle effects, and interactive experiences with better performance and cross-browser compatibility. This article explores the top JavaScript animation libraries that can transform your web projects with stunning visual effects. Anime.js Anime.js is a lightweight animation library designed to animate HTML elements, JavaScript objects, CSS selectors, DOM attributes, and arrays. It provides complete control over targeted elements with an intuitive API. Key Features: SVG animations and ...
Read MoreVoca: The Ultimate Javascript library for String Manipulation
Voca is a powerful JavaScript library designed specifically for string manipulation. In this tutorial, we will explore multiple examples demonstrating how to use the different functions available in Voca. Features of Voca Before we see all the examples, let's highlight some features that Voca brings to the table − It provides a multitude of functions that can be used to manipulate, query, escape, format strings. It also provides detailed and searchable documentation. It supports a wide range of environments like Node.js, Safari 7+, Chrome, ...
Read MoreLogging HTTP Requests and Errors using Morgan.js
Morgan is a middleware for Node.js that simplifies HTTP request logging in Express applications. It automatically captures and formats request information, eliminating the need to write custom logging code manually. Morgan helps gather logs from your server and prepares them for analysis. It provides many predefined formats and customization options, making it suitable for both small and large projects. Installing Morgan Install Morgan using npm: npm install morgan Then import it into your application: const morgan = require('morgan') Basic Usage Example Here's a simple Express application using Morgan ...
Read MoreDesign a Digital Clock in Neumorphism Style using JavaScript
In this tutorial, we will be discussing how to design a digital clock in neumorphism style using JavaScript. Neumorphism is a design trend characterized by soft, raised elements with subtle shadows that create an embossed or pressed effect on the interface. HTML Structure Let's start by creating the basic HTML structure for our neumorphic digital clock. We need a container for the clock and display elements. Neumorphic Digital Clock ...
Read MoreAdding Animations to a Webpage using Velocity.js
Animations have become a very integral part of website interfaces in today's web development world. They help in enhancing the user experience of a website and in this article, we will learn how we can make use of Velocity.js to add beautiful animations to our web pages. VelocityJS is a JavaScript animation engine that provides us with very fast performing animations that we can use in our web pages. It has become one of the leading animation engines and there are different reasons for its success. I have mentioned some of the most important reasons that make it a ...
Read MoreDifference between location.host and location.hostname in JavaScript
JavaScript's Location object provides access to the current URL's components. One can think of this object as a read-only window into the current location. There are two properties of the Location object that are often confused: location.host and location.hostname. Let's explore their differences with practical examples. location.host The host property returns the hostname and port number (if specified) of the current URL. Location Host Example Current URL Host Information ...
Read More