mayanktalwar 0 Newbie Poster

open cv

#include <cv.h>
    #include <highgui.h>
    #include<stdio.h>

    int main()
    {
    cvNamedWindow( "Example2", CV_WINDOW_AUTOSIZE );
    CvCapture* capture = cvCreateFileCapture( "a.avi" );
    IplImage* frame;
    if(!capture)
    {
        printf("fail");
    }
    else{

    while(1) {
    frame = cvQueryFrame( capture );
    if( !frame ) break;
    cvShowImage( "Example2", frame );
    char c = cvWaitKey(33);
    if( c == 27 ) break;
    }
    cvReleaseCapture( &capture );
    cvDestroyWindow( "Example2" );}
    return 0;
    }

i have tried with above code to play a avi file with open cv but only a grey window named  example2 appears and after that it goes away what more libararies are needed for this
mayanktalwar 0 Newbie Poster

i dont have any experince of software making...i know c ,c++ and web designing lanuguages....how should i start it..to do what i have asked...i have to decide a project

mayanktalwar 0 Newbie Poster

as expected print_r($out) throws empty array

mayanktalwar 0 Newbie Poster
<a href=\".\/(viewtopic.php\?f=15&amp;t=[0-9]+)\" class=\"topictitle\">([#\w\s_\-!$%&()?.,'\":;{}\/\\|’=\[\]+\–\™ ]+)<\/a>

i have this regex ina ction when i use it in software like regex buddy its ok but when i use it in php it just dont work it .throw no error at all..but it produce zero result.
it is made to match this

<a href="./viewtopic.php?f=15&amp;t=119871" class="topictitle">Twilight Graphic Novel</a>

the match is ok but when i write
this

<?php
$contents = file_get_contents($url);

preg_match_all("/<a href=\".\/(viewtopic.php\?f=15&amp;t=[0-9]+)\" class=\"topictitle\">([#\w\s_\-!$%&()?.,'\":;{}\/\\|’=\[\]+\–\™ ]+)<\/a>/i",$contents,$out);


$len=count($out[0]);
echo $len;
?>

$len outputs is zero although when i used this in regexbuddy with the sample page source it worked like a charm..
any ideas?

mayanktalwar 0 Newbie Poster
Warning: preg_match_all() [function.preg-match-all]: Compilation failed: range out of order in character class at offset 76 in C:\xampp\htdocs\extracter.php on line 7

hey i am not able to figure out what kind of warning is this?

the line 7 is this in the code

preg_match_all("/(http:\/\/)?(www.)?rapidshare\.com\/[0-9A-Za-z]+\/[0-9A-Za-z]+\/[0-9A-Za-z_-.]+/",$contents1,$out1);
mayanktalwar 0 Newbie Poster
(https?://)?(www.)?[0-9A-Za-z]+\.com/[0-9A-Za-z]+/\?paged=[0-9]+

i am getting this error in php

Warning: preg_match_all() [function.preg-match-all]: Unknown modifier '?' in C:\xampp\htdocs\expression.php on line 19

i have test it on online testers it is giving correct results but when i ran it in preg match it gave above error

mayanktalwar 0 Newbie Poster

thanks yes the text (change here at......) is a string now its fine ....now i will keep this in mind

mayanktalwar 0 Newbie Poster
foreach($routearr as $value)
       {
       if($value==(change here at kashmere gate ) || $value==(change here at rajiv chowk ) ||  $value==(change here at yamuna bank )   )
       {
      echo "<br>";
      echo "<div style=\"color:#8e0b0b\" > $value</div>";
        }
      else
       echo "<span style = \"color:#f80a0a\" >$value</span>";

}
in above code line 3 gives this error Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\knowdelhi\metro\metrosubmit.php on line 2009
line 2009 in the error is line three here.when i comment out this piece of code everything works ok but when i remove the above code form comments the error again creeps in so error must be in above code..but it looks ok to me...

mayanktalwar 0 Newbie Poster

i know that no one is going to type such enormous inputs..but still if you can suggest some gud tutorials over how to just not take care of memory management..........honestly this question i was asking becuse of this problem on codechef http://www.codechef.com/problems/INTEST/

mayanktalwar 0 Newbie Poster

hey i am trying a code...ad in that i am using arayrs to store a sequence of data..i have writen this in he code x[100000] and it say too large arrays as a error......now how o deal with this..and how to store such a large sequence of data..without file handling...... how avoid this type of errors

mayanktalwar 0 Newbie Poster

thanks buddy now i have changed the code updated the value of k ..now its perfect

mayanktalwar 0 Newbie Poster
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
long j,x;



long k=1;

long y=0;
cin>>x;
for(;k!=x+1;)
	      {

	       for(;k%5==0;)
		y++;
	       k++;
	      }

cout<<y;

getch();
}

in above code i am trying to find the total no of zeroes at the and of factorial of no..........in doing this i am finding out total no of 5 in the
factorial product of the no
suppose to find out the toal no of zeroes at the end in the factorial of 20
5*4,19,18,17,16,3*5,14,13,12,11,5*2,9,8,7,6,5,4,3,2,1
by taking each no from above in second for loop i am counting the total no 5 in complete list as in above the total no of 5 are 4 so the zeroes 4(at the end in the factorial of 20)

now the problem is that whenever i enter any no greater than or equal to 5 it does not output anything and got stuck there..where is the prob?

mayanktalwar 0 Newbie Poster

hey how it is gettinghanged my loop is finite one...what to do then..and why it is getting hanged

mayanktalwar 0 Newbie Poster
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();

int k=0;

int x;
cout<<"input the no whose no of zeroes is to be calulated at the end in its factorial";
cin>>x;
for(int i=1;i<=x;i++)
{

while(i%5==0)
{
k++;
}
}
cout<<k;
getch();
}

hey in the above code it does not give compilation error but after i input the value of x after that it did nothing ,it just got stuck there and i have to break out of it ...means first cout get printed then i enter input x after that it dont show the value of k...in above program i am calculating the no of zeros at the end of factorial by calculating the total no of 5 in the factorial product..for example in factorial 10 there are two zeros because there are two 5 like this 5*2,9,8,7,6,5,4,3,2,1......tell me what i am doing wrong

mayanktalwar 0 Newbie Poster

ya that worked thanks

mayanktalwar 0 Newbie Poster

>>> print "hello world"
syntax error :invalid syntax(<pyshell#0>, line1)


where is the prob