If you want to remove an element from the AbstractCollection classs, use the remove() method. It returns TRUE if the elements requested to be removed is successfully removed from the collection.The syntax is as follows:public boolean remove(Object ob)Here, ob is the element to be removed the from this Collection. Whereas, the class Object is the root of the class hierarchy.To work with AbstractCollection class in Java, import the following package:import java.util.AbstractCollection;The following is an example to implement AbstractCollection remove() method in Java:Example Live Demoimport java.util.Iterator; import java.util.ArrayList; import java.util.AbstractCollection; public class Demo { public static void main(String[] args) { ... Read More
Rolling hash is a hash function in which the input is hashed in a window that moves through the input.Rabin-Karp is popular application of rolling hash. The rolling hash function proposed by Rabin and Karp calculates an integer value. For a string the integer value is numeric value of a string.The Rabin–Karp string search algorithm is often explained using a very simple rolling hash function that only uses multiplications and additions −H=c1ak-1+c2ak-2+….+ cka0.Where, a is a constant, and c1, c2….ck are the input characters. In order to manipulate Huge value of H, mod n is done.AlgorithmBegin Declare a constant ... Read More
This example demonstrate about How to use shared preference in Android between activities.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. Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; import android.widget.EditText; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ... Read More
Let us first crate OutputStream with file input.txt −FileOutputStream fileStream = new FileOutputStream("E:/input.txt"); DataOutputStream dataStream = new DataOutputStream(fileStream);Now, the writeBytes() method writes out the string to the underlying output stream as a sequence of bytes.dataStream.writeBytes("Demo text!");Flush the output stream −dataStream.flush();The following is an example. Here, our file is “E:/input.txt” and at the end we are flushing the output stream −Exampleimport java.io.DataOutputStream; import java.io.FileOutputStream; public class Demo { public static void main(String[] args) throws Exception { FileOutputStream fileStream = new FileOutputStream("E:/input.txt"); DataOutputStream dataStream = new DataOutputStream(fileStream); dataStream.writeBytes("Demo text!"); ... Read More
You can use IF() to check if data is NULL. Let us first create a table −mysql> create table DemoTable ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, Name varchar(200), Age int ); Query OK, 0 rows affected (0.44 sec)Insert records in the table using insert command −mysql> insert into DemoTable(Name, Age) values('John', 23); Query OK, 1 row affected (0.12 sec) mysql> insert into DemoTable(Name, Age) values('Sam', null); Query OK, 1 row affected (0.12 sec) mysql> insert into DemoTable(Name, Age) values('Mike', 23); Query OK, 1 row affected (0.20 sec) mysql> insert into DemoTable(Name, Age) values('David', 21); Query OK, ... Read More
DATA FILE MODE in8085 MicroprocessorWe can refer to ‘X8085 cross-assembler’ manual for details.The format of Intel Hex: We have shown the MULT.HEX file to give a brief description at a glance.:01 C100 00 04 3A:01 C200 00 05 38:02 C300 00 00 00 3B:10 C000 00 21 00 C1 5E 16 00 21 00 C2 7E 21 00 00FE 00 CA 90:10 C010 00 17 C0 19 3D C2 12 C0 22 F7 FF 22 00C3 CD BC 06 D3:01 C020 00 76 A9:00 0000 01 FFThere are several lines which the file consists of which are termed as records. ... Read More
Intel 8085 consists of a RESET_IN* pin which is an active low input pin. We RESET 8085 by placing a logic 0 on this pin at least for 0.5μs, after that the power is supplied to Vcc pin of 8085. Moreover, in practice we place the RESET_IN* in logic 0 state for a few milliseconds. A typical reset circuit which we use in ALS 8085 kit, is shown in the following Fig.The moment when the power supply is switched on, the Vcc pin gets +5V power here the RESET_IN* pin stays in logic 0 state for a time dependency on the ... Read More
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 check cursor array list is empty or not in Android sqlite.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and ... Read More
This example demonstrate about How to use rotate() for Listview in Android.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 and record number as Edit text, when user click on save button it will store the data into arraylist. Click on refresh button to ... Read More
Like procedures, you can also create function in a database and store them.SyntaxFollowing is the syntax of creating a function in a(MySQL) database:CREATE FUNCTION Function_Name(input_arguments) RETURNS output_parameter BEGIN declare variables; statements . . . . . . . . . . return data_type; ENDExampleSuppose we have a table named Emp in the database with the following content:+--------+------------+----------------+ | Name | DOB | Location | +--------+------------+----------------+ | Amit | 1970-01-08 | Hyderabad | | Sumith | 1970-01-08 | Vishakhapatnam | | Sudha | 1970-01-05 | Vijayawada ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP