|
You could also try to solve that with a suffix tree or array approach. This is, up to my knowledge, usually the fastest solution.
Cheers
You have the thought that modern physics just relay on assumptions, that somehow depends on a smile of a cat, which isn’t there.( Albert Einstein)
|
|
|
|
|
In c++:
#include <string.h>
char *strstr( const char *str1, const char *str2 );
The function strstr() returns a pointer to the first occurrence of str2 in str1, or NULL if no match is found. If the length of str2 is zero, then strstr() will simply return str1.
For example, the following code checks for the existence of one string within another string:
char* str1 = "this is a string of characters";
char* str2 = "a string";
char* result = strstr( str1, str2 );
if( result == NULL ) printf( "Could not find '%s' in '%s'\n", str2, str1 );
else printf( "Found a substring: '%s'\n", result );
|
|
|
|
|
i m an engineering student and i had selected an application of image processing.well i had to detect a ball in a specified arena or i can say area by using circle hough transform in visual basic 6 but i had not gotten any knowledge in this respect so please please help me and provide me some material to understand the knowledge for this application or technique
|
|
|
|
|
If you can't find that on the internet, I suggest you transfer to phys-ed before you flunk out.
"Republicans are the party that says government doesn't work and then they get elected and prove it." -- P.J. O'Rourke I'm a proud denizen of the Real Soapbox[ ^] ACCEPT NO SUBSTITUTES!!!
|
|
|
|
|
javeria khalid wrote: but i had not gotten any knowledge in this respect so please please help me
you go to school to learn about things you "had not gotten any knowledge". Otherwise what is the point?
|
|
|
|
|
|
I am doing project in Genetic Algorithm
THE TITLE "Optimizing the Classic Controllers to Improve the Cuk Converter Performance Based on Genetic Algorithm" this is an IEEE paper in which objective function of the three controllers ,the controllers are PID ,LQR,POLE PLACEMENT are given.but they didnt specify how and from where it is got and the the coding of genetic algorithm for these objective functions are also not given
i got the final objective functions for lqr controller,pid controller and poleplacement..
can any one tell me how these objective function is derived and how to implement this in matlab programming.
Objective function for LQR
Fobj= (1- exp(-1)) * (Ess +Mp) + (exp(-1) *ts)
ts is settling time, Mp is overshoot and Ess is steady state error.
Objective function POLE PLACEMENT
Fobj = exp(ts +1000 Ess2 + IOOMp)
Objective function PID
Fobj=exp(tr+ lOEss+ lOOTs+ lOOOMp)
here tr is the rise time
|
|
|
|
|
Hi,
When you use the RETR command in POP3, you get the message with this form:
blah: blah blah
blah: blah blah
.
.
.
blah: blah blah
blah: blah blah
body of message
.
The problem is that, the number of headers (blah: blah blah) are variable and they don't appear in the same order always, for example
message-ID: blabla
Reference: blablaba
or
Reference: blablaba
message-ID: blabla
Though, capturing a header is easy because one can use IndexOf("header:") and search for the \n next to that index.
But I'm having real trouble capturing the body of the message, which might contain multiple "\n" inside and it doesnt start with an identifier like "body:" or something (like headers does)
The body finishes with
\n.\n
Also i'm having troubles with the fact that a body of a message could start with "this_is_fake_header: bla bla", so..
Help please
|
|
|
|
|
In POP3, the headers should come without an empty line between them. Therefore, everything after the first empty line and the CRLF '.' CRLF is the body of the message.
It can get a little hairier than that, but that should get you through 95% of the responses from the POP3 server.
To really understand this, you should read the POP3 RFC[^] and the MIME RFC[^].
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Hey thanks a lot for replying..
But, i'm not sure that they come with an emtpy line before the body... do they?
You mean something like the following?:
(...)
lastheader:bla bla bla
body body body
.
|
|
|
|
|
That's how it should look if the POP3 server is acting correctly.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
I'm not exceptionally good at mathematics, so many of the famous algorithms' books which have a good chunk of it are a bit difficult for me to understand easily. I'm looking for a book which is easy to follow. Cormen was difficult, but Wrox's Beginning Algorithms (Java) was a more accessible read.
Can you list a few books which are easy to follow? By easy, I don't mean cut-copy-paste ready code, I'm looking for lucid explanations in easy to understand language, the lesser mathematical in nature, the better. How to solve it with computers was great, and something of the kind with a greater coverage.
Any recommendations?
|
|
|
|
|
O'Rilley Algorithms in a nutshell is awesome desktop book. It has code samples in several languages plus the sudocode covering the logic and why or why not to use a particular algorithm for a particular task.
|
|
|
|
|
can i get a program code that accepts as input any of the following
a listing of edges of a graph given as pairs of positive integers
the adjacency matrix
the incidence matrix
and output the other two
|
|
|
|
|
|
This looks like homework. You need to be able to learn the topics that will let you do this assignment yourself.
|
|
|
|
|
I expect so. It's not particularly complicated.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
letaya wrote: can i get a program code
certainly you can
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
letaya wrote: can i get a program code
You may also try to code yourself 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]
|
|
|
|
|
New Symbian executable uses Deflate algoritm for compression.
Where can i get help/algo/source related to this algorithm?
Thanks in advance.
|
|
|
|
|
Google
Regards
David R
|
|
|
|
|
K. Sushilkumar wrote: Where can i get help/algo/source related to this algorithm?
Oh, many places. Books, School/College/Uni, TWWWW (The Whole World Wide Web)
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
Hi all,
probably not the right forum to post such a question.
But I could not find any more appropriate.
It is a general question about new processors.
Do they still support SSE instructions ? I suppose so.
Is it relevant to write new programs that exploit both data parallelism (i.e. SSE) and multi-threading (multi-processors) ?
Does anyone know the strategy of parallel compilers like Intel C++ compiler or Visual C++ : do they compile seamlessly into SSEx instructions ?
Thanks in advance,
Jean-Marie Epitalon
|
|
|
|
|
Processors must be backward-compatible, so each processor supports the extensions of the previous ones.
Here are some SSE-related links I've found (the Intel link describes their C/C++ compiler):
http://www.tommesani.com/Docs.html
http://www.codeproject.com/KB/recipes/BubbleSortWithSSE2.aspx
http://softwarecommunity.intel.com/isn/downloads/softwareproducts/pdfs/347602.pdf
http://www.hayestechnologies.com/en/techsimd.htm#SSE2
|
|
|
|
|
Thanks Alan for your answer.
I did also some research on the internet in the mean time.
I can answer to my own question :
yes, Intel C++ compiler supports SSE instructions. It parallelizes and compiles directly some code into SSE instructions in a process called autovectorization.
For those that might be interested, follow the link "Product in depth" in the page :
[^]
Microsoft Visual Studio 2008 does not provide that.
Jean-Marie
|
|
|
|