Program counter (PC) in 8085 Microprocessor

Chandu yadav
Updated on 30-Jul-2019 22:30:25
PC is a 16-bit register. It contains a memory address. PC contains that very memory address from where the next instruction is to be fetched for execution. Suppose the PC contents are 8000H, then it means that the 8085 Desires to fetch the instruction Byte at 8000H. After fetching the Byte at 8000H, the PC is automatically incremented by 1. This way 8085 becomes ready to fetch the next Byte of the instruction (in case instruction fetch is incomplete), or fetch the next opcode (in case instruction fetch is over).So in this example, first of all PC is loaded with ... Read More

Android Determine App Starts First Time OR Not Programmatically?

Jennifer Nicholas
Updated on 30-Jul-2019 22:30:25
This example demonstrates about Android Determine App Starts First Time OR Not Programmatically.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 taken textview, when user open application, it will check whether it is the first time or not. If first time, it will append first-time text to textview or else it shows more than first-time text.Step 3 − Add the following code to src/MainActivity.javapackage ... Read More

Create Quartet Tuple from List in Java

karthikeya Boyini
Updated on 30-Jul-2019 22:30:25
Use the fromCollection() method to create Quartet Tuple from List. Let us first see what we need Let us first see what we need to work with JavaTuples. To work with JavaTuples. Let us first see what we need to work with JavaTuples. To work with Quartet class in JavaTuples, you need to import the following package −import org.javatuples.Quartet;Note − Steps to download and run JavaTuples program If you are using Eclipse IDE to run Quartet Class in JavaTuples, then Right Click Project → Properties → Java Build Path → Add External Jars and upload the downloaded JavaTuples jar file.The ... Read More

What are advantages of using JSP?

karthikeya Boyini
Updated on 30-Jul-2019 22:30:25
Following table lists out the other advantages of using JSP over other technologies −vs. Active Server Pages (ASP)The advantages of JSP are twofold. First, the dynamic part is written in Java, not Visual Basic or other MS specific language, so it is more powerful and easier to use. Second, it is portable to other operating systems and non-Microsoft Web servers.vs. Pure ServletsIt is more convenient to write (and to modify!) regular HTML than to have plenty of println statements that generate the HTML.vs. Server-Side Includes (SSI)SSI is really only intended for simple inclusions, not for "real" programs that use form ... Read More

LocalDate plus() method in Java

karthikeya Boyini
Updated on 30-Jul-2019 22:30:25
An immutable copy of a LocalDate where the required duration is added to it can be obtained using the plus() method in the LocalDate class in Java. This method requires two parameters i.e. the duration to be added and the TemporalUnit of the duration. Also, it returns the LocalDate object with the required duration added to it.A program that demonstrates this is given as follows −Example Live Demoimport java.time.*; import java.time.temporal.*; public class Demo { public static void main(String[] args) { LocalDate ld = LocalDate.parse("2019-02-15"); System.out.println("The ... Read More

Collectors averagingInt() method in Java 8

Smita Kapse
Updated on 30-Jul-2019 22:30:25
The averagingInt() method of the Collectors class returns a Collector that produces the arithmetic mean of a int-valued function applied to the input elements.The syntax is as follows −static Collector averagingInt(ToIntFunction

MongoDB Increment value inside nested array?

Nishtha Thakur
Updated on 30-Jul-2019 22:30:25
You can use positional operator $ for this. To understand the above concept, let us create a collection with the document. The query to create a collection with a document is as follows −> db.incrementValueInNestedArrayDemo.insertOne(    ... {"UniqueId":1,       ... "StudentDetails":       ... [          ... {             ... "StudentId":101,             ... "StudentMarks":97          ... },          ... {             ... "StudentId":103,             ... "StudentMarks":99     ... Read More

MySQL ORDER BY Date field not in date format?

Ankith Reddy
Updated on 30-Jul-2019 22:30:25
The following is the syntax to order by date field which is not in date formatselect *from yourTableName order by STR_TO_DATE(yourColumnName, '%d/%m/%Y') DESC;To understand the above syntax, let us create a table. The query to create a table is as followsmysql> create table orderByDateFormatDemo    -> (    -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    -> ArrivalDatetime varchar(100)    -> ); Query OK, 0 rows affected (0.73 sec)Insert some records in the table using insert command. The query is as follows −mysql> insert into orderByDateFormatDemo(ArrivalDatetime) values('01/10/2012'); Query OK, 1 row affected (0.20 sec) mysql> insert into orderByDateFormatDemo(ArrivalDatetime) values('03/11/2010'); ... Read More

exp() function C++

Chandu yadav
Updated on 30-Jul-2019 22:30:25
The C / C++ library function double exp(double x) returns the value of e raised to the xth power. Following is the declaration for exp() function.double exp(double x)The parameter is a floating point value. And this function returns the exponential value of x.Example Live Demo#include #include using namespace std; int main () {    double x = 0;    cout

Exception Handling Basics in C++

Nancy Den
Updated on 30-Jul-2019 22:30:25
In C++, Exception Handling is a process to handle runtime errors. Exception is an event which is thrown at runtime in C++. All exceptions are derived from std::exception class. It is a runtime error which can be handled. It prints exception message and terminates the program, if we don't handle the exception.Exceptions are defined in C++ standard as class that we can use inside our programs. The arrangement of parent-child class hierarchy has been shown below:Common exception classes in C++ are:ExceptionDescriptionstd::exceptionThis is an exception and parent class of all the standard C++ exceptions.std::bad_castIt is an exception thrown by dynamic_cast.std::bad_exceptionThis ... Read More
Advertisements