Retrieve Environment Variables with Java Map Collection

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

475 Views

First, use the getenv() method to get the environment variables −System.out.println("PATH = " + System.getenv("PATH"));Now, get the key and value. Loop through to get the list of environment variables −Map e = System.getenv(); for (Iterator i = e.entrySet().iterator(); i.hasNext();) { Map.Entry mapEntry = (Map.Entry) i.next(); System.out.println(mapEntry.getKey() + " = " + mapEntry.getValue()); }The following is an example to retrieve environment variables with Map Collection −Example Live Demoimport java.util.Iterator; import java.util.Map; public class Demo { public static void main(String args[]) { System.out.println("PATH = " + System.getenv("PATH")); ... Read More

Description of the Pins of 8257

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

3K+ Views

The 8257 pins are described is given in the table below.Fig. Physical pin diagram of Intel 8257Fig: Functional pin diagram of Intel 82578257 is using a power of 5V.D7-0/A15-8For communicating with the processor there are 8 bidirectional data pins, when the processor is in active and the 8257 s active state it is in slave mode. When the processor remains in the HOLD state and 8257 behaves as the master, they are used to send out the Most Significant 8 bits of memory address.A3-0When the processor remains in active state and are used as address input pins of 8257. Hence ... Read More

Use RatingBar in Android

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

2K+ Views

Before getting into an example, we should know what is rating bar in android. Rating bar is a subclass of absSeekbar class in android. It is used to show the rating on view Group or window manager.This example demonstrates how to use the rating 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 declared Rating bar and set numStars as 5 means ... Read More

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

112 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

220 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

143 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

608 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

474 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

Advertisements