Earlier quoted context omitted.
You could distribute it as a single index.html file, with unobfuscated/unminimized vanilla javascript. The user could then execute it offline no problem.
For fun, you could even use redbean ( https://justine.lol/redbean/index.html ), which has been discussed on here recently. That would give you a tiny executable running a webserver that serves your webapp locally. Probably not much advantage compared to a plain html file, though. Might be smaller overall, since everything would be compressed.
Graphtage: A semantic diff utility for JSON, HTML, YAML, CSV, etc
41–50 of 52 posts
Re: Graphtage: A semantic diff utility for JSON, HTML, YAML, CSV, etc
#42Re: Graphtage: A semantic diff utility for JSON, HTML, YAML, CSV, etc
#43Re: Graphtage: A semantic diff utility for JSON, HTML, YAML, CSV, etc
#44and now please, build a tool which converts all these thinks, like imagemagick for machinereadable documents.
If you mean convert between data formats (e.g. between, CSV,YAML,JSON, XML) there are programs already that can do that. For example our Easy Data Transform. However there are wrinkles because some of these formats are trees and some are tables. Flattening a tree into a table isn't too hard. But unflattening a table back into the same tree as the original is trickier. Has anyone got any good references on that?
Re: Graphtage: A semantic diff utility for JSON, HTML, YAML, CSV, etc
#45Earlier quoted context omitted.
If you mean convert between data formats (e.g. between, CSV,YAML,JSON, XML) there are programs already that can do that. For example our Easy Data Transform. However there are wrinkles because some of these formats are trees and some are tables. Flattening a tree into a table isn't too hard. But unflattening a table back into the same tree as the original is trickier. Has anyone got any good references on that?
do you have a list for that? i am aware, that there are dialects and {table,trees,graphs} {table,trees,graphs} may be a problem for some languages, but having it at least would be a progress.
Just as an example of the treetable issue:
If you input this JSON tree:
{ "Color": "Blue", "Part": [ { "Type": "A", "Number": [ "1", "2" ] }, { "Type": "B", "Number": [ "1" ] } ]
It can be converted to a table as:
Color,Part.Type,Part.Number
Blue,A,1
Blue,A,2
Blue,B,1
Which is fine is you then want to output as Excel, CSV etc. But if you then output that back to JSON you get:
[ { "Color": "Blue", "Part": { "Type": "A", "Number": "1" } }, { "Color": "Blue", "Part": { "Type": "A", "Number": "2" } }, { "Color": "Blue", "Part": { "Type": "B", "Number": "1" } } ]
Which is conceptually equivalent, but less compact (similarly for XML). I am hoping to fix this issue. But if anyone has any links to how to unflatten a table into a compact tree, I'm all ears.
Re: Graphtage: A semantic diff utility for JSON, HTML, YAML, CSV, etc
#46Earlier quoted context omitted.
Tree diffing algorithms have very bad complexity (e.g. O(N^4)!) so this will probably only work on really small examples.
I have a use case for diffing trees, so would love to know of any optimal algorithms you may know of; I'm operating generally with less than 100 nodes, so it's not a huge concern, but I'm finding that discovering _any_ algorithms for this has been tough.
There's a few algorithms like XDiff, XyDiff, XChange etc. but be prepared to find very old code on sourceforge or more likely no code at all.
I couldn't find anything with a decent complexity that either had code or was simple/well described enough that I could implement it so I gave up.
Re: Graphtage: A semantic diff utility for JSON, HTML, YAML, CSV, etc
#47Earlier quoted context omitted.
Quadratic doesn't need to equal "bad", especially in this case. Two 45 kB items is 2 billion entries. Allocating 2 billion bytes is easy enough. Iterating over 2 billion bytes is also not terrible. The GP says the process is estimated to take 150 hours, or half a million seconds, or 1.62e15 cycles... so around 1 million cycles per cell.
If it’s doing anything nontrivial (eg computing the weights of the diagonal edges by comparing the rows as sequences) then you’re basically screwed. The problem with quadratic is that it doesn’t scale but it’s fast enough for small inputs that it is hard to notice until you get a large input.
Point is that things like being efficient with memory access and using sufficiently low level (or JIT'ed) languages can get you very far, and it's not really meaningful to dismiss an algorithm solely based on it being quadratic.
Re: Graphtage: A semantic diff utility for JSON, HTML, YAML, CSV, etc
#48Earlier quoted context omitted.
do you have a list for that? i am aware, that there are dialects and {table,trees,graphs} {table,trees,graphs} may be a problem for some languages, but having it at least would be a progress.
Do you mean a link? If so: https://www.easydatatransform.com/ Just as an example of the tree table issue: If you input this JSON tree: { "Color": "Blue", "Part": [ { "Type": "A", "Number": [ "1", "2" ] }, { "Type": "B", "Number": [ "1" ] } ] It can be converted to a table as: Color,Part.Type,Part.Number Blue,A,1 Blue,A,2 Blue,B,1 Which is fine is you then want to output as Excel, CSV etc. But if you then output that…
Re: Graphtage: A semantic diff utility for JSON, HTML, YAML, CSV, etc
#49Earlier quoted context omitted.
The diff I did is aware of the structure of the object. It's not just sorted lines.
Apart from the interesting conversation here, just to make sure... You are all aware of kubectl diff[1], right? I understand that sometimes you just want to diff two k8s objects, kubectl diff is not a tool for that. [1]: https://www.mankier.com/1/kubectl-diff
Re: Graphtage: A semantic diff utility for JSON, HTML, YAML, CSV, etc
#50Earlier quoted context omitted.
Do you mean a link? If so: https://www.easydatatransform.com/ Just as an example of the tree table issue: If you input this JSON tree: { "Color": "Blue", "Part": [ { "Type": "A", "Number": [ "1", "2" ] }, { "Type": "B", "Number": [ "1" ] } ] It can be converted to a table as: Color,Part.Type,Part.Number Blue,A,1 Blue,A,2 Blue,B,1 Which is fine is you then want to output as Excel, CSV etc. But if you then output that…
i meant a cli tool :D but thanks