FAQ Database Discussion Community


How do I import pcap or pyshark on python

python,python-2.7,import,capture,ethernet
I want to write the Ethernet packets capture while using python. I googling and found that I should using Pcap library or PyShark but I try to import pcap, it said that can not found module name Pcap, so I try to using PyShark instance but it show like this...

Non-capture group still capturing

regex,string,capture
I'm trying to make a regex that will match the _TAG (_DT, _NN, etc) part, in the order they appear, of all of the following variations of a sentence: Her_PP$|DT noun_NN|NNS a_PP$|DT noun_NN|NNS Her_PP$|DT adj_JJ noun_NN|NNS a_PP$|DT noun_NN|NNS Her_PP$|DT noun_NN|NNS a_PP$|DT adj_JJ noun_NN|NNS Her_PP$|DT adj_JJ noun_NN|NNS a_PP$|DT adj_JJ noun_NN|NNS This...

Black part of page during capture with CasperJS

javascript,phantomjs,screenshot,casperjs,capture
I have a strange problem. I have to take screenshots from vk.com in album with comments. In this case everything is ok: But when i click to load more comments, the screenshot has a black lower part: The code is pretty simple: // click on image casper.waitForSelector(".photo_row_img", function() { this.click('.photo_row_img');...

Paypal Payments (Authorization & Capture) not returning Authorization ID

api,paypal,authorization,capture
According to the documentation the paypal payment method should be able to do Authorization & Capture just fine. The following excerpt under the PayPal authorizations excerpt specifically states how to go about it: First get payment approval and execute the payment as you normally would do for a PayPal payment....

Xlib,C++ - Get Window Handle (SendEvent,…)

c++,linux,keyboard,mouse,capture
I am currently working with XLib in order to code an Application that can send Mouse and Keyboard Events to a certain window (Not display). I was able to send these Events to a window using The "window"-handle obtained by the "XGetInputFocus()" method. Unfortunately I need to get the window-handle...

Capture face area by camera

python,opencv,camera,capture
I am having problems getting face detection and cropping an image to the face working, below is my code. import cv2 class Crop: #constructor def __init__(self, image): self.data = image def facechop(self): # read xml for training data facedata = "haarcascade_frontalface_default.xml" cascade = cv2.CascadeClassifier(facedata) # read image file img =...

Prevent other applications form capturing/recording screen

android,screen,capture,recording
Basically i want VIDEO PIRACY PROTECTION My application has video streaming and I want to protect my video streaming from other applications. Other applications should not be able to capture screen while my video is playing. Any suggestions how can i achieve this.. Thanks in advance....

OpenCV capture gray scale image with videocapture card API

qt,opencv,video,capture
I am developing a Qt application where I have to capture a video image from different video capture cards (different versions) for a project in my work. I've captured a few cards successfully, using OpenCV and DirectShow drivers (thinking as a standard method), I can read images in a cv::Mat...

Match and capture the (capital) letters inside the square brackets

regex,capture,square-bracket
I'm fairly new to regex and I'd like to know the pattern to match and capture the letters inside the square brackets. For example, I'd like to capture DATA from the string below. My sample code's as below: var myString = "testing/node/234 test_TEST [1234] testing [DATA] SUMMARY,VALUES,abcd,1,0,0"; var re =...

How to capture data from third party web site?

data,capture
For example, I would just like to capture the data for the 30 latest events for the scrolling info shown on this URL: http://hazmat.globalincidentmap.com/home.php# Any idea how to capture it? Thanks....

What is the point of being able to use compile-time characteristics of non-captured local variables in a lambda?

c++,c++11,lambda,capture
I noticed that one is allowed to use compile-time characteristics of variables which were not captured in lambda e.g. call sizeof, decltype functions, for example: #include <iostream> void f () { } int main() { int y = 13; auto x = []{ return sizeof (decltype (y));}; std::cout << x...

Xvfb, Jenkins, Selenium tests - Capture Screenshots of all pages

selenium,jenkins,automated-tests,capture,xvfb
I'm trying to find some clues on the following issues and not able to find good help online. I'm running Xvfb (X virtual frame buffer), firefox on a Linux machine in headless mode. Xvfb main service is up and running and DISPLAY variable is set. /usr/bin/Xvfb :99 -ac -screen 0...

PHP mb_split(), capturing delimiters

php,delimiter,capture,preg-split,multibyte
preg_split has an optional PREG_SPLIT_DELIM_CAPTURE flag, which also returns all delimiters in the returned array. mb_split does not. Is there any way to split a multibyte string (not just UTF-8, but all kinds) and capture the delimiters? I'm trying to make a multibyte-safe linebreak splitter, keeping the linebreaks, but would...

Share variable between two lambdas

c++,lambda,anonymous-function,capture
I want to be able to share a variable in the containing scope between two lambda functions. I have the following: void holdAdd(const Rect& rectangle, Hold anonymousHeld, Hold anonymousFinish) { std::map<int,bool> identifierCollection; HoldFinish holdFinish = [=](const int& identifier) mutable { if (identifierCollection.count(identifier) == 0) return; identifierCollection.erase(identifier); anonymousFinish(); }; holdCollisionCollection.push_back([=](const int&...

iOS Swift camera mode- how to indicate photo is captured

ios,swift,camera,photo,capture
In Camera mode (AVCaptureVideoPreviewLayer) I manage to capture a photo successfully. I would like to indicate this fact to the user- meaning to show him a sudden black flash and a click sound- similar to what he would experience when taking a photo himself. How do I do that? Is...