Articles on Trending Technologies

Technical articles with clear explanations and examples

Find next palindrome prime in C++

sudhir sharma
sudhir sharma
Updated on 13-Mar-2021 348 Views

In this problem, we are given an element N. We need to find the next palindrome prime.Problem Description − We need to find the smallest prime number which is also a palindrome number, greater than N.Palindrome Number is a number in which the numbers are the same in both directions.Prime Number is a number if its only factors are 1 and itself.Let’s take an example to understand the problem, InputN = 12Output101ExplanationThe series of palindromes greater than 12 are 22, 33, 44, 55, 66, 77, 88, 99, 101… out of these the smallest palindrome is 101.Solution ApproachA simple solution to ...

Read More

How communication among functions is established in C language?

Bhanu Priya
Bhanu Priya
Updated on 13-Mar-2021 895 Views

Functions communicate among themselves with the help of arguments and return value.Farm of ‘C’ function is as follows −return-datatype function name (argument list){    local variable declarations;    executable statements(s);    return (expression); }For example, void mul (int x, int y){    int p;    p=x*y;    printf("product = %d”, p); }Return values and their typesA function may or may not send back a value to the calling function.It will be done by using the return statementThe return types are void, int, float, char and double.If a function is not returning any value, then its return type is ‘void’.Function nameA ...

Read More

Find maximum sum array of length less than or equal to m in C++

sudhir sharma
sudhir sharma
Updated on 12-Mar-2021 222 Views

In the problem, we are given n arrays of different length. Our task is to Find the maximum sum array of length less than or equal to m.We need to find sub-arrays from the arrays to maximise the sum and make the length of all subarrays combined equal to m.Let’s take an example to understand the problem, Inputn = 3, m = 4 arrOfArr[][] = {    {5, 2, -1, 4, -3}    {3, -2, 1, 6}    {-2, 0, 5} }Output20ExplanationSubArrays are {5, 4}, {6}, {5}, length = 2 + 1 + 1 = 4 Sum = 5 + ...

Read More

What is the meaning of line "Yug Shahstra Yojan par Bhanu" which is taken from Hanuman Chalisa?

Knowledge base
Knowledge base
Updated on 10-Mar-2021 45K+ Views

Lord Hanuman is the great central characters  of the Indian epic Ramayana. Hanuman is well-known for his strength and he is immune to all sorts of weapons. He has got extreme speed (manojavam, marutha tulya vegam) effulgence, wisdom, no fear of death (Chiranjeevi), has won over the senses that lure. He has the knowledge of Eight Siddhis and Nine devotions. Even the world’s dangerous weapon Brahmastra can never harm him. He is the most powerful yet very obedient devotee of Shri Rama.The accurate prediction of distance from Earth to Sun:It was written in Hanuman Chalisa, “Yug Sahasra Yojana Par Bhanu, ...

Read More

What Is the Default MySQL Port Number?

AmitDiwan
AmitDiwan
Updated on 10-Mar-2021 1K+ Views

MySQL uses port number 3306 by default.3306 Port Number3306 port number is used by MySQL protocol to connect with the MySQL clients and utilities such as ‘mysqldump’. It is a TCP, i.e Transmission Control Protocol.VulnerabilitiesLet us see if there are any vulnerabilities while using this default port −In general, port 3306 shouldn’t be opened since it could make the server vulnerable to attack. If the user needs to connect to the database remotely, there are many other secure options, instead of opening the port 3306.One of the secure options includes using an SSH tunnel. On the other hand, if it ...

Read More

How can I determine the connection method used by a MySQL Client?

AmitDiwan
AmitDiwan
Updated on 10-Mar-2021 535 Views

To determine the connection method that is used by MySQL connection, the below command can be used −netstat −ln | grep 'mysql'On Unix, MySQL programs treat the host name ‘localhost’ in a special manner. Hence, it behaves differently than what is expected of it.Type of ConnectionTo know the type of connection from within the mysql CLI, the below command can be used −mysql> \sOutput −Connection: 127.0.0.1 via TCP/IP (or) Connection: Localhost via UNIX socketTCP/IP connection to the local serverTo ensure that the client makes a TCP/IP connection to the local server, the --host or -h can be used. This will ...

Read More

MySQL Administrative and Utility Programs

AmitDiwan
AmitDiwan
Updated on 10-Mar-2021 316 Views

Let us look at the administrative and utility programs in MySQL and understand how they can be used −ibd2sdiIt is a utility to extract serialized dictionary information (SDI) from InnoDB tablespace files. SDI data is present all persistent InnoDB tablespace files. ibd2sdi can be used at runtime or when the server is offline.innochecksumIt prints the checksums for InnoDB files. It reads an InnoDB tablespace file, calculates the checksum for every page, compares the calculated checksum to the stored checksum, and reports mismatches, which show the damaged pages. It was originally developed to speed up the verification of the integrity of ...

Read More

A Load Emulation Client for MySQL

AmitDiwan
AmitDiwan
Updated on 10-Mar-2021 314 Views

The mysqlslap utility is a diagnostic program that has designed to emulate client load for a MySQL server and report the timing of every stage. It works as though multiple clients are accessing the server.Invoking mysqlslapmysqlslap can be invoked using the below command −shell> mysqlslap [options]Some options are: --create or --query that would enable the user to specify a string that contains an SQL statement or a file containing statements.Stagesmysqlslap runs in three stages. They are −Create schema, table, and any stored programs or data to use (it is optional) for the test. This stage uses a single client connection.Run ...

Read More

Display MySQL Database, Table, and Column Information

AmitDiwan
AmitDiwan
Updated on 10-Mar-2021 414 Views

The mysqlshow client can be used to see what databases exist, their tables, or a table's columns or indexes.It provides a command-line interface for several SQL SHOW statements.Invoke mysqlshowThe mysqlshow utility can be invoked as shown below −shell> mysqlshow [options] [db_name [tbl_name [col_name]]]Here, If no database is provided, a list of database names are displayed.If no table is given, all matching tables in the database are displayed.If no column is provided, all matching columns and column types in the table are shown.The output displays the names of only those databases, tables, or columns for which the user has certain privileges.Optionsmysqlshow ...

Read More

mysqlimport - A MySQL Data Import Program

AmitDiwan
AmitDiwan
Updated on 10-Mar-2021 615 Views

The mysqlimport client comes with a command-line interface that helps with the LOAD DATA SQL statement. Most options to mysqlimport respond directly to clauses of LOAD DATA syntaxInvoking mysqlimportThe utility mysqlimport can be invoked as shown below −shell> mysqlimport [options] db_name textfile1 [textfile2 ...]For every text file that is named on the command line, mysqlimport strips any extension from the file name and uses the result to figure out the name of the table into which the file's contents have to be imported.ExampleLet us take an example: Files named sample.txt, sample.text, and sample all would be imported into a table ...

Read More
Showing 50201–50210 of 61,297 articles
Advertisements