Chandu yadav has Published 1091 Articles

8085 Block movement without overlap

Chandu yadav

Chandu yadav

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

1K+ Views

In this program, we will see how to move blocks of data from one place to another.Problem StatementWrite 8085 Assembly language program to move a data block. The blocks are assumed to be non-overlapping. The block size is given, the block is starting from X and we have to move ... Read More

Biggest value from two or more fields in MySQL?

Chandu yadav

Chandu yadav

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

111 Views

To know the biggest value from two or more fields, use the function GREATEST() from MySQL.The syntax is as follows −SELECT GREATEST(MAX(yourColumnName1), MAX(yourColumnName2), ...............MAX(yourColumnName2) ) from yourTableName;Let us understand the above concept by creating a table with more than two columns −mysql> create table GreatestOfTwoOrMore -> ( ... Read More

Is there a way to know your current username in MySQL?

Chandu yadav

Chandu yadav

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

8K+ Views

Yes, you can use the method CURRENT_USER() to know the current username in MySQL.The above method returns the username that can be used to authenticate the client connection.The query is as follows −mysql> select CURRENT_USER();The following is the output −+----------------+ | CURRENT_USER() | +----------------+ | root@% ... Read More

How to Counting Chars in EditText Changed Listener in Android?

Chandu yadav

Chandu yadav

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

1K+ Views

Some situations, we have to restrict an edit text for some characters. To solve this situation, in this example demonstrate how to Counting Chars in Edit Text Changed Listener.Step 1 - Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to ... Read More

How to change the default charset of a MySQL table?

Chandu yadav

Chandu yadav

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

880 Views

To change the default charset of a MySQL table, you can use the below syntax. The syntax is as follows −alter table yourTableName convert to character set yourCharsetName;Let us create a table and apply the above syntax to change the default charset. The query to create a table −mysql> create ... Read More

Fetch elements of Java TreeSet using Iteration

Chandu yadav

Chandu yadav

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

173 Views

Use Iterator class to fetch elements of TreeSet.Create a TreeSet and add elements to itTreeSet set = new TreeSet(); set.add("13"); set.add("11"); set.add("12"); set.add("16"); set.add("19"); set.add("23"); set.add("21"); set.add("20"); set.add("30");Now, to display the elements, use Iterator classIterator i = set.iterator(); while(i.hasNext()){ System.out.println(i.next()); }The following is an example that fetch ... Read More

Converting a date in MySQL from string field?

Chandu yadav

Chandu yadav

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

179 Views

To convert string to date in MySQL, you can use STR_TO_DATE() function. The syntax is as follows −select str_to_date(‘StringValue’, '%d, %m, %Y') as anyVariableName;Apply the above syntax in the following query wherein, we have a string value −mysql> SELECT STR_TO_DATE('26, 11, 2018', '%d, %m, %Y');The following is the output −+--------------------------------------+ ... Read More

NavigableMap pollFirstEntry() method in Java

Chandu yadav

Chandu yadav

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

100 Views

The pollFirstEntry() method in NavigableMap remove and return a key-value mapping associated with the least key in this mapThe following is an example to implement pollFirstEntry() methodExample Live Demoimport java.util.*; public class Demo { public static void main(String[] args) { NavigableMap n ... Read More

Remove all values from HashMap in Java

Chandu yadav

Chandu yadav

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

5K+ Views

To remove all values from HashMap, use the clear() method.First, let us create a HashMap.HashMap hm = new HashMap();Add some elements to the HashMaphm.put("Wallet", new Integer(700)); hm.put("Belt", new Integer(600)); hm.put("Backpack", new Integer(1200));Now, remove all the elementshm.clear();The following is an example to remove all values from HashMap.Example Live Demoimport java.util.*; public class ... Read More

Where does MySQL store database files?

Chandu yadav

Chandu yadav

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

2K+ Views

To know where MySQL store database files, you can use the variable @@datadir. The query is as follows −mysql> select @@datadir;The following is the output that displays the path −+---------------------------------------------+ | @@datadir ... Read More

Advertisements