
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Smita Kapse has Published 498 Articles

Smita Kapse
4K+ Views
First of all, you need to enable innodb_print_all_deadlocks. Following is the syntax −set global innodb_print_all_deadlocks=1;After executing the above statement, let us execute the below syntax in order to display all deadlock logs −show engine innodb status;Let us implement the above syntax −mysql> set global innodb_print_all_deadlocks=1; Query OK, 0 rows affected ... Read More

Smita Kapse
559 Views
To align multiple buttons with different height in Java, try the following example, Here, we have set 5 buttons with GridBagConstraints −GridBagConstraints constraints = new GridBagConstraints(); constraints.insets = new Insets(5, 5, 5, 5); constraints.anchor = GridBagConstraints.WEST;In addition, to set different height for different buttons, we have used −component. getPreferredSize().heightThe following ... Read More

Smita Kapse
463 Views
You can use subquery. Following is the syntax −SELECT * FROM ( SELECT * FROM yourTableName ORDER BY yourIdColumnName DESC LIMIT 3 ) anyAliasName ORDER BY yourIdColumnName;Let us first create a table −mysql> create table DemoTable ( ClientId int NOT NULL AUTO_INCREMENT PRIMARY KEY, ClientName varchar(100) ); Query OK, 0 rows affected (0.60 sec)Insert some records in the table using insert command ... Read More

Smita Kapse
244 Views
Use $nin operator along with $elemMatch and $not for this. To understand the concept, let us create a collection with the document. The query to create a collection with a document is as follows −> db.combinationOfArrayDemo.insertOne({"StudentName":"Larry", "StudentAge":21, "StudentFavouriteTechnicalSubject":["C", "Java"]}); { "acknowledged" : true, "insertedId" : ObjectId("5c7f77cc8d10a061296a3c58") } > ... Read More

Smita Kapse
118 Views
To add value in Ennead class in JavaTuples, you need to use the addAtX() method. Here, X represents the index wherein you need to add the value i.e. for index 2, use addAt2() method. Add the specific value as the parameter value of the method. For example −addAt2(“John”);Let us first ... Read More

Smita Kapse
681 Views
PyMongo is a Python distribution containing tools for working with MongoDB. Use the following syntax to use a variable for collection name −var yourVariableName="yourCollectionName"; db[storeCollectionName].yourOperationName;To understand the above syntax, let us create a collection with the document. The query to create a collection with a document is as follows. ... Read More

Smita Kapse
543 Views
You can use the distinct command for this. To understand the concept, let us create a collection with the document. The query to create a collection with a document is as follows −> db.distinctCountValuesDemo.insertOne({"StudentFirstName":"John", "StudentFavouriteSubject":["C", "C++", "Java", "MySQL", "C", "C++"]}); { "acknowledged" : true, "insertedId" : ObjectId("5c8a39f193b406bd3df60e07") } ... Read More

Smita Kapse
745 Views
Before getting into example, we should know what sqlite data base in android is. SQLite is an open source SQL database that stores data to a text file on a device. Android comes in with built in SQLite database implementation. SQLite supports all the relational database features. In order to ... Read More

Smita Kapse
133 Views
To create LabelValue tuple from an array, use the fromArray() method. First, create an array and add elements to it. After that, use the fromArray() method to create a Tuple and set the array in it.Let us first see what we need to work with JavaTuples. To work with LabelValue ... Read More

Smita Kapse
636 Views
To remove the _id element, you can use the following syntax −db.yourCollectionName.find({}, {'_id': false}).pretty();To understand the above syntax, let us create a collection with the document. The query to create a collection with a document is as follows −> db.removingidElementDemo.insertOne({"UserName":"John", ... "UserAge":21}); { "acknowledged" : true, "insertedId" : ... Read More