jimjkelly / missile-defense

http://missile.exchange
1 stars 0 forks source link

Allow Sharing of a Computation #3

Closed jimjkelly closed 7 years ago

jimjkelly commented 7 years ago

We'll need to come up with a way to encode the current values in the URL.

wslafoy commented 7 years ago

Just bumping to remind of the NES-code idea. most of the variables can be broken down into small values (and easily hexed variables)

jimjkelly commented 7 years ago

The most recent change implements an initial stab at this. I decided to, for now, stay away from the NES idea, mostly because of the arbitrary precision the floating point numbers have - though actually as I write this out I just realized that our inputs don't have such a problem, so I probably should have gone that way. :)

But for now basically I base64 encoded the entire application state tree. That has some advantages - namely we can share the application exactly as it is from machine to machine and it will reflect changes in the internal schema. Downside is, as you will see, the url can get pretty long.

I'll probably keep it like this for now during continued development, that way if you see a problem you can share things with me exactly as they are, and we can revisit it if we want to.

jimjkelly commented 7 years ago

And that's live at the old test link right now, I haven't wired up your bucket yet.

Here's an example link with a couple added but unconfigured layers: http://missile-defense.s3-website-us-west-2.amazonaws.com/?link=eyJ0YXJnZXQiOnsibGF0aXR1ZGUiOjM3Ljc1NzcsImxvbmdpdHVkZSI6LTEyMi40Mzc2LCJoYXJkbmVzcyI6MTAwfSwibGF5ZXJzIjp7Im9mZmVuc2l2ZSI6W10sImRlZmVuc2l2ZSI6W3sibmFtZSI6Ik5ldyBkZWZlbnNpdmUgbGF5ZXIifSx7Im5hbWUiOiJOZXcgZGVmZW5zaXZlIGxheWVyIn1dfX0=

Like I said, long. :) The control to get the link is in the bottom right.

wslafoy commented 7 years ago

Perfect!