Chandu yadav has Published 1163 Articles

How to get server_id in MySQL?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:25

4K+ Views

To get the server_id, use the system defined variable @@server_id. You cannot use only a single @ as user defined variable for server_id.The syntax is as followsSELECT@@ server_idAs an alternate, you can use SHOW VARIABLES command.The syntax is as followsSHOW VARIABLES LIKE ‘server_id’;Case 1The query is as followsmysql> SELECT @@server_id ... Read More

Simulation of 8 to 1 multiplexer

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:25

637 Views

We shall write a program in assembly language just for the simulation of a multiplexer 8 to 1 which is used by the logic controller interface.The pins of the 8 to 1 multiplexer to be simulated are assumed to be as shown in the fig.For this multiplexer simulation, 8255 ports as ... Read More

DoubleStream anyMatch() method in Java

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:25

62 Views

The anyMatch() method of the DoubleStream class returns whether any elements of this stream match the provided predicate.The syntax is as followsboolean anyMatch(DoublePredicate predicate)Here, the parameter predicate is a stateless predicate to apply to elements of this stream. The DoublePredicate here is a predicate of one double-valued argument.To use the ... Read More

Get the array of _id in MongoDB?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:25

638 Views

The _id in MongoDB is a field, which is mandatory. In MongoDB, each document stored in a collection requires a unique _id field that acts as a primary key. Following is the syntax to get the array of all the ids i.e. _id in MongoDBdb.yourCollectionName.find({ _id : { $in : ... Read More

Dangling, Void, Null and Wild Pointers in C/C++

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:25

619 Views

Dangling pointerDangling pointer is a pointer pointing to a memory location that has been freed (or deleted). There are different ways where Pointer acts as dangling pointerFunction CallThe pointer pointing to local variable becomes dangling when local variable is not static.int *show(void) {    int n = 76; /* ... ... Read More

DoubleStream forEachOrdered() method in Java

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:25

90 Views

The forEachOrdered() method of the DoubleStream class in Java performs an action for each element of this stream. This assures that each element is processed in encounter order for streams that have a defined encounter order.The syntax is as followsvoid forEachOrdered(DoubleConsumer action)Here, DoubleConsumer represents an operation that accepts a single ... Read More

The iterator() method of AbstractList class in Java

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:25

79 Views

The iterator() method of AbstractList class is used to return an iterator over the elements in this list in proper sequence.The syntax is as followspublic Iterator iterator()Here, the Iterator is an iterator over a collection. To work with the AbstractList class, import the following packageimport java.util.AbstractList;The following is an example ... Read More

Generation of triangular wave using DAC interface

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:25

5K+ Views

We write an 8085 assembly language program for the generation of triangular waveform using the Digital to Analog Converter (DAC) interface. The display of the waveform is seen on the CRO.Let us consider a problem solution in this domain. The problem states that: To get unipolar output, J1 is shorted to ... Read More

Get the duplicate values of a field in MongoDB?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:25

1K+ Views

Use aggregate() method to get the duplicate value of a field. Let us first create a collection with documents using the following query> db.findAllNonDistinctDemo.insertOne({"UserName":"John", "UserAge":28}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c995078863d6ffd454bb647") } > db.findAllNonDistinctDemo.insertOne({"UserName":"Larry", "UserAge":21}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c995081863d6ffd454bb648") } > db.findAllNonDistinctDemo.insertOne({"UserName":"Larry", ... Read More

Check how many rows are in a MySQL database table?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:25

1K+ Views

To know how many rows are in a ySQL database table, you need to use aggregate function COUNT(*).The syntax is as followsSELECT COUNT(*) FROM yourTableName;To understand the above syntax, let us create a table. The query to create a table is as followsmysql> create table CountRowsDemo    - > ( ... Read More

Advertisements