What is Polynomial Code?

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

4K+ Views

A polynomial code is a linear code having a set of valid code words that comprises of polynomials divisible by a shorter fixed polynomial is known as generator polynomial.They are used for error detection and correction during the transmission of data as well as storage of data.Types of Polynomial CodesThe types of polynomial codes are:Cyclic Redundancy CodeBose–Chaudhuri–Hocquenghem (BCH) CodesReed–Solomon CodesRepresentation of Bit Strings with PolynomialsThe code words, which are essentially bit strings, are represented by polynomials whose coefficients are either 0 or 1. A 𝑘 – bit word is represented by a polynomial ranging from 𝑥0 to 𝑥𝑘−1. The order ... Read More

Work with this Keyword in Java

Rishi Raj
Updated on 30-Jul-2019 22:30:24

353 Views

The this keyword in Java is mainly used to refer to the current instance variable of the class. It can also be used to implicitly invoke the method or to invoke the constructor of the current class.A program that demonstrates the this keyword in Java is given as follows:Example Live Democlass Student {    private int rno;    private String name;    public Student(int rno, String name) {       this.rno = rno;       this.name = name;    }    public void display() {       System.out.println("Roll Number: " + rno);       System.out.println("Name: " + ... Read More

Replace All NULL Values in a Specific Field of a Table in MySQL

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

295 Views

To replace all NULL values in a particular field of a particular table, use UPDATE command with IS NULL property. The syntax is as follows:UPDATE yourTableName SET yourColumnName=”yourValue’ WHERE yourColumnName IS NULL;To understand the above syntax, let us create a table. The query to create a table is as follows:mysql> create table Employee_Information_Table    -> (    -> Id int NOT NULL AUTO_INCREMENT,    -> Name varchar(20),    -> Salary int,    -> PRIMARY KEY(Id)    -> ); Query OK, 0 rows affected (0.59 sec)Insert some records in the table using insert command. The query to insert record is as ... Read More

Get Lower Key from NavigableMap in Java

Samual Sam
Updated on 30-Jul-2019 22:30:24

116 Views

To get lower key means returning the greatest key strictly less than the given key. This can be done using lowerKey() method.The following is an example to get lower key from NavigableMap −Example Live Demoimport java.util.*; public class Demo { public static void main(String[] args) { NavigableMap n = new TreeMap(); n.put(5, "Tom"); n.put(9, "John"); n.put(14, "Jamie"); n.put(1, "Tim"); n.put(4, "Jackie"); ... Read More

Find Minimum Element of HashSet in Java

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

2K+ Views

To get the minimum element of HashSet, use the Collections.min() method.Declare the HashSet −Set hs = new HashSet();Now let us add the elements −hs.add(29); hs.add(879); hs.add(88); hs.add(788); hs.add(456);Let us now get the minimum element −Object obj = Collections.min(hs);The following is an example to find the minimum element of HashSet −Example Live Demoimport java.util.*; public class Demo { public static void main(String args[]) { // create hash set Set hs = new HashSet(); hs.add(29); hs.add(879); ... Read More

Different Shapes of Galaxies

Knowledge base
Updated on 30-Jul-2019 22:30:24

718 Views

In the vast space around us, there are numerous galaxies present, which are known as large groups filled with stars, dust, and gases all held together due to gravity. All the galaxies are likely to contain stars, planets, moons, comets, asteroids, black holes, nebulae, dust, neutron stars etc.Just like our solar system that lies in the Milky Way galaxy, there are many galaxies in the space. Every galaxy moves at certain speed and exists in a certain shape. Our milky way galaxy is in the spiral shape with a bright bulge at its center.The famous astronomer Edwin Hubble studied the ... Read More

Get Ceiling Key from NavigableMap in Java

Samual Sam
Updated on 30-Jul-2019 22:30:24

135 Views

Getting ceiling key means to return the least key greater than or equal to the given key. For this, use the ceilingKey() method.The following is an example to get ceiling key from NavigableMap.Example Live Demoimport java.util.*; public class Demo { public static void main(String[] args) { NavigableMap n = new TreeMap(); n.put(5, "Tom"); n.put(9, "John"); n.put(14, "Jamie"); n.put(1, "Tim"); n.put(4, "Jackie"); ... Read More

Algorithm for Computing the CRC

Ankith Reddy
Updated on 30-Jul-2019 22:30:24

7K+ Views

Cyclic Redundancy Check (CRC)Cyclic Redundancy Check (CRC) is a block code that was invented by W. Wesley Peterson in 1961. It is commonly used to detect accidental changes to data transmitted via telecommunications networks and storage devices.CRC involves binary division of the data bits being sent by a predetermined divisor agreed upon by the communicating system. The divisor is generated using polynomials. So, CRC is also called polynomial code checksum.Before sending the message over network channels, the sender encodes the message using CRC. The receiver decodes the incoming message to detect error. If the message is error-free, then it is ... Read More

Non-Static Initialization Block in Java

Vikyath Ram
Updated on 30-Jul-2019 22:30:24

2K+ Views

Instance variables are initialized using initialization blocks. These blocks are executed when the class object is created and before the invocation of the class constructor. Also, it is not necessary to have initialization blocks in the class.A program that demonstrates a non-static initialization block in Java is given as follows:Example Live Demopublic class Demo {    static int[] numArray = new int[10];    {       System.out.println("Running non-static initialization block.");       for (int i = 0; i < numArray.length; i++) {          numArray[i] = (int) (100.0 * Math.random());       }    }   ... Read More

Select Not Null Column from Two Columns in MySQL

Ankith Reddy
Updated on 30-Jul-2019 22:30:24

9K+ Views

There are lots of ways to select NOT NULL column from two columns. The syntaxes are as follows:Case 1: Use IFNULL() function.The syntax is as follows:SELECT IFNULL(yourColumnName1, yourColumnName2) as anyVariableName from yourTableName;Case 2: Use coalesce() function.The syntax is as follows:SELECT COALESCE(yourColumnName1, yourColumnName2) as anyVariableName from yourTableName;Case 3: Use CASE statement.The syntax is as follows:SELECT CASE WHEN yourColumnName1 IS NOT NULL THEN yourColumnName1 ELSE yourColumnName2 END AS anyVariableName FROM yourTableName;Case 4: Use only IF().The syntax is as follows:SELECT IF (yourColumnName1 ISNULL, yourColumnName2, yourColumnName1) AS NotNULLValue FROM SelectNotNullColumnsDemo;To understand the above syntax, let us create a table. The query to create a ... Read More

Advertisements