Programming GP diff app! :D Now commentable!

sandshrewz

POTATO
is a Site Content Manager Alumnusis a Top Artist Alumnusis a Forum Moderator Alumnusis a Top Contributor Alumnusis a Top Smogon Media Contributor Alumnusis a Battle Simulator Moderator Alumnus
Original by Sarenji. Diff code by Google.

GP diff app! :D

This was a very lazy app to serve a very lazy purpose hehe. Anyway, this is basically the same as the old diff app but improved. It uses efficiency cleanup as the one I made previously -- it just means it screws up less lol. BUTTTTTT the best thing is you can now add comments to it!

Escape comments using !@comments go here@! :D

For example, original sentence "This is old diff app!" and the new one is "This is a new !@no it's new and dun be lazy!! :O@! diff app!" and the output would be "This is olda new no it's new and dun be lazy!! :O diff app!"

Also explained some stuff in this post about the edit cost and timeout. You can usally stick to just 3 edit costs and 1 timeout. For longer checks you can increase the timeout to be greater by like a bit. Try not to exceed 10??? If it's super long you can put timeout to 0 and it might freeze your browser for awhile to diff the thing.

And if you want colors added to the options post in this thread and let me know. As long as the color is reasonable and isn't eye blinding or anything I'll add it. oh and comments are black + bold by default. oh and the red green diff you preview doesn't have comments there.

Enjoy! :)

TODO:
- reduce chance of comments causing diff to screw up. done
 
Last edited:
The new version of the diff app kinda screwed up for me as for long gp checks it basically does
original said:
[OVERVIEW]

<p>Drakrai has all the tools it needs to succeed-power, skill & versatility.
new said:
[Overview]

<p>Darkrai has all the tools it needs to succeed&mdash;power, skill, and versatility.
What diff does is
diff said:
[OVERVIEW]

<p>Drakrai has all the tools it needs to succeed-power, skill & versatility.

verview]

verview]
<p>Darkrai has all the tools it needs to succeed&mdash;power, skill, and versatility.
Is that fixed in the new diff? Thanks. (Btw, all the parameters were default in this; also only happens for long checks)
 

sandshrewz

POTATO
is a Site Content Manager Alumnusis a Top Artist Alumnusis a Forum Moderator Alumnusis a Top Contributor Alumnusis a Top Smogon Media Contributor Alumnusis a Battle Simulator Moderator Alumnus
The new version of the diff app kinda screwed up for me as for long gp checks it basically does


What diff does is

Is that fixed in the new diff? Thanks. (Btw, all the parameters were default in this; also only happens for long checks)
It depends on which diff you were using. If you were using the one that didn't have the edit cost and timeout thing, then idk lol. Anyway if it screws up just tweak the settings until it doesn't. Honestly it works if you tweak it a few times. Generally the longer the diffing the more you should increase timeout. Or you can set it to 0 for best diffing at the cost of more time taken to diff. More information here: https://neil.fraser.name/software/diff_match_patch/svn/trunk/demos/demo_diff.html and "Increase computational efficiency by factoring out short commonalities which are not worth the overhead. The larger the edit cost, the more agressive the cleanup."

edit: btw I do not code how diffing is done. The code is done by Google. The only coding I've done here is only a few lines xD

edit2: @ below uhhh try harder ?_? haha. I usually just set it to 0 because I don't want to guage how much it might actually need cos the number might get too big for trail and error and it works fine. Or play around with edit cost.
 
Last edited:
yea i tried most stuff and it didnt work, for shorter checks i can use the editor anyway, so i didnt use diff. i will definitely try this though!!
 

sandshrewz

POTATO
is a Site Content Manager Alumnusis a Top Artist Alumnusis a Forum Moderator Alumnusis a Top Contributor Alumnusis a Top Smogon Media Contributor Alumnusis a Battle Simulator Moderator Alumnus
lemolame stinks. The output is correct though. I intentionally didn't make the output change colors with what colors you picked. Moved orange over to deletions. I thought it should be with additions for CNY colors :( lol.

Anyway, I updated the code slightly so that it has less chance of screwing up with comments when comments and additions can tangled up together. So far no one has experienced it so far but I did once during one of my small tests so to be safe I made it better. Let me know if it glitches up or something. Do try to preview your bbcoded diffs before posting just to be sure though. Thanks! :)
 

sandshrewz

POTATO
is a Site Content Manager Alumnusis a Top Artist Alumnusis a Forum Moderator Alumnusis a Top Contributor Alumnusis a Top Smogon Media Contributor Alumnusis a Battle Simulator Moderator Alumnus
It's been literally 3 years but figured I should probably give a quick update on what has been happening with it.

Firstly, you should now use the link http://sandshrewz.github.io/gpdiff instead of the dropbox one. For some reason dropbox decided to stop hosting stuff and make them downloads instead which is meh. It's also updated in the OP just in case.

Secondly, thanks to users who have continued to give me feedback to improve on the app. I edited the Google diff API so that it no longer automatically escapes HTML entities like &eacute; etc. Also slight improvements to the code so that it automatically removes spaces that were removed, so you don't get empty BBCode tags when you delete a space.

If anyone has any suggestion or feedback or bug etc, feel free to post ITT or contact me through forum or Discord.

Thanks :)
 

Users Who Are Viewing This Thread (Users: 1, Guests: 0)

Top