Karthikeya Boyini has Published 2383 Articles

MySQL query to group data in the form of user login time per hour and get the records of the users logged in the recent hour?

karthikeya Boyini

karthikeya Boyini

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

232 Views

You can use a subquery with JOIN condition for this. The syntax is as follows −SELECT yourTablevariableName.* FROM ( SELECT MAX(UNIX_TIMESTAMP(yourDateTimeColumnName)) AS anyAliasName FROM getLatestHour GROUP BY HOUR(UserLoginDateTime) ) yourOuterVariableName JOIN yourTableName yourTablevariableName ON UNIX_TIMESTAMP(yourDateTimeColumnName) = yourOuterVariableName.yourAliasName WHERE DATE(yourDateTimeColumnName) = 'yourDateValue';To ... Read More

How to set target and action for UIBarButtonItem at runtime?

karthikeya Boyini

karthikeya Boyini

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

951 Views

To create a bar button action at run time we’ll need to go through a few steps. First of all let’s start by creating a new project.Once you have created the project, go to it’s storyboard directly, select the ViewController and Embed it into a navigation controller.Now go to the ... Read More

Can I change the size of UIActivityIndicator in Swift?

karthikeya Boyini

karthikeya Boyini

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

592 Views

It is possible to change the size of UIActivityIndicator in swift using some tricks but it’s not recommended to change the size. To change the size of activity indicator let’s first add an indicator on an empty screen and see how it looks. For this example, I’ll also change the ... Read More

Why is python best suited for Competitive Coding

karthikeya Boyini

karthikeya Boyini

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

194 Views

Competitive programming is generally referred to coding to make use of efficient algorithms using an appropriate data structure. They test the skills of programmers on many levels.With the help of algorithms and data structures, you have to solve a hypothetical programming problem posed to you by applying different logics. You ... Read More

Convert one base number system to another base system in MySQL

karthikeya Boyini

karthikeya Boyini

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

98 Views

The CONV() function can be used to convert one base number system to another base system.For Example, The 16 is one base system and 10 is another base system. The 16 base system is hexadecimal and 10 is a decimal.The syntax is as follows −SELECT CAST(CONV('yourColumnName', 16, 10) AS UNSIGNED ... Read More

Formatter Specifier for Octal and Hexadecimal in Java

karthikeya Boyini

karthikeya Boyini

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

152 Views

For Formatter, import the following package −import java.util.Formatter;Now create a Formatter object like this −Formatter f1 = new Formatter(); Formatter f2 = new Formatter(); Formatter f3 = new Formatter();If you want a Format specifier for Octal, use %o −f3.format("Octal values %o %o %o", 15, 55, 78);If you want a Format ... Read More

Floating-point hexadecimal in Java

karthikeya Boyini

karthikeya Boyini

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

349 Views

For Floating-point hexadecimal form, use the %a format specifier.For Formatter, import the following package −import java.util.Formatter;Now create a Formatter object like this −Formatter f = new Formatter();Use the format() method for floating-point hexadecimal −f.format("%a", 298.45)The following is an example −Example Live Demoimport java.util.Formatter; public class Demo { public ... Read More

How to use Swift to detect when AVPlayer video ends playing?

karthikeya Boyini

karthikeya Boyini

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

2K+ Views

To detect the end of a video in swift we’ll need to create a video player, then use notifications to detect when the video stops playing. We’ll do this with help of an example in swift.Let’s create a project and drag and drop any video with extension “mp4”, select copy ... Read More

Using “WHERE binary” in SQL?

karthikeya Boyini

karthikeya Boyini

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

2K+ Views

The binary keyword can be used after WHERE clause to compare a value with exact case sensitive match.The following is an example −Case 1 − Case insensitive matchThe query is as follows −mysql> select 'joHN'='JOHN' as Result;The following is the output −+--------+ | Result | +--------+ | ... Read More

Replacing strings with numbers in Python for Data Analysis

karthikeya Boyini

karthikeya Boyini

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

723 Views

Sometimes there is a requirement to convert a string to a number (int/float) in data analysis. For each string, we can assign a unique integer value to differentiate string values.For this, we use the data in Comma Separated Values(CSV) files. Say we have an excel file containing CSV data as ... Read More

Advertisements