|
kilt wrote: This has no sense at all.
You can do it with 10 lines of code with COM (or UDLTF)
Yes, and with 5 lines of WTF, I suppose.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
kilt wrote: You can do it with 10 lines of code
Interesting that all your responses are like this, except the actual number of line may be different, but you never post the actual code, or a link to where it may be found!
|
|
|
|
|
Then shouldn't you be really kind and post those 10 lines in a reply to the original poster, instead of whinging about people helping.
I think I've just been suckered into troll-feeding...
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
kilt wrote: This has no sense at all.
By seeing the kind of trash that you post here, it can be concluded that you have no sense at all.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
You could navigate the HTML with Microsoft's IHTMLDocument2 interface. The table you are interested in extracting from is the first <table> element on that page.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Thank you very much for the reply David.
|
|
|
|
|
I have struggled with loading web page sources and parsing them too.
This is the way I prefer and it's the easiest one I know:
#include "afxinet.h"
...
BOOL GetPageSource(CString& url, CString& source){
CInternetSession ises;
CFile* file=new CFile();
try{
file=ises.OpenURL(url);
}
catch(CInternetException* e){
CString error=L"";
error.Format(L"Connection error!\nError code: %ld",e->m_dwError);
AfxMessageBox(error);
return FALSE;
}
UINT len=1024;
char buf[1024];
source=L"";
while(len>0){
len=file->Read(buf,1024);
if(len>0)source.Append(CString(buf),len);
}
file->Close();
ises.Close();
return TRUE;
}
You can use GetPageSource() function to get a page source.
For the parsing part, I use regex.
|
|
|
|
|
when i changed the main function of a template class into a separate file, i have got a link error.Display is a function in the template class
error LNK2001: unresolved external symbol "public: void __thiscall Gen_Queue<int>::Display(void)" (?Display@?$Gen_Queue@H@@QAEXXZ)
What may be the problem?
Anyone know the solution?
I was coding a generic queue. i have made GenericQueue.cpp with functions Add(), delete() and display(). genericQueue.h have the variables and declaration of the functions.
In another file GenericQueueMain.cpp i have written the function main() for the generic queue. I have made an object for the GenericQueue and tried to call the functions . Then i got the error-- error LNK2001: unresolved external symbol "public: void __thiscall Gen_Queue<int>::Display(void)" (?Display@?$Gen_Queue@H@@QAEXXZ)
modified on Tuesday, October 13, 2009 6:23 AM
|
|
|
|
|
What files? What is the 'main function' of a template file? What were the changes (i.e. There are chances you'll post the relevant code?)?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Your question is not really clear but I guess you are trying to move the definition of a template class from a header file to a cpp file. Am I right ?
If that is the case, you can't do something like that. For a template class, the full definition of the class and functions has to be known when compiling, thus you have to include everything in the header file. One 'trick' to get around that problem is to move the definition in a .inl file (to differentiate from a standard cpp file) and include that file in your header file (at the bottom of the file).
|
|
|
|
|
hi.
i am writing a video processing application. at first i tried to use OpenCV and it was greate as it had very high performance. but i need to implement some functions by myself and i am doing this. but the main peroblem is the "performance". for example, i used the cvSub(...) funcation to subtract two 2D arrays. and then i tried to do this with a simple "for loop". the calculation times are shown below:
openCV : 0.135496 ms
mycode : 0.376614 ms
and i ran the program several times and the result was the same.
so i am here to ask :
do you have any idea for performing the task as fast as OpenCV?
part of my code :
double t2;
printf("-----cvSub on cvMat------\n");
for(int i=0; i<5; i++)
{
t2 = (double)cvGetTickCount();
cvSub(mat1, mat2, mat3, 0);
t2 = (double)cvGetTickCount() - t2;
printf( "detection time = %gms\n", t2/((double)cvGetTickFrequency()*1000.) );
}
printf("-----sub on 2D array------\n");
for(int i=0; i<5; i++)
{
t2 = (double)cvGetTickCount();
for(int j=0; j<240; j++)
{
for(int k=0; k<320; k++)
{
m3[j][k] = m1[j][k]-m2[j][k];
}
}
t2 = (double)cvGetTickCount() - t2;
printf( "detection time = %gms\n", t2/((double)cvGetTickFrequency()*1000.) );
}
each method is performed 5 times to get the mean time
|
|
|
|
|
Since the OpenCV source code is available, why don't you have a look at it?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I've searched for it and ... nothing. if you find that please let me know
|
|
|
|
|
__erfan__ wrote: if you find that please let me know
I found it (you've to go a bit deep inside the source code): The library uses the SSE2 for integer arithmetic operations (see [^]), in particular _mm_subs_epu8 for cvSub .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Have you tried disabling the printf command while measuring the performance? I reckon it takes a bit of time.
You could store all those values to be printed into a vector or something and print it all together at the end (of course don't count that as execution time).
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
thanks for your help. but printf is out of timming block and is present in both methods
|
|
|
|
|
You could consider doing 4 double operations in each for-loop. This would allow modern CPU's to perform the operation in parallel.
Taken from Software Optimization Guide for AMD64 Processors[^]:
Rationale and Examples
This is especially important to break long dependency chains into smaller executing units in floating-point code, whether it is mapped to x87, SSE, or SSE2 instructions, because of the longer latency of
floating-point operations. Because most languages (including ANSI C) guarantee that floating-point expressions are not reordered, compilers cannot usually perform such optimizations unless they offer a switch to allow noncompliant reordering of floating-point expressions according to algebraic rules.
Reordered code that is algebraically identical to the original code does not necessarily produce identical computational results due to the lack of associativity of floating-point operations. There are
well-known numerical considerations in applying these optimizations (consult a book on numerical analysis). In some cases, these optimizations may lead to unexpected results. In the vast majority of
cases, the final result differs only in the least-significant bits.
Listing 10. Avoid
double a[100], sum;
int i;
sum = 0.0f;
for (i = 0; i < 100; i++) {
sum += a[i];
}
Listing 11. Preferred
double a[100], sum1, sum2, sum3, sum4, sum;
int i;
sum1 = 0.0;
sum2 = 0.0;
sum3 = 0.0;
sum4 = 0.0;
for (i = 0; i < 100; i + 4) {
sum1 += a[i];
sum2 += a[i+1];
sum3 += a[i+2];
sum4 += a[i+3];
}
sum = (sum4 + sum3) + (sum1 + sum2);
Notice that the four-way unrolling is chosen to exploit the four-stage fully pipelined floating-point adder. Each stage of the floating-point adder is occupied on every clock cycle, ensuring maximum sustained utilization.
|
|
|
|
|
Snakefoot wrote: Notice that the four-way unrolling is chosen to exploit the four-stage fully pipelined floating-point adder.
Notice the four-way unrolling will eat up all the CPU time (and block the application) just to perform the first four operations
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
thank you guys.
my brain is telling me go to sleep
i am on my computer for 24 hours and ... 
|
|
|
|
|
Hi All
How can i use Stored Procedure?I am using MySql and ODBC.in the code i am create table andinsert the data.It's take too much time.So i want to do through Stored Procedure.Plz help me
|
|
|
|
|
If you have a database query, post it in the database forum.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
|
Hi,
I'd like to know how to caputre screen including movie play which runs on Media player or GOM Player.
for example, Media player run on cetner of screen...
I can caputre screen with WindowDC() function... but Media player play.
Media player area is captured with whole black screen...
Could Someone advice me ... or some example soource ...
how to capute whole screen includeing movie play...
Thansk.
|
|
|
|
|
Hi,
CamStudio[^] does precisely that and is open source (written in C++). You could use it as a reference project to build your application.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
I use the free jing, from the TechSmith (Snagit) people.
After you have captured the swf, you can share it online using the free (2GB storage and 2GB monthly bandwidth) screencast.com service.
Highly recommended.
|
|
|
|