I use mergeJSON to move back an forth between json and arrays for web services. It’s currently failing when I fetch json data from another source on the Ubuntu server, while the same code and data works on MacoS - presumably due to some encoding issues.
It’s a large amount of data and I can’t debug where the issue is easily. Maybe I can use jsonImport/Export on the server? Not sure. Any thoughts? On 31 Oct 2020, 02:29 +0000, Roger Guay via use-livecode <use-livecode@lists.runrev.com>, wrote: > Lots of clever ideas here, Alex, but I think you’re missing the point of what > I ultimately want to do. I'm building a plotting program for which I want to > plot any equation including those that have multiple values of y for a given > x. An equation might branch at any point and might even have multiple > branches both of which are unknown before plotting. > > Of course, there’s always the possibility that I’m not fully comprehending > your suggestions??? What does NB stand for? Are you suggesting creating a new > polygon every time a branch is detected? That just might work?! > > Roger > > > > On Oct 30, 2020, at 4:12 PM, Alex Tweedly via use-livecode > > <use-livecode@lists.runrev.com> wrote: > > > > > > On 30/10/2020 22:40, Roger Guay via use-livecode wrote: > > > Let’s try this again after spellchecking: > > > > > > > > > Yes, yours is a good example of a bifurcated line. But now imagine > > > producing this line programmatically with an equation that: > > > > > > Produces a constant y value of 149 as x progresses from 35 to 235 (no > > > problem) > > > Then produces 2 different but simultaneous values of y as x progresses > > > from 235 to 335. This is the problem as you don’t want the end point of > > > the separated lines to connect. If you place an empty line in the points > > > after each iteration beyond x = 235 then you end up with the bifurcated > > > lines being points rather than a solid line. > > > > > > How do plotting programs handle this situation???? > > > > > > Here are two different ways you could do it. > > > > 1. simple - assume there would (could) be two Y values for any x, and just > > calculate two series, and combine them for output. > > > > 2. harder - for each x value, keep track of the previous y value for each > > series, and if necessary, put in a 'skip' plus new value plus skip ... > > > > NB makes for a more complex polygon; each new x value after bifurcation > > results in 5 lines added to the points. > > > > on mouseup > > local tSeries1, tSeries2, thepoints > > if the shiftkey is down then > > > > -- the easy way - just allow for the possibility of two series of points > > all along > > repeat with i = 35 to 335 > > -- calculate series 1 > > if i < 235 then > > put i,249 &CR after tSeries1 > > else > > put i, 249+(i-235) &CR after tSeries1 > > end if > > -- calculate series 2 > > if i < 235 then > > -- do nothing - it's the same as series 1 > > else > > put i, 249+2*(i-235) &CR after tSeries2 > > end if > > end repeat > > > > put tSeries1 &CR & tSeries2 into thePoints > > set the points of grc "X" to thePoints > > set the foregroundColor of grc "X" to "blue" > > else > > -- the harder way - multiple series ... > > -- does each step for each series ... much more complex polygon, but ... > > local t1, t2, tLast1, tLast2 > > repeat with i = 35 to 335 > > -- calculate values > > if i < 235 then > > put 249 into t1 > > put 249 into t2 > > else > > put 249+(i-235) into t1 > > put 249+2*(i-235) into t2 > > end if > > -- put in series 1 > > if tLast1 is not empty then > > put i-1, tLast1 &CR & i, t1 &CR after thePoints > > end if > > -- possibly put in series 2 > > if tLast1 <> tLast2 OR t1 <> t2 then > > put CR after thePoints -- blank skip over to series 2 value > > put i-1, tLast2 &CR & i, t2 &CR after thePoints > > put CR after thePoints -- blank skip back to series 1 > > end if > > put t1 into tLast1 > > put t2 into tLast2 > > end repeat > > set the points of grc "X" to thePoints > > set the foregroundColor of grc "X" to "red" > > end if > > > > end mouseup > > > > > > _______________________________________________ > > use-livecode mailing list > > use-livecode@lists.runrev.com > > Please visit this url to subscribe, unsubscribe and manage your > > subscription preferences: > > http://lists.runrev.com/mailman/listinfo/use-livecode > > _______________________________________________ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode