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
Articles by Vrundesha Joshi
218 articles
How to use JavaScript to set cookies for homepage only?
To set cookies for a homepage, add the page to the homepage itself.ExampleYou can try to run the following code to set cookies Enter name:
Read MoreWhat is the use of JavaScript eval function?
The JavaScript eval() is used to execute an argument. The code gets execute slower when the eval() method is used. It also has security implementations since it has a different scope of execution. In addition, use it to evaluate a string as a JavaScript expression.The eval() method is not suggested to use in JavaScript since it executes slower and improper usage opens your website to injection attacks.ExampleHere’s how you can implement eval() function var a = 30; var b = 12; var res1 = eval("a * b") + ""; var res2 = eval("5 + 10") + ""; document.write(res1); document.write(res2);
Read MoreHow can I delete all cookies with JavaScript?
To delete all cookies with JavaScript, you can try to run the following code. Here, we’re using an array and the split() method to get all the cookies and finally delete themExample var num = 1; function addCookie(){ document.cookie = num+" = "+num; num++; } function listCookies(){ var result = document.cookie; document.getElementById("list").innerHTML = result; } function removeCookies() { var res = document.cookie; var multiple = res.split(";"); for(var i = 0; i < multiple.length; i++) { var key = multiple[i].split("="); document.cookie = key[0]+" =; expires = Thu, 01 Jan 1970 00:00:00 UTC"; } } ADD LIST COOKIES REMOVE Cookies List
Read MoreHow do I add two numbers without using ++ or + or any other arithmetic operator in C/C++?
In this article we will see how to add two numbers without using arithmetic operators like +, ++, -, or --.To solve this problem, we can solve them using binary adder logic. In that case we were designed half adder and full adder. These adders can add one bit binary numbers. By cascading multiple adders, we have can create circuit to add bigger numbers.In that adder, we have performed XOR operation among the numbers, then for the carry we were performing the ANDing logic. These features are implemented here to add two numbers.Example Code#include using namespace std; int add(int ...
Read MoreWhat uses are there for “placement new” in C++?
In this section we will see what is the placement new operator in C++. This placement new is another variation of new operator. The normal new operator performs two things. It allocates memory, and then constructs an object in allocated memory.The new operator allocates memory in the heap section and constructs objects there. But for the placement new operator, it constructs object at the given address. To deallocate memory, we can use delete keyword if the memory is allocated using new operator. But for placement new there is no placement delete feature.So in a nutshell, placement new allows you to ...
Read MoreConvert a floating point number to string in C
In this section we will see how to convert a number (integer or float or any other numeric type data) to a string.The logic is very simple. Here we will use the sprintf() function. This function is used to print some value or line into a string, but not in the console. This is the only difference between printf() and sprintf(). Here the first argument is the string buffer. where we want to save our data.Input: User will put some numeric value say 42.26 Output: This program will return the string equivalent result of that number like “42.26”AlgorithmStep 1 − ...
Read MoreCreate a list group heading in Bootstrap
To create a list group heading, use the .list-group-item-heading class in Bootstrap.You can try to run the following code to implement .list-group-item-heading class −Example Bootstrap Example Countries Asia India Nepal Europe Germany Italy Spain
Read MoreAdd HTML paragraphs into Bootstrap thumbnails
With Bootstrap, you can easily add paragraphs to thumbnails.You can try to run the following code to add HTML paragraphs −Example Bootstrap Example Thumbnail label This is demo paragraph! This is demo paragraph! This is demo paragraph! This is demo paragraph! This is demo paragraph! This is demo paragraph! This is demo paragraph! This is demo paragraph! This is demo paragraph! This is demo paragraph! This is demo paragraph!
Read MoreAdd a green background color to an element to set positive action with Bootstrap
Use the .btn-success class in Bootstrap to set a positive action to an element. You can try to run the following code to implement the .btn-success class −Example Bootstrap Example The following are FMCG companies: ITC Limited Nestle Britannia Industries Limited Click below if the above list is correct: Success
Read MoreSet the color of the rule between columns with CSS
To set the color between columns, use the column-rule-color property. You can try to run the following code to implement the column-rule-color property.With that, we will also set the style of the column rule:Example .demo { column-count: 4; column-gap: 50px; column-rule-color: orange; column-rule-style: dashed; } This is ...
Read More