Split Numerical Query Result in MySQL

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

185 Views

To split a numerical query result, you can use the CONCAT() function in MySQL. Let us first create a table −mysql> create table DemoTable    (    StudentId int    ); Query OK, 0 rows affected (0.68 sec)Now you can insert some records in the table using insert command −mysql> insert into DemoTable values(2222); Query OK, 1 row affected (0.18 sec) mysql> insert into DemoTable values(5555); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable values(4567); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable values(8905); Query OK, 1 row affected (0.15 sec)Display all records from ... Read More

HTML a Target Attribute

Arjun Thakur
Updated on 30-Jul-2019 22:30:26

632 Views

The target attribute of the element is used to set where the linked document will open. You can set the document to open in a new window, same frame, parent frame, etc.Following is the syntax −Here, _blank is used to open the linked document in new window or tab, _self opens the linked document in the same frame as it was clicked, _parent opens the document in the parent frame, _top opens the linked document in the entire body of the window, frame opens the linked document in a named frame.Let us now see an example to implement target attribute ... Read More

Create Transparent Status Bar and Navigation Bar in iOS

Sharon Christine
Updated on 30-Jul-2019 22:30:26

1K+ Views

You might have come across many application where the screen extends to complete screen i.e transparent Status Bar and transparent navigation bar.Here we will be seeing how to create an application where the you’ll be having transparent status and navigation bar.So let’s get startedStep 1 − Open Xcode → New Project → Single View Application → Let’s name it “TransparentViews”Step 2 − Embed the View Controller in Navigation Controller. Add Image View and shown and add image.Step 3 − Run the application without adding any piece of code for making status and navigation bar transparent.The screen looks like belowStep 4 ... Read More

Count Rows Having Three or More Values in MySQL Table

Rama Giri
Updated on 30-Jul-2019 22:30:26

139 Views

Let us first create a table −mysql> create table DemoTable    -> (    -> UserId int    -> ); Query OK, 0 rows affected (0.48 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(10); Query OK, 1 row affected (0.15 sec) mysql> insert into DemoTable values(20); Query OK, 1 row affected (0.12 sec) mysql> insert into DemoTable values(30); Query OK, 1 row affected (0.15 sec) mysql> insert into DemoTable values(10); Query OK, 1 row affected (0.14 sec) mysql> insert into DemoTable values(10); Query OK, 1 row affected (0.09 sec) ... Read More

C++ Program for Sum of Squares of First N Natural Numbers

Arnab Chakraborty
Updated on 30-Jul-2019 22:30:26

629 Views

In this problem we will see how we can get the sum of squares of first n natural numbers. Here we are using one for loop, that runs from 1 to n. In each step we are calculating square of the term and then add it to the sum. This program takes O(n) time to complete. But if we want to solve this in O(1) or constant time, we can use this series formula −AlgorithmsquareNNatural(n)begin    sum := 0    for i in range 1 to n, do       sum := sum + i^2    done    return ... Read More

HTML DOM Length Property

AmitDiwan
Updated on 30-Jul-2019 22:30:26

174 Views

The HTML DOM length property returns a number corresponding to the nodes in node list object.SyntaxFollowing is the syntax −Returning number of nodes in nodeList Object.nodeList.lengthExampleLet us see an example for HTML DOM length property − Live Demo HTML DOM length    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: 2px;       margin:5px;    }    input[type="button"] {       border-radius: 10px;    }    ul{       width: 30%;       margin: 0 auto; ... Read More

Difference Between P and X in C/C++

Nishtha Thakur
Updated on 30-Jul-2019 22:30:26

10K+ Views

Here we will see what are the differences between %p and %x in C or C++. The %p is used to print the pointer value, and %x is used to print hexadecimal values. Though pointers can also be displayed using %u, or %x. If we want to print some value using %p and %x then we will not feel any major differences. The only difference that can be noticed is that the %p will print some leading zeros, but %x doesn’t.Example#include main() {    int x = 59;    printf("Value using %%p: %p", x);    printf("Value using %%x: %x", x); ... Read More

Levenshtein Distance Computing Algorithm in C++

Nishtha Thakur
Updated on 30-Jul-2019 22:30:26

3K+ Views

The Levenshtein distance between two strings means the minimum number of edits needed to transform one string into the other, with the edit operations i.e; insertion, deletion, or substitution of a single character.For example: The Levenshtein Distance between cat and mat is 1 −cat mat(substitution of ‘c’ with ‘m’)Here is a C++ Program to implement Levenshtein Distance computing algorithm.AlgorithmsBegin    Take the strings as input and also find their length.    For i = 0 to l1       dist[0][i] = i    For j = 0 to l2       dist[j][0] = j    For j=1 to l1 ... Read More

Clear Android Notification After a Few Seconds

Smita Kapse
Updated on 30-Jul-2019 22:30:26

687 Views

This example demonstrate about How to clear an Android notification after a few seconds.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 − Add the following code to res/layout/activity_main.xml.     Step 3 − Add the following code to src/MainActivity.javapackage app.tutorialspoint.com.notifyme ; import android.app.NotificationChannel ; import android.app.NotificationManager ; import android.app.PendingIntent ; import android.content.Context ; import android.content.Intent ; import android.os.Handler ; import android.support.v4.app.NotificationCompat ; import android.support.v7.app.AppCompatActivity ; import android.os.Bundle ; import android.view.View ; import android.widget.Button ; public class MainActivity extends AppCompatActivity {   ... Read More

Resize and Position a JFrame in Java

Arjun Thakur
Updated on 30-Jul-2019 22:30:26

841 Views

To resize and position JFrame, use the Dimensions class. Here, we have set the bounds for the frame −int width = 500; int height = 400; Dimension size = Toolkit.getDefaultToolkit().getScreenSize(); frame.setBounds((int) size.getWidth() - width, 0, width, height);The following is an example to resize and poisiton a frame −Examplepackage my; import java.awt.Dimension; import java.awt.GridLayout; import java.awt.Toolkit; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPasswordField; import javax.swing.JTextField; import javax.swing.SwingConstants; public class SwingDemo {    public static void main(String[] args) throws Exception {       JFrame.setDefaultLookAndFeelDecorated(true);       JFrame frame = new JFrame("Register!");       JLabel label1, label2, label3;       ... Read More

Advertisements