w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
OpenCV VideoCapture reading issue
The problem with your implementation is that the camera is not running freely and capturing images in real time. When you start up the camera, the videocapture buffer is filled up while waiting for you to read in the frames. Once the buffer is full, it doesn't drop old frames for new ones until you read and free up space in it. The solution would be to have a separate capture thread, in addition to your "process" thread. The capture thread keeps reading in frames from the buffer whenever a new frame comes in and stores it in a "recent frame" image object. When the process thread needs the most recent frame (i.e. when you hit Enter), it locks a mutex for thread safety, copies the most recent frame into another object and frees the mutex so that the capture thread continues reading in new f

Categories : Opencv

OpenCV VideoCapture can't read from my webcam at all
There is a bug on Opencv 2.4.6 please take a look here moreover try this: cv::VideoCapture cap = cv::VideoCapture(0); Hope it helped !

Categories : C++

OpenCV VideoCapture IP camera reconnection
http://docs.opencv.org/modules/highgui/doc/reading_and_writing_images_and_video.html#videocapture-read If no frames has been grabbed (camera has been disconnected, or there are no more frames in video file), the methods return false and the functions return NULL pointer. try this if(cap.read(src) == false ) break;

Categories : C++

icvOpenAVI_XINE() error in VideoCapture Opencv
I found a solution to avoid this error without change anything in OpenCV. The solution is described as follows: 1. Install vlc: sudo apt-get install vlc 2. By command line write this script: vlc "http://192.168.180.60:82/videostream.cgi?user=admin&pwd=" --sout "#transcode{vcodec=mp2v,vb=800,scale=1,acodec=mpga,ab=128,channels=2,samplerate=44100}:duplicate{dst=rtp{sdp=rtsp://:8554/output.mpeg},dst=display}" --sout-keep where http:// 192.168.180.60:82/videostream.cgi?user=admin&pwd= contains my Ip-camera streamming and rtsp://:8554/output.mpeg is the output created by VLC 3. Call the streaming using OpenCV using this function: cap=cv2.VideoCapture("rtsp://:8554/output.mpeg")

Categories : Python

Debug Assertion Failed (unsigned)(c+1) <= 256 (in VideoCapture::open [Qt Creator])
It looks like you're linking in both debug and release versions of the libs (twice?). That's caused me problems in the past before. Try using only LIBS += C:/C/opencv/build/x86/vc10/bin/opencv_highgui240.dll for release builds and LIBS += C:/C/opencv/build/x86/vc10/bin/opencv_highgui240d.dll for debug builds. Also, 0 is the same as NULL. Probably the library aborts doing whatever it was doing (whether in debug or release) prior to the assert fail. You shouldn't be getting assert fails in release mode, but the fact that you are tells me that the debug library was loaded in your program that you compiled for release mode. Edit: Looks like somebody already answered you here: http://answers.opencv.org/question/15838/videocaptureopenqt-creatordebug-assertion-failed/

Categories : C++

Installing anaconda to use with windows
well you might have two installations of python, one inside the anaconda package, and other which you might have installed earlier. try doing : which python from CygWin console. If it returns: /usr/bin then it is definitely a add-to-path problem. to fix it for CygWin, you have to add the python installation from anaconda to the path. try this fromn CygWin: PATH=path-where-anaconda-is-installed/anaconda/bin:$PATH and then doing: which python should give you: /path-to-anaconda/anaconda/bin and then it will work. Cheers

Categories : Python

Anaconda default directory
Double your backslashes. pd.read_csv('C:\Users\aaa\Desktop\contrylist.csv') Or use raw strings: pd.read_csv(r'C:UsersaaaDesktopcontrylist.csv') Backslash is a special character in string literals and it's used for escaping. You should read the docs: strings and string literals.

Categories : Python

Pyqtgraph with anaconda python on MAC gives nib error
The solution is to use python.app (or the equivalent pythonw) to run the program, instead of just python. If pyqtgraph installed any commands, you'll need to edit them so that their shebang line calls #!/path/to/anaconda/bin/python.app/Contents/MacOS/python.

Categories : Python

