Decimal Counter Using Logic Controller

Arjun Thakur
Updated on 30-Jul-2019 22:30:25

315 Views

We write a program in the 8085 which is written in assembly language just for the implementation of a decimal counter which is used by the logic controller interface. The input of the starting count must be the input through the complete interface and moreover we display the count on the interface.Let us consider a sample program on this –The program which follows it should always contain an infinite loop until the inputs of the user contains a valid value of two-digit Binary Coded Decimal value just only to the Port B. After that the initial count gets displayed by ... Read More

Important Components of JDBC

Krantik Chavan
Updated on 30-Jul-2019 22:30:25

2K+ Views

To communicate with the Database using JDBC you need the following components.JDBC DriverManager: The DriverManager class of the java.sql package manages different types of JDBC drivers. This class loads the driver classes. In addition to this, whenever a new connection establishes it chooses and loads the suitable driver from the previously loaded ones.Note: From JDBC 4.0 the drivers in the CLASSPATH will be loaded automaticallyJDBC API: It is a Java abstraction which enables applications to communicate with relational databases. It provides two main packages namely, java.sql and javax.sql. It provides classes and methods to connect with a database, create statements ... Read More

Get Current Wi-Fi Link Speed in Android

Jennifer Nicholas
Updated on 30-Jul-2019 22:30:25

1K+ Views

This example demonstrates How to get current Wi-Fi link speed 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 taken a text view to show WIFI link speed.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager; import android.os.Build; import android.os.Bundle; import android.support.annotation.RequiresApi; import android.support.v7.app.AppCompatActivity; import android.text.format.Formatter; import android.widget.TextView; public class MainActivity extends AppCompatActivity { TextView ... Read More

LocalDateTime from Method in Java

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

83 Views

An instance of a LocalDateTime object can be obtained from a Temporal object using the from() method in the LocalDateTime class in Java. This method requires a single parameter i.e. the Temporal object and it returns the LocalDateTime object that is obtained from the Temporal object.A program that demonstrates this is given as follows −Example Live Demoimport java.time.*; public class Main {    public static void main(String[] args) {       LocalDateTime ldt = LocalDateTime.from(ZonedDateTime.now());       System.out.println("The LocalDateTime is: " + ldt);    } }OutputThe LocalDateTime is: 2019-02-18T09:55:05.489Now let us understand the above program.The instance of the LocalDateTime ... Read More

Collectors collectingAndThen Method in Java 8

Daniol Thomas
Updated on 30-Jul-2019 22:30:25

1K+ Views

The collectingAndThen() method in Java Collectors class acclimates a Collector to perform an additional finishing transformation. It returns collector which performs the action of the downstream collector, followed by an additional ending step.The syntax is as follows.static Collector collectingAndThen(Collector downstream, Function finisher)Here, the parameter, T − Type of the input elementsA − Intermediate accumulation type of the downstream collectorR − The result type of the downstream collectorRR − The result type of the resulting collectordownstream − Collectorfinisher − A function to be applied to the final result of the downstream collectorTo work with Collectors class in Java, import the ... Read More

Call Existing Function in Database Using JDBC API

Nitya Raut
Updated on 30-Jul-2019 22:30:25

7K+ Views

You can call a function using CallableStatement object just like stored procedures, to call a function using a JDBC program you need to.Connect to the database.Create a PreparedStatement object and to its constructor pass the function call in String format.Set values to the place holders.Execute the Callable statement.Following is the query to call a function from JDBC:{? = call getDob(?)}As you observe the query contains place holders (?) just like prepared and callable statements.In the above query, the first place holder represents the return value of the function and the second placeholder represents the input parameter.You need to register the ... Read More

Use Size in Android PriorityBlockingQueue

Nitya Raut
Updated on 30-Jul-2019 22:30:25

113 Views

Before getting into the example, we should know what PriorityBlockingQueue is. It is an unbounded queue and follows the same order as a priority queue. The main usage of priority blocking queue is, it going to handle out of memory error.This example demonstrates about How to use size() in android PriorityBlockingQueueStep 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 a text view to show PriorityBlockingQueue ... Read More

Why C++ Does Not Have a Virtual Constructor

Smita Kapse
Updated on 30-Jul-2019 22:30:25

4K+ Views

The virtual mechanism works only when we have a base class pointer to a derived class object.In C++, constructor cannot be virtual, because when constructor of a class is executed there is no virtual table in the memory, means no virtual pointer defined yet. So, the constructor should always be non-virtual.But virtual destructor is possible. Here is an exampleExample#include using namespace std; class b {    public:    b()    { cout

Cast a Type to a BIGINT in MySQL

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

6K+ Views

You need to use the CAST operator along with CONV() function. The CONV() function can be used to convert one base number system to another base system.For Example, The 16 is one base system and 10 is another base system. The 16 base system is hexadecimal and 10 is a decimal.The syntax is as follows −SELECT CAST(CONV('yourColumnName', 16, 10) AS UNSIGNED INTEGER) as anyAliasName FROM yourTableName;To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create table castTypeToBigIntDemo    -> (    -> Id int NOT NULL AUTO_INCREMENT,     ... Read More

ShortBuffer allocate Method in Java

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

127 Views

A new ShortBuffer can be allocated using the method allocate() in the class java.nio.ShortBuffer. This method requires a single parameter i.e. the capacity of the buffer. It returns the new ShortBuffer that is allocated. If the capacity provided is negative, then the IllegalArgumentException is thrown.A program that demonstrates this is given as follows −Example Live Demoimport java.nio.*; import java.util.*; public class Demo {    public static void main(String[] args) {       int n = 5;       try {          ShortBuffer buffer = ShortBuffer.allocate(5);          buffer.put((short)12);          buffer.put((short)91);   ... Read More

Advertisements