Karthikeya Boyini has Published 2383 Articles

MySQL select distinct rows into a comma delimited list column?

karthikeya Boyini

karthikeya Boyini

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

890 Views

You can achieve it with the help of GROUP_CONCAT() function. The syntax is as follows −SELECT yourColumnName1, yourColumnName2, yourColumnName3, ..N, GROUP_CONCAT(yourColumnName4) as anyAliasName FROM yourTableName group by yourColumnName3, yourColumnName1, yourColumnName2;To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create ... Read More

Left justify output in Java

karthikeya Boyini

karthikeya Boyini

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

2K+ Views

Including a minus sign after the %, makes it left justified.Note − By default, output is right justifiedFirstly, create a formatter object −Formatter f = new Formatter();Now, use the format() method to left justify output −f.format("|%-15.5f|", 299.675796)The following is an example −Example Live Demoimport java.util.*; public class Demo { ... Read More

How to create multiple styles inside a TextView on iOS App?

karthikeya Boyini

karthikeya Boyini

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

375 Views

To create multiple styles inside a textview we need to use attributed string. The text view in ios has a property attributedText which can be used to style the text inside a text view. We’ll see this with help of an example.First, we’ll create an attributelet attributeOne : [NSAttributedString.Key : ... Read More

Differences between Flatten() and Ravel() in Numpy

karthikeya Boyini

karthikeya Boyini

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

218 Views

There are numerous ways to create a numpy array. Numpy provides two different kinds of ways to convert a ndarray to 1Darray: that is using the flatten() method and the other using the ravel() method.Example#Import required library, numpy import numpy as np #create an array from a list arr = ... Read More

Formatting a Negative Number Output with Parentheses in Java

karthikeya Boyini

karthikeya Boyini

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

486 Views

A negative number output can be shown using the Formatter object −Formatter f = new Formatter(); f.format("%12.2f", -7.598); System.out.println(f);Try the below given code to format a Negative Number Output with Parentheses −Formatter f = new Formatter(); f.format("%(d", -50); System.out.println(f);The following is an example −Example Live Demoimport java.util.Formatter; public class Demo { ... Read More

Print Colors of terminal in Python

karthikeya Boyini

karthikeya Boyini

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

609 Views

In the terminal, if you want to make some texts appears in colored mode, there are numerous ways in python programming to achieve it.Using python modules1.termcolor module: It is the ANSII Color formatting for output in the terminal.import sys from termcolor import colored, cprint text1 = colored('Hello, Tutorialspoint!', 'blue', attrs=['reverse', ... Read More

How to add a Submit button after the end of the tableview using Swift?

karthikeya Boyini

karthikeya Boyini

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

2K+ Views

To add a submit button at the end of a table view, we can make use of table view footers. Let’s see this with help of an example where we’ll add a footer view to our table, and inside the table, we will add code for adding button at the ... Read More

The # format flag in Java

karthikeya Boyini

karthikeya Boyini

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

265 Views

Apply the # flag to the %o, %x, %e, and %f format specifiers. If you want to display the hexadecimal number with a 0x prefix, then precede the %x specifier with #.Preceding the %x specifier with a #, the hexadecimal number will be printed with a 0x prefix.Let us see ... Read More

SHA encoding using Python?

karthikeya Boyini

karthikeya Boyini

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

780 Views

One of the major concern of all IT companies in the security of there data. Multiple hashing techniques are there to project and check our data.What is HashHash is a function which takes variable length sequence of bytes as input and converts it to a fixed length sequence. However, to ... Read More

Develop Notepad using Tkinter in python

karthikeya Boyini

karthikeya Boyini

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

2K+ Views

Tkinter is a GUI library from python from which we can create multiple GUI apps. Here, using tkinter we will develop a notepad like text editor. This notepad will have the menu where we can create new file, open existing file, save the file, editing, cut and paste, all functionality ... Read More

Advertisements