The measurements of angles in mathematics are done using these two units of measurement called degree and radian. They are frequently used in math calculations involving angles and need conversion from one value to another. In python we can achieve these conversions using python functions.degrees() FunctionThis function takes radian value as parameter and return the equivalent value in degrees. The return is a float value.Example Live Demoimport math # Printing degree equivalent of radians. print("1 Radians in Degrees : ", math.degrees(1)) print("20 Radians in Degrees : ", math.degrees(20)) print("180 Radians in Degrees : ", math.degrees(180))OutputRunning the above code gives us the ... Read More
Here, we are converting time value, for example 150:50:10 to days and hours form, i.e. 6 days 6 hours.You can use CONCAT() along with HOUR() for this. Let us first create a table −mysql> create table DemoTable657(DueTime time); Query OK, 0 rows affected (3.68 sec)Insert some records in the table using insert command. Here, we have inserted the records in the form of total hours −mysql> insert into DemoTable657 values('120:30:00'); Query OK, 1 row affected (0.38 sec) mysql> insert into DemoTable657 values('150:50:10'); Query OK, 1 row affected (0.27 sec)Display all records from the table using select statement −mysql> select *from ... Read More
A covering graph is a subgraph which contains either all the vertices or all the edges corresponding to some other graph. A subgraph which contains all the vertices is called a line/edge covering. A subgraph which contains all the edges is called a vertex covering.Line CoveringLet G = (V, E) be a graph. A subset C(E) is called a line covering of G if every vertex of G is incident with at least one edge in C, i.e., deg(V) ≥ 1 ∀ V ∈ Gbecause each vertex is connected with another vertex by an edge. Hence it has a minimum ... Read More
In this article we develop a program to calculate the frequency of each element present in a list.Using a dictionaryHere we capture the items as the keys of a dictionary and their frequencies as the values.Example Live Demolist = ['a', 'b', 'a', 'c', 'd', 'c', 'c'] frequency = {} for item in list: if (item in frequency): frequency[item] += 1 else: frequency[item] = 1 for key, value in frequency.items(): print("% s -> % d" % (key, value))OutputRunning the above code gives us the following result −a -> 2 b -> 1 c ... Read More
Kirchoff's theorem is useful in finding the number of spanning trees that can be formed from a connected graph.ExampleThe matrix 'A' be filled as, if there is an edge between two vertices, then it should be given as '1', else '0'.
You can use SELECT *FROM yourTableName in stored procedure. Let us first create a table −mysql> create table DemoTable654 ( StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY, StudentFirstName varchar(100) ); Query OK, 0 rows affected (0.70 sec)Insert some records in the table using insert command −mysql> insert into DemoTable654(StudentFirstName) values('John'); Query OK, 1 row affected (0.11 sec) mysql> insert into DemoTable654(StudentFirstName) values('Sam'); Query OK, 1 row affected (0.14 sec) mysql> insert into DemoTable654(StudentFirstName) values('Mike'); Query OK, 1 row affected (0.15 sec) mysql> insert into DemoTable654(StudentFirstName) values('Robert'); Query OK, 1 row affected (0.12 sec)Display all records from the table using ... Read More
IsomorphismIf two graphs G and H contain the same number of vertices connected in the same way, they are called isomorphic graphs (denoted by G ≅ H).It is easier to check non-isomorphism than isomorphism. If any of these following conditions occurs, then two graphs are non-isomorphic −The number of connected components are differentVertex-set cardinalities are differentEdge-set cardinalities are differentDegree sequences are differentExampleThe following graphs are isomorphic −HomomorphismA homomorphism from a graph G to a graph H is a mapping (May not be a bijective mapping) h: G → H such that − (x, y) ∈ E(G) → (h(x), h(y)) ∈ ... Read More
This function return the string representing a character whose Unicode code point is the integer supplied as parameter to this function. For example, chr(65) returns the string 'A', while chr(126) returns the string '~'.SyntaxThe syntax of the function is as below.chr(n) where n is an integer valueExampleThe below program shows how the chr() is used. We supply various integer values as parameter and get back the respective characters. Live Demo# Printing the strings from chr() function print(chr(84), chr(85), chr(84), chr(79), chr(82))Running the above code gives us the following result −T U T O RUsing a series of numbersWe can take help ... Read More
To change order of items in MySQL, use ORDER BY alias name. Let us first create a table −mysql> create table DemoTable653 (Product1Amount int, Product2Amount int); Query OK, 0 rows affected (0.42 sec)Insert some records in the table using insert command −mysql> insert into DemoTable653 values(400, 250); Query OK, 1 row affected (0.14 sec) mysql> insert into DemoTable653 values(500, 300); Query OK, 1 row affected (0.16 sec) mysql> insert into DemoTable653 values(40, 400); Query OK, 1 row affected (0.15 sec) mysql> insert into DemoTable653 values(200, 450); Query OK, 1 row affected (0.14 sec) mysql> insert into DemoTable653 values(50, 20); Query ... Read More
Let us first create a table −mysql> create table DemoTable651 (Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, Value varchar(100)); Query OK, 0 rows affected (0.59 sec)Insert some records in the table using insert command −mysql> insert into DemoTable651(Value) values('Title'); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable651(Value) values('course'); Query OK, 1 row affected (0.26 sec) mysql> insert into DemoTable651(Value) values('subject'); Query OK, 1 row affected (0.20 sec)Display all records from the table using select statement −mysql> select *from DemoTable651;This will produce the following output −+----+---------+ | Id | Value | +----+---------+ | 1 | ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP