Arjun Thakur has Published 1109 Articles

The implementation of import in Python (importlib)

Arjun Thakur

Arjun Thakur

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

2K+ Views

The importlib package provides the implementation of the import statement in Python source code portable to any Python interpreter. This also provides an implementation which is easier to comprehend than one implemented in a programming language other than Python.This package also exposes components to implement import, making it easier for ... Read More

How do I make a dotted/dashed line in Android?

Arjun Thakur

Arjun Thakur

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

3K+ Views

This example demonstrates how do I make a dotted/dashed line 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.         ... Read More

MySQL strip time component from datetime?

Arjun Thakur

Arjun Thakur

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

1K+ Views

You can strip time component from datetime with the help of DATE() function. The syntax is as follows −SELECT DATE(yourColumnName) from yourTableName;To understand the above concept, let us first create a table −mysql> create table StripComponentDatetimeDemo -> ( -> YourDateTime datetime ... Read More

Create NavigableMap in Java

Arjun Thakur

Arjun Thakur

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

91 Views

Let us first create a NavigableMapNavigableMap n = new TreeMap();Now, let us add some elementsn.put("A", 888); n.put("B", 999); n.put("C", 444); n.put("D", 555); n.put("E", 666); n.put("F", 888);The following is the complete example to create NavigableMap, add elements and display themExample Live Demoimport java.util.*; public class Demo { public static ... Read More

ALTER table by adding AUTOINCREMENT in MySQL?

Arjun Thakur

Arjun Thakur

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

2K+ Views

To add AUTOINCREMENT in MySQL, you can use the ALTER command.ALTER TABLE yourTableName change yourColumName yourColumnName dataType AUTO_INCREMENT PRIMARY KEY;To understand the above concept, create a table with a column. Let us create a table −mysql> create table AlterTableToAddAutoIncrement -> ( -> StudentId int ... Read More

Get the element ordered last in Java TreeSet

Arjun Thakur

Arjun Thakur

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

144 Views

To get the element ordered last i.e. the last element in TreeSet, use the last() method.Create a TreeSet and add elements to itTreeSet set = new TreeSet (); set.add("65"); set.add("45"); set.add("19"); set.add("27"); set.add("89"); set.add("57");Now, get the last elementset.last()The following is an example to get the element ordered last in TreeStExample Live ... Read More

How to get battery level and state in Android?

Arjun Thakur

Arjun Thakur

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

1K+ Views

This example demonstrates how to get battery level and state 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 ... Read More

How do I get the creation date of a MySQL table?

Arjun Thakur

Arjun Thakur

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

1K+ Views

To get the creation date of MySQL table, use the information_schema. The syntax is as follows −SELECT create_time FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = 'yourDatabaseName’ AND table_name = 'yourTableName';Apply the above syntax for your database and the table name. Here I am using the database ... Read More

Clear LinkedList in Java

Arjun Thakur

Arjun Thakur

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

1K+ Views

An LinkedList can be cleared in Java using the method java.util.LinkedList.clear(). This method removes all the elements in the LinkedList. There are no parameters required by the LinkedList.clear() method and it returns no value.A program that demonstrates this is given as follows.Example Live Demoimport java.util.LinkedList; public class Demo { ... Read More

MySQL DATE_FORMAT '%M' is used for short month?

Arjun Thakur

Arjun Thakur

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

71 Views

The %M Date Format is not used for displaying short months like Jan for January, Feb for February, etc. You need to use DATE_FORMAT() function with %b format for short month. The syntax is as follows:SELECT DATE_FORMAT(yourColumnName, '%d-%b-%y') AS anyVariableName FROM yourTableName;To understand the above syntax, let us create a ... Read More

Advertisements