Articles on Trending Technologies

Technical articles with clear explanations and examples

What is the difference between parseInt(string) and Number(string) in JavaScript?

V Jyothi
V Jyothi
Updated on 13-Jan-2020 313 Views

parseInt(string)The parseInt() method parses up to the first non-digit and returns the parsed value.  For example, the following returns 765:parseInt("765world")Let’s take another example. The following returns 50:parseInt(‘50px”);Number(string)Number() converts the string into a number, which can also be a float BTW.For example, the following returns NaN:Number(“765world”)The following returns NaN:Number(“50px”);

Read More

Difference between != and !== operator in JavaScript Program

Mahesh Parahar
Mahesh Parahar
Updated on 13-Jan-2020 680 Views

'!=' comparison operator'!=' operator checks the unequality of two objects without making the type check. It converts the datatype of two operands to one and then compares their value. For example 1 != '1' will results false.'!==' comparison operator'!==' operator checks the unequality of two objects with a type check. It does not converts the datatype and makes a typed check.For example 1 !== '1' will results true.Following example, shows usage of '!=' vs '!==' operators.Example    Operator Example           console.log(" 1 != '1' " + (1 != '1'));       ...

Read More

Difference between "." and "#" selector in CSS

Mahesh Parahar
Mahesh Parahar
Updated on 13-Jan-2020 3K+ Views

'.' selector'.' selector is a class level selector. The dot operator is used to create a style class which can then be applied on multiple html elements.'#' selector'#' selector is an element level selector. Hash operator is used to applying style on a particular element whose id is the same as used in '#' selectorExampleFollowing the example, shows usage of '.' as well as '#' selector on three div elements.    Selector Example>/title>           .blackBorder {          border: 2px solid black;       }       #redDiv {   ...

Read More

Why Google embedded Map Makers inside Google Maps?

Samual Sam
Samual Sam
Updated on 10-Jan-2020 348 Views

When you have to go somewhere, but you don’t know the directions, what do you do? Simple, Google Maps, earlier we had to rely on traditional maps and routes but Google Maps made it so much easier. There was a time where we could easily locate and add certain locations to the Google maps. Remember?Yup, we are talking about the Google Map Maker, the app that made traveling more reliable and easier. Be it tracking best places at your state, region, country or the entire world. Due to certain reasons we lost it for years, but we could never forget ...

Read More

How to match bold fields in a HTML script using a regular expression in Java?

Maruthi Krishna
Maruthi Krishna
Updated on 10-Jan-2020 432 Views

The regular expression "\S" matches a non-whitespace character and the following regular expression matches one or more non space characters between the bold tags."(\S+)"Therefore to match the bold fields in a HTML script you need to −Compile the above regular expression using the compile() method.Retrieve the matcher from the obtained pattern using the matcher() method.Print the matched parts of the input string using the group() method.Exampleimport java.util.regex.Matcher; import java.util.regex.Pattern; public class Example {    public static void main(String[] args) {      String str = "This is an example>/b> HTML script.";       //Regular expression to match contents of ...

Read More

How to integrate Google AdSense into your webpage?

Anjana
Anjana
Updated on 10-Jan-2020 500 Views

If your website is having a sufficient content and a good number of page views, then start adding some advertisements to earn money. Google AdSense is a free and easy way to earn money by placing ads on your website.Integrating Google AdSense on a website is quite easy. Let’s see the steps:Go to the official website and SIGN IN with the Google Account, which you want to use for AdSense.Setup the account will all the details i.e. website information, content language, etc.Read the Google AdSense Terms and Conditions and follow the Google rules. Also, read the Google Program Policies and do ...

Read More

Why did Intel Abandon a Promising Project like Atom?

Samual Sam
Samual Sam
Updated on 10-Jan-2020 268 Views

As of now, Intel is taking few of the last breaths left in the colossally competitive smartphone and tablet market. Intel drained out millions and billions of dollars in developing and marketing its mobile processor department. The PC chip manufacturer couldn’t stand a chance when it had to face the likes of Qualcomm and Mediatek as per my opinion.Inside IntelAccording to an Intel spokesperson, the company had to cancel two of its Atom-based chips immediately. These chips were code-named, Sofia and Broxton. These are perhaps the first few products that Intel has terminated for bringing in a revamp in its ...

Read More

How to create JavaScript alert with 3 buttons (Yes, No and Cancel)?

Prabhas
Prabhas
Updated on 10-Jan-2020 4K+ Views

The standard JavaScript alert box won’t work if you want to customize it. For that, we have a custom alert box, which we’re creating using jQuery and styled with CSS.ExampleYou can try to run the following code to create an alert box with 3 buttons i.e Yes, No and Cancel.                          function functionConfirm(msg, myYes, myNo, cancel) {             var confirmBox = $("#confirm");             confirmBox.find(".message").text(msg);             confirmBox.find(".yes, .no, .cancel").unbind().click(function() {     ...

Read More

How to deal with floating point number precision in JavaScript?

varma
varma
Updated on 10-Jan-2020 969 Views

To handle floating point number precision in JavaScript, use the toPrecision() method. It helps to format a number to a length you can specify. Example               var num = 28.6754;       document.write(num.toPrecision(3));       document.write("<br>"+num.toPrecision(2));       document.write("<br>"+num.toPrecision(5));         Output 28.7 29 28.675

Read More

Maximum element in a very large array using pthreads in C++

Narendra Kumar
Narendra Kumar
Updated on 10-Jan-2020 557 Views

Problem statementGiven a very large array of integers, find maximum within the array using multithreadingExampleIf input array is {10, 14, -10, 8, 25, 46, 85, 1673, 63, 65, 93, 101, 125, 50, 73, 548} thenmaximum element in this array is 1673AlgorithmLet us call array size as total_elementsCreate N threadsEach thread will process (total_elementes/N) array elements and will find maximum element from it.Finally compute the maximum from the maximum value reported by each thread.Example#include #include #include #include #define MAX 10 #define SIZE(arr) (sizeof(arr) / sizeof(arr[0])) typedef struct struct_max {    int start;    int end;    int thread_num; } ...

Read More
Showing 53521–53530 of 61,248 articles
Advertisements