This discussion is archived
1 2 Previous Next 25 Replies Latest reply: Nov 30, 2013 8:45 AM by Dude! Go to original post RSS
  • 15. Re: Why is it still so hard to format CODE as CODE?
    EdStevens Guru
    Currently Being Moderated

    moniquevdb_oracle wrote:

     

    The reason Sonya hasn't been around is that she is on a medical leave of absence. This is also why we are short-staffed at the moment. Feel free to @ me if you feel there's something I need to be made aware of, and I will do my best to keep you proactively updated in her absence. And yes, we are working on the Jive 7 upgrade, along with a lot of other behind-the-scenes features and projects. I will post an update for everyone within the next week or so and try to keep the lines of communication open.

    thanks for the update -- in general and specifically about Sonya.  I think a lot of people were starting to suspect nefarious corporate reasons for he sudden lack of involvement and the cessation of what used to be her regular updates.

  • 16. Re: Why is it still so hard to format CODE as CODE?
    BluShadow Guru Moderator
    Currently Being Moderated

    The moderators were aware, but it would not have been appropriate for us to mention it, whereas Monique is.

    Hopefully Sonya will return in the near future, and I'm sure we all wish her a speedy recovery.

  • 17. Re: Why is it still so hard to format CODE as CODE?
    Dude! Guru
    Currently Being Moderated

    Yes, speedy recovery! For what it’s worth, according to research studies, women are 14 % less likely to die than men with equivalent wounds.

  • 18. Re: Why is it still so hard to format CODE as CODE?
    Barbara Boehmer Oracle ACE
    Currently Being Moderated

    Andrew,

     

     

    I have been following the advice of "SomeoneElse" in the following thread with satisfactory results.

     

    preserving code formatting

     

     

    "For now, I go into the Advanced Editor, paste the code, then highlight it and change the font to Courier New.

    That at least changes it to a fixed width font and looks kinda code-ish."

     

     

    Regards,

    Barbara

  • 19. Re: Why is it still so hard to format CODE as CODE?
    EdStevens Guru
    Currently Being Moderated

    BluShadow wrote:

     

    The moderators were aware, but it would not have been appropriate for us to mention it, whereas Monique is.

    Hopefully Sonya will return in the near future, and I'm sure we all wish her a speedy recovery.

    +1

  • 20. Re: Why is it still so hard to format CODE as CODE?
    EdStevens Guru
    Currently Being Moderated

    BarbaraBoehmer wrote:

     

    Andrew,

     

     

    I have been following the advice of "SomeoneElse" in the following thread with satisfactory results.

     

    preserving code formatting

     

     

    "For now, I go into the Advanced Editor, paste the code, then highlight it and change the font to Courier New.

    That at least changes it to a fixed width font and looks kinda code-ish."

     

     

    Regards,

    Barbara

    That's been my practice as well.  I also like to indent the code block, just to help set it off from non-code.  And I'm now starting to change the color as well.

  • 21. Re: Why is it still so hard to format CODE as CODE?
    BluShadow Guru Moderator
    Currently Being Moderated

    I've been doing the same, though I'm tempted to knock up a function/procedure on my database to generate me the necessary HTML for whatever code I want to paste, so it appears like this (based on something Dude! was doing some months back)...

     

    SQL*Plus (Oracle v11.2.0.3)

    SQL> with t as (select '(({A}&{B})||({C}||{D})&({E}||({F}&{G})))' as exp from dual)
      2  --
      3      ,e(exp, l, v, rn) as
      4        (select exp, 0, cast(null as varchar2(3)) as v, 0 as rn from t
      5         union all
      6         select case when substr(e.exp, 1, 1) = '{' then substr(e.exp,4)
      7                     when substr(e.exp, 1, 1) = '|' then substr(e.exp,3)
      8                else substr(e.exp,2)
      9                end as exp
    10               ,case when substr(e.exp, 1, 1) = '(' then e.l+1
    11                     when e.v = ')' then e.l-1
    12                else e.l
    13                end as l
    14               ,case when substr(e.exp, 1, 1) = '{' then substr(e.exp,1,3)
    15                     when substr(e.exp, 1, 1) = '|' then substr(e.exp,1,2)
    16                else substr(e.exp,1,1)
    17                end as v
    18               ,e.rn+1 as rn
    19         from   e
    20         where  e.exp is not null
    21        )
    22     ,j(rn, lvl, v, start_l) as
    23       (select rn as xrn, l as xl, v, 1 as start_l from e where v = '('
    24        union all
    25        select e.rn
    26              ,e.l
    27              ,cast(j.v as varchar2(100))||e.v as v
    28              ,case when e.v = '(' then j.start_l + 1
    29                    when e.v = ')' then j.start_l - 1
    30               else j.start_l
    31               end as start_l
    32        from   e join j on (e.rn = j.rn+1)
    33        where  j.start_l > 0 or (j.start_l = 0 and j.v = '(')
    34       ) search depth first by rn set seq
    35  select lvl, v
    36  from j
    37  where start_l = 0
    38  ;

           LVL V
    ---------- ----------------------------------------
             1 (({A}&{B})||({C}||{D})&({E}||({F}&{G})))
             2 ({A}&{B})
             2 ({C}||{D})
             2 ({E}||({F}&{G}))
             3 ({F}&{G})

     

    Though obviously this makes it a little trickier as you have to use the HTML editor rather than the wysiwig(?) editor, but it does have the advantage that it can be copy/pasted back from the forum to a code editor without inserting blank lines.

  • 22. Re: Why is it still so hard to format CODE as CODE?
    Dude! Guru
    Currently Being Moderated

    The white on black text has the advantage that the reader might immediately realize that this is a terminal. But some HTML aware applications, like MS Word, for instance, copy the white text attribute, but not necessarily the background.

     

     

    The double-line spacing issue is a real problem. The only way to work around it seems to use SHIFT-RETURN at the line endings, which is a huge inconvenience, because you cannot simply copy code into the Jive editor window without correcting each line. Lines look ok in the browser, but not when you copy it out, unless you use a browser like Safari, which is otherwise the most incompatible with the Jive editor.

     

     

    Please see here: https://forums.oracle.com/message/11179213

     

     

    Furthermore, the line numbers that are inserted when using Jive code highlighting can be useful, but the numbers get selected when copying the text unless you use a compatible browser, which makes it useless again.

     

    Not using any sort of code tag could perhaps be a future problem with the next forum upgrade. Apparently a Jive 7 upgrade is already in the works. The migration of data in the last upgrade was very stupid and did not realize <pre> tags, headers, and all text attributes. I have seen a lot of old posts, with > and + signs, pre tags, even code tags and and parameters that required double hyphen, e.g. java --version, which now appear as strike through. A lot of previous content has been rendered useless and destroyed.

  • 23. Re: Why is it still so hard to format CODE as CODE?
    moniquevdb-oracle Guru Moderator
    Currently Being Moderated

    I wasn't around for the last upgrade, but I'm involved in this one, and I hear you guys about the editor and the issue of code formatting (and losing that formatting when migrating data). It is absolutely on my radar as a priority for Jive 7.

     

    And I will pass your well-wishes on to Sonya. We hope to have her back in the spring.

  • 24. Re: Why is it still so hard to format CODE as CODE?
    BluShadow Guru Moderator
    Currently Being Moderated

    Dude! wrote:

     

    The white on black text has the advantage that the reader might immediately realize that this is a terminal. But some HTML aware applications, like MS Word, for instance, copy the white text attribute, but not necessarily the background.

     

     

     

     

    a) I've just copy/pasted what I posted above into Word and it pasted the text ok, black on white as I'd expect.

    b) I wouldn't consider Word an appropriate tool to be using for code editing, so it's the last thing I would be copy/pasting code into, there are far better code editors to use.... (even notepad is better LOL!)

  • 25. Re: Why is it still so hard to format CODE as CODE?
    Dude! Guru
    Currently Being Moderated

    I'm using OS X and it generally retains the source formatting between applications. For plain text it is often annoying, but sometimes it is useful. I don't use MS Word for programming either. However, whether it keeps the source formatting depends on your version of MS Office and settings. You may have to select a special paste option in the menu to keep the source formatting.

     

    When I copy text from the forum window and paste it into TextEdit it appears at a tiny size including all text attributes. The only way around is to select "Make Plain Text" from the menu, which applies a default font I can specify. When I copy text back into the forum editor I have to use the "normalize" button in the advanced editor. Unfortunately there is no one size fits all solution. With all the high resolution displays text gets smaller and smaller. Size 12 pt is barely readable. I have to get used to press CMD+ to zoom and increase the text sizes.

1 2 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points