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 access this database, you don't need to establish any kind of connections for it like JDBC, ODBC etc.This example demonstrate about How to use SUM () in Android sqlite.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to ... Read More
The indexOf() method is inherited from the AbstractList class. It is used to return the index of the first occurrence of the specified element in this list. If the list is empty, it returns -1.The syntax is as follows −public int indexOf(Object ele)Here, ele is the element for which you want the index.To work with the AbstractSequentialList class in Java, you need to import the following package −import java.util.AbstractSequentialList;The following is an example to implement AbstractSequentialList indexOf() method in Java −Example Live Demoimport java.util.LinkedList; import java.util.AbstractSequentialList; public class Demo { public static void main(String[] args) { ... Read More
MongoDB indexes every value of an array so that you can query for single elements.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.indexingForArrayElementDemo.insertOne({"StudentFavouriteSubject":["MongoDB", "MySQL"]}); { "acknowledged" : true, "insertedId" : ObjectId("5c8acdca6cea1f28b7aa0816") }Display all documents from a collection with the help of find() method. The query is as follows −> db.indexingForArrayElementDemo.find().pretty();The following is the output −{ "_id" : ObjectId("5c8acdca6cea1f28b7aa0816"), "StudentFavouriteSubject" : [ "MongoDB", "MySQL" ] }Here is the query by which MongoDB index ... Read More
In this we are going to write python program which is going to analyse the images taken from the webcam and try to detect the movement and store the time-interval of the webcam video in a csv file.Required LibraryWe are going to use the OpenCV & pandas library for that. If it’s not already installed, you can install it using pip, with something like:$pip install opencv2, pandasExample Code#Import required libraries import cv2 import pandas as pd import time from datetime import datetime #Initialise variables stillImage = None motionImage = [ None, None ] time = [] # Initializing ... Read More
A hash table is a data structure which is used to store key-value pairs. Hash function is used by hash table to compute an index into an array in which an element will be inserted or searched.Linear probing is a collision resolving technique in Open Addressed Hash tables. In this method, each cell of a hash table stores a single key–value pair. If a collision is occurred by mapping a new key to a cell of the hash table that is already occupied by another key. This method searches the table for the following closest free location and inserts the ... Read More
Before getting into example, we should know what is Recycler view in android. Recycler view is more advanced version of list view and it works based on View holder design pattern. Using recycler view we can show grids and list of items.This example demonstrate about how to Scroll top in RecyclerView with LinearLayoutManager by creating a beautiful student records app that displays student name with age.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 − Open build.gradle and add Recycler view & ... Read More
This example demonstrate about How to send data to previous activity 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. Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.app.Activity; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; public class MainActivity extends AppCompatActivity { private final static int MY_REQUEST_CODE = 1; TextView textView; ... Read More
When we talk about the device make, we refer to the Phone manufacturer (e.g. Apple, Samsung, Nokia and so on) and device model is generally the specific product such as iPhone, iPad/TAB etc.Any mobile devices will be categorized using make and model only.Now let’s understand how do I get device make and model in iOS?There are two ways to get make and model the first way is to directly open your iOS device, navigate to setting, tap on general and in the about section you can find the details of your iOS deviceThe second way is getting make and model ... Read More
To display message from stored procedure on the basis of conditions, let us use IF-ELSE condition −mysql> DELIMITER // mysql> CREATE PROCEDURE showMessage(value int, Name varchar(20)) BEGIN IF(value > 100) then SELECT CONCAT("HELLO", " ", Name); ELSE SELECT CONCAT("BYE", " ", Name); END IF; END // Query OK, 0 rows affected (0.18 sec) mysql> DELIMITER ;Case 1 − Call the stored procedure using CALL command, when value is more than 100 −call showMessage(200, 'John');This will produce ... Read More
In a single operation, we can run the entire program of 8085. We run the entire program in this mode so that we can get the accurate results. If the process is unsuccessful a single-stepping by the entire program is attempted.We type ‘G’ at the prompt ‘>’. By noticing the absence of change of address after G. The prompting of the system are as follows:The address of starting is: xxxx - yy/where the memory address is xxxx and the content of the memory location is yy. Which allows the user for responding with the desired address of starting. If ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP