php-windows Digest 1 Apr 2004 22:59:56 -0000 Issue 2191

Topics (messages 23335 through 23343):

STUCK : String Comaparison
        23335 by: Ron.Herhuth.tatumpartners.com
        23336 by: Rico Derks
        23337 by: Svensson, B.A.T. (HKG)
        23338 by: DvDmanDT

Re: Refresh in php
        23339 by: DvDmanDT

Upgraded to 4.3.5
        23340 by: Shawn Beard

Re: [PEAR] WARNING! Virus
        23341 by: Daniel Kopp

Re: [PHP] RE: [PEAR] WARNING! Virus
        23342 by: Red Wingate

Re: [PEAR-DEV] Re: [PHP] RE: [PEAR] WARNING! Virus
        23343 by: Lukas Smith

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
I may be just over thinking this but I'm stuck trying to figure out a
solution that has to deal with comparing a series of dynamic strings to a
known string.  The strings will be 8 characters long and each character
will be either a zero or a 1.  What I need to do is to compare the dynamic
strings with the known and if each of the 1 characters in the dynamic
string aligns with the 1 characters in the known string it will throw a
flag.  The dynamic string does NOT need to contain all of the 1 characters
that the known string does, just that the ones that it contains align.

Examples:

Known:
10100010

Dynamic:
00100000  Throws flag because both strings contain a 1 in position 3
01100000  Doesn't throw flag because there is a 1 in position 2
10100000  Throws a flag because the 1s in position 1 and 3 align
10110000  Doesn't throw a flag because of the 1 in position 4

I was able to create a function that matches the entire string but I lost
it when trying to deal with partial matches.  Does anyone have a potential
solution for such a beast?  I appreciate any input you might be able to
offer...

Thanks,
Ron






--- End Message ---
--- Begin Message ---
Hi Ron,

Also in PHP a string is actually an array of characters. Maybe you can pick 
out each character and compared it to the character in the same position of 
the known string! 
Example:
// Get the first character of a string
$str = 'This is a test.';
$first = $str{0};

// Get the third character of a string
$third = $str{2};

Cheers, RICO

On Thursday 01 April 2004 14:59, [EMAIL PROTECTED] wrote:
> I may be just over thinking this but I'm stuck trying to figure out a
> solution that has to deal with comparing a series of dynamic strings to a
> known string.  The strings will be 8 characters long and each character
> will be either a zero or a 1.  What I need to do is to compare the dynamic
> strings with the known and if each of the 1 characters in the dynamic
> string aligns with the 1 characters in the known string it will throw a
> flag.  The dynamic string does NOT need to contain all of the 1 characters
> that the known string does, just that the ones that it contains align.
>
> Examples:
>
> Known:
> 10100010
>
> Dynamic:
> 00100000  Throws flag because both strings contain a 1 in position 3
> 01100000  Doesn't throw flag because there is a 1 in position 2
> 10100000  Throws a flag because the 1s in position 1 and 3 align
> 10110000  Doesn't throw a flag because of the 1 in position 4
>
> I was able to create a function that matches the entire string but I lost
> it when trying to deal with partial matches.  Does anyone have a potential
> solution for such a beast?  I appreciate any input you might be able to
> offer...
>
> Thanks,
> Ron

--- End Message ---
--- Begin Message ---
For an exhaustiv brute force partial match, between string 1 and
string 2. Take the first string and break it up in segment of
lenght 1,2,3,...,n-1, where n is the lenght of string 1.

Then for each of these segment do a "string-find-in-string"
in the second string - if you get a hit, then you have a
partial match.


    //Anders - doesn't pople read Knut anymore?

-----Original Message-----
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: 4/1/2004 2:59 PM
Subject: [PHP-WIN] STUCK : String Comaparison

I may be just over thinking this but I'm stuck trying to figure out a
solution that has to deal with comparing a series of dynamic strings to
a
known string.  The strings will be 8 characters long and each character
will be either a zero or a 1.  What I need to do is to compare the
dynamic
strings with the known and if each of the 1 characters in the dynamic
string aligns with the 1 characters in the known string it will throw a
flag.  The dynamic string does NOT need to contain all of the 1
characters
that the known string does, just that the ones that it contains align.

Examples:

Known:
10100010

Dynamic:
00100000  Throws flag because both strings contain a 1 in position 3
01100000  Doesn't throw flag because there is a 1 in position 2
10100000  Throws a flag because the 1s in position 1 and 3 align
10110000  Doesn't throw a flag because of the 1 in position 4

I was able to create a function that matches the entire string but I
lost
it when trying to deal with partial matches.  Does anyone have a
potential
solution for such a beast?  I appreciate any input you might be able to
offer...

Thanks,
Ron

--- End Message ---
--- Begin Message ---
Umm..
$static=bindec('10100000');
$dynamic=bindec('10110000');

# Can't think right now, but it seems like
# you can just do this instead:  $dynamic & ~$static
if(($static|$dynamic)& ~$static)
{
# Don't throw flag
}
else
{
# Throw flag
}

It throws a flag, if all 1's in the dynamic string has a match in the static
one, but not if the static one has a 1 that the other doesn't have..
Correct?
-- 
// DvDmanDT
MSN: dvdmandt€hotmail.com
Mail: dvdmandt€telia.com
"Ron Herhuth" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
I may be just over thinking this but I'm stuck trying to figure out a
solution that has to deal with comparing a series of dynamic strings to a
known string.  The strings will be 8 characters long and each character
will be either a zero or a 1.  What I need to do is to compare the dynamic
strings with the known and if each of the 1 characters in the dynamic
string aligns with the 1 characters in the known string it will throw a
flag.  The dynamic string does NOT need to contain all of the 1 characters
that the known string does, just that the ones that it contains align.

Examples:

Known:
10100010

Dynamic:
00100000  Throws flag because both strings contain a 1 in position 3
01100000  Doesn't throw flag because there is a 1 in position 2
10100000  Throws a flag because the 1s in position 1 and 3 align
10110000  Doesn't throw a flag because of the 1 in position 4

I was able to create a function that matches the entire string but I lost
it when trying to deal with partial matches.  Does anyone have a potential
solution for such a beast?  I appreciate any input you might be able to
offer...

Thanks,
Ron

--- End Message ---
--- Begin Message ---
You use the meta-tag-style in PHP as well, or a javascript..

-- 
// DvDmanDT
MSN: dvdmandt€hotmail.com
Mail: dvdmandt€telia.com
"Sudeep sarath" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> Hi friends,
>
> Is there any function in php that keeps refreshing the page after a fixed
time...just like "<meta refresh>" in normal HTML files.
>
>
> Thanx
>
> ...SuDeEp...
>
> Win an evening with the Indian cricket captain: Yahoo! India Promos.

--- End Message ---
--- Begin Message ---
I jsut upgraded to PHP 4.3.5 and now my email functionality does not work.  I do have 
the SMTP setting in the php.ini set up.  Any ideas?

Shawn Beard 
Web Administrator
Iowa Foundation for Medical Care
Information Systems
[EMAIL PROTECTED]
Office: 515-440-8581
Pager: 515-208-5907

--- End Message ---
--- Begin Message ---
Hi!

People who do not check anything that comes in by internet should see a
doctor concerning suicidal tendences. Over here - every day I get at least
one virus (probably 2-3). But ... who cares ... Norton, F-Secure and co.
should care - but I ... got better things to do

Regards
Daniel

> Be carefull guys, maybe email attachment contain a virus, NAV 2003 catch a
> virus [EMAIL PROTECTED] I don't know from which list, php-general,
> php-windows, pear-general, pear-dev or pear-cvs.

--- End Message ---
--- Begin Message --- interessting, as those lists only allow text/plain files to be attached

Daniel Kopp wrote:
Hi!

People who do not check anything that comes in by internet should see a
doctor concerning suicidal tendences. Over here - every day I get at least
one virus (probably 2-3). But ... who cares ... Norton, F-Secure and co.
should care - but I ... got better things to do

Regards
Daniel


Be carefull guys, maybe email attachment contain a virus, NAV 2003 catch a
virus [EMAIL PROTECTED] I don't know from which list, php-general,
php-windows, pear-general, pear-dev or pear-cvs.



--- End Message ---
--- Begin Message --- lets have this thread die now .. especially as it crosses way too many lists.

regards,
Lukas Smith
[EMAIL PROTECTED]
_______________________________
  BackendMedia
  www.backendmedia.com
  [EMAIL PROTECTED]

  Linn Zwoch Smith GbR
  Pariser Str. 44
  D-10707 Berlin

  Tel +49 30 83 22 50 00
  Fax +49 30 83 22 50 07

--- End Message ---

Reply via email to