Formatting code on these forums

When I copy code directly from codewarrior (with its nice colorcoding and white space and indenting) into this forum and post, everything is justified left with no colors or bolding and it's all in the forum font. I notice that some people are able to present code in these forums that looks like codewarrior code. Just wondering how one takes code from a source file and puts it in these forums looking like code should.
Thanks,
Maduin

http://forum.java.sun.com/faq.jsp#messageformat

Similar Messages

  • Posting script code in these forums

    OK, it looks like there are some (new) formatting issues with these forums when people try to post their scripts. I have been using a formatter script that converts the text on the clipboard to HTML and then wraps it in a pre tag, but there still seems to be some issues with certain characters. The following script has worked for me so far (although I don't post that much) - what other scripts or methods work for you?
    <pre title="this text can be pasted into the Script Editor" style="font-family: Monaco, 'Courier New', Courier, monospace; font-size: 10px; padding: 5px; width: 720px; color: #000000; background-color: #E0E0E0; overflow: auto">-- script formatter
    property TempFile : "SF_TempFile" -- a temporary work file
    property TheWidth : "width: 720px; " -- a width attribute (deprecated in HTML 4.01)
    try
    set TheClipboard to (the clipboard) as string
    set MyOpenFile to open for access ("/tmp/" & TempFile & ".txt" as POSIX file) with write permission
    set eof of MyOpenFile to 0 -- empty the temp file
    write TheClipboard to MyOpenFile
    close access MyOpenFile
    -- convert to HTML - see man textutil
    do shell script "cd /tmp/; textutil -convert html -excludedelements '(html, head, title, body, p, span, font)' -encoding US-ASCII " & TempFile & ".txt"
    -- strip the first line (<?xml ?>) and add the <pre>...</pre> wrapper
    set TheText to rest of (paragraphs of (read ("/tmp/" & TempFile & ".html" as POSIX file))) as text
    set TheText to "<pre title=\"this text can be pasted into the Script Editor\" style=\"font-family: Monaco, 'Courier New', Courier, monospace; font-size: 10px; padding: 5px; " & TheWidth & "color: #000000; background-color: #E0E0E0; overflow: auto\">" & TheText & "</pre>"
    set the clipboard to TheText
    display dialog ((count TheText) as text) & " characters placed on the clipboard" with title "Script Formatted" buttons {"OK"} default button "OK" giving up after 4
    on error ErrorMessage number ErrorNumber
    display alert "Error " & (ErrorNumber as string) message ErrorMessage as warning buttons {"OK"} default button "OK"
    end try</pre>

    Hello red_menace,
    Indeed a pre-processing code like yours is always an option for us, but from my point of view, the correct solution is for the discussions' admins to disable this meddlesome formatting feature of the new fora software.
    This new feature affects not only new posts but also the existing messages in the fora, that means it has rendered quite a few useful messages totally useless. This is actually serious data loss caused by the thoughtless software. And for what?
    After all, these discussions' boards are not chat rooms where people might want some simple input methods for fancy text formattings, but technical support fora where people frequently post programming codes, computer outputs and so forth that have many reserved symbols and notation.
    I really wish they may fix this promptly.
    Best regards,
    Hiroto

  • Suggest me to format code in this forum

    please tell me how to put my code in proper format..
    i tried
    my codebut not work

    just sample to format my code..please ignore
    SQL> ed
    Wrote file afiedt.buf
    1  declare
    2  t t1%rowtype;
    3  begin
    4  t.id:=1;
    5  t.fn:='john';
    6  t.sn:='sn';
    7  insert into t1 values t;
    8  commit;
    9* end;
    You're using PRE tags which works ok and allows you to include other formatting such as bold and italics etc. but it tends to remove blank lines. You can also use the CODE tags which will leave in the blank lines but you can't use other formatting within it.
    This has Pre tags and blank lines and as you can see
    it tends to remove blank lines
      from inside the codeWhereas...
    This has Code tags which
    will leave in the blank lines
    but won't allow other formatting

  • Code Formatting Instructions for Developer Forums

    Although this topic only applies to the two Developer forums, the need for some upfront code formatting instructions in those forums is desperate. There may be hundreds of threads which include one or more messages on this subject. In my case alone, I've posted at least a dozen messages each containing these three lines:
    Paste your code here.
    Of course a quick search of either Dev forum on the keys +code formatting+ will find the above right away, but those who need help the most don't know code requires special formatting so won't be making that search. For the same reason, neither the excellent instructions in the User Tips Library nor the pertinent threads in this forum are likely to be discovered before they're needed. The +Help & Terms of Use+ FAQ might seem to be a good place for the instructions, but this has been proposed so many times before I'm sure it will never happen. The need is confined to the Dev forums afterall.
    I think the solution would be a permanent post (similar to +How to Post a new Topic+ in this forum) at the top of both Dev forums. I don't think most developers want to see instructions on any other topic at the top of the forums, but a brief note titled +How to Post Code+ might make everyone's life easier.
    Assuming most of the other developers agree, how could we make this happen?

    Thanks so much for helping with this, Nubz!
    Joerg's instructions are excellent. I refer to them often and I've had them bookmarked since I found Apple Discussions last year. The new Code section is great!! Very clear!
    Now we just need to find a way to get users to that page. Our problem has never been with users who are interested enough in Apple Discussions to visit the Tips Library. The unformatted code is coming from first-time users--not necessarily novice coders, but programmers of all skill levels who aren't coming here to learn about the forums or relate to the community. These folks are focused on their current project, may have found no answers anywhere else, and arrive here with tunnel vision. Often there's a language problem as well.
    The newly arrived OP will often start the thread with a page of unformatted code. Those of us with eyes used to filling in the missing brackets, indentation etc. can sometimes decypher the mess, but usually we need to give formatting instructions and ask the OP to repost. The frequency of this scenario has been increasing. Lately I've been posting those instructions almost once every day.
    Of course that's a good sign! We've been giving good service down there and the number of newcomers seems to be reflecting that. A big percentage have turned into regulars, so I think we have a very healthy forum. It's just the formatting cycle gets old, and the time and bytes add up too.
    My suggestion is this:
    One yellow moderator announcement that stays in the first position on the topic page for both dev forums. The subject line is:
    To format code: Paste your code here
    The user doesn't even need to open the message. Only developers will see this. No change to the page header is needed. If the user does open the message, a link will be provided to Joerg's tips.
    - Ray

  • How to format code when posting in this forum

    This may have been discussed in earlier messages, but I haven't seen it.
    The engine that drives these forums accepts various tags. The one that can be used for preformatted text is the "pre" tag. Similar to html, you have the open and close above and below the preformatted text. The characters surrounding the tags are square brackets.
    In the sample below I have added a space between the tag and the closing ']', so that Jive doesn't interpret it. You would want to omit that space :)
    [pre ]
        some formatted
        text
            with multiple indents
        that don't get lost
        on posting
    [pre ]Which would come up as.
        some formatted
        text
            with multiple indents
        that don't get lost
        on posting--
    [email protected] Product Technical Support Engineer (APAC)

    Here is a link to the FAQ: How do I post formatted text?<p>The short answer is enclose it in either [ pre ] [ /pre ] or [ code ] [ /code ] tags (minus the spaces.
    HTH.

  • Off topic: posting XML/HTML in these forums

    How do you post XML to these forums? Encoding the < as > just gets interpreted as a literal, but using straight XML doesn't work because if there's overlap with HTML, the XML gets formatted as HTML. Here's an example -- if you have an XML tag called "s" (< s n a m e = " f o o " > b a r < / s > ), look what happens (because of the strikethrough HTML tag): <s name="foo">bar</s>.
    Sorry to post off-topic!
    Chris Bucchere | bdg | [email protected] | www.bdg-online.com

    Hello red_menace,
    Indeed a pre-processing code like yours is always an option for us, but from my point of view, the correct solution is for the discussions' admins to disable this meddlesome formatting feature of the new fora software.
    This new feature affects not only new posts but also the existing messages in the fora, that means it has rendered quite a few useful messages totally useless. This is actually serious data loss caused by the thoughtless software. And for what?
    After all, these discussions' boards are not chat rooms where people might want some simple input methods for fancy text formattings, but technical support fora where people frequently post programming codes, computer outputs and so forth that have many reserved symbols and notation.
    I really wish they may fix this promptly.
    Best regards,
    Hiroto

  • I used to champion these forums. Now I don't give a gnat's...

    I was a contributor, a corrector, a clarifier.
    I'd write 1,500 words explaining every possible angle on the simplest of topics, sometimes revealing tricks to people who have far more experience with Photoshop than I do. I exercised painstaking detail in choosing the proper terminology and phrasing when answering questions, and I'd test everything to make sure what I posted was correct. I was an obsessive re-editor of my posts if I noticed the wording was wrong, or didn't flow well. I'd craft screen shot composites so clean you couldn't tell they weren't monitor images that could occur natively. I added arrows, and numbering, and translucent, colored-box paragraph backgrounds for descriptors, colors chosen for the best clarity I could muster. I'd bodge together difficult GIF animations and QT Movies if it would help a user understand a concept more completely.
    I was a defender, a protector, an evangelist.
    I took it personally when newbies and spammers would come in and muck the place up. I was sometimes brusque, other times gentle in trying to bring people into line with how to get the most out of their time here. I beat up on troublemakers ruthlessly, and without remorse.
    I brought the "How to Get Help Quickly" mantra to this forum after reading it elsewhere, because it was the best exposition I'd ever seen on the subject of efficient information exchange.
    I'd take the time to help troubleshoot forum problems.
    Now, I don't give a crap about what happens to this place. I'd been hoping for the best, as I had during past attempts at major forum changes.
    It's clear to me now that the planning, preparation, roll-out and fine tuning has been doomed from the start.
    Every single person involved in ramming this new system through is to blame.
    And I'm only one person. I'd guess there are hundreds of people who feel the same way I do.
    Too bad, Adobe. You totally and completely screwed up.
    I'll still visit once in awhile, because there are people here that I like.
    But as for all that content I was giving away for free—and happily, I might add—and all the cheerleading I did for this place?
    You can shove all that right up that gnat's arse and then go sit on your own thumbs and spin.
    It feels to me like you are intentionally doing almost everything in your power to discourage the type of participation I used to revel in. From slow bug fixes and promises unkept (EFF you very much, Jive–shysters) to the mere trickle of ongoing feedback and update info offhandedly tossed to us, Adobe have become slumlords, slapping paint on a building that fails to meet standard-of-living code. Sure, there are some decent new features, but they either don't work, work only part of the time, are cumbersome, and generally regarded as so slow as to inhibit any sort of lively momentum.
    I'd be ashamed and embarrassed to be the captain of this rotting ship. As a fully vested, ranking mate on this vessel, I hereby resign my commission.
    You don't deserve my help anymore.

    Phos, although I am answering your opening message, I'm not really addressing this message to you, but to everyone.
    Almost exactly a month ago, I accepted the first important job I have been offered in more that two years. I did although it had a 30 days deadline and I knew it was very difficult, if not impossible, to complete it in that time. Well, I did manage to finish it not long ago, and one of the first things I did was to come back to my once beloved forums, full of hope of being met with some important changes introduced in these 30 days.
    I am sorry to say that, so far, I have noticed only these two changes:
    1. The "Report spam..." link in the stickies now points to the correct thread, not to a locked one, something I had been asking for weeks before this 30 days interlude; and
    2. The problem for which I offered a suggestion in this post
    http://forums.adobe.com/message/1968406#1968406
    and which had received a very good solution as I reported two days later, is back here. Plus, the "Next" button doesn't work (I don't remember if it worked before the change that was reverted).
    As this forum is full of so many easy to fix complaints, seeing only these two changes in 30 days -one of which can hardly be called an improvement- was really very discouraging. However, what really got me down was reading the opening post of this thread.
    Those who haven't followed Phos' trajectory in these forums may think that he is making false pretences, or at least exagerating, about his contributions to these forums. I am one of those who can testify that he is doing neither.
    To make it short: over these so many years trying to give whatever modest help I'm capable of in the Acrobat and Reader forums, I lost count of the times I asked Phos, somewhat jokingly, to please leave the easy questions for me to answer. Each time I saw a just published easy one, I rushed to try to answer it, only to find he had done a much better job than my attempt, and had replied a several other more recent questions in the meantime. He showed an infinite patience to answer the same questions over and over again, which I admired because I don't have it and just refered the questioner to the appropriate FAQ instead -when I did manage to post before he did.
    And he did everything else he writes in his OP, never boasting about what he did and accomplished. That's why I am sorry he had to do it now, I imagine that in an attempt to put some weight to his words. Not for us, of course, but for those responsible for this unbelievably large fiasco they have so stubbornly refused to acknowledge. And we used to call a fiasco the previous one, which was nothing compared with this mess, and which was rectified!
    I am afraid that I am feeling my age, and so I'm finding that the enormous effort that too many very capable users have being putting in suggestions to improve these new forums, since the last "little fiasco" until now, to be such an gigantic waste, that I also don't feel like continuing. Had I not had this 30 days interlude with no noticeable changes, I would probably have continued by inertia for much longer, hopefully waiting for the improvements that never come, but this has opened my eyes. However, just logging in, or moving from one forum to another, is so excruciatingly slow that I find I simply do not have enough time to waste in just waiting for things to happen.
    I will miss the group spirit of the old forums, and the many persons I got to know and like and care for, although knowing that I would never meet them. But then, I am missing more of them everyday and, after all, such is life.
    Just a final thought. It is most probably true that JC has spent this week in the moutains. I would be happy to be corrected if I'm wrong, but I would say his presence has hardly been noticed, if at all, for quite a lot longer than a week. Another one of those many not at all encouraging signs.

  • Problem with these forums

    I don't know that this is necessarily a Safari issue, but I wasn't sure where to post it. I've got an odd display problem on these forums. When I click the My Posts link, I see odd formatting problems if one of my posts included a link or a smiley in the first few lines. Take a look at the screen shot below for an example:
    !http://web.mac.com/thomasareed/forum_issue.png!
    If I look at the source for this, it looks like the href attribute for the link gets cut off and is not properly closed, meaning that everything until the width="1%" attribute on the td for the next post's number is lost.
    I've also noticed a couple times where one page of posts will end with a number like 28 and the next page picks up with 30, but where was 29? I suspect it's probably related to the above problem.
    Is anyone else seeing this? I find it hard to believe that Apple would have left a problem like this for as long as I've been seeing this, yet I am not sure what other possible explanations there could be. Any ideas? If it's a forum bug, how do I report that? I can't find any way.
    Thanks in advance!

    ali brown wrote:
    To check for activity, instead of My Posts, you can open Your Subscriptions, where Threads with new entries are marked with a .
    Well, the problem with that is that I don't want to subscribe to every thread I post to... I don't want to get e-mail notifications that the thread has been updated.
    And Thank You, for extending the courtesy, of awarding in  Discussions, as this is not a requirement, nor mandatory, but is much appreciated!
    LOL, no problem! I sometimes wonder how some of you guys have gotten up to level 4 and 5, given how infrequently people actually assign stars...

  • Kindly do not make these forums as only the game of points

    Hi all,
    Please stop mentioning commitments on the points as thread heading or as the part of threads.It sometimes mis guide the new persons in utilizing this forums.
    Even though every body interested to gain points, it does not mean that points is the only ultimate goal of these forums.
    And also think abt a while how threads on interview questions spiol the culture of the forums.
    With rgds,
    Anil Kumar Sharma .P

    This might be stretching the argument, but...
    In many cases, the answer 'original poster' wrote is not that original - it may be a code copy from his system which is his employer's IP (again weblogs containing slidesets used at customer site and then used in the blog on SDN comes to mind), a copy from SAP's documentation, a copy from OSS note and so on.
    If I really tell anyone "RSXXXX will get you the change log table name" as an answer, it might be a copy from another post, but really, do you think it was such an 'original' answer drafted by the original poster that an acknowledgement is necessary?
    An acknowledgement, where due, should be given I agree. But, many a times a URL opening something in another window (or same) for a two line answer is mere inconvenience for the questioner, compared to a cut-paste in the same thread. At least this is what is the decider for me. (If it is a small generic answer, just do a cut-paste, if it is a post where original thread needs to be acknowledged, mention the URL). In the end, your priority is to answer to help the questioner, why not make it easy by pasting it there in that thread? In the end, I would still think leaving it in poster's good-faith decision is the most practical option.
    In general, people gaming for points are not that successful (you and me have discussed at least one such poster on this board), and others on the board do figure out what they are up to. I know it stretches the moderator's work but this is the price SDN has to pay for success.
    As an example, if I ever quote Pizzaman's answer, I will mention the URL since he typically writes a well-formed descriptive answer and that effort needs to be appreciated, however if it is a two line code, I may paste it without bothering about mentioning the link.
    In the end, one needs to be somewhat detached with the points one gets, or not. We all evolve (initially the craving for points is more, and it subsides to a level later). At any point in time different SDNers are at different points on that evolution curve, thus causing such friction/debates.
    I take it philosophically, I know as a moderator you may not have that choice
    Apologies for too much free time (on my hand) causing such long posts (perils of on-the-bench life).

  • These Forums Make IE Navigation go SLOW

    I am not talking about going to new forum pages, or to a link in a page
    I am talking about navigation within IE itself
    When I first start IE (have to use Internet Explorer due to work support policy) I can click the Favorites link at the top and my list of saved links appears INSTANTLY
    As soon as I go to any of these Adobe forums, IE slows to a crawl and there is a noticeable lag between click on Favorites and the drop down list showing
    Whatever script is running at these Adobe forums is evidently taking up a LOT of computer cycles... enough to make IE's internal navigation run slow
    It is really too bad that the webx software could not keep up with the message volume and had to be replaced (per a FAQ note before the change)
    I really don't care (much) about the new format... but the scripting to MAKE that new format seems to be using up a lot of computer time

    Phos says much the same thing here http://forums.adobe.com/thread/426384?tstart=0
    For everything to work, scripting must be active
    With scripting active, the forum is SLOW
    Since that seems to just be part of what Jive is doing, I don't think these forums are ever going to get any faster

  • Has etiquette in these forums worsened? Or is it just me?

    Hey,
    So it's been about a year since I've been at these forums. I've been working on something non-java related for a while.
    But anyway, I was just browsing over the posts and noticed that the level of etiquette is lower than what it was.
    I'm seeing a lot more arguments or unrelated discussions going on in someone's question thread.
    I just read over a student post who posted a simple legitimate question about operator precedence. And the responses were so over-the-top arrogant. And then two posters started discussing and arguing over something completely unrelated on the OP's thread!
    I remember a year ago, that arrogance in these forums was VERY rare, and not tolerated by anyone. Under-researched questions or commonly asked questions were responded to with a link to a relevant page, or a few terms that the OP could look for. Nothing more was needed.
    And if the attitude of the OP doesn't appeal to someone, they just ignored it.
    Has it always been this bad? or is it just me?
    -Cuppo
    PS: And what happened to the Watercooler forum?

    I remember a year ago, that arrogance in these forums
    was VERY rare, and not tolerated by anyone.
    Under-researched questions or commonly asked
    questions were responded to with a link to a relevant
    page, or a few terms that the OP could look for.
    Nothing more was needed.
    And if the attitude of the OP doesn't appeal to
    someone, they just ignored it.
    I am sorry but you are wrong. This is not the way it was a year ago, or five years ago or eight years ago.
    Has it always been this bad? or is it just me?In some ways things are better. Less Goldie for one thing.
    In other ways things are worse. Look at this thread http://forum.java.sun.com/thread.jspa?threadID=5176699&start=0&tstart=0
    I would say it's fairly typical to have several of these a day.
    Here's another example from this week http://forum.java.sun.com/thread.jspa?threadID=5176013
    I mean. Come on. Vague questions. Lazy, lazy, lazy, lazy people with no clue seeking "teh codes". It's not surprising to me that there's off-topic chatter in some threads when this is the quality of so many of the questions.
    But it isn't just getting worse here, it's getting worse everywhere. More and more lazy nitwits think the answers to much of life's problems can be found for free on the internet without their having to work one iota to actually learn or do anything.
    -Cuppo
    PS: And what happened to the Watercooler forum?You've been gone longer than a year I guess. Sun axed the water cooler (aka the forum that shall not be named although the thought police are less active then they used to be) around 2002.

  • How to format code properly in Visual Studio 2013 express

    <li><img id="img5" class="sm-im" src="img/elephant.jpg" title="click to enlarge" /></li>
    <li><img id="img6" class="sm-im" src="img/crow.jpg" title="click to enlarge" /></li>
    <li><img id="img7" class="sm-im" src="img/catdog.jpg" title="click to enlarge" /></li>
    <li><img id="img8" class="sm-im" src="img/kangroo.jpg" title="click to enlarge" /></li>
    <li><img id="img9" class="sm-im" src="img/eagle.jpg" title="click to enlarge" /></li>
    http://i.imgur.com/wqVb0LI.png?1?2818
    How to format code properly in visual studio, like we can see that the initial <li> moreover img idand class are
    properly aligned and can be easily changed using click+alt, but the second highlighted portion (in brown ) is not aligned i.e. the closing </li> tags
    should be in one straight line. Moreover 'title' should be in one straight line. How to make that possible.

    Hi Nobele,
    Thank you for posting in MSDN forum.
    Since this forum is discuss the VS IDE issue, based on your issue, I’m afraid that it is not the correct forum for this issue.
    To help you find the correct forum to support this issue, could you please tell me which kind of app you create in VS IDE? Is it a web application in the VS?
    (1)If yes, I suggest you can ask this issue directly to the ASP.NET forum:http://forums.asp.net/ , maybe you will get better support.
    (2)If no, please tell me more detail message about the issue.
    Thanks for your understanding.
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Does Adobe ever look at these forums to try to solve problems which have been reported???

    Does Adobe ever look at these forums to try to solve problems which have been reported?  Doesn't seem like we are getting any answers, does it??

    I think the best idea is to contact the book publishers, let them know that Adobe Digital Editions is not capable of delivering their book to you, and ask in what other, more reliable formats they can provide it. 

  • Paste code on the forum

    Hi,
    This question is not related to this forum, per se, but many times I face difficulty in asking question where I need to paste some sample code on this forum. How to paste the code so that it gets formatted properly rather than just seeing unformatted code on the screen which makes it difficult to read? Any html tag to be used?
    Thanks

    check this for more format options:
    http://wikis.sun.com/display/Forums/Forums+FAQ
    Edited by: M.Jabr on Apr 6, 2011 1:36 AM

  • How do you post images in these forums

    I've been wondering for a while. How do you post like a screen shot on these forums (so I can better illustrate me questions.)

    Hi Caleb!
    How To Post Images In  Discussions
    Create a Screen Shot of the image you wish to post.
    Upload the image to an online storage facility, like one of these linked to below.
    Flickr
    ImageShack
    PhotoBucket
    Twango
    Then use HTML formatting, to insert the URL of the location.
    Use this format <img src="Insert URL Here">
    Keep the images small, and unobtrusive, when possible.
    You can also just post a Link/URL, to the image location, using this format:
    <a href="Insert URL Here">Type Title Here</a>
    Have Fun!
    ali b

Maybe you are looking for