# The Gaming Den

Welcome to the Gaming Den.

Skip to content

## Wednesday night maintenance

Practice posts and questions about the boards. The registration code for this board is 'Th3G@m|ngD3n' (Note the use of numbers and symbols!)

Moderator: Moderators

Post Reply

- Print view

21 posts • Page 1 of 1

Zherog
  Knight-Baron
  Posts: 907
  Joined: Fri Mar 07, 2008 7:54 pm

### Wednesday night maintenance

- Quote

Post by Zherog » Mon Jul 28, 2014 2:03 am

Nockermensch was kind enough to take a look at the code that writes posts to the database, and he believes he was able to correct the ever-annoying bug that causes missing quote tags to fuck up the format of the entire page. The code looks solid to me, but unfortunately I'm going to have to experiment with it in "production" to verify it works. So...
Wednesday around 10pm EDT I'm going to install the new code, and then run a test or two. If things go to hell in a handbasket quickly I'll undo the changes and revert to the prior version as quickly as possible. If things seem to be OK after I install the new code, I intend to leave it in place, and I'll keep checking in every few minutes over the next couple hours after that to make sure nobody else ran into weird trouble.
If somebody encounters any sort of error while making or editing a post after 10pm Wednesday, please include as much detail as possible here. Also, please do not attempt to verify the bug is fixed right away - if something is wrong, I'll find it quick enough after installing, and having everybody submit a "bad" post just to verify it's fixed won't be good if there's something else wrong.
Thank in advance for your patience on Wednesday evening.
You can't fix stupid.
"A life is not important except in the impact it has on other lives." ~ Jackie Robinson
Top

Zherog
  Knight-Baron
  Posts: 907
  Joined: Fri Mar 07, 2008 7:54 pm

###

- Quote

Post by Zherog » Thu Jul 31, 2014 2:07 am

test post #1
You can't fix stupid.
"A life is not important except in the impact it has on other lives." ~ Jackie Robinson
Top

Zherog
  Knight-Baron
  Posts: 907
  Joined: Fri Mar 07, 2008 7:54 pm

###

- Quote

Post by Zherog » Thu Jul 31, 2014 2:08 am

