Karthikeya Boyini has Published 2192 Articles

Improve MySQL Search Performance with wildcards (%%)?

karthikeya Boyini

karthikeya Boyini

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

466 Views

No, MySQL won’t improve search performance whenever you have leading wildcards because MySQL will be unable to use the index. If you change to ‘anyLetter%’ then it will be able to use indexThe below syntax is better to use with trailing wildcards. The syntax is as follows −SELECT *FROM yourTableName ... Read More

Java Program to return the hexadecimal value of the supplied byte array

karthikeya Boyini

karthikeya Boyini

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

159 Views

The following is the supplied byte array −byte[] b = new byte[]{'x', 'y', 'z'};We have created a custom method “display” here and passed the byte array value. The same method converts byte array to hex string −public static String display(byte[] b1){    StringBuilder strBuilder = new StringBuilder();    for(byte val ... Read More

Formatting day in d format in Java

karthikeya Boyini

karthikeya Boyini

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

201 Views

The d format is used in Java Date to format day like 1, 2, 3, 4, etc. Let us use it.// displaying day in d format SimpleDateFormat simpleformat = new SimpleDateFormat("d"); String strDay = simpleformat.format(new Date()); System.out.println("Day in d format = "+strDay);Above, we have used the SimpleDateFormat class, therefore the ... Read More

MySQL show tables sort by table name?

karthikeya Boyini

karthikeya Boyini

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

1K+ Views

You can sort the table_name property from INFORMATION_SCHEMA.TABLES with ORDER BY clause. Sort in ascending order or descending order with the help of ASC or DESC respectively. The syntax is as follows −SELECT table_name FROM information_schema.tables WHERE table_type = 'BASE TABLE' AND table_schema='yourDatabaseName' ORDER BY table_name DESC;Use the database with ... Read More

Display hour in h (1-12 in AM/PM) format in Java

karthikeya Boyini

karthikeya Boyini

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

282 Views

The h format in Java Date is like 1-12 hour in AM/ PM. Use SimpleDateFormat("h") to get the same format;// displaying hour in h format SimpleDateFormat simpleformat = new SimpleDateFormat("h"); String strHour = simpleformat.format(new Date()); System.out.println("Hour in h format = "+strHour);Above, we have used the SimpleDateFormat class, therefore the following ... Read More

How to develop or migrate apps for iPhone 5 screen resolution?

karthikeya Boyini

karthikeya Boyini

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

108 Views

At the release of iPhone 5, it’s resolution and aspect ratio was different (640 x 1136 pixels), hence it was tough to migrate applications from iPhone 4 sizes to the newer iPhone. But later with the release of iOS 8, size classes and abstract screen sizes were also introduced to ... Read More

MySQL- GROUP and COUNT by date?

karthikeya Boyini

karthikeya Boyini

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

2K+ Views

You can use GROUP BY clause and COUNT() function for this. The syntax is as follows −SELECT yourColumnName1, yourColumnName2, ..N, COUNT(*) as anyAliasName FROM yourTableName GROUP BY yourColumnName1, yourColumnName2;To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create table ... Read More

Java program to check if binary representations of two numbers are anagram

karthikeya Boyini

karthikeya Boyini

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

180 Views

The binary representations of two numbers are anagrams if they have the same number of 0’a and 1’s. An example of this is given as follows −Number 1 = 3 Binary representation of Number 1 = 0011 Number 2 = 12 Binary representation of Number 2 = 1100The two numbers ... Read More

How to integrate PayU Money in iOS using swift?

karthikeya Boyini

karthikeya Boyini

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

323 Views

payU money is a payment gateway which is more popular in Indian online markets. To Integrate payU money we need to go through a few steps. Be careful with integrating payU and do not skip any of the steps of integration.Sign Up with payU money.Once you sign up, your key ... Read More

Return order of MySQL SHOW COLUMNS?

karthikeya Boyini

karthikeya Boyini

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

355 Views

To return order of MySQL SHOW COLUMNS, you need to use ORDER BY clause. The syntax is as follows −SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = ‘yourTableName’ AND column_name LIKE 'yourStartColumnName%' ORDER BY column_name DESC;Let us create a table in database TEST. The query to create a table is as ... Read More

Advertisements