Anaconda's NumbaPro CUDA Assertion Error
The problem is you are using vectorize on a function that takes non-scalar arguments. The idea with NumbaPro's vectorize is that it takes a scalar function as input, and generates a function that applies the scalar operation in parallel to all the elements of a vector. See the NumbaPro documentation. Your function takes a matrix and a vector, which are definitely not scalar. [Edit] You can do what you want on the GPU using either NumbaPro's wrapper for cuBLAS, or by writing your own simple kernel function. Here's an example that demonstrates both. Note will need NumbaPro 0.12.2 or later (just released as of this edit). from numbapro import jit, cuda from numba import float32 import numbapro.cudalib.cublas as cublas import numpy as np from timeit import default_timer as timer def gener

Categories : Python

How to override anaconda/kickstart package ordering?
Your package "thirdparty-tools" needs to specify all of its requirements. If you can get a SRPM of this package, you can modify the spec to indicate that you need coreutils, bash, etc in your package. If you can't modify this package at all, your best option is to create a wrapper package that has the necessary requirements. Just use your favorite editor to create a file "thirdparty-tools-installer.spec" and ensure you include coreutils as a requirement as well as "thirdparty-tools". You can refer to rpm.or for more information http://www.rpm.org/max-rpm/s1-rpm-build-creating-spec-file.html Lastly, you can just do yum -y install thirdparty-tools in the %post section of Kickstart. It's uglier for sure, but it will probably work.

Categories : Linux

