Programming Archive

Preserve and Add Edge & Node Level Attributes in Networkx Diagraph

If you are looking for a way to add the node and edge level attribute to contain basic data properties to use it while processing and developing the graph algorithms. This piece of code is for you. Find below the python code that elaborated how to add node and edge level attributes. import networkx as

Mathematical Morphology – Opening and Closing, Top Hat, Black Hat, Gradient in OpenCV

We discussed dilation and erosion in previous article where we discussed that one expands the object pixels and the other shrinks them. What if we combine these operations? Fine these interesting details written below. Opening An erosion operation followed by dilation operation with the same structuring element is known as opening operation. An opening removes

Motion Detection using Frame Differencing and Mean Background Model

Instead of using static background model to find difference in current frame, I am using frame difference technique where current frame is compared or subtracted from previous frame. The difference depends upon speed of moving objects. Making a fair analysis is very difficult. Find the code bellow to find difference in frames. VideoCapture capture("ewap/seq_hotel.avi"); Mat

Opencv 3 installation, Difference between Frames and Averaging Frames

Opencv 3 installation on windows 10 and configure with visual studio 2012 Step1:Download windows version of opencv from   Step2: Extract into a folder   Step3: Configure opencv with Visual studio   Set envirenment Vairable variable name: OPENCV3_DIR value: D:\\development\opencv\build\x86\vc11 Set Path: %OPENCV_DIR%\bin   Configure visual studio for opencv project C/C++   additional include

Retrieve tweets using multiple twitter accounts for the search API

You can read my last article before you proceed with further, where you can read how to use Twitter4J API which enables us to fetch more then 100 tweets. The idea is simple. Twitter search API allows the use of multiple accounts. You may create multiple accounts for search API and switch the sessions when one

How to retrieve more than 100 tweets with the Twitter API and Twitter4J

The twitter4j wraps the twitter API and provides you access to public_timeline and retrieve latest tweets. The twiter API returns only the last 20 tweets. For retrieving old tweets you may have to request the timeline a number of times. Twitter does not provide any other option (I guess you can use the streaming API

JShell – Java 9 interpreter (REPL) – Getting Started with Examples and Video Tutorial

Why JShell – Java 9 interpreter (REPL)? In order to evaluate your statements instantly without creating a project and compiling whole source code, Oracle recently introduced JShell in Java 9. JShell is a similar tool like other compiled language own for statements interpretation, sometimes called REPL (read-eval-print loop). It helps programmer to quickly evaluate code

Java 9 features – Collections Update

Finally, Java 9 is out and it’s high time to go through and discuss the issues of previous JDK releases and discuss the benefits of recently release JDK 9 features. Changing in Collections is one of the features that is of particular interest to developers and is discussed in this article. Some of the previous

Java 9 Support for Eclipse IDE and 1st Java 9 Example

Recently java 9 has been released and support to make your eclipse IDE ready to build, debug and run Java 9 code. Java 9 applications are available at Eclipse Marketeplace and you may install it from Marketeplace client in the Eclipse IDE by going to Help-> Eclipse Marketeplace or by dragging and dropping the following

Advance Streams Operations

Plethora of different operations available with streams. Some basic and very important operations are already been discussed in previous article (read it from here). Let’s see how collect, flatMap and reduce operations works. How to use Collect operation in streams? Collect is used to transform the elements of the stream into a different data structures