Daniol Thomas has Published 242 Answers

C++ Program to Implement Network_Flow Problem

Daniol Thomas

Daniol Thomas

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

This is a C++ Program to implement Network_Flow problem using Ford Fulkerson algorithm.Algorithms:Begin    function bfs() returns true if there is path from source s to sink t in    the residual graph which indicates additional possible flow in the graph. End Begin    function fordfulkarson() return maximum flow in ... Read More

How to delete documents from a collection in MongoDB?

Daniol Thomas

Daniol Thomas

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

To delete the documents from a collection in MongoDB, you need to use remove() method. The syntax is as follows:db.yourCollectionName.remove(yourDeleteValue);Here, let us create a collection with some documents. The query is as follows:>db.deleteDocuments.insert({"UserId":1, "UserName":"Bob", "UserTechnicalSubject":"Introducti on to PL/SQL"}); WriteResult({ "nInserted" : 1 }) >db.deleteDocuments.insert({"UserId":2, "UserName":"Carol", "UserTechnicalSubject":"Introduction to MongoDB"}); WriteResult({ ... Read More

C++ Program to Implement The Edmonds-Karp Algorithm

Daniol Thomas

Daniol Thomas

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

This is a C++ Program to Implement the Edmonds-Karp algorithm to calculate maximum flow between source and sink vertex.Algorithm:Begin    function edmondsKarp() :       initiate flow as 0.       If there is an augmenting path from source to sink, add the path to flow.     ... Read More

How to delete document from a collection in MongoDB using deleteOne() method?

Daniol Thomas

Daniol Thomas

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

To delete document from a collection in MongoDB, you can use the deleteOne() method. Let us first create a collection and insert some documents to it:> db.deleteDocumentsDemo.insert({"Name":"Larry", "Age":23}); WriteResult({ "nInserted" : 1 }) > db.deleteDocumentsDemo.insert({"Name":"Mike", "Age":21}); WriteResult({ "nInserted" : 1 }) > db.deleteDocumentsDemo.insert({"Name":"Sam", "Age":24}); WriteResult({ "nInserted" : 1 })Now display ... Read More

The get() method of AbstractList class in Java

Daniol Thomas

Daniol Thomas

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

The get() method of the AbstractList class is used to get the element at the specified position in the list. It returns the element at the position set as parameter.The syntax is as follows:public abstract E get(int index)Here, index is the index of the element to return.To work with the ... Read More

What is the use of setFetchSize() and setMaxRows() methods of the JDBC Statement Interface?

Daniol Thomas

Daniol Thomas

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

The setFetchSize(int) method defines the number of rows that will be read from the database when the ResultSet needs more rows. setFetchSize(int) affects how the database returns the ResultSet data.Whereas, setMaxRows(int) method of the ResultSet specifies how many rows a ResultSet can contain at a time. setMaxRows(int) affects the client ... Read More

Python Functions creating iterators for efficient looping

Daniol Thomas

Daniol Thomas

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

As in most programming languages Python provides while and for statements to form a looping construct. The for statement is especially useful to traverse the iterables like list, tuple or string. More efficient and fast iteration tools are defined in itertools module of Python’s standard library. These iterator building blocks ... Read More

Difference between Session Storage and Local Storage in HTML5

Daniol Thomas

Daniol Thomas

Updated on 30-Jul-2019 22:30:22

Session StorageThe Session Storage is designed for scenarios where the user is carrying out a single transaction but could be carrying out multiple transactions in different windows at the same time.Local StorageThe Local Storage is designed for storage that spans multiple windows and lasts beyond the current session. In particular, ... Read More

What are the differences between group and layer in KineticJs with HTML?

Daniol Thomas

Daniol Thomas

Updated on 30-Jul-2019 22:30:22

When making HTML5 web application using KineticJS, grouping, and layering need to be used.Groups are basically containers whereas layers are separators basically.The group is a container which is having shaped objects inside layers for ex group might contain both circle and rectangle.If a group is manipulated then elements within that ... Read More

What are secured cookies in JavaScript?

Daniol Thomas

Daniol Thomas

Updated on 30-Jul-2019 22:30:21

A secured cookie is a cookie that works with HTTP/HTTPS, known as a httpOnly cookie. These cookies are only used for HTTP requests, so unethical access though scripting is not possible. Therefore, cross-site scripting can be stopped, which in turn stops attacks.The secure attribute is always activated for secured cookies, ... Read More

Advertisements