Articles on Trending Technologies

Technical articles with clear explanations and examples

Maximum product of an increasing subsequence of size 3 in C++

Ayush Gupta
Ayush Gupta
Updated on 09-Sep-2020 168 Views

In this tutorial, we will be discussing a program to find maximum product of an increasing subsequence of size 3.For this we will be provided with an array of positive integers. Our task is to find a subsequence of three elements with the maximum product.Example#include using namespace std; //returning maximum product of subsequence long long int maxProduct(int arr[] , int n) {    int smaller[n];    smaller[0] = -1 ;    setS ;    for (int i = 0; i < n ; i++) {       auto j = S.insert(arr[i]);       auto itc = j.first;   ...

Read More

How to put variable in regular expression match with JavaScript?

AmitDiwan
AmitDiwan
Updated on 09-Sep-2020 1K+ Views

You can use match() with passing the variable name. The syntax is as follows −console.log(yourVariableName.match(yourMatchingVariableName));Examplevar senetence = 'My Name is John'; console.log("The actual value="); console.log(senetence); var matchWord = 'John'; console.log("The matching value="); console.log(matchWord); var matchRegularExpression = new RegExp(matchWord, 'g' ); console.log(senetence.match(matchWord));To run the above program, you need to use the following command −node fileName.js.Here, my file name is demo107.js.OutputThis will produce the following output −PS C:\Users\Amit\JavaScript-code> node demo107.js The actual value= My Name is John The matching value= John

Read More

How to create a custom function similar to find() method in JavaScript?

AmitDiwan
AmitDiwan
Updated on 09-Sep-2020 454 Views

Let’s say we have the following records of studentId and studentName and want to check a specific student name −const studentDetails= [    {       studentId:101,       studentName:"John"    },    {       studentId:102,       studentName:"David"    },    {       studentId:103,       studentName:"Carol"    } ]Create a custom function to find by name. Following is the code −Exampleconst studentDetails= [    {       studentId:101,       studentName:"John"    },    {       studentId:102,       studentName:"David"    },    {       studentId:103,       studentName:"Carol"    } ] function findByName(name){    var flag=true;    for(var i=0;i node demo106.js The name found=David

Read More

Difference between Oracle 11g and Oracle 12c

Himanshu shriv
Himanshu shriv
Updated on 09-Sep-2020 7K+ Views

Oracle 12c is just upgraded version of the Oracle 11g with some new features like cloud support and pluggable database, kind of like master slave architecture. With the Oracle 12 c, you can plug your database to cloud anytime. It has multiple new features like JSON support, multitenant architecture and etc.Sr. No.KeyOracle 11gOracle 12c1BasicIt was released in released in 2008 and has no pluggable databaseIt is High performance RDbMS which is released in 2014. It is pluggable database.2Identity columnWe can't set primary key to raise automaticallyWe can set primary key to rise automatically.3JSON typeWe can't store Json directly to the ...

Read More

Difference between Ant and Maven.

Himanshu shriv
Himanshu shriv
Updated on 09-Sep-2020 2K+ Views

Ant and maven both are build tools.They both can be used for compile, pulling dependence from repository and for creating war or ear files. Both are provided by the Apache.Ant is a tool and it doesn't have formal conventions. If you are using Ant then you have to tell what to do in XML files therefore it can't be used in different types of project setup.Maven is framework and it can also  act as a dependency management tool. It is declarative build tool so everything we can define in the pom.xml. Sr. No.KeyMavenAnt1BasicMaven is a build automation framework based on the ...

Read More

Difference between Hibernate and Eclipse link

Himanshu shriv
Himanshu shriv
Updated on 09-Sep-2020 2K+ Views

Hibernate and Eclipse link both are object relational mapping tool. They both are the implementation of JPA.Hibernate is very popular implementation of JPA built by Red hat. It also has some extra features that JPA does not provide.Eclipse is an open source implementation of JPA built by Eclipse foundation. It 'is one of the first project which became part of EE4J. It is available in two forms −Eclipse link jar file format − It is complete package. It has everything which need to run any Eclipse link functionality.OSGI bundles for each of the eclipse link component.Sr. No.KeyHibernateEclipse link1BasicIt is a ...

Read More

Differences between String and StringBuffer

Himanshu shriv
Himanshu shriv
Updated on 09-Sep-2020 14K+ Views

String is an immutable class and its object can’t be modified after it is created but definitely reference other objects. They are very useful in multithreading environment because multiple threads can’t change the state of the object so immutable objects are thread safe.String buffer is mutable classes which can be used to do operation on string object such as reverse of string, concating string and etc. We can modify string without creating new object of the string. String buffer is also thread safe.Also, string concat + operator internally uses StringBuffer or StringBuilder class. Below are the differences.Sr. No.KeyStringStringBuffer1BasicString is an ...

Read More

Difference between CountDownLatch and CyclicBarrier in Java Concurrency

Himanshu shriv
Himanshu shriv
Updated on 09-Sep-2020 2K+ Views

CountDownLatch and CyclicBarrier both used in multithreading environment and they both are part of.As per Java Doc −CountDownLatch − A synchronization aid that allows one or more threads to wait until a set of operations being performed in other threads completes.CyclicBarrier − A synchronization aid that allows a set of threads to all wait for each other to reach a common barrier point.Sr. No.KeyCyclicBarrierCountDownLatch1BasicA synchronization aid that allows a set of threads to all wait for each other to reach a common barrier point.A synchronization aid that allows one or more threads to wait until a set of operations being ...

Read More

Difference between Docker Swarm and Kubernetes

Himanshu shriv
Himanshu shriv
Updated on 09-Sep-2020 632 Views

Docker Swarm and Kubernetes both can be used for similar purpose. They both are container orchestration tool.Docker Swarm is a tool used for clustering and scheduling Docker containers. We can easily establish and manage a cluster of Docker nodes under a single virtual system.Kubernetes is also container orchestration tool which is developed by google. It can be used for automatic deployment ,scaling, load balancing  and logging and monitoring.Sr. No.KeyDocker SwarmKubernetes1BasicKubernetes is also container orchestration tool which is developed by google. It can be used for automatic deployment ,scaling, load balancing  and logging and monitoring.Docker Swarm is a tool used for ...

Read More

Difference between Apache Kafka and JMS.

Himanshu shriv
Himanshu shriv
Updated on 09-Sep-2020 880 Views

Kafka and JMS both are messaging system. Java message service is an api which are provided by Java. It is used for implementing messaging system in your application. JMS supports queue and publisher /subscriber(topic) messaging system . With queues, when first consumer consumes a message, message gets deleted from the queue and others cannot take it anymore. With topics, multiple consumers receive each message but it is much harder to scale.Kafka is a generalization of these two concepts - it allows scaling between members of the same consumer group, but it also allows broadcasting the same message between many different ...

Read More
Showing 45841–45850 of 61,248 articles
Advertisements