PHP Developers Network
http://forums.devnetwork.net/

CryoBB - Create your own Bulletin Board
http://forums.devnetwork.net/viewtopic.php?f=50&t=124469
Page 5 of 6

Author:  Jonah Bron [ Wed Dec 22, 2010 8:38 pm ]
Post subject:  Re: CryoBB - Create your own Bulletin Board


Author:  s.dot [ Wed Dec 22, 2010 8:59 pm ]
Post subject:  Re: CryoBB - Create your own Bulletin Board

If a tag is never opened or a tag is never closed, the regexp will not detect it and will just leave it alone.
Wondering why correct the invalid nesting instead of just parsing it?

Edit| I mean, if a parser could be wrote to correct all invalid nests and open and close tags, then that would be beyond the scope of amazing. But seems like a rather complex chore.

Author:  josh [ Wed Dec 22, 2010 9:20 pm ]
Post subject:  Re: CryoBB - Create your own Bulletin Board

If you can define expected inputs & outputs, I think I could wing whatever is specified. However IMO the list of specs could become rather large if we try and do too much, I think its definitely worth considering.

Perhaps before we do that, we could do one that outputs invalid XHTML (and keep that as a separate mode as well)? That will provide some value to some users, and help us better gauge the complexity. Or not?

Author:  s.dot [ Wed Dec 22, 2010 9:50 pm ]
Post subject:  Re: CryoBB - Create your own Bulletin Board

OK, I think there are several "modes" here that have been discussed (from my understanding)

1) As it currently is
2) One that parses all tags, even if they're improperly nested, producing invalid xhtml
3) One that produces valid xhtml
4) One that fixes invalid nesting and produces valid xhtml

Have I got it straight?

1 and 2 would be great. 3 would be awesome, 4 would be asking too much (though definitely cool)

And if 3 or 4 were to be done, wouldn't that replace 1 and 2? (I mean why have 1 and 2, if 3-4 could do the same thing but with valid output)

Author:  josh [ Wed Dec 22, 2010 10:06 pm ]
Post subject:  Re: CryoBB - Create your own Bulletin Board

1 & 3 sound the same.

Author:  Jonah Bron [ Wed Dec 22, 2010 11:27 pm ]
Post subject:  Re: CryoBB - Create your own Bulletin Board

Lets start with adding number 2. We already have 1/3, all we have to do is break it out into a separate object, then create a drop-in replacement that uses method 2.

Author:  josh [ Thu Dec 23, 2010 12:13 am ]
Post subject:  Re: CryoBB - Create your own Bulletin Board


Author:  Jonah Bron [ Thu Dec 23, 2010 1:52 pm ]
Post subject:  Re: CryoBB - Create your own Bulletin Board

I'll start on separating out the matching object sometime today, probably this morning.

Author:  Jonah Bron [ Thu Dec 23, 2010 3:39 pm ]
Post subject:  Re: CryoBB - Create your own Bulletin Board

Done. Feedback?

Author:  josh [ Thu Dec 23, 2010 10:43 pm ]
Post subject:  Re: CryoBB - Create your own Bulletin Board


Author:  Jonah Bron [ Thu Dec 23, 2010 11:42 pm ]
Post subject:  Re: CryoBB - Create your own Bulletin Board


Author:  josh [ Fri Dec 24, 2010 12:10 am ]
Post subject:  Re: CryoBB - Create your own Bulletin Board


Author:  Jonah Bron [ Fri Dec 24, 2010 12:28 am ]
Post subject:  Re: CryoBB - Create your own Bulletin Board


Author:  josh [ Tue Jan 04, 2011 5:47 pm ]
Post subject:  Re: CryoBB - Create your own Bulletin Board

The way I'd recommend tackling this new strategy is to first get the old strategy under unit test. Right now its tested indirectly thru "base.php".

(@Jonah & Scott)
The way I understand this currently works is the current strategy finds "positions" of matches. It then loops thru matches, replacing with replacements. Each time it does this it factors in the difference of the length of the old & new text, so that it can update the positions. (the difference in length between the matched text & the text to be substituted is subtracted from the positions of all remaining matches)

We have no unit tests that show that these sub-systems find the right positions, but we do show that the thing as a whole works, in our tests.

I'd find it really easy to do this feature, if we first had some tests that shows the inputs & outputs for finding positions with the current strategy. From there I could duplicate the tests, and modify the expected positions as per the new algorithm, from there I could duplicate & change the existing implementation and modify it to do matching differently until the tests pass, then we could refactor. I don't mean to rant about tests, just saying how I'd keep the ball rolling if I were familiar enough with the code, or if it had enough tests for me to do this in this area.

If you guys can get at least 1 test showing an input string, and the output array of positions, I could probably take it from there...

Author:  Jonah Bron [ Fri Jan 07, 2011 2:48 pm ]
Post subject:  Re: CryoBB - Create your own Bulletin Board


Page 5 of 6 All times are UTC - 5 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/