
Reverse Engineering Using Chrome - rudkovskyi
https://rudk.ws/2016/10/17/reverse-engineering-by-using-chrome/
======
rudkovskyi
People you are amazing! Thank you very much for liking this link - Just in two
hours, I have never expected it is going to be at the very top of Hacker News
web-site. I am very happy you have enjoyed this article.

------
amelius
I would be interested in a tool that allows the user to make a snapshot of the
DOM, and then at a later instant, compare the current DOM with the saved one
(like a diff). For arbitrary websites of course.

~~~
rudkovskyi
It's an interesting idea, thanks for sharing. I haven't heard if there is a
plugin is available for such job, although it would be cool to have it!

~~~
elcapitan
Diffing trees sounds NP-complete. Or is there a polynomial solution of some
kind?

~~~
Etzos
Trees are a special case of graphs in general, which aren't necessarily even
NP-complete.

In fact, if trees couldn't be diffed things like React would have serious
speed concerns, or more realistically wouldn't even exist in the first place.

~~~
amelius
React is not optimal, or it would require O(N^3) time at least. Think for
example of a linear structure like a listbox, and then consider that a perfect
diff requires an algorithm like Smith-Waterman, which is O(N^3). (Perhaps
faster algorithms exist, but they are probably not really significantly
faster).

~~~
Etzos
I certainly wasn't commenting on the preciseness of React's diffing (and how
they're able to reduce it from O(n) to O(n^3) by ignoring things). I was
merely pointing out that it's possible to diff trees in polynomial time.

Edit: Just to clarity, I'm also not saying O(n^3) isn't slow compared to
React's O(n), just that it's potentially a lot faster than NP.

------
slhck
dezoomify [1] does all that for most common tileset formats.

[1]:
[https://github.com/lovasoa/dezoomify](https://github.com/lovasoa/dezoomify)

~~~
rudkovskyi
Thanks for sharing!

