Android Popup Menu Example

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

2K+ Views

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 More

FTP Rawlist Function in PHP

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

121 Views

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 −

Get the Content of a Directory in Java

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

234 Views

The contents of a directory can be obtained using the method java.io.File.listFiles(). This method requires no parameters and it returns the abstract path names that specify the files and directories in the required directory.A program that demonstrates this is given as follows −Exampleimport java.io.File; public class Demo {    public static void main(String[] args) {       File directory = new File("C:\JavaProgram");       File[] contents = directory.listFiles();       for (File c : contents) {          if(c.isFile())             System.out.println(c + " is a file");         ... Read More

Math Operations on BigInteger in Java

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

2K+ Views

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 More

Discover Your Career Passion and Its Importance

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

158 Views

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 More

Intel 8253 Programmable Interval Timer

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

645 Views

Many situations may arise, where a microcomputer system requires accurate time delays. For example, when we implement a real time clock, the time needs to get updated at least for once in every second.We generate accurate time delays by using a few instructions in a loop.It is completely software based, where 8085 does not perform any work which is beneficial except the generation of time delays.The delay in time or Time delay scan also be generated by hardware method also. As an example, a 555 timer chip can also be used for the generation of time delays or delay in ... Read More

Can a Poet Be a Hero?

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

488 Views

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 More

What is CTET

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

616 Views

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 More

Get Byte Array from BigInteger in Java

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

267 Views

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

FTP Rename Function in PHP

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

342 Views

The ftp_rename() function renames a file or directory on the FTP server.Syntaxftp_rename(conn,oldname,newname);Parametersconn − The FTP connectionold_name − The file or directory to rename.new_name − The new name of the file or directoryReturnThe ftp_rename() function returns TRUE on success or FALSE on failure.ExampleThe following is an example −

Advertisements