> And this post is being submitted with a broken close-quote tag on purpose
> [/quote
> And we'll see what happens...

Last edited by Zherog on Thu Jul 31, 2014 2:10 am, edited 1 time in total.
You can't fix stupid.
"A life is not important except in the impact it has on other lives." ~ Jackie Robinson
Top

Zherog
  Knight-Baron
  Posts: 907
  Joined: Fri Mar 07, 2008 7:54 pm

###

- Quote

Post by Zherog » Thu Jul 31, 2014 2:09 am

And... that looks about right.
So, the code is pretty simple overall. If there are more open tags than close tags, it simply adds close tags until there are the same number of each. It does this right before submitting the post to the database. I'll do a few more tests, and I'll be around for about an hour or so. If anybody runs into an issue while posting, please let me know here.
You can't fix stupid.
"A life is not important except in the impact it has on other lives." ~ Jackie Robinson
Top

Sam
  Journeyman
  Posts: 111
  Joined: Mon Jul 14, 2014 2:37 am

###

- Quote

Post by Sam » Thu Jul 31, 2014 2:25 am

> Quick test.

Last edited by Sam on Thu Jul 31, 2014 2:31 am, edited 1 time in total.
Top

Zherog
  Knight-Baron
  Posts: 907
  Joined: Fri Mar 07, 2008 7:54 pm

###

- Quote

Post by Zherog » Thu Jul 31, 2014 2:32 am

So... looks like the code only fixes when there are more open tags than close tags. So, improvement but not perfect. I should be able to tweak the fix to cover both scenarios, but not tonight - my mind is too much goo to concentrate tonight.
You can't fix stupid.
"A life is not important except in the impact it has on other lives." ~ Jackie Robinson
Top

fbmf
  The Great Fence Builder
  Posts: 2588
  Joined: Fri Mar 07, 2008 7:54 pm

###

- Quote

Post by fbmf » Thu Jul 31, 2014 2:06 pm

We appreciate it, Z.
[/The Great Fence Builder Speaks]
Top

Zherog
  Knight-Baron
  Posts: 907
  Joined: Fri Mar 07, 2008 7:54 pm

###

- Quote

Post by Zherog » Thu Jul 31, 2014 2:09 pm

Props to nockermensch too. He took the initiative to fix the code.
You can't fix stupid.
"A life is not important except in the impact it has on other lives." ~ Jackie Robinson
Top

Maj
  Prince
  Posts: 4705
  Joined: Fri Mar 07, 2008 7:54 pm
  Location: Shelton, Washington, USA

###

- Quote

Post by Maj » Thu Jul 31, 2014 4:24 pm

Thank you, you guys!
My son makes me laugh. Maybe he'll make you laugh, too.
Top

Zherog
  Knight-Baron
  Posts: 907
  Joined: Fri Mar 07, 2008 7:54 pm

###

- Quote

Post by Zherog » Fri Aug 01, 2014 3:45 am

more testing
You can't fix stupid.
"A life is not important except in the impact it has on other lives." ~ Jackie Robinson
Top

Zherog
  Knight-Baron
  Posts: 907
  Joined: Fri Mar 07, 2008 7:54 pm

###

- Quote

Post by Zherog » Fri Aug 01, 2014 3:45 am

> and some more

You can't fix stupid.
"A life is not important except in the impact it has on other lives." ~ Jackie Robinson
Top

Zherog
  Knight-Baron
  Posts: 907
  Joined: Fri Mar 07, 2008 7:54 pm

###

- Quote

Post by Zherog » Fri Aug 01, 2014 3:46 am

> and one more

You can't fix stupid.
"A life is not important except in the impact it has on other lives." ~ Jackie Robinson
Top

Zherog
  Knight-Baron
  Posts: 907
  Joined: Fri Mar 07, 2008 7:54 pm

###

- Quote

Post by Zherog » Fri Aug 01, 2014 3:47 am

OK, I believe the code will now correct the post regardless of whether the tag is missing at the beginning or the end.
As with yesterday, if anybody sees anything weird please post here. I'll be online for the next 30 minutes to an hour, and I'll make a point to refresh in the morning as well.
You can't fix stupid.
"A life is not important except in the impact it has on other lives." ~ Jackie Robinson
Top

TiaC
  Knight-Baron
  Posts: 968
  Joined: Thu Jun 20, 2013 7:09 am

###

- Quote

Post by TiaC » Fri Aug 01, 2014 4:11 am

Thanks Z!

> virgil wrote:Lovecraft didn't later add a love triangle between Dagon, Chtulhu, & the Colour-Out-of-Space; only to have it broken up through cyber-bullying by the King in Yellow.

> FrankTrollman wrote:If your enemy is fucking Gravity, are you helping or hindering it by putting things on high shelves? I don't fucking know! That's not even a thing. Your enemy can't be Gravity, because that's stupid.

Top

ACOS
  Knight
  Posts: 452
  Joined: Thu Apr 03, 2014 4:15 pm

###

- Quote

Post by ACOS » Fri Aug 01, 2014 4:33 am

It appears that when quoting, shit goes haywire when you actually have the quoted person's name in the tag, e.g., <quote="ACOS">, as opposed to just <quote>
I hit "preview", and everything is fine; but when I submit, it gratuitously adds two more open quote tags at the beginning.
I played around a bit with variations I've seen on other boards, but nothing helped but to just make it a generic quote tag.
"Civilized men are more discourteous than savages because they know they can be impolite without having their skulls split, as a general thing."
- Robert E. Howard
Top

Username17
  Serious Badass
  Posts: 29894
  Joined: Fri Mar 07, 2008 7:54 pm

###

- Quote

Post by Username17 » Fri Aug 01, 2014 5:10 am

> ACOS wrote:It appears that when quoting, shit goes haywire when you actually have the quoted person's name in the tag, e.g., <quote="ACOS">, as opposed to just <quote>
> I hit "preview", and everything is fine; but when I submit, it gratuitously adds two more open quote tags at the beginning.
> I played around a bit with variations I've seen on other boards, but nothing helped but to just make it a generic quote tag.

Yes this. It seems to interpret attributed quote tags as missing quote tags and then "fix them" for you by adding in additional open quote tags to the beginning of the post, which makes everything fucked.
-Username17
Last edited by Username17 on Fri Aug 01, 2014 10:58 am, edited 3 times in total.
Top

Username17
  Serious Badass
  Posts: 29894
  Joined: Fri Mar 07, 2008 7:54 pm

###

- Quote

Post by Username17 » Fri Aug 01, 2014 5:20 am

Even if you remove the "" in the attributed quotes, it's still fucked.
Even if you add your own attributed quotes in by hand, it's still fucked.
Attributed quotes are just fucked.
-Username17
Last edited by Username17 on Fri Aug 01, 2014 5:22 am, edited 2 times in total.
Top

nockermensch
  Duke
  Posts: 1896
  Joined: Fri Jan 06, 2012 1:11 pm
  Location: Rio: the Janeiro

###

- Quote

Post by nockermensch » Fri Aug 01, 2014 6:46 am

What's causing this is the code looking for just [ quote] and not the much more common [ quote="whatever"]. I mailed Zherog a fix for that.
@ @ Nockermensch

> Koumei wrote:After all, in Firefox you keep tabs in your browser, but in SovietPutin's Russia, browser keeps tabs on you.

> Mord wrote:Chromatic Wolves are massively under-CRed. Its "Dood to stone" spell-like is a TPK waiting to happen if you run into it before anyone in the party has Dance of Sack or Shield of Farts.

Top

Zherog
  Knight-Baron
  Posts: 907
  Joined: Fri Mar 07, 2008 7:54 pm

###

- Quote

Post by Zherog » Fri Aug 01, 2014 11:00 am

I've removed the code that adds the open quotes; the fix from nocker didn't seem to resolve it, and I don't have the time or brainpower at the moment to debug and figure it out completely.
I'll play with it some more tonight. But in the meantime the code to add closing tags is still in place.
You can't fix stupid.
"A life is not important except in the impact it has on other lives." ~ Jackie Robinson
Top

Zherog
  Knight-Baron
  Posts: 907
  Joined: Fri Mar 07, 2008 7:54 pm

###

- Quote

Post by Zherog » Fri Aug 01, 2014 11:00 am

> testing

Last edited by Zherog on Fri Aug 01, 2014 11:02 am, edited 2 times in total.
You can't fix stupid.
"A life is not important except in the impact it has on other lives." ~ Jackie Robinson
Top

DSMatticus
  King
  Posts: 5271
  Joined: Thu Apr 14, 2011 5:32 am

###

- Quote

Post by DSMatticus » Fri Aug 01, 2014 12:22 pm

There are three ways to do a quote tag (e's dropped to avoid making actual tags):
[quot]Stuff[/quot]
[quot=XYZ]Stuff[/quot]
[quot="XYZ"]Stuff[/quot]
The first case is simple enough that I don't think it needs addressing.
In the second case, the first close bracket encountered terminates the quote open tag, and as such XYZ cannot contain a close bracket. Except I just lied to you, and it totally can, because you can put tags inside XYZ (like italics tags or URL tags) and those tags will consume close brackets first. Note it has to be an actual tag that gets recognized, not just gibberish in a pair of brackets.
In the third case, the first quotation mark immediately followed by a close bracket terminates the quote open tag, and as such XYZ can contain any number of close brackets and quotation marks (but not a quotation mark followed immediately by a close bracket). As far as I know, there's no exceptions this time, because the only tag which can end in that particular way is the quote open tag, and worrying about the fact that you can put a quote open tag in the middle of a quote open tag (you really can) is beyond the scope of this fix.
Handling one is simple. They're fixed strings. Match, count, compare, add whichever you need*.
Handling three is almost as simple. There is technically a single variable substring, but its contents are completely irrelevant. Match, count, compare, add whichever you need*.
Handling two requires matching tags so you can actually tell whether or not your quote open tag has its closing bracket or if they've all been consumed.
Yes, I just told you to unleash regex or an equivalently unsophisticated tool on an html derivative. We aren't trying to pair tags, only identify them; the former isn't regular, but the latter is.
*I lied to you again. While it is the case that I can't put tags inside those quote tags that will break the matching, there is at least one tag in which you can put a quote tag that modifies the quote tag's behavior: the code tag, which causes all tags contained therein to be printed as text instead of parsed. If someone puts mismatched quote tags inside a code tag, the code breaks. But this is an edge case that's going to come up a lot less than people fucking their tags (i.e. it will never come up). Also don't forget that the three different kinds of quote open tags all share quote close tags. There's the potential for some some silly double/triple-counting errors there.
Last edited by DSMatticus on Fri Aug 01, 2014 12:26 pm, edited 3 times in total.
Top
Post Reply

- Print view

Display:
Sort by:
Direction:

21 posts • Page 1 of 1

Return to “About the Gaming Den”

Jump to

- Main
- ↳ About the Gaming Den
- ↳ In My Humble Opinion...
- ↳ I Gave the Mouse a Cookie...
- ↳ In The Trenches
- ↳ It's My Own Invention...
- ↳ MPSIMS