Website Design Hell

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hi19hi19
    lol happy
    FFR Simfile Author
    • Oct 2005
    • 12194

    #16
    Re: Website Design Hell

    Day 2:

    So I open up one of the existing pages to see if I can salvage any code. To my surprise the raw code is LITERALLY 10,000 lines long. Apparently whoever coded it decided putting 100 lines of blank space between each line of code was a great idea. Because you know that makes it more readable or something.

    I have heard of a solution to this, I can just use find/replace with a regular expression to find all the line breaks and replace with \n!
    WRONG.

    The blank space is not actual line breaks, it's spaces. From the spacebar. Good old &# 32;
    Which means somehow between each line of code is 100 lines worth of holding down the spacebar.

    Yeah I don't know either.
    Last edited by hi19hi19; 02-14-2013, 08:41 AM.


    Comment

    • Mollocephalus
      Custom User Title
      • Jul 2009
      • 2608

      #17
      Re: Website Design Hell

      I'm not even into programming and i laughed my ass off imagining this person holding the spacebar for minutes... it's like those people who write "letter - space - letter - space - letter - space" cause they want their text to be wider

      Comment

      • Coolboyrulez0
        VICES
        FFR Simfile Author
        FFR Music Producer
        • Aug 2006
        • 10042

        #18
        Re: Website Design Hell

        Originally posted by hi19hi19
        Day 2:

        So I open up one of the existing pages to see if I can salvage any code. To my surprise the raw code is LITERALLY 10,000 lines long. Apparently whoever coded it decided putting 100 lines of blank space between each line of code was a great idea. Because you know that makes it more readable or something.

        I have heard of a solution to this, I can just use find/replace with a regular expression to find all the line breaks and replace with \n!
        WRONG.

        The blank space is not actual line breaks, it's spaces. From the spacebar. Good old &# 32;
        Which means somehow between each line of code is 100 lines worth of holding down the spacebar.

        Yeah I don't know either.
        I can't breathe. Please keep a daily log of this because this is absolutely golden.
        https://soundcloud.com/cbrbreakcore
        https://cbrrecords.bandcamp.com/

        Comment

        • gold stinger
          Signature Extraordinare~~
          Event Staff
          Game Manager
          FFR Simfile Author
          FFR Music Producer
          • Jan 2007
          • 6428

          #19
          Re: Website Design Hell

          golden man just golden

          would probably take less time to make World Tour using just the .sm file and a notepad.
          Originally posted by YoshL
          butts.



          - Tosh 2014






          Comment

          • Reincarnate
            x'); DROP TABLE FFR;--
            • Nov 2010
            • 6332

            #20
            Re: Website Design Hell

            I hope you didn't fix that problem manually, hi19hi19 -- that can still be automated easy

            Comment

            • hi19hi19
              lol happy
              FFR Simfile Author
              • Oct 2005
              • 12194

              #21
              Re: Website Design Hell

              Originally posted by Reincarnate
              I hope you didn't fix that problem manually, hi19hi19 -- that can still be automated easy
              Oh? Teach me. The only way I could think of also got rid of spaces in between the actual code too...

              But no I found a copy of the page in a different folder (lol) that had no extra lines. It had no indentation in the code (also lol) but that took like 4 minutes to fix manually instead of 4 days.
              Last edited by hi19hi19; 02-14-2013, 12:14 PM.


              Comment

              • UserNameGoesHere
                FFR Veteran
                • May 2008
                • 1114

                #22
                Re: Website Design Hell

                Originally posted by hi19hi19
                Oh? Teach me. The only way I could think of also got rid of spaces in between the actual code too...

                But no I found a copy of the page in a different folder (lol) that had no extra lines. It had no indentation in the code (also lol) but that took like 4 minutes to fix manually instead of 4 days.
                If you have access to a UNIX-like environment, from a command shell type prompt, do
                Code:
                sed -e 's/  \+/ /g' bad.html > good.html
                It is assumed bad.html is the name of the original too many spaces HTML file and you want extra spaces stripped down to just a single space. good.html will be the same except have this spaces problem fixed.

                You have no idea how batty I went trying to get that to work because apparently I had to "escape" the + modifier because I guess the shell was interpreting it before passing it to sed ... or something. I'm like why won't this work? It's a simple substitution .. lol. ...Then I'm like hmm let me try escaping the + ... BAM worked.
                There are two spaces after the s/ and one space before the /g

                --edit--

                If, instead, you wish to convert all instances of too many spaces into newlines (for example, there are only tons of spaces where newlines should be but not elsewhere) then do this instead
                Code:
                sed -e 's/  \+/\n/g' bad.html > good.html
                --edit2--

                And if you're editing the file on multiple machines/environments it's possible the line endings can get pretty strange. If that happens, any decent text editor should be able to fix this for you (You need one which lets you select between Windows, Linux, and Mac line ending types .. choose to convert all to, say, Windows line ending format) and save the file.
                Last edited by UserNameGoesHere; 02-14-2013, 02:03 PM.
                Originally posted by Crashfan3
                Man, what would we do without bored rednecks?

                Comment

                Working...