- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- 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 558 Articles
Smita Kapse
372 Views
To get the leaves of nodes, use the getLeafCount() method.Let’s say you want the leaves of the entire tree, then use the root node, Let’s say “node” is our root node −node.getLeafCount()Now, let’s say we want to get the leaves of a node, which is not a root node, therefore ... Read More
Smita Kapse
250 Views
As an alternative, use the $eq operator. Let us first create a collection with documents −> db.equalDemo.insertOne({_id:1, "StudentFriendNames":["John", "Carol", "Sam"]}); { "acknowledged" : true, "insertedId" : 1 } > db.equalDemo.insertOne({_id:2, "StudentFriendNames":null}); { "acknowledged" : true, "insertedId" : 2 } > db.equalDemo.insertOne({_id:3, "StudentFriendNames":["Carol"]}); { "acknowledged" : true, "insertedId" : 3 } ... Read More
Smita Kapse
1K+ Views
If you wish to run a timer in background within your iOS Application, Apple provides beginBackgroundTaskWithExpirationHandler method, you can read more about the same https://developer.apple.com/documentation/uikit/uiapplication/1623031-beginbackgroundtaskwithexpiration.We will be using the same for writing our code for running the timer in background.So let’s begin.Step 1 − Open Xcode → Single View Application → ... Read More
Smita Kapse
365 Views
To create empty border, use the createEmptyBorder() method. Let us first create a label component −JLabel label = new JLabel("Label with empty border!");Now, create empty border with BorderFactory class −label.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));The following is an example to create empty border −Examplepackage my; import javax.swing.BorderFactory; import java.awt.Font; import javax.swing.JFrame; import ... Read More
Smita Kapse
749 Views
Use ALTER command to remove a value from an enum in MySQL. Let us first create a table −mysql> create table DemoTable ( `Rank` ENUM('LOW', 'MEDIUM', 'HIGH') ); Query OK, 0 rows affected (0.52 sec)Let us check the description of table.mysql> DESC DemoTable;This will produce the following output −+-------+-----------------------------+------+-----+---------+-------+ | Field | Type ... Read More
Smita Kapse
444 Views
You can use update(). Let us first create a collection with documents −> db.addExtraFieldDemo.insertOne( { "_id": 1, "UserName": "Larry" , "UserOtherDetails":[ { "UserCountryName": "US", ... Read More
Smita Kapse
2K+ Views
CLOB stands for Character Large Object. in general, an SQL Clob is a built-in datatype which is used to store large amount of textual data. Using this datatype, you can store data up to 2, 147, 483, 647 characters. MYSQL database provides support Clob datatype TINYTEXT, TEXT, MEDIUMTEXT, LONGTEXT.The java.sql.Clob ... Read More
Smita Kapse
569 Views
To paste clopboard text to JTextArea, use tha paste () method. Let’s say the following is our text area −JTextArea textArea = new JTextArea("");Now, paste the clipboard text −textArea.paste();Note − Let’s say our clipboard text is “This is clipboard text that got inserted in the text area”.The following is an ... Read More
Smita Kapse
46 Views
Use MONTH() and YEAR() for this. Let us first create a table −mysql> create table DemoTable ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, ShippingDate datetime ); Query OK, 0 rows affected (0.54 sec)Insert some records in the ... Read More
Smita Kapse
583 Views
To return specific fields, use aggregate $project. Let us first create a collection with documents −> db.returnSpecificFieldDemo.insertOne( { "StudentId":1, "StudentDetails": [ { "StudentName":"Larry", "StudentAge":21, ... Read More