Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Articles on Trending Technologies
Technical articles with clear explanations and examples
Android Popup Menu Example
Popup menu just like a menu, it going to be display either above of the view or below of the view according to space on activity. Here is the simple solution to create android popup menu.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 given button. when you click on the above button, it going to show popup menu.Step 3 − Add the following code to ...
Read Moreftp_rawlist() function in PHP
The ftp_rawlist() function displays the list of files with file information from a specified directorySyntaxftp_rawlist(conn,dir,recursive);Parametersconn − The FTP connectiondir − The directory pathrecursive − Sends a "LIST" command to the server by default.ReturnThe ftp_rawlist() function returns an array where each element corresponds to one line of text.ExampleThe following is an example to get a list of files with file information −
Read MoreMath Operations on BigInteger in Java
Let us apply the following operations on BigInteger using the in-built methods in Java.Addition: add() method Subtraction: subtract() method Multiplication: multiply() method Division: divide() methodLet us create three BigInteger objects.BigInteger one = new BigInteger("98765432123456789"); BigInteger two = new BigInteger("94353687526754387"); BigInteger three = new BigInteger("96489687526737667");Apply mathematical operations on them.one = one.add(two); System.out.println("Addition Operation = " + one); one = one.multiply(two); System.out.println("Multiplication Operation = " + one);The following is an example −Example Live Demoimport java.math.BigInteger; public class Main { public static void main(String[] args) { BigInteger one = new BigInteger("98765432123456789"); ...
Read MoreWhy is it important to discover your career passion, and how?
Education today has become all about getting a job and good packages that can help you keep up to the rising standard of living. However, as many people are now joining this rat race, specialization and commitment to work reduce over a period of time. People also start taking a fixed path which has been set by the majority of the people. Hence it is now important for the younger generation to find the calling of their heart and discover what is their real career passion.Plan for a long term CareerPeople today function with a fixed mindset. These individuals want ...
Read MoreCan a poet be a hero?
The reason why some people may find this question abrupt would be their shallow understanding of the term “Hero “ and even of the term “Poet”.Who is a Hero?We often regard hero as somebody out of the world, probably with superhuman abilities like wings or extremely high speed and so on. But in actual terms, Hero, as described by Thomas Carlyle in his essay Hero as a Poet, is not someone who is extraordinary, rather he is someone who is less questionable and less ambitious. A hero is indeed someone, whom we can relate to and someone whose life becomes ...
Read MoreWhat is CTET?
It is a famous competitive exam in India. It is the acronym of Central Teacher Eligibility Test. As the name suggests, it is a qualifying exam for recruiting teachers for central schools like Kendriya Vidyalaya School, Army Public School, Navodya School and the like.The exam is taken to allow candidates who want to make their career in the teaching field to fulfil their dream of teaching. The Ministry of Human Resource Development, Govt. of India has entrusted the responsibility of conducting the Central Teacher Eligibility Test to the Central Board of Secondary Education Delhi.Is CTET only for central schools?While the ...
Read MoreGet byte array from BigInteger in Java
First, set the BigInteger object with binary.BigInteger val = new BigInteger("100000000110001100000", 2);Now, use the toByteArray() method.byte[] byteArr = val.toByteArray();The following is an example −Example Live Demoimport java.math.BigInteger; public class Demo { public static void main(String[] argv) throws Exception { BigInteger val = new BigInteger("100000000110001100000", 2); byte[] byteArr = val.toByteArray(); for (int i = 0; i < byteArr.length; i++) { System.out.format("0x%02X", byteArr[i]); } } }Output0x10 0x0C 0x60
Read MoreDelete file or directory on termination in Java
A file or directory can be deleted on termination of the program i.e. after the virtual machine terminates using the method java.io.File.deleteOnExit(). This method requires no parameters and it does not return a value.A program that demonstrates this is given as follows −Example Live Demoimport java.io.File; public class Demo { public static void main(String[] args) { try { File file = new File("demo1.txt"); file.createNewFile(); System.out.println("File: " + file); file.deleteOnExit(); } catch(Exception e) { e.printStackTrace(); ...
Read MoreBigInteger.isProbablePrime() method in Java
TheBigInteger.isProbablePrime(int certainty) returns true if this BigInteger is probably prime, false if it's definitely composite. If certainty is ≤ 0, true is returned.Here, the “certainty” parameter is a measure of the uncertainty that the caller is willing to tolerate: if the call returns true the probability that this BigInteger is prime exceeds (1 - 1/2certainty). The execution time of this method is proportional to the value of this parameter.The following is an example −Example Live Demoimport java.math.BigInteger; public class Demo { public static void main(String[] argv) throws Exception { // create 3 ...
Read MoreHow does Constraint Layout works in android?
In simple words, constraint layout is an advanced version of a Relative layout. It is used to reduce the child view hierarchies and improve the performance.Properties of constraint layout as shown below -Wrap Content –It wrap the view size according to data. Any Size – This is very similar to match parent. Fixed Size – This allows standard height and width(fixed sizes). In the above example we have shown the button with all properties, now look into code level as shown below -In the above, we have declare layout margin-top, bottom, start and end. those are the standard distance (Similar ...
Read More