What is Cumulative Acknowledgement

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

7K+ Views

In data communications, when a receiver receives a message, it sends an acknowledgement back to the sender to notify it about correct receipt of the message. Cumulative acknowledgement is a process in which the receiver sends a single acknowledgement in response to a finite number of frames received. Through this, the receiver acknowledges that it has correctly received all previous frames or packets. When the sender receives an acknowledgement for frame n, it understands correct delivery of frames n – 1, n – 2 and so on.Cumulative acknowledgement is used along with sliding window protocols. It reduces the time and ... Read More

Reset Primary Key to 1 After Deleting All Data in MySQL

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

8K+ Views

To reset the primary key to 1 after deleting the data, use the following syntaxalter table yourTableName AUTO_INCREMENT=1; truncate table yourTableName;After doing the above two steps, you will get the primary key beginning from 1.To understand the above concept, let us create a table. The query to create a table is as followsmysql> create table resettingPrimaryKeyDemo    -> (    -> UserId int NOT NULL AUTO_INCREMENT PRIMARY KEY    -> ); Query OK, 0 rows affected (0.66 sec)Insert some records in the table using insert command. The query is as follows −mysql> insert into resettingPrimaryKeyDemo values(); Query OK, 1 row ... Read More

Move Result Set Pointer to Required Position

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

255 Views

The absolute() method of the ResultSet interface accepts an integer value representing the index of a row and moves the ResultSet pointer of the current ResultSet object to the specified position.Assume we have a table named cricketers_data with 6 records as shown below:+------------+------------+---------------+----------------+-------------+ | First_Name | Last_Name  | Date_Of_Birth | Place_Of_Birth | Country     | +------------+------------+---------------+----------------+-------------+ | Shikhar    | Dhawan     | 1981-12-05    | Delhi          | India       | | Jonathan   | Trott      | 1981-04-22    | CapeTown       | SouthAfrica | | Lumara   ... Read More

Store Query Result into a Variable

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

554 Views

To store query result (a single document) into a variable, you can use var. Following is the syntaxvar anyVariableName=db.yourCollectionName.find().limit(1); yourVariableName; //Print the records;Let us first create a collection with documents> db.storeQueryResultDemo.insertOne({"ClientName":"Chris", "ClientAge":23}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c9ecf8fd628fa4220163b8d") } > db.storeQueryResultDemo.insertOne({"ClientName":"Robert", "ClientAge":21}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c9ecf97d628fa4220163b8e") } > db.storeQueryResultDemo.insertOne({"ClientName":"Sam", "ClientAge":25}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c9ecf9ed628fa4220163b8f") } > db.storeQueryResultDemo.insertOne({"ClientName":"Mike", "ClientAge":26}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c9ecfa8d628fa4220163b90") }Following is the query to display all documents from a collection with the help of find() method> db.storeQueryResultDemo.find().pretty();This will produce ... Read More

Get Maximum and Minimum Values in a Single MySQL Query

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

197 Views

To get maximum and minimum values in a single query, use the aggregate function min() and max(). Let us first create a table:mysql> create table DemoTable (    FirstValue int,    SecondValue int ); Query OK, 0 rows affected (0.66 sec)Following is the query to insert some records in the table using insert command:mysql> insert into DemoTable values(10, 30); Query OK, 1 row affected (0.18 sec) mysql> insert into DemoTable values(30, 60); Query OK, 1 row affected (0.15 sec) mysql> insert into DemoTable values(100, 500); Query OK, 1 row affected (0.10 sec) mysql> insert into DemoTable values(50, 80); Query OK, ... Read More

8255 Programmable Peripheral Interface Chip

Nancy Den
Updated on 30-Jul-2019 22:30:25

5K+ Views

Intel 8255 is a peripheral interface (PPI) chip which is programmable. It is used for the connection of peripheral devices and interfacing. We call Peripheral device also as Input Output device. We use Input Output ports for the connection of Input Output devices. Hence 8255 is a programmable Input Output port chip. It is a 40 pin chip available for dual line packaging. Power supply of +5 Volt DC is needed for its working. It consists of two programmable Input Output ports having of size 8 bits and two programmable Input Output ports of size 4 bits. We call them ... Read More

Remove a Field Completely from a MongoDB Document

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

989 Views

You can use $unset operator to remove a field completely from a MongoDb document. The syntax is as follows:db.yourCollectionName.update({}, {$unset: {yourFieldName:1}}, false, true);To understand the above syntax, let us create a collection with some documents. The query to create a collection with documents are as follows:> db.removeFieldCompletlyDemo.insertOne({"StudentName":"Larry", "StudentFavouriteSubject": ["Java", "C", "C++", "Python"]}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c6ef55a6fd07954a48906a3") } > db.removeFieldCompletlyDemo.insertOne({"StudentName":"Mike", "StudentFavouriteSubject": ["Javascript", "HTML5", "CSS3"]}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c6ef57b6fd07954a48906a4") } > db.removeFieldCompletlyDemo.insertOne({"StudentName":"Sam", "StudentFavouriteSubject": ["MongoDB", "MySQL", "SQL Server"]}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c6ef59c6fd07954a48906a5") }Display all documents from a collection ... Read More

Create a Hit Counter in JSP

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

196 Views

Click the Below link to know how to create a hit Counter in Jsphttps://www.tutorialspoint.com/jsp/jsp_hits_counter.htm

LocalTime get Method in Java

Nancy Den
Updated on 30-Jul-2019 22:30:25

136 Views

The value of the specified field from the LocalTime can be obtained using the get() method in the LocalTime class in Java. This method requires a single parameter i.e. ChronoField that is required and it returns the value of the specified field from the LocalTime.A program that demonstrates this is given as followsExample Live Demoimport java.time.*; import java.time.temporal.ChronoField; public class Main{    public static void main(String[] args){       LocalTime lt = LocalTime.parse("23:15:30");       System.out.println("The LocalTime is: " + lt);       System.out.println("The MINUTE_OF_HOUR is: " +       lt.get(ChronoField.MINUTE_OF_HOUR));    } }outputThe LocalTime is: 23:15:30 ... Read More

Image Processing in Python

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

13K+ Views

Python provides lots of libraries for image processing, including −OpenCV − Image processing library mainly focused on real-time computer vision with application in wide-range of areas like 2D and 3D feature toolkits, facial & gesture recognition, Human-computer interaction, Mobile robotics, Object identification and others.Numpy and Scipy libraries − For image manipuation and processing.Sckikit − Provides lots of alogrithms for image processing.Python Imaging Library (PIL) − To perform basic operations on images like create thumnails, resize, rotation, convert between different file formats etc.In this section we are going to see some basics of image processing in python.Install required library Our first step ... Read More

Advertisements