To create a column with ‘false’ as the default value, we can use the concept of “default” at the time of creation of the table. Note − 0 represents false and 1 represents true. Creating a table using “default” false. mysql> create table TrueFalseTable -> ( -> Adult boolean default false -> ); Query OK, 0 rows affected (0.65 sec) Inserting records with no value, since we have set “default” above. mysql> insert into TrueFalseTable values(); Query OK, 1 row affected (0.16 sec) To display records. ... Read More
In 8085 Instruction set, ADD R is a mnemonic that stands for “Add contents of R to Accumulator”. As addition is a binary operation, so it requires two operands to be operated on. So input operands will reside on Accumulator and R registers and after addition the result will be stored back on to Accumulator. In this case, “R” stands for any of the following registers or memory location M pointed by HL pair. R = A, B, C, D, E, H, L, or M It is 1-Byte instruction so occupies only 1-Byte in memory. As R can ... Read More
Union is a type of operator in MySQL. We can use ORDER BY with this to filter records. Use UNION if you want to select rows one after the other from several tables or several sets of rows from a single table all as a single result set. Let us see an example. Creating first table mysql> create table UnionDemo1 -> ( -> id int -> ); Query OK, 0 rows affected (0.59 sec) Inserting records into first table. mysql> insert into UnionDemo1 values(1), (4), (10); Query OK, ... Read More
In 8085 Instruction set, ADI is a mnemonic, which stands for “ADd Immediate to Accumulator” and here “d8” stands for any 8-bit or 1-Byte of data. This instruction is used to add 8-bit immediate data to the Accumulator. The result of addition will be stored in the Accumulator. So the previous content of the Accumulator will be over written. It occupies 2-Bytes in memory. The flags are affected based on the result. Mnemonics, Operand Opcode(in HEX) Bytes ADI Data C6 2 Let us consider as example instruction ADI 03H of this type. As it ... Read More
The repair of MySQL tables is only applicable to MyISAM engine type, not for InnoDB. Therefore, we need to change the Engine type to MyISAM. The following is an example. Creating a table mysql> create table RepairTableDemo -> ( -> id int, -> name varchar(100) -> ); Query OK, 0 rows affected (0.51 sec) To convert this table to engine type MyISAM, use ALTER. mysql> ALTER TABLE RepairTableDemo ENGINE = MyISAM; Query OK, 0 rows affected (1.14 sec) Records: 0 Duplicates: 0 Warnings: ... Read More
Given a number n, print m multiplies of n without using any loop. Here we use recursive function. Examples Input: n = 15 Output: 15 10 5 0 5 10 15 Algorithm Step 1: Given n. Step 2: If we are moving back toward the n and we have reached there, then we are done. Step 3: If we are moving toward 0 or negative. Step 4: If m is greater, then 5, recursive function with true flag else recursive function is false. Step 5: If m is not greater than 5 then flag is false. ... Read More
We can restore the MySQL root user full privileges with the help of UPDATE command. Firstly, you need to stop mysqld and restart it with the --skip-grant-tables option. After that, connect to the mysqld server with only mysql (i.e. no -p option, and username may not be required). Issue the below given command in the mysql client to restore the MySQL root user with full privileges. mysql> UPDATE mysql.user SET Grant_priv = 'Y', Super_priv = 'Y' WHERE User = 'root'; Query OK, 0 rows affected (0.04 sec) Rows matched: 1 Changed: 0 Warnings: 0 Above, ... Read More
$(document).ready(function(){ $('#myinput').keydown(function(e) { var newkey = 'Key code = ' + e.which + ' ' + (e.ctrlKey ? 'Ctrl' : '') + ' ' + (e.shiftKey ? 'Shift' : '') + ' ' + (e.altKey ? 'Alt' : ''); $('#mykey').text(newkey); return false; }); });
Queue collection class is a concept in C# that is included in the System.Collection namespace. The elements are stored in a QUEUE in FIFO. The first element added will be the first to go out like a queue of people outside a movie hall to buy tickets. It has two methods. Enqueue() method to add values Dequeue() method to retrieve values Enqueue Add items in the queue. Queue q = new Queue(); q.Enqueue(“Two”); q.Enqueue(“One”); Dequeue Return items from the queue. Queue q = new Queue(); q.Enqueue(“Two”); q.Enqueue(“One”); // remove elements while (q.Count > 0) ... Read More
This example demonstrate about how to check the state of internet connection through broadcast Receiver.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 − To find the internet status we have to add network state permission to AndroidManifest.xml file as shown below. Step ... Read More