When you are done with a user's session data, you have several options −Remove a particular attribute − You can call the public void removeAttribute(String name) method to delete the value associated with the particular key.Delete the whole session − You can call the public void to invalidate() method to discard an entire session.Setting Session timeout − You can call the public void setMaxInactiveInterval(int interval) method to set the timeout for a session individually.Log the user out − The servers that support servlets 2.4, you can call log out to log the client out of the Web server and invalidate ... Read More
This example demonstrate about How to use toUpperCase () in Android textview.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml. In the above code, we have taken name as Edit text, when user click on button it will take data and Convert into upper case letters.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; ... Read More
The skip() method of the IntStream class in Java returns a stream consisting of the remaining elements of this stream after discarding the first n elements of the stream.The syntax is as followsIntStream skip(long n)Here, n is the number of elements to skip. The method returns the new stream.Create an IntStream and add some elements within a range using range() methodIntStream intStream = IntStream.range(20, 40);Now to skip some elements and only display the rest of them, use the skip() methodintStream.skip(15)The following is an example to implement IntStream skip() method in Java. It skips 15 elements since we have set the ... Read More
This example demonstrate about How to append data from priority queue to arraylist for listview in AndroidStep 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml. In the above code, we have taken name as Edit text, when user click on save button it will store the data into arraylist. Click on refresh button to get the changes of ... Read More
To get sum the value of a key across all documents in a MongoDB collection, you can use aggregate().To understand the above concept, let us create a collection with the document. The query to create a collection with a document is as follows −> db.sumOfValueDemo.insertOne({"Name":"Larry", "Amount":14.50}); { "acknowledged" : true, "insertedId" : ObjectId("5c8ee7272f684a30fbdfd592") } > db.sumOfValueDemo.insertOne({"Name":"Mike", "Amount":15.68}); { "acknowledged" : true, "insertedId" : ObjectId("5c8ee7342f684a30fbdfd593") } > db.sumOfValueDemo.insertOne({"Name":"Carol", "Amount":50.32}); { "acknowledged" : true, "insertedId" : ObjectId("5c8ee7412f684a30fbdfd594") } > db.sumOfValueDemo.insertOne({"Name":"David", "Amount":120.90}); { "acknowledged" : true, "insertedId" : ObjectId("5c8ee7532f684a30fbdfd595") }Display all documents from a collection ... Read More
To get only the FALSE value, let us first create a collection with documents. One of the fields is isEnable that is having TRUE or FALSE values as shown below> db.translateDefinitionDemo.insertOne({"_id":10, "StudentName":"Larry", "isEnable":true}); { "acknowledged" : true, "insertedId" : 10 } > db.translateDefinitionDemo.insertOne({"_id":20, "StudentName":"Chris", "isEnable":false}); { "acknowledged" : true, "insertedId" : 20 } > db.translateDefinitionDemo.insertOne({"_id":30, "StudentName":"Robert", "isEnable":true}); { "acknowledged" : true, "insertedId" : 30 } > db.translateDefinitionDemo.insertOne({"_id":40, "StudentName":"Sam", "isEnable":false}); { "acknowledged" : true, "insertedId" : 40 } > db.translateDefinitionDemo.insertOne({"_id":50, "StudentName":"Mike", "isEnable":true}); { "acknowledged" : true, "insertedId" : 50 }Following is the query to display all the documents from a collection ... Read More
In MySQL, it is not possible to use select from procedure in FROM clause. You can use CALL command and after that the SELECT statement can be executed.Let us first create a table:mysql> create table DemoTable2 -> ( -> CustomerId int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> CustomerName varchar(100), -> ShippingDateTime datetime -> ); Query OK, 0 rows affected (0.66 sec)Following is the query to create stored procedure:mysql> DELIMITER // mysql> CREATE PROCEDURE insert_information(Name varchar(100), shippingtime datetime) -> BEGIN -> -> INSERT INTO DemoTable2(CustomerName, ShippingDateTime) VALUES(Name, shippingtime); -> END -> ... Read More
You can use $slice operator for this. Let us first create a collection with documents −> db.firstElementOfArray.insertOne( ... { ... _id: 100, ... "Details": [ ... { ... "CustomerName": "John", ... "CustomerCountryName":"US" ... } ... ] ... } ... ); { "acknowledged" : true, "insertedId" : 100 } > db.firstElementOfArray.insertOne( ... { ... _id: 101, ... "Details": [ ... ... Read More
As per a recent survey, more than a third of all adults (34%) use their smartphone within five minutes of waking up, which is a figure that takes a sharp rise to almost half (49%) of those aged 18-24. While there are many important factors, but the biggest contributor to this has been subscriptions to the high-speed 4G mobile internet, which was first introduced in the UK in 2012.4G Subscriptions: providing easy access to 4G speed networks to India, one of the youngest and most populous countries in the world made smartphone usage rise eightfold from 2.7 million in the ... Read More
If you get your Desktop computer assembled or custom made, here is the configuration that works best for a Graphics Designer.CPU: Preferably Intel i5 or i7 ProcessorMotherboard: get a motherboard that supports 32GB or more Ram and SATA 3.0 and 2TB-4TB HDDGPU: Prefer NVIDIA instead of a powerful graphics cardMonitors: IPS monitor with a Matte FinishOS: Best option is Mac OS which can be used on a custom built PC.