
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
1K+ Views
To create a date spinner, use the SpinnerDateModel class. Within that set the date format −Date today = new Date(); JSpinner spinner2 = new JSpinner(new SpinnerDateModel(today, null, null, Calendar.MONTH)); JSpinner.DateEditor editor = new JSpinner.DateEditor(spinner2, "dd/MM/yy"); spinner2.setEditor(editor);Above, we have set the Date format to be −dd/MM/yyThe following is an example to ... Read More

Smita Kapse
446 Views
Let us first create a collection with documents −> db.queryForPartialObjectDemo.insertOne({_id:new ObjectId(), "StudentDetails": [{"StudentId":1, "StudentName":"Chris"}]}); { "acknowledged" : true, "insertedId" : ObjectId("5cdfcf55bf3115999ed51206") } > db.queryForPartialObjectDemo.insertOne({_id:new ObjectId(), "StudentDetails": [{"StudentId":2, "StudentName":"David"}]}); { "acknowledged" : true, "insertedId" : ObjectId("5cdfcf55bf3115999ed51207") }Following is the query to display all documents from a collection ... Read More

Smita Kapse
539 Views
You cannot use except in MySQL. You can work with NOT IN operator to get the same result. Let us first create a table −mysql> create table DemoTable1 ( Number1 int ); Query OK, 0 rows affected (0.71 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1 values(100); Query OK, 1 row affected (0.14 sec) mysql> insert into DemoTable1 values(200); Query OK, 1 row affected (0.13 sec) ... Read More

Smita Kapse
498 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
323 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 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
580 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
545 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
3K+ 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
73 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