aspose file tools*
The moose likes Ranch Office and the fly likes I hate smileys Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » This Site » Ranch Office
Bookmark "I hate smileys" Watch "I hate smileys" New topic
Author

I hate smileys

William Barnes
Ranch Hand

Joined: Mar 16, 2001
Posts: 986

I am so tired of seeing smileys in every piece of code which is posted. Can't the default be no smiles, and you have to check the box to use them?


Please ignore post, I have no idea what I am talking about.
Ken Loh
Ranch Hand

Joined: Feb 16, 2005
Posts: 190
Is there some sort of escape characters we can use ? E.g. "\" :

[ April 06, 2005: Message edited by: Ken Loh ]
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

There's a checkbox on the message entry screen labelled "Disable smilies in this post" (scroll down to find it.) Check it, and no smilies.


[Jess in Action][AskingGoodQuestions]
Ken Loh
Ranch Hand

Joined: Feb 16, 2005
Posts: 190
I think that's exactly what the original-post sender didn't want. It's easy for one to forget to check the box. He wanted it to be checked as a default.

However, checking the box would dissappoint those who want both intact codes and smileys.

Originally posted by Ernest Friedman-Hill:
There's a checkbox on the message entry screen labelled "Disable smilies in this post" (scroll down to find it.) Check it, and no smilies.
Steven Bell
Ranch Hand

Joined: Dec 29, 2004
Posts: 1071
While I don't think this is something possible with the current forum software it would make sense to not allow smilies within code tags and/or have a tag such as [nosmiley] that leaves text within it alone.
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
I'm not sure how possible it is with the current software. There may be an option in our control panel - or I might be able to hack the code. Assuming it's possible: does this sound like a good idea to everyone? Personally I think it makes sense. I use smilies all the time, but I'm willing to have to toggle a checkbox on my posts in order to do so. I think there's probably more damage done to posts containing code which is now incorrectly interpreted as smilies, than there would be damage done to posts which try to use smilies, and they just get the individual ASCII characters. (Most of which are still understood as smilies by other humans, after all.) Is there a compelling reason not to make the default "no smilies" as William suggests?


"I'm not back." - Bill Harding, Twister
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


does this sound like a good idea to everyone?

+1 vote.

The implications of adding etc. to a post seems to pass new users by completely as the site currently behaves. And most people seem to assume the implied promise of code tags for example is that they will preserve the original formatting. So its usually a surprise to see smilies where you expected a JDBC url.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

Sure would be nice if they could just be blocked inside code tags, though. I'm not a huge smiley user, but this would be an extra step when I did use one.

Here's a potentially radical idea: there are only a very few smilies that cause this problem:

;) :p

What if we gave them all a nose:

:-) :-( :-D ;-) :-p

Those never come up in Java code (although they're probably meaningful in Perl!)

Looking at the control panel, though, it seems that code-hacking would be required to do this; UBB won't let you change the text for these "built-in" smilies from the control panel.
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
Changing the smilies is an interesting idea, but I'm guessing it would be too complex. The main problem is, how to get this to work with existing posts and new ones? The existing posts still have standard smilies like : ) (without the space of course). The UBB code that renders posts as HTML would have to decide whether to interpret a post using old or new rules. Might work if we just look at a timestamp. Or we could run some huge batch job that transforms all the old post files into a new format. Possible, but it's sounding rather icky to me.

I like the idea of simply turning off smilies inside [ code ] tags. Would require a little Perl hacking, but probably a lot less than other solutions, and I think it would be straightforward for our users.

Of course, there are a couple other things I should really tackle first. Like tracking down where our bulk e-mailer is getting those old addresses from... And some bonehead user managed to screw up his profile page somehow; need to look into that.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61769
    
  67

Disabling them inside code tags is a great idea -- just wish more people would actually use the code tags.

Obviously this is a big issue for the JSP forum where phrases like <c:out> appear with great frequency.

Adding noses to the smiley codes is also a good idea -- you would think that there's a translation table somewhere, but I don't know how it was actually implemented.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 31079
    
163

I agree that giving the smilies a nose is a good idea. What I don't see is why you have to make it backward compatible? Old format smilies could just be written as plain text smilies. My real question with the smilies is how to people know to type them with a nose? I never actually click the instant graemlins button; smilies just appear when typing : ).

Either approach (noses or disabling in code tags) would certainly be an improvement over what we have now though.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Jason Menard
Sheriff

Joined: Nov 09, 2000
Posts: 6450
Originally posted by Bear Bibeault:
Disabling them inside code tags is a great idea -- just wish more people would actually use the code tags.


I feel your pain.
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
Wonder if it's possible to write a script or something that automatically detects code and inserts code tags where needed (along with a scalding hot message to the poster about doing his own code tags in the future)


42
Ryan McGuire
Ranch Hand

Joined: Feb 18, 2005
Posts: 1013
    
    3
Originally posted by Ernest Friedman-Hill:

What if we gave them all a nose:

:-) :-( :-D ;-) :-p

Those never come up in Java code



How about this (contrived) example:


...would end up looking like...



(although they're probably meaningful in Perl!)


Ouch, I'd be insulted on behalf of all Perl users if this weren't true.

Ryan
[ April 07, 2005: Message edited by: Ryan McGuire ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61769
    
  67



Very contrived, and unlikely to show up in real code. Point is, adding the "noses" would prevent 99% of the non-contrived cases where smilies show up unintentionally in code examples.
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
but then a lot of the things posted here look quite contrived even if they're genuine attempts
Ryan McGuire
Ranch Hand

Joined: Feb 18, 2005
Posts: 1013
    
    3
Originally posted by Bear Bibeault

Very contrived, and unlikely to show up in real code. Point is, adding the "noses" would prevent 99% of the non-contrived cases where smilies show up unintentionally in code examples.


Point is, why use any patterns that could possibly show up in valid code? (Or why expand smilies in a CODE block at all?)

Also, I disagree with your 99% estimate. The only difference between "colon p" and "colon negative p" in a chunk of code is the inclusion of a negative for the third term of a ?: expression. In the battle between "(p<0)?-p:p" and "(p>=0)?p:-p", I could definitely see the latter hapenning more than 1% of the time. In fact, if we use my code as a test case we're more likely to see the latter construct (including the lack of spaces), so adding minuses to smily patterns would actually make the problem worse (for that particular smily).

Ryan
[ April 08, 2005: Message edited by: Ryan McGuire ]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Removing all smilies from within code blocks is going to be a lot more work (on a product that we don't maintain) whereas adding the nose is a small quick hack that can eliminate the vast majority of unintended smilies.

Sounds like a good start to me.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
I still prefer disabling smilies in code blocks. Many people will still omit code blocks, and their code will still look like crap. But that has little to do with smilies, and they can always add code tags later. Meanwhile there are other similar problems we could solve, like the fact that using the variable name i as an array index often gets interpreted as an italics tag. And < often creates problems. I don't want to create custom new syntaxes for these - they already exist, actually, but they're a pain to use. Disabling most forms of UBB interpretation inside code tags seems like a good approach here. Though there will probably be some problems with backwards compaptibility as alluded to earlier - but as Jeanne suggests, we can probably live with some mild goofiness in old posts.
[ April 08, 2005: Message edited by: Jim Yingst ]
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

Originally posted by Ryan McGuire:
How about this (contrived) example


Wow, you've got a devious brain!

I admit that I forgot about the ternary operator in considering possible valid character sequences in Java. Hmm. Maybe a "." for a nose...

I think Jim's right, though -- there are other things that go wrong with code tags, and simply turning off UBBCode inside of them could potentially fix them all.
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
I also vote for disabling smilies inside "code" tag. It would become effective to all previous posts as well. Like when we change our signatures, it changes to all our previous posts as well. Like the no of posts automatically updated in all the previous posts.

Moreover, we have to discourage the codes without code tag, indeed.
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 31079
    
163

If we end up disabling smilies in code tags, can we do it for url tags as well. It doesn't come up as often, but just often enough to be mildly annoying.
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1081

Can't there be a simple javascript code,the moment I click on "CODE" button it would enable the checkbox of "Disable smilies in this post"

Or

We can check same before posting FORM if content contains any [CODE] tag then It would make checkbox value true so that smiley in same post are disabled. even this case would be better as it would handle [CODE] tag directly typed by keyboard

Shailesh
[ April 16, 2005: Message edited by: Shailesh Chandra ]

Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
[Jeanne]: If we end up disabling smilies in code tags, can we do it for url tags as well. It doesn't come up as often, but just often enough to be mildly annoying.

I'm not sure I know what you mean. Can you give an example?

[Shailesh]: Can't there be a simple javascript code,the moment I click on "CODE" button it would enable the checkbox of "Disable smilies in this post"

I suppose that sould be possible, but I'd prefer not to disable smilies outside of code tags for no reason. Moreover as discussed previously the problem is not just smilies; it includes other UBB markup as well. I wouldn't want to disable all markup outside code tags - but I think it does make sense to disable it within code tags.

The same reply applies to your second suggestion.
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1081

but I'd prefer not to disable smilies outside of code tags for no reason.


Point taken my thought was that If today I submit a post with code and if I want to disable smiley then I would select the checkbox to disable smile and that would also disable smiley outside of code tags for no reason

Shailesh
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 31079
    
163

Originally posted by Jim Yingst:
[Jeanne]: If we end up disabling smilies in code tags, can we do it for url tags as well. It doesn't come up as often, but just often enough to be mildly annoying.

I'm not sure I know what you mean. Can you give an example?


If I post this without disabling similies in the post, it displays as a bunch of text with a happy face (and not as a link)
[URL=http://www.google.com/search?q=javaranch&sourceid=mozilla-search&start=0&start=0&ie=utf-8&oe=utf-8&client=firefox-a&rls=org.mozilla:en-US fficial]JavaRanch link from Google[/URL]
[ April 17, 2005: Message edited by: Jeanne Boyarsky ]
Alan Moore
Ranch Hand

Joined: May 06, 2004
Posts: 262
Here's an idea: don't interpret a character sequence as a smiley if the sequence is immediately preceded or followed by another non-whitespace character. That's a lot easier than determining whether or not the characters are inside a certain kind of tag, and it would also work on naked URLs (naked code, too, come to think of it). And it shouldn't break the formatting of existing posts because the forum software has always padded smileys with spaces (of course, it wouldn't need to do that anymore). You might try it as an interim fix while you work on a more complete one (i.e., disabling other tags within CODE segments).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: I hate smileys