Re: [PHP] How to authnticate and use contents from ${HOME}

2009-07-06 Thread Isaac Dover
Hi Chantale, as Bastien mentioned, a preconfigured package might be the best
way to go. Wikipedia has more information:

http://en.wikipedia.org/wiki/List_of_LAMP_Packages

What are you wanting to build in your interface?

 - Isaac

On Mon, Jul 6, 2009 at 9:14 AM, Bastien Koert  wrote:

> Try xamp or one of the preconfigured packages
>
> bastien
>
> On Sunday, July 5, 2009,   wrote:
> > Hello,
> >
> > My name ich Chantale, I am 15years old and in a german Lycee. I like to
> study Informatic in two years and now try to code my first applications. I
> am new to php and like to code my own Intranet Web-Interface which should
> run on my FileServer at home.
> >
> > I have installed suPHP, but it seems to be not the thing I need, because
> it works only on a VHost.
> >
> > What I need is, that a ${USER} can login and work on her/his ${HOME}.
> >
> > How can I archive this?
> >
> > Thank you
> > Chantale
> >
> >
> >
> >
> >
> >
> >
> > #adBox3 {display:none;}
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
> --
>
> Bastien
>
> Cat, the other other white meat
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


Re: [PHP] PHP script for detecting pattern sequences?

2009-07-10 Thread Isaac Dover
sorry, should have added that i'm not aware of any library to do this, but
you could certainly write one! :) and i forgot to use the list, sorry.

- isaac

On Fri, Jul 10, 2009 at 10:28 AM, Isaac Dover  wrote:

> though this looks suspiciously like a homework assignment, i'll bite.
>
> those regex patterns wouldn't solve his problem. he wants to pull
> repetitions from the string _before_ knowing a pattern. those patterns will
> match the entire source string
>
> without trying, i would think that you may try using a technique that reads
> a character, then looks for the next occurrence of that character. if you're
> lucky, then that character will be the beginning of the sequence. you'll
> just look at the substring from that first occurrence until the next, then
> search the string for that substring.
>
> if unlucky, you'll move to the next string, _append it_ to the previous,
> repeat the process, and so on. at some point, you'll have the pattern built
> in memory and will be searching the source string using your built "pattern
> string". at some point, something will have to match.
>
> the trick is in recursion. also, i'm assuming your real examples are more
> complicated than what you have above. in the two listed, you already know
> that a zero indicates that the pattern is beginning, so you just look for,
> and note the index of, zeroes.
>
> i've thumbed through a free book online that deals with text parsing. it's
> very technical, but interesting at the same time. maybe you can find it.
>
> - isaac
>
>
> On Wed, Jul 8, 2009 at 11:32 PM, WenDong Zhang  wrote:
>
>> yes
>> (\d+?)\1+  works fine
>>
>> On Thu, Jul 9, 2009 at 6:00 AM, Per Jessen  wrote:
>>
>> > Rob Gould wrote:
>> >
>> > > Can anyone tell me if there's a PHP library out there that will help
>> > > me determine "pattern sequences" from a string?
>> > >
>> > >
>> > > Example input:
>> > >
>> > > 032258064516129032258064516129032258064516129032258064516129
>> > > Sequence = 032258064516129
>> > >
>> > >
>> > > 037037037037037037037037037037037037037037037037037037037037
>> > > Sequence = 037
>> > >
>> > >
>> > > I know regex can help you find a pattern when you know what the
>> > > pattern is already, but this is different.
>> >
>> > Nah, it's the same thing.
>> >
>> > A suitable regex might look something like this:
>> >
>> > /([0-9]+)\1+/
>> >
>> > Not tested, probably won't work on the first try.  You may need
>> > greediness adjustments.
>> >
>> >
>> > /Per
>> >
>> >
>> > --
>> > Per Jessen, Zürich (14.1°C)
>> >
>> >
>> > --
>> > PHP General Mailing List (http://www.php.net/)
>> > To unsubscribe, visit: http://www.php.net/unsub.php
>> >
>> >
>>
>>
>> --
>> Best Regards!
>> Wen Dong
>>
>
>


Re: [PHP] PHP script for detecting pattern sequences?

2009-07-10 Thread Isaac Dover
i just got pwned!

thanks, andrew. i should've paid more attention to what i was reading.

- isaac

On Fri, Jul 10, 2009 at 11:19 AM, Andrew Ballard  wrote:

> On Fri, Jul 10, 2009 at 10:30 AM, Isaac Dover wrote:
> >> On Wed, Jul 8, 2009 at 11:32 PM, WenDong Zhang 
> wrote:
> >> On Thu, Jul 9, 2009 at 6:00 AM, Per Jessen  wrote:
> >> > A suitable regex might look something like this:
> >> >
> >> > /([0-9]+)\1+/
> >> >
> >> > Not tested, probably won't work on the first try.  You may need
> >> > greediness adjustments.
> >> >
> >> >
> >> > /Per
> >>
> >> yes
> >> (\d+?)\1+  works fine
> >>
> >>
> >>
> >> --
> >> Best Regards!
> >> Wen Dong
> > those regex patterns wouldn't solve his problem. he wants to pull
> > repetitions from the string _before_ knowing a pattern. those patterns
> will
> > match the entire source string
> >
> > - isaac
>
> Those patterns look like a pretty good starting point to me. True, the
> first captured result of preg_match would be the entire string, but
> the submatches array would contain the actual sequence that is
> repeated:
>
> 
> $pattern = '/(\d+?)\1+/';
>
> $subject = '032258064516129032258064516129032258064516129032258064516129';
> if (preg_match($pattern, $subject, $matches)) {
>var_dump($matches);
> }
>
> /*
> array(2) {
>  [0]=>
>  string(60) "032258064516129032258064516129032258064516129032258064516129"
>  [1]=>
>  string(15) "032258064516129"
> }
> */
>
> $subject = '037037037037037037037037037037037037037037037037037037037037';
> if (preg_match($pattern, $subject, $matches)) {
>var_dump($matches);
> }
> /*
> array(2) {
>  [0]=>
>  string(60) "037037037037037037037037037037037037037037037037037037037037"
>  [1]=>
>  string(3) "037"
> }
> */
>
> $subject = '';
> if (preg_match($pattern, $subject, $matches)) {
>var_dump($matches);
> }
> /*
> array(2) {
>  [0]=>
>  string(60) ""
>  [1]=>
>  string(1) "3"
> }
> */
>
> ?>
>
>
>
> Some slight adjustments to the pattern could also be useful.
>
> // This would catch a pattern of any repeating characters, not just
> numeric digits
> $pattern = '/(.+?)\1+/';
>
> // This would only match if the entire string was a repeated sequence
> $pattern = '/^(\d+?)\1+$/';
>
> // This would match the repeated sequence only if the string began
> with a repeated sequence.
> $pattern = '/^(\d+?)\1+/';
>
> // This would match the repeated sequence only if the string ended
> with a repeated sequence.
> $pattern = '/(\d+?)\1+$/';
>
> If a string had multiple sequences, you could also use preg_match_all
> to find each sequence, but that looks a bit more involved than the OP.
>
> None of these require knowing the sequence in advance. How do they not
> satisfy the OP?
>
> Andrew
>