How to keep track of pip installed packages in an Anaconda (conda) env?
conda will only keep track of the packages it installed. And pip will give you the packages that were either installed using the pip installer itself or they used setuptools in their setup.py so conda build generated the egg information. So you have basically three options. You can take the union of the conda list and pip freeze and manage packages that were installed using conda (that show in the conda list) with the conda package manager and the ones that are installed with pip (that show in pip freeze but not in conda list) with pip. Install in your environment only the python, pip and distribute packages and manage everything with pip. (This is not that trivial if you're on Windows...) Build your own conda packages, and manage everything with conda. I would personally recommend the

Categories : Python

pip install lxml and gdal failing in anaconda env
Here is my $0.02, in my experience lxml installs on OS X have always caused problems because of the libmxl2 and libxslt dependencies. The specific issue here is that the 'cpl_port.h' is not being found suggesting that you don't have the headers for gdal on your system, a similar issue to the one I've encountered with lxml. I found this StackExchange post gdal package missing which addresses building and installing gdal with your specific error using pip and a virtual Ubuntu machine, but the idea is the same. The pip tool need to be told explicitly where to find the headers for gdal. In general the issue is that OS X puts headers in non standard places for a *nix system, and quite often dependencies are several revision behind the version used for development of the packages you are trying

Categories : Python

cannot import numpy in idle (2.7) after anaconda installation
So you have several python installations going; which one is idle using? This should get you pointed in the correct direction for finding modules: http://docs.python.org/release/2.7.5/tutorial/modules.html#the-module-search-path (Tweak the version number in that URL as appropriate.) If that doesn't help, then the list of Related questions, to the right, currently has this as the first hit, and it looks useful too.

Categories : Python

Importing scipy.misc.pilutil in python using Komodo and Anaconda?
The problem is that the scipy.misc.__init__ deletes the pilutil module - relevant code line - so you cannot import it directly. But all functions from the pilutil module are, before that, added to the misc module, and you can use them from there: In [1]: from scipy import misc In [2]: misc.fromimage Out[2]: <function scipy.misc.pilutil.fromimage> In [3]: misc.bytescale Out[3]: <function scipy.misc.pilutil.bytescale>

Categories : Python

Anaconda: Where and how to install a non-distribution package to support a flask-wtf conda recipe?
The only way that conda build will see dependencies is if they also exist as conda packages. So you need to build the conda package for wtforms as well. Fortunately, the recipe for this exists in the conda-recipes as well, so you can just clone that repo and do conda build wtforms conda build flask This works because conda is able to find the packages that it has already built. To make sure that they don't get lost if you delete the build directory, it's recommended to upload your packages to Binstar. If you do that and conda install binstar, after you build, it will ask you if you want to upload the package to binstar. If you do that, and also add your Binstar repo to your .condarc, those packages will always be available for you to conda install.

Categories : Python

Javascript - How do I get a statement to work once, not work if it did it 1 time already, then work again?
You could use an auxiliary array with gets emptied from time to time, and refilled then. Leaving hp and stuff aside, it's something like: player.TALK=['you pwn the dragon','you kick the dragon','you eviscerate the dragon']; player.AUXTALK=player.TALK.slice(0); function killdragon(player) { var talkindex = Math.floor(Math.random() * player.AUXTALK.length); console.log(player.AUXTALK[talkindex]); delete player.AUXTALK[talkindex]; if (player.AUXTALK.length==0) player.AUXTALK=player.TALK.slice(0); }

Categories : Javascript

main program work good , but when put it into a function doesn't work pyQt
You aren't seeing any windows in the class based version because the function calls finalise and your PyQt objects are being garbage collected. In the simple first case you have, the variables containing your PyQt objects remain in scope for the duration. In this simple case, the easiest way to see this in action is store your PyQt objects in instance variables, ie. self.Frame and self.MainWindow to retain references to the object so that Python doesn't garbage collect them. Generally you would not work with PyQt in this fashion. You subclass the relevant object and do setup in the initialiser.

Categories : Python

Why shellcodes with jmp instruction work, and why doesn't the labels work inside a C wrapper?
The address of mesg can vary depending on how your program is laid out in memory. The following will hard-code a specific address and will not work reliably (or at all): mov ecx, mesg For reference, the first approach hard-codes the following address: mov ecx, 0x804807d The second approach does work because it figures out the address of mesg at runtime, using the return address of a call instruction. Put another way, the first version only works if loaded at a specific address whereas the second is position-independent. It is worth noting that the jmp and the call instructions that appear in the second version use relative addressing, meaning that the opcodes specify the distance to the target rather than the address of the target. This makes these instructions work regard

Categories : Assembly

After switching from jquery-ui 1.8.x to 1.10.3, "tabs()" do not work as expected....--Is there a workaround to enable the "tab key" work again?
You need to use the full URL of the site in the hash links. Here's an example: <div id="loginTabs"> <ul class="nav nav-tabs"> <li><a href="<?php echo $_SERVER["REQUEST_URI"]; ?>#parent-login">Parent Login</a></li> <li><a href="<?php echo $_SERVER["REQUEST_URI"]; ?>#staff-login">Staff Login</a></li> <li><a href="<?php echo $_SERVER["REQUEST_URI"]; ?>#student-login">Student Login</a></li> </ul> <div id="parent-login"> <?php $this->showLoginForm("parent"); ?> </div> <div id="student-login"> <?php $this->showLoginForm("student"); ?> </div> <div id="staff-login">

Categories : Jquery

Why does ssh connection to gitlab not work (while http push and clone work fine)?
Check the permissions on the .ssh folder. Login as the git user and set with sudo su - git chmod 700 ~/.ssh chmod 600 ~/authorized_keys If still having issues use the verbose output from ssh to gain more info ssh -v ssh -T git@my-server.com (Also it could be a selinux context issue if selinux is enabled and enforcing, see this blog)

Categories : Ubuntu

Dynamically generated html links work in Firefox but does not work in Chrome
Have you ever tried the preventDefault ? You should use preventDefault which is the default behaviour when you click the link. Besides the links should not be inside the div #rContent ? You are using .on so the links should be inside the parent.

Categories : Jquery

IIS php Mysql - databse insert value work on XAMPP & WAMP but does not work on IIS
The MySQL user being used to interact with the database may not have the INSERT Grant for that database. WAMP and XAMPP are both using a mysql user with defined privileges. Have you created the same user with the same privileges on the newly created MySQL instance on your Windows 2008 server? You may consider reading over the MySQL Grant syntax. Utilizing mysql_error() for error trapping could prove useful for troubleshooting as well.

Categories : PHP

Why doesn't a DOM2"click" event work, when it does work for "mouseover"?
As far as i can tell the link <a id="workID" href="#">WORK</a> is not bound to a click event handler. In the screenshot you can see that you have set several events, but on click is not set. In your main.js you are calling the function showWorkPane() but in this function you define no event handler for onClick: function showWorkPane() { var workID = document.getElementById("workID"); workID.addEventListener("mouseover", showWorkPaneHandler, false); // add an event handler for click } To address your question: Why doesn't a DOM2“click” event work, when it does work for “mouseover”? Well you have to bind both events (click and mouseover). And currently i am looking into your code and it looks like that the eventhandler onmouseout which fires hideWorkP

Categories : Javascript

Data trigger work with TextBox but doesnt work with TextBlock?
Implicit styles are applied within templates to elements which inherit from System.Windows.Controls.Control and since TextBlock inherits directly from FrameworkElement it will not apply. To make it work you must give your Style x:Key and assign style explicitly to your TextBlock or define your style within TextBlock UPDATE:I should also mention, to cover the topic, that there is a way to apply implicit Style to all TextBlocks. If you put it in Application.Resources it will apply to all TextBlocks across whole application. In this case it would cause some major performance issues and potentially other errors, which is probably why Microsoft decided to protect these basic elements from accidentally using complicated, implicit styles on them. Not everyone realise that basically every piece of

Categories : C#

.htaccess redirect doesn't work on first load, but does work on refresh
Your rule is fine. It redirects for me in every browser. What's probably happening is that when you click on the link, your browser brings up a cached copy of the PDF. But when you explicitly reload the page, it sends the request to the server instead of pulling up a cached copy of the page and you see the redirect. If you want to test it again, clear your chrome cache and hit the link again.

Categories : Htaccess

Same url, work like reference to style, but doesn't work like AJAX call
The simplest answer will be to use a local web server like WAMP(or IIS) if you are not already. the second answer is Chrome and Safari has a restriction on using ajax with local resources. That's why it's throwing an error like Origin null is not allowed by Access-Control-Allow-Origin. Solution: Use firefox or upload your data to a temporary server. If you still want to use Chrome, start it with the below option; --allow-file-access-from-files More info how to add the above parameter to your Chrome: Right click the Chrome icon on your task bar, right click the Google Chrome on the pop-up window and click properties and add the above parameter inside the Target textbox under Shortcut tab. It will like as below; C:UsersXXX_USERAppDataLocalGoogleChromeApplicationchrome.exe --al

Categories : CSS

I'm trying to make the click only work 4 times and then not work afterwards although I am unsure what I am doing incorrectly?
You should wrap the .click around the "if else". Something like this: $(document).ready(function(){ var i=0; $('#nums').click(function(){ if(i<3){ $('#pic').stop().animate({top:'-=384px'},'300'); i++; }else{ $('#pic').stop().animate({top:'+=384px'},'300'); } }); });

Categories : Javascript

does the enum hack work in C? If so, is it supposed to work in VisualStudio 2003?
struct foo { enum { MAXELEMENTS=10 }; long id[MAXELEMENTS]; }; enum hack like this is valid in C (But not a good style of code, see @Jonathan Leffler's comment). Because when id is defined, MAXELEMENTS qualifies with enumeration constant. C99 6.2.1 Scopes of identifiers Structure, union, and enumeration tags have scope that begins just after the appearance of the tag in a type specifier that declares the tag. Each enumeration constant has scope that begins just after the appearance of its defining enumerator in an enumerator list. Any other identifier has scope that begins just after the completion of its declarator. And an enumeration is a type of integer constant. C99 6.6 Constant expressions An integer constant expression shall have integer type and shall only ha

Categories : C

does RhoMobile or PhoneGap or Mosync can work with SQL Server CE or SQLite database and does it work with barcode scanner manufacturer provided dll?
RhoElements, part of the RhoMobile Suite, includes support for hardware barcode scanners of Motorola devices. if the device you want to target is from a different HW vendor, you can implement a native extension using the C/C++ SDK provided by the HW vendor, as explained in the documentation or in this recorded webinar. Just as a remainder, RhoElements include a version of the WebKit rendering engine optimized for Windows Mobile and Windows CE devices.

Categories : Cordova

Why does this prime checker work, and not work if I try to make it more efficient
// I do not understand why the if-statement below works Explanation: Because i has been incremented until it equals number. If you stop at sqrt(number) then the if statement will always fail. By the way I don't like using square root with integers. I like this better for a isPrime function: if (number < 2) return false; if (number > 2 && number % 2 == 0) return false; for (int i = 3; i * i <= number; i = i + 2) if (number % i == 0) return false; return true;

Categories : Java

Why wont twitter api work live but work locally
Sadly, I've been having the same problem, it looks like either Twitter blocks links from 000WH or 000WH blocks requests to Twitter, because of past attacks. If you look at some of the forums, it looks like they may not reverse the block. See: cURL can't connect in a free host but works fine in my localhost http://www.000webhost.com/forum/customer-assistance/34393-cant-post-twitter-anymore.html

Categories : PHP

Sqlite update work on simulator but do not work on device
I thing you have made changes in simulator, but on device new database have not been updated. Just delete your app from device and re-run it i.e. CLEAN INSTALL

Categories : Iphone

Why does a javascript function work in firefox but not work on Chrome or IE
Probable cause The reason that this doesn't work is that JavaScript is single threaded. The time-consuming function app.timeConsumingFunction() will block the UI from updating in Chrome and IE. The reason for it to work in Firefox is simply because FF has a different implementation that allow UI events to execute in-between so to speak (Canary and I believe Chrome as well has an experimental mode that allow UI updates to be executed on a separate thread). A browser in general cues up different events such as paint events. Then this queue is traversed and executed event by event. However, if a queue-entry is for example executing the context for a time consuming function, the queue won't have a "breathing space" to continue with the other events in that queue. That would be among othe

Categories : Javascript

Google doesnt work on https but it work on http
I get response in both cases : <?php ini_set('display_errors', true); error_reporting(-1); function o($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization:key=123']); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, [1,2,3]); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $output = curl_exec($ch); curl_close($ch); return $output; } var_dump( o("http://android.googleapis.com/gcm/send") ); var_dump( o("https://android.googleapis.com/gcm/send") ); So you probably have error somewhere.

Categories : PHP

Why does the first one work and the second one not work? Global and Private variable declaration
In javascript, functions are variables, just in function form. So, in the second one, the variable start and function start conflict. If you were to change function start(){ to function init(){, for example, it would work. This is what allows you to define functions such as var foo = function() { ... } The first one worked because you had a local variable start and a global function start, resulting in no conflicts. var start = new Date(); function instance(){ document.getElementById("foo").innerHTML = start.getTime(); window.setTimeout(instance, 1000); } function init(){ window.setTimeout(instance, 1000); }

Categories : Javascript

keydown event Does not work on forms but does work on Datagridview in Vb.net
Change the .KeyPreview property of the form to True. When this property is set to true, the form will receive all KeyPress, KeyDown, and KeyUp events. More information in MSDN Documentation.

Categories : Vb.Net

How does scoping work in javascript? Why does this function work?
In your example, value is defined at the global scope so it can be accessed anywhere. So upon clicking the element reset, the global value is set back to 0. Changing it to: $("#reset").click(function() { var value = 0} ); would create a seperate value variable scoped only to that function.

Categories : Javascript

Why do my image links not work in chrome, even though they work in IE?
First of all you are using id="right" many times which is incorrect. Also try to use selectors in right way : .latest_work a:hover img{ opacity: 1.0; color: #666; border: 2px solid #ddd; }

Categories : HTML

AngulaJS: Why don't checkboxes work in directives? (And how to get them to work?)
Here are your answers : 1. There was a small issue in your code : You used <field type="checkbox" ng-model="data.aBoolean"></field> which should be : <field type="checkbox" model="data.aBoolean"></field> That's the reason why your code was not working even if you set replace : true 2. you were overwriting type attribute : You were using custom attribute type and setting it by html attribute type. which was causing type="checkbox type". So you can simply avoid declaring custom attribute type. Here is corrected fiddle : http://jsfiddle.net/rC36m/1/

Categories : Angularjs

Why does "except" work in filtering out IDs/rows, but "not in" doesn't work?
Would this be what you are trying to accomplish Select pm.patient_id from PatientMedication pm Where (pm.medicine_id = 11 or pm.medicine_id = 29) AND pm.start_date >= '2009-03-17'

Categories : Sql Server



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.