[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  Forum
. -> [Folder]  Test
. . -> [Subject]  Testing templates

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: Testing templates
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Pages: 1  2  3 4  5  

Posted by Conner   USA  (381 posts)  [Biography] bio
Date Tue 25 Aug 2009 03:06 AM (UTC)  quote  ]
Message
Just to throw in my gratz too, Nick, I also really like the recent template & quote & code changes, and so does my wife, Dragona. The template changes look great and seem like a really good idea in general. The most recent quote & code tag changes look really good and were probably overdue, especially the ability to attribute quotes directly. In short, good job! :)

-=Conner=-
--
Come test your mettle in the Land of Legends at telnet://tcdbbs.zapto.org:4000
or, for a little family oriented medieval fun, come join us at The Castle's Dungeon BBS at telnet://tcdbbs.zapto.org
or, if you just want information about either, check our web page at http://tcdbbs.zapto.org
[Go to top] top

Posted by Nick Gammon   Australia  (18,800 posts)  [Biography] bio   Forum Administrator
Date Mon 24 Aug 2009 07:08 AM (UTC)  quote  ]
Message
Twisol said:

I slept on it. What if you counted (again), but each start was +1 and each end was -1? That means that if at any point you're under 0, or if at the end you're NOT zero, something's wrong.


David Haley said:

Is a recursive descent really that expensive? I imagine that it's probably not much worse than a regular expression match. It's just a linear string scan, really. I think that malformed posts might be the trickier thing to deal with.


It all works fairly well with the simplified method, so I won't bother doing either of those, thanks for the suggestions however. :-)

Twisol said:

I really like the new updates.


Glad everyone likes them.

Now, back to business with MUD clients ...

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Mon 24 Aug 2009 02:50 AM (UTC)  quote  ]
Message
Echo. The new changes are great! :-) Thanks much.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Twisol   USA  (2,230 posts)  [Biography] bio
Date Sat 22 Aug 2009 02:34 AM (UTC)  quote  ]
Message
Yay! The little things often add so much to the big picture - I really like the new updates. ^_^

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Nick Gammon   Australia  (18,800 posts)  [Biography] bio   Forum Administrator
Date Fri 21 Aug 2009 10:10 PM (UTC)  quote  ]
Message
David Haley said:

I think that malformed posts might be the trickier thing to deal with.


Yes, tricky.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (18,800 posts)  [Biography] bio   Forum Administrator
Date Fri 21 Aug 2009 10:09 PM (UTC)  quote  ]

Amended on Fri 21 Aug 2009 10:11 PM (UTC) by Nick Gammon

Message
Template:post=9700 Please see the forum thread: http://gammon.com.au/forum/?id=9700.

That is good enough as far as I am concerned. ;)

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Fri 21 Aug 2009 02:29 PM (UTC)  quote  ]
Message
Is a recursive descent really that expensive? I imagine that it's probably not much worse than a regular expression match. It's just a linear string scan, really. I think that malformed posts might be the trickier thing to deal with.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Twisol   USA  (2,230 posts)  [Biography] bio
Date Fri 21 Aug 2009 02:08 PM (UTC)  quote  ]
Message
Nick Gammon said:

Counting won't detect this:

------
[/quote] ..... [quote]
------



I slept on it. What if you counted (again), but each start was +1 and each end was -1? That means that if at any point you're under 0, or if at the end you're NOT zero, something's wrong.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by WillFa   USA  (517 posts)  [Biography] bio
Date Fri 21 Aug 2009 07:37 AM (UTC)  quote  ]
Message
Yup, a code tag is a new block element.

You could make .code a css class that has white-space: pre; and font-family: monospace; then change the php so it doesn't write <pre><code> tags, but a <div class="code"> tag...

A div will not nest inside of a <P> tag, so it will behave like the rest of the forum even when not nested.


[Go to top] top

Posted by Nick Gammon   Australia  (18,800 posts)  [Biography] bio   Forum Administrator
Date Fri 21 Aug 2009 07:24 AM (UTC)  quote  ]
Message
Ah, why did it do that? I didn't give it permission to render the page that way.

A <code> tag must have an implied end of paragraph.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (18,800 posts)  [Biography] bio   Forum Administrator
Date Fri 21 Aug 2009 07:20 AM (UTC)  quote  ]
Message
Er, maybe not.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (18,800 posts)  [Biography] bio   Forum Administrator
Date Fri 21 Aug 2009 07:19 AM (UTC)  quote  ]
Message
Nick said:



<aliases>
  <alias
   match="target *"
   enabled="y"
   variable="target"
   send_to="9"
   sequence="100"
  >
  <send>%1</send>
  </alias>
</aliases>



There! I quoted code.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by WillFa   USA  (517 posts)  [Biography] bio
Date Fri 21 Aug 2009 07:18 AM (UTC)  quote  ]

Amended on Fri 21 Aug 2009 07:19 AM (UTC) by WillFa

Message
WillFa said:

Balanced tags are easy in LPEG! Quick, Nick, rewrite the forum software in Lua!


;)



;)

What a can of worms we've opened...
[Go to top] top

Posted by Nick Gammon   Australia  (18,800 posts)  [Biography] bio   Forum Administrator
Date Fri 21 Aug 2009 07:16 AM (UTC)  quote  ]
Message
WillFa said:


But how will we quote code? :)





..... must ..... not ..... quote ..... code ......

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (18,800 posts)  [Biography] bio   Forum Administrator
Date Fri 21 Aug 2009 07:14 AM (UTC)  quote  ]
Message
I remember now why it is hard to get quotes (or anything) going as a nested thing, using regular expressions. Basically regexp matches can be greedy or non-greedy, but neither one matches correctly on a message with both nested and non-nested quotes in it.


           [quote=Nick] aaa [quote=Willfa] bbb [/quote] [/quote]  [quote=Twisol] ccc [/quote]
greedy:    ^-------------------------------------------------------------------------^
nongreedy: ^-----------------------------------^
correct:   ^--------------------------------------------^


The greedy one goes too far, and the non-greedy one doesn't handle the nesting.

Now you could recursively descend into it (and then you have the problems of handling badly-formed messages) but this is something that has to happen on every post, on every page. (There are up to 15 posts a page).

I was worried about the overhead of doing that all the time.

The current system just blindly replaces form codes with html, eg. [b] becomes <b>.

Twisol said:

One of many solutions I can think of is counting the number of start tags versus end tags


Counting won't detect this:


[/quote] ..... [quote]


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


15,417 views.

This is page 3, subject is 5 pages long:  [Previous page]  1  2  3 4  5  [Next page]

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]