What are the most selfish acts you have ever witnessed?

Ishita K
Updated on 30-Jul-2019 22:30:25
I have witnessed this astonishing selfish act by my so-called best friend and was shocked. Even today, I cannot forget the incident.When we were in our graduation, my friend Rohini and I, had to attend a wedding of one of our classmates in Karimnagar. Therefore, we thought about it and made a plan and decided to go by APSRTC bus because that is safe and economical for two young girls. Even the bus station was near to our College hostel. We enquired in the Bus station, and there was an AC bus starting at 10 a.m. from Jubilee Bus Station ... Read More

Provider elements() method in Java

karthikeya Boyini
Updated on 30-Jul-2019 22:30:25
An enumeration of the values in the hash table can be obtained using the method elements() in the class java.security.Provider. This method requires no parameters and it returns the enumeration of the values in the hash table.A program that demonstrates this is given as follows −Example Live Demoimport java.security.*; import java.util.*; public class Demo {    public static void main(String[] argv) {       try {          SecureRandom sRandom = SecureRandom.getInstance("SHA1PRNG");          Provider p = sRandom.getProvider();          Enumeration enumeration;          enumeration = p.elements();          System.out.println("The ... Read More

How can I profile C++ code running on Linux?

Ankith Reddy
Updated on 30-Jul-2019 22:30:25
In Linux platform there are many great profiling tools for profiling C++ programs. Valgrind is one of them. It is widely used. It is a programming tool for memory debugging, memory leak detection, and profiling. We can use Valgrind by passing the binary to it and setting the tool to callgrind. First generate the binary by compiling the program$ g++ -o abc.cpp abcNow use valgrind to profile it$ valgrind --tool=callgrind ./abcThis will generate a file called callgrind.out.x. You can read this file using a tool called kcachegrind.If you're using gcc, you can use the inbuilt profiling tool, gprof. You can ... Read More

Does MySQL support table inheritance?

karthikeya Boyini
Updated on 30-Jul-2019 22:30:25
MySQL uses foreign key constraint instead of inheritance. MySQL does not support table inheritance.You can achieve the same with the help of foreign key constraint. Let us create a table and use the foreign key constraint. The query to create the first table is as follows −mysql> create table Parent_Table -> ( -> ParentId int, -> PRIMARY KEY(ParentId) -> ); Query OK, 0 rows affected (3.59 sec)Now create the second table. The query to create the second table is as follows −mysql> create table Child_Table ... Read More

How to get programmatically android host information?

Jennifer Nicholas
Updated on 30-Jul-2019 22:30:25
This example demonstrats about How to get programmatically android host information.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. In the above code, we have taken text view to show host information.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.Manifest; import android.app.ProgressDialog; import android.content.pm.PackageManager; import android.os.Build; import android.os.Bundle; import android.support.annotation.RequiresApi; import android.support.v4.app.ActivityCompat; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.webkit.CookieManager; import android.webkit.WebChromeClient; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; import ... Read More

How to get subtitle of action bar in android?

Jennifer Nicholas
Updated on 30-Jul-2019 22:30:25
This example demonstrates How to get subtitle of action bar in android.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. In the above code, we have taken text view to show status bar sub tittle.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.app.ActivityManager; import android.app.admin.DevicePolicyManager; import android.content.ComponentName; import android.content.Context; import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager; import android.os.Build; import android.os.Bundle; import android.support.annotation.RequiresApi; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.TextView; public class ... Read More

The contains() method of CopyOnWriteArrayList in Java

Ankith Reddy
Updated on 30-Jul-2019 22:30:25
The contains() method of the CopyOnWriteArrayList class is used to get the specified element. It returns TRUE if the element is in the List, else FALSE is returned.The syntax is as followsboolean contains(Object ob)Here, ob is the element to be checked for existence. To work with CopyOnWriteArrayList class, you need to import the following packageimport java.util.concurrent.CopyOnWriteArrayList;The following is an example to implement CopyOnWriteArrayList class contains() method in JavaExample Live Demoimport java.util.concurrent.CopyOnWriteArrayList; public class Demo {    public static void main(String[] args) {       CopyOnWriteArrayList arrList = new CopyOnWriteArrayList();       arrList.add(100);       arrList.add(250);       ... Read More

LocalTime query() Method in Java

Samual Sam
Updated on 30-Jul-2019 22:30:25
The LocalTime object can be queried as required using the query method in the LocalTime class in Java. This method requires a single parameter i.e. the query to be invoked and it returns the result of the query.A program that demonstrates this is given as follows −Example Live Demoimport java.time.*; import java.time.temporal.*; public class Demo {    public static void main(String[] args) {       LocalTime lt = LocalTime.parse("23:15:30");       System.out.println("The LocalTime is: " + lt);       String precision = lt.query(TemporalQueries.precision()).toString();       System.out.println("The Precision for the LocalTime is: "+ precision);    } }OutputThe LocalTime ... Read More

How to print dimensions of multidimensional array in C++

Vrundesha Joshi
Updated on 30-Jul-2019 22:30:25
Here is a C++ program to print dimensions of given array.AlgorithmHere template() function is used to find out the current size of array. Then recursively call it till the last dimension of array.Example Code Live Demo#include using namespace std; template void printDimensionsOfArray(const t (&a)[n]) {    cout

How to fix poor performance of INFORMATION_SCHEMA.key_column_usage in MySQL?

karthikeya Boyini
Updated on 30-Jul-2019 22:30:25
You can use GLOBAL variable as shown below −SET global innodb_stats_on_metadata =0;After including the above syntax, the INFORMATION_SCHEMA.key_column_usage will take less time and that would improve the performance.The query is as follows −mysql> set global innodb_stats_on_metadata =0; Query OK, 0 rows affected (0.00 sec) mysql> SELECT REFERENCED_TABLE_NAME,TABLE_NAME,COLUMN_NAME,CONSTRAINT_SCHEMA -> FROM INFORMATION_SCHEMA.key_column_usage;The following is the output −It returns 674 rows in 0.28 seconds.
Advertisements