Paul Richard

Paul Richard

42 Articles Published

Articles by Paul Richard

Page 4 of 5

What are favicon best practices regarding size and format?

Paul Richard
Paul Richard
Updated on 25-Feb-2020 4K+ Views

A favicon is a little icon visible on the web browser tab, just before the page title. It is generally a logo with the smaller size.The size of a favicon is 16x16 since it also gets displayed next to the URL of your site in a browser's address bar. It is visible on a users list of bookmarks and easily helps in recognizing the website from a list of websites.Here’s how you can spot the Favicon, The preferred size, 1. 16x16: For a web browser 2. 32x32: or taskbar shortcut icon 3. 96x96: For ...

Read More

How to count the number of words in a text file using Java?

Paul Richard
Paul Richard
Updated on 20-Feb-2020 6K+ Views

Read the number of words in text fileCreate a FileInputStream object by passing the required file (object) as a parameter to its constructor.Read the contents of the file using the read() method into a byte array. Insatiate a String class by passing the byte array to its constructor.Using split() method read the words of the String to an array.Create an integer variable, initialize it with 0, int the for loop for each element of the string array increment the count.Exampleimport java.io.File; import java.io.FileInputStream; public class Sample {    public static void main(String args[]) throws Exception{       int count =0;       File ...

Read More

How to Edit, Compile, and Execute a C++ Program?

Paul Richard
Paul Richard
Updated on 10-Feb-2020 3K+ Views

Create a new cpp file using your text editor. Enter the following in it −#include int main() {     std::cout

Read More

What is C++ programming language?

Paul Richard
Paul Richard
Updated on 10-Feb-2020 5K+ Views

C++ is a programming language developed by Bjarne Stroustrup in 1979 at Bell Labs. C++ is regarded as a middle-level language, as it comprises a combination of both high-level and low-level language features. It is a superset of C, and that virtually any legal C program is a legal C++ program. C++ runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX.It is a language that is − Statically typed − A programming language is claimed to use static typing when type checking is performed during compile-time as opposed to run-time. Compiled − ...

Read More

How can MySQL COALESCE() function be used with MySQL SUM() function to customize the output?

Paul Richard
Paul Richard
Updated on 07-Feb-2020 3K+ Views

When MySQL SUM() function got a column, having no values, an argument then it will return NULL, rather than 0, as output. But if we want to customize this output to show 0 as output then we can use MySQL COALESCE() function which accepts two arguments and returns the second argument if the first argument is NULL, otherwise, it returns the first argument. To illustrate it, we are taking the example of ‘Tender’ table having the following data −mysql> Select * from tender; +----+---------------+--------------+ | Sr | CompanyName   | Tender_value | +----+---------------+--------------+ | 1  | Abc Corp.   ...

Read More

What happens if the value of number 'N' in CONV() function is not as per accordance with its base?

Paul Richard
Paul Richard
Updated on 04-Feb-2020 204 Views

MySQL returns 0 as output if the number given in CONV() function is not as per accordance with its base. Suppose, if we want to convert decimal number 9 into the number in binary number system then in this case the value of from_base must be 10 but if we provide 8 as the value of from_base then MySQL returns 0 as output.Examplemysql> Select CONV(9,8,2); +-------------+ | CONV(9,8,2) | +-------------+ | 0           | +-------------+ 1 row in set (0.00 sec)As we know that the values of octal number system must be between 0 to 7, hence the number system for number 9 must be decimal i.e. 10.

Read More

C++ Program to Check Whether a Hamiltonian Cycle or Path Exists in a Given Graph

Paul Richard
Paul Richard
Updated on 30-Jul-2019 1K+ Views

A Hamiltonian cycle is a Hamiltonian Path such that there is an edge (in graph) from the last vertex to the first vertex of the Hamiltonian Path. It is in an undirected graph is a path that visits each vertex of the graph exactly once.Functions and purposes:Begin    1.function isSafe() is used to check for whether it is adjacent to the previously added vertex and already not added.    2. function hamiltonianCycle() solves the hamiltonian problem.    3. function hamCycle() uses hamiltonianCycle() to solve the hamiltonian problem.       It returns false if there is no Hamiltonian Cycle possible, ...

Read More

C++ Program to Generate All Subsets of a Given Set in the Lexico Graphic Order

Paul Richard
Paul Richard
Updated on 30-Jul-2019 534 Views

This is C++ Program to Generate All Subsets of a Given Set in the Lexico Graphic Order. This algorithm prints all the possible combination of each length from the given set of array in increasing order. The time complexity of this algorithm is O(n*(2^n)).AlgorithmBegin    For each length ‘i’ GenAllSubset() function is called:    1) In GenAllSubset(), if currLen is more than the reqLen then return.    2) Otherwise, if currLen is equal to reqLen then there will be a new sequence generated, print it.    3) If proceed with a start as ‘true’ and recursively call GenAllSubset() with incremented ...

Read More

C++ Program to Perform Edge Coloring of a Graph

Paul Richard
Paul Richard
Updated on 30-Jul-2019 746 Views

In this program, we will perform Edge Coloring of a Graph in which we have to color the edges of the graph that no two adjacent edges have the same color. Steps in Example.AlgorithmBegin    Take the input of the number of vertices, n, and then number of edges, e, in the graph.    The graph is stored as adjacency list.    BFS is implemented using queue and colors are assigned to each edge. EndExample#include using namespace std; int n, e, i, j; vector g; vector color; bool v[111001]; void col(int n) {    queue q;    int c = ...

Read More

When to use LinkedList over ArrayList in Java

Paul Richard
Paul Richard
Updated on 30-Jul-2019 3K+ Views

LinkedList should be used where modifications to a collection are frequent like addition/deletion operations. LinkedList is much faster as compare to ArrayList in such cases. In case of read-only collections or collections which are rarely modified, ArrayList is suitable.

Read More
Showing 31–40 of 42 articles
Advertisements