Show Constraints on Table Command in MySQL

Arjun Thakur
Updated on 26-Jun-2020 12:44:26

2K+ Views

You can show constraints on tables with the help of SHOW command. The syntax is as follows −show create table yourTableName;The above command will show all constraints with table ENGINE. Using this, you can even see all the column names and corresponding data types.To understand the above MySQL statement, let us first create a table −mysql> create table ShowConstraintsDemo    -> (    -> BookId int not null, -> BookName varchar(200) not null, -> BookAuthor varchar(200) Unique not null, -> Primary key(BookId, BookName) -> ); Query OK, 0 rows affected (1.04 sec)Now you can apply the above syntax in order ... Read More

Check Anagram Values and Count Occurrences in Android

Fendadis John
Updated on 26-Jun-2020 12:44:06

127 Views

This example demonstrate about How to check edit text values are Anagram or Not and Count Occurrences of Anagrams 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 two edit texts to take the data from user and when user click on button it will give result on toast.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import ... Read More

Validate TextView Data to Allow Only Digits in Android

Fendadis John
Updated on 26-Jun-2020 12:43:30

198 Views

This example demonstrate about How to valid textview data is only digits 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 a text view to show digits.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.Manifest; import android.content.pm.PackageManager; import android.location.Address; import android.location.Geocoder; import android.location.Location; import android.location.LocationManager; import android.os.Build; import android.os.Bundle; import android.support.annotation.RequiresApi; import android.support.v4.app.ActivityCompat; import android.support.v7.app.AppCompatActivity; import android.text.TextUtils; import android.widget.TextView; import ... Read More

Multiprocessing in Python

Samual Sam
Updated on 26-Jun-2020 12:43:27

5K+ Views

The multiprocessing package supports spawning processes. It refers to a function that loads and executes a new child processes. For the child to terminate or to continue executing concurrent computing, then the current process hasto wait using an API, which is similar to threading module.IntroductionWhen we work with Multiprocessing, at first we create process object. Then it calls a start() method.Example codefrom multiprocessing import Process    def display():       print ('Hi !! I am Python')       if __name__ == '__main__':       p = Process(target=display)       p.start()       p.join()In this example, ... Read More

Print Current Package Name in Android

Anuradha Nanda
Updated on 26-Jun-2020 12:42:33

2K+ Views

This example demonstrate about How to print current package name 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 a text view to show the current package name.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.os.Build; import android.os.Bundle; import android.support.annotation.RequiresApi; import android.support.v7.app.AppCompatActivity; import android.widget.TextView; import java.security.Security; import java.util.Locale; public class MainActivity extends AppCompatActivity {    TextView textView;   ... Read More

Print Current Package Cache Directory Information in Android

Vikyath Ram
Updated on 26-Jun-2020 12:41:59

594 Views

This example demonstrate about How to print current package cache directory information 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 text view to show current package cache information.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.os.Build; import android.os.Bundle; import android.support.annotation.RequiresApi; import android.support.v7.app.AppCompatActivity; import android.widget.TextView; import java.security.Security; import java.util.Locale; public class MainActivity extends AppCompatActivity {    TextView textView; ... Read More

Print Current Activity Name in Android

Arushi
Updated on 26-Jun-2020 12:41:18

832 Views

This example demonstrate about How to print current activity name 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 text view to show current activity name.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.os.Build; import android.os.Bundle; import android.support.annotation.RequiresApi; import android.support.v7.app.AppCompatActivity; import android.widget.TextView; import java.security.Security; import java.util.Locale; public class MainActivity extends AppCompatActivity {    TextView textView;    @RequiresApi(api = ... Read More

Print Application Base APK Path in Android

Fendadis John
Updated on 26-Jun-2020 12:40:23

707 Views

This example demonstrate about How to print application base apk path 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 text view to show the current application base apk path .Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.os.Build; import android.os.Bundle; import android.support.annotation.RequiresApi; import android.support.v7.app.AppCompatActivity; import android.widget.TextView; import java.security.Security; import java.util.Locale; public class MainActivity extends AppCompatActivity {   ... Read More

Column Flags in MySQL Workbench

Ankith Reddy
Updated on 26-Jun-2020 12:38:03

5K+ Views

In MySQL Workbench, column flags can be used with a column to maintain integrity. The column flags are as follows −PK − Primary KeyNN − NOT NULLBIN − BinaryUN − UnsignedUQ − UniqueZF − Zero FilledG − Generate ColumnAI − Auto IncrementLet us learn about them one by one −PKThis stands for the primary key. It can be used to make the column as a primary key.NNIt is for NOT NULL. Used to enforce the column that it will not insert a NULL value.BINThis stands for Binary. This can be used to store data as a binary string.UNIt is for ... Read More

Scraping and Finding Ordered Word in a Dictionary in Python

karthikeya Boyini
Updated on 26-Jun-2020 12:37:10

675 Views

For solving this problem we need requests module.For installing requests module, we need this command to get executed at command line.pip install requestsScrapingImport requests module.Then we need to fetch data from URL.Using UTF-8 decode the text.Then convert string into a list of words.Ordered FindingTraverse the list of words using loop.Then compare the ASCII value of adjacent character of each word.If the comparison is true then print ordered word otherwise store the unordered word.Example codeimport requests    def Words_find():       my_url = ""#put thisurl of .txt files in any website       my_fetchData = requests.get(my_url)       ... Read More

Advertisements