The Google Tag Manager is a tag management system that allows you to configure and rapidly deploy tags on your website or mobile app using a simple web-based interface. It has the same capabilities as the Google Tag, a JavaScript library used to send data from your website to Google Analytics. Tag Manager also supports tag version management and organization, community and third-party-developed tag templates, enterprise collaboration tools, and security features. JavaScript for Google Tag Manager Before you start using the Google Tag Manager, the following JavaScript topics are necessary for you to learn − Basic Syntax of ... Read More
You are given a String, your task is to write a program in Java that checks the order of its characters. If the order is previously defined, you have to check if the characters are in the given order otherwise check for alphabetical order. Let's understand the problem statement with an example − Example Scenario: Input: str = "abcmnqxz"; Output: res = TRUE The given string is in alphabetical order. Using Iteration In this approach, use a for loop to iterate over the string and check if the value of character at the current place and the previous ... Read More
For a given list of elements, write a JavaScript program to find the sum of its odd and even indexed elements and then, calculate difference between them. To solve this problem, we will first separate odd indexed and even indexed elements. After separating them find their sum separately and store it in different variables. Now, we will calculate the difference between these sums to get desired result. Example Scenario: Input: list = [11, 21, 31, 41, 51, 61]; Output: difference = 30 Here, odd-indexed items are [21, 41, 61] and their sum is 123. The even-indexed items are ... Read More
For a given linked list, write a program in JavaScript to find its middle element. Here, linked lists are a type of linear data structure. If there are an even number of elements in the linked list, there will be two middle nodes. In this case, the middle element would be the latter element out of both elements. Example Scenario: Input: linked_list = 1->2->3->4->5->6-> null Output: middle_element = 4 Using Iteration Iterate over the whole list and count the number of nodes. Now, iterate over the node till count/2 and return the count/2 i.e. the middle element. Example ... Read More
We are required to write a JavaScript function that takes in a number n and returns an array that contains first n prime numbers. We know that prime numbers are those numbers that are only divisible by 1 and themselves like 2, 3, 19, 37, 73 etc. Let's understand the problem with an example − Input: n = 6; Output: prime_numbers = [ 2, 3, 5, 7, 11, 13 ] Using Iteration We will first write a function that checks whether a given number is prime or not and then run a loop till the given number n ... Read More
The serial number of a CPU is a unique identifier which is given to a particular CPU by the manufacturer to each of them. Its main purpose is to track and identify the hardware for warranty claim. In this article, we are going to write a java program to get CPU serial number for windows machine. Central Processing Unit, in short CPU, is the brain of the computer. Using WMIC Command In this approach, we will use wmic command in java code. The wmic is a command line tool for working with Windows management. It stands for Windows Management Instrumentation ... Read More
There are 5 weekdays in a week, which are Monday, Tuesday, Wednesday, Thursday and Friday. The two remaining days i.e. Saturday and Sunday make up the weekend. In this article, we will learn how to write a Java program to display name of the weekdays in a calendar year. Using the DateFormatSymbols Class The Java standard library's java.text package contains the DateFormatSymbols class which provides methods for retrieving and setting the following date and time symbols − Month and day names and abbreviations Day of the week names and abbreviations Era names AM/PM strings Time Zone Names and ... Read More
A time zone is a region of the globe that observes a uniform standard time for legal, commercial, and social purposes. Suppose you have an application that is running in India as well as Japan. Here, you can't use the same time zone for both regions. Therefore, it is necessary to display time in different time zones. Java provides various built-in classes like TimeZone and ZoneId and methods like getTimeZone() that can help in displaying the current time in another time zone. However, before using them, you must import them into your Java program. Using getTimeZone() and setTimeZone() Methods ... Read More
Suppose you are given a set of numbers, your task is to write a Java program to print their summation. To find summation, you need to add all the given numbers with the help of addition operator. In Java, a set of numbers can be represented by an array. Let's understand the problem with an example − Example Scenario: Input: number_set = 34, 11, 78, 40, 66, 48; Output: summation = 277 Sum of all the numbers is 277 as 34 + 11 + 78 + 40 + 66 + 48 = 277. Using Iteration The most ... Read More
To create shimmer effect using CSS, we will be using CSS animations and linear-gradient properties. Shimmer effect is an animation effect used in many webpages while loading the web page. In this article we are having a layout of a box having two other child boxes, our task is to create a shimmer effect using CSS. Steps to Create Shimmer Effect We will be following below mentioned steps to create shimmer effect using CSS. We are having two boxes wrapped inside a div container. The container class sets the dimension of ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP