Thread: Code Formatter/Colorizer for the Board

  1. #1
    Magically delicious LuckY's Avatar
    Join Date
    Oct 2001
    Posts
    856

    Code Formatter/Colorizer for the Board

    It is very obvious to anyone who has been within walking distance of this board that more people do not use code tags than you can shake a stick at. Anyway, after noticing that a few people like to be sort of flashy by coloring up their code blocks, I figured it might be a kick to write a program to automate it. So, without further ado, here's my nifty little program "CodeFmt.exe". Just drop your *.cpp on it or run it from the command line if you're old fashioned. After it parses your file, the colored/code-blocked source will be on your clipboard. Just head on over to cboard.cprogramming.com and paste it on in.

    Please give it a try and tell me what you think or if you find any insects. I wrote it in about an hour, so there might be something I missed (like keywords or some such thing). Thanks.
    Last edited by LuckY; 12-23-2004 at 12:59 PM.

  2. #2
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    I'm gonna tell you the same thing I tell everyone who posts an executable:

    Post the source. Sorry its not that I don't trust you, its that I don't trust anyone

  3. #3
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    Yea i think that it should be a forum rule honestly, it lessens the chance of us running something that will compromise our system.

  4. #4
    yes, I'm registered!!! algi's Avatar
    Join Date
    Nov 2004
    Location
    Ipswich
    Posts
    161
    Trust everyone, just don't trust the devil inside them
    I got that off some movie
    I started out with nothing and I still have most of it left.

  5. #5
    Magically delicious LuckY's Avatar
    Join Date
    Oct 2001
    Posts
    856
    You have clearly treaded well into the realm of the severely overdramatic, Thantos, but to your credit, you have at the very least successfully managed to induce one other onto your bandwagon.

  6. #6
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    What is overdramatic about asking for the source? There are a couple good reasons:
    1) You computer could be infected and this executable is infected
    2) You haven't stated which platform you compiled it on. Not everyone here runs windows or your flavor of linux.
    3) I don't know you. While I don't suspect you'd post a malicious program its not outside the realm of possiblities.
    4) No one learns from an executable. This site's main purpose is learning.

  7. #7
    Mayor of Awesometown Govtcheez's Avatar
    Join Date
    Aug 2001
    Location
    MI
    Posts
    8,823
    Quote Originally Posted by LuckY
    You have clearly treaded well into the realm of the severely overdramatic, Thantos, but to your credit, you have at the very least successfully managed to induce one other onto your bandwagon.
    With all the wannabe script kiddies here, why would anyone download any executable without the source to back it up? Get off your high horse.

  8. #8
    Registered User
    Join Date
    Sep 2004
    Posts
    719
    Quote Originally Posted by Govtcheez
    With all the wannabe script kiddies here, why would anyone download any executable without the source to back it up? Get off your high horse.
    ...but then still, you don't know that the source matches the executable
    i seem to have GCC 3.3.4
    But how do i start it?
    I dont have a menu for it or anything.

  9. #9
    UT2004 Addict Kleid-0's Avatar
    Join Date
    Dec 2004
    Posts
    656
    Quote Originally Posted by misplaced
    ...but then still, you don't know that the source matches the executable
    Well, if there's no executable in the first place, then there's no reason to match. Executables == bad :(. Source == good :).

  10. #10
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    There are already code formatters for vBulletin out there. I have a program called Syntax Highlighter which monitors the clipboard for C++ code and automatically parses it.
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  11. #11
    Mayor of Awesometown Govtcheez's Avatar
    Join Date
    Aug 2001
    Location
    MI
    Posts
    8,823
    Quote Originally Posted by misplaced
    ...but then still, you don't know that the source matches the executable
    You do if you compile the source yourself

  12. #12
    Magically delicious LuckY's Avatar
    Join Date
    Oct 2001
    Posts
    856
    Quote Originally Posted by Thantos
    What is overdramatic about asking for the source? There are a couple good reasons:
    1) You computer could be infected and this executable is infected
    2) You haven't stated which platform you compiled it on. Not everyone here runs windows or your flavor of linux.
    3) I don't know you. While I don't suspect you'd post a malicious program its not outside the realm of possiblities.
    4) No one learns from an executable. This site's main purpose is learning.
    What I'm calling overdramatic is that your implication is that you refuse to download any executable and that you are only willing to accept source code on your computer. There are executables that you could download from anywhere. Is it your intention to never trust any application, allowing only applications you compile or purchase on a CD-ROM into your inner circle of trust? I'm not saying you should go around running every executable you come across, but to say that you "don't trust anyone" can easily be considered paranoic. There may be some good reasons that you ask for source code, but you were less asking for source and more explaining your fear that I might have uploaded a virus-ridden or just generally malicious application.

    Quote Originally Posted by Govtcheez
    With all the wannabe script kiddies here, why would anyone download any executable without the source to back it up?
    To reiterate the aforementioned statement, I was simply asking for some input on it's operation. I think it is quite obvious that I am not a "script kiddy," and it is very evident in many cases, especially considering the years one spends on this board, who might not be trustworthy.

    Quote Originally Posted by Govtcheez
    Get off your high horse.
    Good one. I'm on a high horse for saying it's overdramatic to be afraid of every executable that hasn't come through your compiler?

    Quote Originally Posted by Sang-drax
    There are already code formatters for vBulletin out there. I have a program called Syntax Highlighter which monitors the clipboard for C++ code and automatically parses it.
    That sounds like a very interesting application. To be clear, I did not go out searching for existing software, nor was it my intention to come up with something profoundly original. I just had the idea to write it and went for it and was simply asking for feedback. As an aside, I'm glad to see that you of all people, who has probably downloaded my work more than anyone else on this board, are not as frightened as Thantos of my applications.

  13. #13
    Mayor of Awesometown Govtcheez's Avatar
    Join Date
    Aug 2001
    Location
    MI
    Posts
    8,823
    > Good one. I'm on a high horse for saying it's overdramatic to be afraid of every executable that hasn't come through your compiler?

    The way you're saying it, you really come off that way, yeah. "Pish, 'twould be nonsensical for one to even begin to presume that such as I would compose a program that would harm another user! Poppycock!"

    [keep it civil]

  14. #14
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    Where did I imply that I won't download executables from anywhere? Since I used the word post, I implied this board. I don't trust anyone (salem, webmaster, prelude, kermi, etc included) at this board well enough to blindly execute a program.

    The reason I posted that line was so you wouldn't feel I was singling you out.

  15. #15
    Lead Moderator kermi3's Avatar
    Join Date
    Aug 1998
    Posts
    2,595
    Ok, flame war, nothing constructive here. Thanks for the suggestion on the code formatter Sang - if you have a link I'd love to see it.

    Everyone on this thread is an old hat to the boards. I'm not going to close the thread, I'm close. You are all respectful people and I don't think it needs to be done. But I am going to ask you to please maintain a reasonable level of curtisy and avoid name calling and other types of flaming that are atypical for longtime posters like yourselves.

    Thank you,
    Kermi3
    Kermi3

    If you're new to the boards, welcome and reading this will help you get started.
    Information on code tags may be found here

    - Sandlot is the highest form of sport.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem : Threads WILL NOT DIE!!
    By hanhao in forum C++ Programming
    Replies: 2
    Last Post: 04-16-2004, 01:37 PM
  2. True ASM vs. Fake ASM ????
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 04-02-2003, 04:28 AM
  3. Seems like correct code, but results are not right...
    By OmniMirror in forum C Programming
    Replies: 4
    Last Post: 02-13-2003, 01:33 PM
  4. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM
  5. Shouldn't either HTML or vB code be enabled in the C++ Board?
    By SilentStrike in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 08-13-2001, 07:30 AM