Set MySQL INT Column to Auto Increment Starting at 10000

karthikeya Boyini
Updated on 30-Jul-2019 22:30:25

595 Views

Let us first create a table. Here, we have set UserId as AUTO_INCREMENT PRIMARY KEY −mysql> create table DemoTable (    UserId int NOT NULL AUTO_INCREMENT PRIMARY KEY ); Query OK, 0 rows affected (0.72 sec)Following is the query to set int column to auto increment by 1 beginning at 10000 −mysql> alter table DemoTable AUTO_INCREMENT=10000; Query OK, 0 rows affected (0.31 sec) Records: 0 Duplicates: 0 Warnings: 0Insert records in the table using insert command −mysql> insert into DemoTable values(); Query OK, 1 row affected (0.16 sec) mysql> insert into DemoTable values(); Query OK, 1 row affected (0.19 sec) ... Read More

Multiple Memory Address Range in 8085 Microprocessor

Arjun Thakur
Updated on 30-Jul-2019 22:30:25

922 Views

Suppose we have the chip select circuit as shown in the below figure, then what is the address range for the RAM?Fig. Chip selection that results in multiple address range.A15 and A14 pins are used for the selection of Random Access Memory, and pins ranging from A10 to A0 are used for the selection of location in RAM. But the value of the pins A13, A12 and A11 have non-dependent value. They play no role for selection of chip or location on RANDOM ACCESS MEMORY. Hence they are termed as don't cares and called x for more signification.We have eight ... Read More

Need for Masking in 8085

Arjun Thakur
Updated on 30-Jul-2019 22:30:25

1K+ Views

 Let us say that the 8085 which is interrupted because of RST6.5 pin and has been branched to the ISS for the pin RST6.5. Then, except the DI instruction at the beginning of this ISS, all the interrupts gets disabled except TRAP. So, even if RST7.5 pin is in activated state in the middle of the execution of RST6.5 ISS, the interruption of 8085 will not occur due to RST7.5. Actually a higher priority interrupt is RST7.5, but the lower priority interrupt ISS cannot be interrupted by it of RST6.5. We solve this problem by specifically having the instruction which ... Read More

Save Data Using SQLite in Android

Vrundesha Joshi
Updated on 30-Jul-2019 22:30:25

3K+ Views

Before getting into example, we should know what sqlite data base in android is. SQLite is an opensource 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 demonstrates How to save data using sqlite in android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a ... Read More

Append Data from HashMap to ArrayList for ListView in Android

Nishtha Thakur
Updated on 30-Jul-2019 22:30:25

745 Views

This example demonstrates how to append data from hashmap 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 the name and record number as Edit text, when user click on save button it will store the data into ArrayList. Click on the ... Read More

Support WebView with Multiple Screens in Android

Vrundesha Joshi
Updated on 30-Jul-2019 22:30:25

960 Views

This example demonstrate about How to support webview with multiple screens 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 web view to show tutorialspoint.com.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.app.ProgressDialog; import android.os.Build; import android.os.Bundle; import android.support.annotation.RequiresApi; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.webkit.WebChromeClient; import android.webkit.WebSettings; import android.webkit.WebView; import android.widget.EditText; public class MainActivity extends AppCompatActivity {    @RequiresApi(api ... Read More

Check if Android Mobile Supports Humidity Sensor

George John
Updated on 30-Jul-2019 22:30:25

244 Views

This example demonstrate about How to check android mobile supports HUMIDITY sensorStep 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 a text view to show HUMIDITY sensor information.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.annotation.SuppressLint; import android.content.Context; import android.hardware.Sensor; import android.hardware.SensorManager; import android.os.Build; import android.os.Bundle; import android.support.annotation.RequiresApi; import android.support.v7.app.AppCompatActivity; import android.widget.TextView; public class MainActivity extends AppCompatActivity {    TextView ... Read More

KeyValue Class in Java Tuples

Smita Kapse
Updated on 30-Jul-2019 22:30:25

100 Views

A KeyValue class is a Tuple of 2 elements i.e. a key and value. It is in the JavaTuples library. The following is the declaration −public final class KeyValue extends Tuple implements IValueKey, IValueValueLet us first see what we need to work with JavaTuples. To work with KeyValue class in JavaTuples, you need to import the following package −import org.javatuples.KeyValue;Note − Download JavaTuples Jar library to run JavaTuples program. If you are using Eclipse IDE, then Right Click Project -> Properties -> Java Build Path -> Add External Jars and upload the downloaded JavaTuples jar file. Refer the below guide ... Read More

Show Current Database in MongoDB

Anvi Jain
Updated on 30-Jul-2019 22:30:25

559 Views

The command to show the database currently used in MongoDB is the following −db;Let us first check how many databases are present. The query is as follows −> show dbs;The following is the output displaying all the databases −admin 0.000GB config 0.000GB local 0.000GB sample 0.000GB sampleDemo 0.000GB studentSearch 0.000GB test 0.003GBNow, we have the list of all databases. Let us use the above syntax to check current database. The query is as follows −> db;The following is the output −sampleLook at the above sample output, we are currently using ‘sample’ database. Let us switch the database and verify again ... Read More

Create Ennead Tuple Using with() Method in Java

Daniol Thomas
Updated on 30-Jul-2019 22:30:25

141 Views

To create Ennead Tuple, you can use the with() method. With that, you can also add elements to it. Let us first see what we need to work with JavaTuples. To work with Ennead class in JavaTuples, you need to import the following package:import org.javatuples.Ennead;Note: Download JavaTuples Jar library to run JavaTuples program. If you are using Eclipse IDE, then Right Click Project → Properties → Java Build Path → Add External Jars and upload the downloaded JavaTuples jar file. Refer the below guide for all the steps to run JavaTuples:Steps: How to run JavaTuples program in EclipseThe following is ... Read More

Advertisements