To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.publishOpen lugnet.publish in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Publishing / 4231
4230  |  4232
Subject: 
Re: // and ** vs {} and [] (was: testing in rtl...)
Newsgroups: 
lugnet.publish, lugnet.admin.nntp
Date: 
Fri, 30 May 2003 12:35:37 GMT
Viewed: 
4523 times
  
In lugnet.publish, Todd Lehman wrote:
In lugnet.publish, William R. Ward wrote:
I agree that FTX should translate {} and [] to // and ** when displaying in
plain text, and I'm *not* joking.

The problem with that is that articles are stored in the news server in their
raw original format only.  When they're displayed by the web interface, and
the FTX content is rendered into HTML for viewing on a web browser, it's done
so on-the-fly by a fairly complex set of Perl5 operations.  Although it
wouldn't be the hardest thing in the world to convert {} and [] to // and **
when dispatching articles by e-mail, I sure don't like the idea of firing up
Perl to convert the content on-the-fly from the news server every time an
article is fetched.  An alternative to on-the-fly converstion might be to
store two copies of articles on the server (one raw, one converted), but that
seems pretty gunky to me.

But all of the above presupposes that the conversion should even happen in the
first place, which I disagree with anyway.  If the conversion did occur, what
would happen in replies?  How would those get magicly converted back?

Let's approach the problem from a different direction:  What if FTX simply
supported // and ** directly?  I'll bet that if it did, a lot of people would
choose that over {} and [], and you'd be able to read them in Mozilla.

Now I'm tossing this idea out without having thoroughly thought through the
ramifications of parsing.  The syntax of // and ** is much more subtle than
the syntax of {} and [].

Help convince me that // and ** could be parsed without horrible anomalies
and exception tables.  Here is some food for thought...

   Menelaus replied, "/How/ do I take your meaning? Am I to stay with ...

   "Have you read Steven King's /Pet Semetary/?" she asked.

   "What's the /Herald/'s position on this issue?"

   Coffee with cream /and/or/ sugar.

   "No, you're supposed to turn it /counter/clockwise!"

I think all of those except the last one could be handled with some clever
word-boundary detection.  Some more:

   * = .10 level (10%)     ** = .05 level (5%)     *** = .01 level (1%)

   I think *Bill* was the one who mentioned this earlier.*

   Dude, I love your mosaic! (*Wow!*)

   Microsoft (*cough* bloat *cough*) Windows.

   (*^_^*)

I suppose that defining a word boundary might start with dividing the ASCII
character set into 3 character classes...

   1.  Whitespace - tabs, spaces, newlines
   2.  Printable "punctuation" characters - .,:;!?'"()[]{}
   3.  Everything else - letters, numbers, and other symbols

...and then doing...

   my $FOO = q{.,:;!?'"()[]{}};
   my $BAR = join "", grep { !m/[\Q$foo\E\s]/ } map { chr($_) } (32..255);
   s{\b([\Q$FOO\E]*)/([\Q$BAR\E])}{$1<I>$2}g;
   s{([\Q$BAR\E])/([\Q$FOO\E]*)\b}{$1</I>$2}g;
   s{\b([\Q$FOO\E]*)\*([\Q$BAR\E])}{$1<B>$2}g;
   s{([\Q$BAR\E])\*([\Q$FOO\E]*)\b}{$1</B>$2}g;

...or something like that.  But that doesn't handle (*Wow!*) or /Herald/'s
yet.

--Todd

   I think you'll find too many anomalies if FTX supports // and ** directly.
You have to also make sure you don't FTX format text that is not intended to be
FTX formatted.  Some examples to consider follow.

   For slashes:

     Valid web addresses:
       http://www.lugnet.com/publish/ftx/guide/
       //www.lugnet.com/publish/ftx/guide/
       http://www.lugnet.com/publish/ftx/guide/lists

     Text:
        One plate is 1/3 the height of a brick and 2 plates 2/3 the height.
        I'll be there on 5/30/03 at noon.
        You need to put a </TD> tag after the </A> tag.
        my $BAR = join "", grep { !m/[\Q$foo\E\s]/ } map { chr($_) } (32..255);

   For asterisks:
        If you want to do that use: grep -l a*b* *.txt
        The correct formula is a * a + b * b = c * c


   Some situations may even be ambiguous as to whether they were intended to be
FTX formatted or not.

   Even with [] and {} you might have some problems.  For example, what would
happen if I wanted this message to use FTX formatting in a reply to your
message?  What would your parsing code look like?  And do I really need the
headache of having to take the time to make the FTX changes to preserve the
format?  What if I don't know I need to do it in subtle situations?

Brian H. Nielsen



Message has 1 Reply:
  Re: // and ** vs {} and [] (was: testing in rtl...)
 
(...) That's what I used to think too -- but I'm not so sure anymore... (...) the double slash and (2) the http: prefix. (...) I've never seen anyone write anything like that before. But in any case, it's got two leading slashes instead of one. (...) (21 years ago, 30-May-03, to lugnet.publish, lugnet.admin.nntp)

Message is in Reply To:
  // and ** vs {} and [] (was: testing in rtl...)
 
(...) The problem with that is that articles are stored in the news server in their raw original format only. When they're displayed by the web interface, and the FTX content is rendered into HTML for viewing on a web browser, it's done so (...) (21 years ago, 30-May-03, to lugnet.publish, lugnet.admin.nntp)

31 Messages in This Thread:









Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR