Arnab Chakraborty

Arnab Chakraborty

29 Articles Published

Articles by Arnab Chakraborty

29 articles

Operating system time slicing in round robin scheduling

Arnab Chakraborty
Arnab Chakraborty
Updated on 17-Mar-2026 459 Views

Round Robin (RR) is a CPU scheduling algorithm where each process is assigned a fixed time slot called a time slice (or time quantum). The CPU cycles through all ready processes in order, giving each one the time slice. If a process does not finish within its time slice, it is moved to the back of the queue and the next process gets the CPU. This is one of the simplest and most widely used scheduling algorithms in operating systems, especially in time-sharing systems where fair CPU allocation is important. How Round Robin Scheduling Works The scheduler ...

Read More

How to validate a form using jQuery?

Arnab Chakraborty
Arnab Chakraborty
Updated on 16-Mar-2026 32K+ Views

To validate a form using jQuery, we can use the jQuery Validation Plugin. This plugin provides a simple way to define validation rules, custom error messages, and submit handlers for HTML forms without writing complex validation logic from scratch. The plugin works by attaching the .validate() method to a form element and defining rules for each input field by its name attribute. Syntax The basic syntax for jQuery form validation is − $(document).ready(function() { $("#formId").validate({ rules: { ...

Read More

How to horizontally center a <div> in another?

Arnab Chakraborty
Arnab Chakraborty
Updated on 16-Mar-2026 373 Views

To horizontally center a div inside another div, we need to apply CSS centering techniques on the inner element. The most common methods include using margin: 0 auto, flexbox, and position with transform. The key principle is that the inner div must have a defined width smaller than its parent, so the browser can calculate equal space on both sides to center it. Outer DIV (full width) Inner DIV (centered) auto margin auto margin ...

Read More

How can I remove all child elements of a DOM node in JavaScript?

Arnab Chakraborty
Arnab Chakraborty
Updated on 15-Mar-2026 14K+ Views

When building web applications, you often need to clear dynamic content like task lists, shopping carts, or search results. JavaScript provides several methods to remove all child elements from a DOM node efficiently. Here are the main approaches to remove all child elements: Using the removeChild() method with iteration Setting innerHTML to an empty string Using jQuery's empty() method Using the modern replaceChildren() method Using removeChild() Method with Iteration This method iterates through all child nodes and removes them one by one using removeChild(). It's reliable and works across all browsers. Syntax ...

Read More

Count spaces, uppercase and lowercase in a sentence using C

Arnab Chakraborty
Arnab Chakraborty
Updated on 15-Mar-2026 952 Views

In C programming, counting different types of characters in a string is a common task. This involves analyzing each character to determine if it's uppercase, lowercase, a digit, whitespace, or a special character. Syntax for (int i = 0; str[i] != '\0'; i++) { // Check character type using ASCII values if (str[i] >= 'A' && str[i] = 'a' && str[i] = '0' && str[i] = 'A' && str[i] = 'a' && str[i] = '0' && str[i]

Read More

How can I write in order with for loop or while loop?

Arnab Chakraborty
Arnab Chakraborty
Updated on 15-Mar-2026 308 Views

In C programming, we can create ordered patterns using for loops or while loops. This example demonstrates how to generate a specific numerical pattern where each line contains repeating digits based on the line number. Syntax for(initialization; condition; increment) { // loop body } while(condition) { // loop body increment; } Method 1: Using For Loop This approach uses nested for loops to create a pattern where each line displays the line number followed by repeating 0s and 1s − ...

Read More

How to get the content of a textarea using jQuery?

Arnab Chakraborty
Arnab Chakraborty
Updated on 13-Mar-2026 742 Views

In jQuery, you can easily retrieve the content of a textarea element using the val() method. This method returns the current value of form elements, including textareas. Basic Syntax The basic syntax to get textarea content is − var content = $("#textareaId").val(); Example Here is a complete example using one textarea and one button. The textarea is used for user input, then clicking the button displays the value in an alert box − ...

Read More

How to get current URL in jQuery?

Arnab Chakraborty
Arnab Chakraborty
Updated on 13-Mar-2026 4K+ Views

For getting the current URL in jQuery, you can use the attr() method with the location object or the native JavaScript window.location property. Both methods provide access to the complete URL of the current page. Methods to Get Current URL There are two main approaches − 1. Using jQuery's attr() method: $(location).attr('href') returns the complete URL as a string. 2. Using window.location: The native JavaScript window.location object provides access to the current URL and its components. Example Here's a complete example demonstrating both methods − ...

Read More

How to check if a div is visible using jQuery?

Arnab Chakraborty
Arnab Chakraborty
Updated on 13-Mar-2026 13K+ Views

You can use .is(':visible') to check if a div element is visible. This jQuery selector returns true if the element is currently visible on the page, and false if it's hidden through CSS properties like display: none, visibility: hidden, or if its width and height are set to zero. Example The following example demonstrates how to check if a div is visible and show it if it's hidden − Check Div Visibility with jQuery ...

Read More

How to count number of rows in a table with jQuery?

Arnab Chakraborty
Arnab Chakraborty
Updated on 13-Mar-2026 1K+ Views

Counting the number of rows in a table is a common requirement in web development. jQuery provides several methods to count table rows efficiently. In this tutorial, we'll learn how to count table rows using jQuery's .length property. Basic Method to Count Table Rows The simplest way to count table rows is by using jQuery's selector to target all tr elements within a table and then use the .length property to get the count. Example Here's a complete example that demonstrates how to count table rows − Count ...

Read More
Showing 1–10 of 29 articles
« Prev 1 2 3 Next »
Advertisements