&#39 everywhere

Discussion in 'Help, support & suggestions' started by Carson, Feb 2, 2012.

Welcome to the Speedsolving.com. You are currently viewing our boards as a guest which gives you limited access to join discussions and access our other features. By joining our free community of over 30,000 people, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us and we'll help you get started. We look forward to seeing you on the forums!

Already a member? Login to stop seeing this message.
  1. Carson

    Carson Premium Member

    I have been attempting to learn 4x4BLD, and have been reading through many old threads in the process. Many of these threads have this code, which I assume happened somewhere along the way when an update was made to the forum. I'm sure that manually fixing all of this would be time preventative, but was wondering if there was perhaps some batch type fix.

     
  2. aaronb

    aaronb Member

    424
    0
    Apr 23, 2011
    Maine, USA
    The same thing actually happened to me. Tried to learn 4x4 BLD (Eventually got lazy and quit) and that code was everywhere in old threads. Though I find it obvious that "&#39" equals an apostrophe. So the first line in your quote would become "D2 y'; RU'; R'; U'; RUR';F'; RUR'; R'; R'; FRy D2" I thought the problem was well known and that it was just a hassle to fix all those threads, so I never mentioned it.

    Thanks for making this thread though.
     
  3. Brest

    Brest Super Reconstructor Staff Member

    2,098
    24
    Sep 30, 2010
    WCA:
    2011STUA01
    YouTube:
    BrestCubing
    It actually includes the semicolon <'> and is HTML decimal for a standard apostrophe. I have manually edited a few of the old (useful) posts that I have come across with this formatting error; however some kind of 'batch fix' would be much less painstaking.
    Carson, which thread did you take that text from?

    Edit:
    Also: <!> ! <"> ?
     
    Last edited: Feb 2, 2012
  4. kirtpro

    kirtpro Member

    515
    0
    Nov 27, 2010
    Sydney, Australia
    WCA:
    2010PROT01
    YouTube:
    kirtpro
    Can't you just copy text into notepad, do Ctrl+H then replace the thing?
     
  5. antoineccantin

    antoineccantin Member

    5,470
    11
    Nov 8, 2010
    near Ottawa, Canada
    WCA:
    2010CANT02
    YouTube:
    antoineccantin
    You could also make an HTML document with the algs in it and view it on a browser.
     
  6. ben1996123

    ben1996123 Banned

    4,976
    1
    May 17, 2009
    Ponyville
    WCA:
    2009WHIT01
    YouTube:
    ben1996123
    I'm sure someone could make some sort of program or script or something to go through all the old threads and search for ' in a post and replace it with '.
     
  7. pjk

    pjk Administrator Staff Member

    5,652
    59
    Mar 13, 2006
    Bangkok, Thailand
    WCA:
    2007KELL02
    YouTube:
    pjkcards
    Any thread with these characters is way back from like 2007 when we moved from phpBB to vB. The character issue was tough to avoid, since I had to buy the database from the free host so that I could preserve all the old posts (and then there were some character incompatibilities). At the time, we had 30,000 posts on the forum, and I'd say only a few were affected to the extent where they needed to be heavily edited (and a lot were heavily edited over the years). It would be much easier to just fix these as we come across them. The best way would be to copy into notepad, do a find and replace, and then paste from notepad into the thread. If you come across some, post links here so the mods can make their way through them.
     
  8. qqwref

    qqwref Member

    7,823
    5
    Dec 18, 2007
    a <script> tag near you
    WCA:
    2006GOTT01
    YouTube:
    qqwref2
    How about something like
    UPDATE posts SET text = REPLACE(text, "'", "'")
     
  9. Brest

    Brest Super Reconstructor Staff Member

    2,098
    24
    Sep 30, 2010
    WCA:
    2011STUA01
    YouTube:
    BrestCubing
    This is what I have been doing.

    If this is what I think it is, I would like it to happen.
     
  10. Carson

    Carson Premium Member

    A post in dbeyer's thread: How To: Commutators for Big Cubes


    When needed, I have been using the copy/paste + find and replace trick. It's not a huge deal most of the time, but it becomes slightly more annoying when digging through many old posts at once.

    Edit: According to Google, there are 410 threads containing "&#39" in the forums, although one of those is this one. I'm sure greater than 300 of those threads or pointless though...
     
  11. Cheese11

    Cheese11 Member

    Ya I always get that on twitter.
     
  12. radmin

    radmin Member

    391
    0
    Feb 25, 2010
    Columbus, Ohio
    WCA:
    2010HARD02
    mySQL uses single quotes for strings so "'" would error out. But a correct version should be possible. I use MSSql so I'm not sure what the right way is on MySQL.

    It seems like there should be a way to tell the page to render those correctly, like by setting the character encoding in a meta tag or something.

    The original forum probably replaced ' with &#39 to prevent script injection.
     
    Last edited: Feb 2, 2012
  13. IanTheCuber

    IanTheCuber Member

    215
    0
    Oct 28, 2011
    In the clouds
    WCA:
    2013SCAH01
    YouTube:
    UCZVfZuvPSoBn3Ch2s2v
    I also found it at the beginning of the Algorithm thread.
     
  14. Litz

    Litz Member

    216
    0
    Dec 14, 2009
    Portugal
    That's not the point but I'm pretty sure it wouldn't error out. That script (with the appropriate table/column names obviously) should solve the problem in just a few minutes (if you use something like MySQL workbench you might have to disable safe updates but that's it).
     
  15. kirtpro

    kirtpro Member

    515
    0
    Nov 27, 2010
    Sydney, Australia
    WCA:
    2010PROT01
    YouTube:
    kirtpro
    Sorry, thought you meant by 'manual' you had been doing 'backspace backspace backspace, apostrophe'
     
  16. Brest

    Brest Super Reconstructor Staff Member

    2,098
    24
    Sep 30, 2010
    WCA:
    2011STUA01
    YouTube:
    BrestCubing
    Fixed.

    Please post a link in this thread to any other useful posts with a similar problem.
     
  17. Sahid Velji

    Sahid Velji Member

    499
    0
    Jul 5, 2009
    WCA:
    2008VELJ01
    YouTube:
    sv00013
    This thread might have some useful information at the beginning.
     
  18. pjk

    pjk Administrator Staff Member

    5,652
    59
    Mar 13, 2006
    Bangkok, Thailand
    WCA:
    2007KELL02
    YouTube:
    pjkcards
    Yeah, that is much easier now that I see a lot more threads were affected than I suspected.

    I'll do this sometime this week.
     
  19. FatBoyXPC

    FatBoyXPC Member

    1,794
    0
    Nov 28, 2009
    WCA:
    2010LACH01
    YouTube:
    fatboyxpc
    Don't forget to put the site down for maintenance or something if the posts table is MyISAM. Writing to the MyISAM table locks the whole table I believe, whereas InnoDB will only lock the respective row.

    In any case, if this is also a problem with other characters, you could also just find php scripts that format the text for display, and throw an html_entity_decode() around the output text. That should fix it for all the characters, whereas doing this update will only do this specific character.
     
  20. pjk

    pjk Administrator Staff Member

    5,652
    59
    Mar 13, 2006
    Bangkok, Thailand
    WCA:
    2007KELL02
    YouTube:
    pjkcards
    Of course it will go down for a bit. The database is pretty massive. As for other characters, I will deal with those separately as problems arise. This character is the biggest problem because it is part of so many algs. Cheers for the suggestions.
     

Share This Page