Re: Put a stack into a variable?
Thanks for the thoughts on this conundrum. Mark S' suggestion of restoring by saving the clipboardData[objects] by pasting is a good one and might be worth testing to see if this can be done with LC Server, but since the clipboard version of a stack is nearly twice as large as its native format I'm reluctant to spend much time with that option in a setting already concerned with network latency. Similarly, Alain's suggestion of serializing to a text format (I tend to use arrays for object serialization now that we have arrayEncode(); I'm lazy so I let the engine do the parsing g) would also be a good one in some contexts but suffers from the same limitation as the binary clipboard data in terms of size. It's hard to beat the compact expression of stack data in the native stack file format. At the moment I'm resigned to allowing file I/O in the app, rationalizing the use of a cache folder for other benefits beyond the necessity of sending stack files back to the server. For the future, I've submitted a feature request: Request: copy stack to variable http://quality.runrev.com/show_bug.cgi?id=12639 Also relevant for those of you who make client-server apps, an older request that would be useful in some scenarios by limiting file I/O to one specific folder, prohibiting all other reads/writes: secureFolder http://quality.runrev.com/show_bug.cgi?id=867 -- Richard Gaskin Fourth World Systems Software Design and Development for the Desktop, Mobile, and the Web ambassa...@fourthworld.comhttp://www.FourthWorld.com ___ 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
Re: Put a stack into a variable?
The paste is how I did it in my little stack. Theres an old post about it here: http://forums.livecode.com/viewtopic.php?f=9t=12876hilit=objects+clipboarddata but I still haven't relocated the little stack thingy. Love the idea of copying a stack directly to a variable. On Sat, Jun 14, 2014 at 9:07 AM, Richard Gaskin ambassa...@fourthworld.com wrote: Thanks for the thoughts on this conundrum. Mark S' suggestion of restoring by saving the clipboardData[objects] by pasting is a good one and might be worth testing to see if this can be done with LC Server, but since the clipboard version of a stack is nearly twice as large as its native format I'm reluctant to spend much time with that option in a setting already concerned with network latency. Similarly, Alain's suggestion of serializing to a text format (I tend to use arrays for object serialization now that we have arrayEncode(); I'm lazy so I let the engine do the parsing g) would also be a good one in some contexts but suffers from the same limitation as the binary clipboard data in terms of size. It's hard to beat the compact expression of stack data in the native stack file format. At the moment I'm resigned to allowing file I/O in the app, rationalizing the use of a cache folder for other benefits beyond the necessity of sending stack files back to the server. For the future, I've submitted a feature request: Request: copy stack to variable http://quality.runrev.com/show_bug.cgi?id=12639 Also relevant for those of you who make client-server apps, an older request that would be useful in some scenarios by limiting file I/O to one specific folder, prohibiting all other reads/writes: secureFolder http://quality.runrev.com/show_bug.cgi?id=867 -- Richard Gaskin Fourth World Systems Software Design and Development for the Desktop, Mobile, and the Web ambassa...@fourthworld.comhttp://www.FourthWorld.com ___ 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
Re: Put a stack into a variable?
On the clipboard data question.. is it possible to compress the data in memory on one end and decompress it on the other? (talking about lc server interactions) Am now also wondering if it would be worthwhile to have rev be able to load and decompress stack files on the fly. As far as getting stacks from a database, shouldn't it be possible to have a database interface script, and have actuall stack files saved to a db that can be requested with go stack http://wheres.the.stack.com/grabstack?which=stackname.livecode;, query the db and send the stackfile back intact? On Sat, Jun 14, 2014 at 11:13 AM, Mike Bonner bonnm...@gmail.com wrote: The paste is how I did it in my little stack. Theres an old post about it here: http://forums.livecode.com/viewtopic.php?f=9t=12876hilit=objects+clipboarddata but I still haven't relocated the little stack thingy. Love the idea of copying a stack directly to a variable. On Sat, Jun 14, 2014 at 9:07 AM, Richard Gaskin ambassa...@fourthworld.com wrote: Thanks for the thoughts on this conundrum. Mark S' suggestion of restoring by saving the clipboardData[objects] by pasting is a good one and might be worth testing to see if this can be done with LC Server, but since the clipboard version of a stack is nearly twice as large as its native format I'm reluctant to spend much time with that option in a setting already concerned with network latency. Similarly, Alain's suggestion of serializing to a text format (I tend to use arrays for object serialization now that we have arrayEncode(); I'm lazy so I let the engine do the parsing g) would also be a good one in some contexts but suffers from the same limitation as the binary clipboard data in terms of size. It's hard to beat the compact expression of stack data in the native stack file format. At the moment I'm resigned to allowing file I/O in the app, rationalizing the use of a cache folder for other benefits beyond the necessity of sending stack files back to the server. For the future, I've submitted a feature request: Request: copy stack to variable http://quality.runrev.com/show_bug.cgi?id=12639 Also relevant for those of you who make client-server apps, an older request that would be useful in some scenarios by limiting file I/O to one specific folder, prohibiting all other reads/writes: secureFolder http://quality.runrev.com/show_bug.cgi?id=867 -- Richard Gaskin Fourth World Systems Software Design and Development for the Desktop, Mobile, and the Web ambassa...@fourthworld.comhttp://www.FourthWorld.com ___ 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
Re: Put a stack into a variable?
Mike Bonner wrote: On the clipboard data question.. is it possible to compress the data in memory on one end and decompress it on the other? (talking about lc server interactions) Am now also wondering if it would be worthwhile to have rev be able to load and decompress stack files on the fly. LiveCode's built-in support for gzip is well suited for this: on mouseUp GoStack http://www.fourthworld.net/revnet/devolution/4W_gzipper.mc.gz; end mouseUp on GoStack pURL put url pURL into tStackData -- Try to decompress .gz files: if char -3 to -1 of pURL = .gz then try put decompress(tStackData) into tStackData catch tErr answer Corrupted gzip data in URL quote pURL quote exit to top end try end if -- go stack tStackData end GoStack The URL there may also be of interest: it's a simple LC stack I keep in my Plugins folder that will compress any file dropped onto it, and add a .gz suffix to the compressed copy. Side note: Why is it that some LC commands (like decompress) throw an error when they fail, but others (like decrypt) set the result? Is there a rule somewhere that I missed that would make it easy for scripters to anticipate when try is necessary? As far as getting stacks from a database, shouldn't it be possible to have a database interface script, and have actuall stack files saved to a db that can be requested with go stack http://wheres.the.stack.com/grabstack?which=stackname.livecode;, query the db and send the stackfile back intact? Yes, in any context where you can read from disk (pretty much anytime unless you have the securityPermissions set to disallow it) reading the stack file as binary allows you to store that data in a way that you can later go to it. That's one of the oddities about go url - when I write: put url tUrlToSomeStackFile into tVar ...I can later write: go tVar ...and it'll go just as if I'd passed a file name rather than a binary blob of stack data. But once we go to a stack contained a variable, it becomes unpacked into a form that's no longer reachable within the language, except to write it to disk (or get parts of it in a nearly duplicated strange format with clipboardData[objects]). -- Richard Gaskin Fourth World Systems Software Design and Development for the Desktop, Mobile, and the Web ambassa...@fourthworld.comhttp://www.FourthWorld.com ___ 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
Re: Put a stack into a variable?
On Fri, Jun 13, 2014 at 9:26 AM, Richard Gaskin ambassa...@fourthworld.com wrote: I'd like to put a stack into a variable, but without reading the stack file from disk. Other languages have first class functions, you want first class stacks. ;-) ___ 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
Re: Put a stack into a variable?
Thanks much for the gzip example, as well as the go tVar trick. Too bad its one directional. Would be pretty cool if you could put stack into URL http://data.catch.page; On Sat, Jun 14, 2014 at 3:19 PM, Geoff Canyon gcan...@gmail.com wrote: On Fri, Jun 13, 2014 at 9:26 AM, Richard Gaskin ambassa...@fourthworld.com wrote: I'd like to put a stack into a variable, but without reading the stack file from disk. Other languages have first class functions, you want first class stacks. ;-) ___ 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
Put a stack into a variable?
I'd like to put a stack into a variable, but without reading the stack file from disk. Is there a way to do this? I'm considering a scenario in which we have a standalone with the securityPermissions all turned off except network. At that point we have a app more secure than any browser. So far so good: we can download and run any stack with complete safety for the local system. In that environment I'd like to be able to let the user modify the stacks, and save those back to the server. I have the POST worked out with encryption and all that, so that much is good - for data within the stack, but not the stack itself. It would be very convenient in this scenario if I could somehow get the data that comprises the stack from memory and put it into a variable to send back to the server. Stephen Barncard has done some experiments with the copy command, but I'm unable to find a way to obtain the binary date from the clipboard contents when they contain LC objects. Also, it would be nice to be able to also get any substacks, but the copy command only copies the stack itself. Ideally what I'd have is the same as we get from doing this: put url tPathToSomeRemoteStack into tVar go stack tVar At that point, tVar contains the stack data - substacks and all, just as if it were read from disk. So now the trick is to find a way to get that from the current copy of the stack file in memory - any ideas? -- Richard Gaskin Fourth World LiveCode training and consulting: http://www.fourthworld.com Webzine for LiveCode developers: http://www.LiveCodeJournal.com Follow me on Twitter: http://twitter.com/FourthWorldSys ___ 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
Re: Put a stack into a variable?
In case anyone needs this, this works in a button but not in the Message Box, which is why I had missed this before: on mouseUp copy this stack put the clipboardData[objects] into tVar put tVar end mouseUp -- Richard Gaskin Fourth World Systems Software Design and Development for the Desktop, Mobile, and the Web ambassa...@fourthworld.comhttp://www.FourthWorld.com ___ 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
Re: Put a stack into a variable?
How do you paste the stack? -- Best regards, Mark Schonewille Economy-x-Talk Consulting and Software Engineering Homepage: http://economy-x-talk.com Twitter: http://twitter.com/xtalkprogrammer KvK: 50277553 Installer Maker for LiveCode: http://qery.us/468 Buy my new book Programming LiveCode for the Real Beginner http://qery.us/3fi LiveCode on Facebook: https://www.facebook.com/groups/runrev/ On 6/13/2014 23:10, Richard Gaskin wrote: In case anyone needs this, this works in a button but not in the Message Box, which is why I had missed this before: on mouseUp copy this stack put the clipboardData[objects] into tVar put tVar 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
Re: Put a stack into a variable?
Mark Schonewille wrote: How do you paste the stack? If you use the copy command on a stack, the paste command will do the same as the clone command, duplicating the stack with a name prepended with Copy of. That said, it appears there's a difference in the binary data of a copied stack and a saved copy of the same stack file. For starters, LC 6.6.2 saved in the v5 format, but copied stacks have a 2700 header for the old 2.7 format. Bug maybe? But worse, even when I save a stack in the old 2.7 format, the data in the stack file still differs from the data in the clipboard is a surprisingly large number of ways, including an apparent replication of nearly the entire data in the clipboard, and with a different header than used in the stack file. So right now, my dream of being able to get a stack's data from RAM to save to a server without going to disk as an intermediary step is hosed. :( -- Richard Gaskin Fourth World Systems Software Design and Development for the Desktop, Mobile, and the Web ambassa...@fourthworld.comhttp://www.FourthWorld.com ___ 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
Re: Put a stack into a variable?
On Fri, Jun 13, 2014 at 2:17 PM, Mark Schonewille m.schonewi...@economy-x-talk.com wrote: How do you paste the stack? It seems to me that I played around with this a while back (or did someone else play around on my musings?), and found that cards could be cut/moved/paste like this. -- Dr. Richard E. Hawkins, Esq. (702) 508-8462 ___ 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
Re: Put a stack into a variable?
Hi, If you want to move cards within a stack, you can just set the number. -- Best regards, Mark Schonewille Economy-x-Talk Consulting and Software Engineering Homepage: http://economy-x-talk.com Twitter: http://twitter.com/xtalkprogrammer KvK: 50277553 Installer Maker for LiveCode: http://qery.us/468 Buy my new book Programming LiveCode for the Real Beginner http://qery.us/3fi LiveCode on Facebook: https://www.facebook.com/groups/runrev/ On 6/13/2014 23:59, Dr. Hawkins wrote: On Fri, Jun 13, 2014 at 2:17 PM, Mark Schonewille m.schonewi...@economy-x-talk.com wrote: How do you paste the stack? It seems to me that I played around with this a while back (or did someone else play around on my musings?), and found that cards could be cut/moved/paste like this. ___ 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
Re: Put a stack into a variable?
On Fri, Jun 13, 2014 at 3:06 PM, Mark Schonewille m.schonewi...@economy-x-talk.com wrote: If you want to move cards within a stack, you can just set the number. My interest is actually in passing forms from my service to a compiled customer application. So if the Western District of Lincoln has it's own form, the customer could get it from my server, stash it to a local database, and it would get inserted on program run. Possibly even for saving customer generated forms to the local db to be inserted at runtime. -- Dr. Richard E. Hawkins, Esq. (702) 508-8462 ___ 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
Re: Put a stack into a variable?
Hi, If you want to add a new form to an existing application, you can save the card with the form on your server and download and save it locally when the app starts. No database involved. If your app needs to get new form data from the server, that's even easier. Just download the data and save them in the local database. It is important to treat interface and data separately. -- Best regards, Mark Schonewille Economy-x-Talk Consulting and Software Engineering Homepage: http://economy-x-talk.com Twitter: http://twitter.com/xtalkprogrammer KvK: 50277553 Installer Maker for LiveCode: http://qery.us/468 Buy my new book Programming LiveCode for the Real Beginner http://qery.us/3fi LiveCode on Facebook: https://www.facebook.com/groups/runrev/ On 6/14/2014 00:09, Dr. Hawkins wrote: On Fri, Jun 13, 2014 at 3:06 PM, Mark Schonewille m.schonewi...@economy-x-talk.com wrote: If you want to move cards within a stack, you can just set the number. My interest is actually in passing forms from my service to a compiled customer application. So if the Western District of Lincoln has it's own form, the customer could get it from my server, stash it to a local database, and it would get inserted on program run. Possibly even for saving customer generated forms to the local db to be inserted at runtime. ___ 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
Re: Put a stack into a variable?
It means that you can make it work. Go to url won't work, but you can download the data, set clipboarddata[objects] and paste. Not sure if it is a bug. It is if copied stacks lose properties that aren't part of the old format. Otherwise I'd call it a feature request. -- Best regards, Mark Schonewille Economy-x-Talk Consulting and Software Engineering Homepage: http://economy-x-talk.com Twitter: http://twitter.com/xtalkprogrammer KvK: 50277553 Installer Maker for LiveCode: http://qery.us/468 Buy my new book Programming LiveCode for the Real Beginner http://qery.us/3fi LiveCode on Facebook: https://www.facebook.com/groups/runrev/ On 6/13/2014 23:48, Richard Gaskin wrote: Mark Schonewille wrote: How do you paste the stack? If you use the copy command on a stack, the paste command will do the same as the clone command, duplicating the stack with a name prepended with Copy of. That said, it appears there's a difference in the binary data of a copied stack and a saved copy of the same stack file. For starters, LC 6.6.2 saved in the v5 format, but copied stacks have a 2700 header for the old 2.7 format. Bug maybe? But worse, even when I save a stack in the old 2.7 format, the data in the stack file still differs from the data in the clipboard is a surprisingly large number of ways, including an apparent replication of nearly the entire data in the clipboard, and with a different header than used in the stack file. So right now, my dream of being able to get a stack's data from RAM to save to a server without going to disk as an intermediary step is hosed. :( ___ 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
Re: Put a stack into a variable?
This may seem off-topic, sort-of, but it might be simpler to transmit an exhaustive DESCRIPTION of the stack, and have their LiveCode create it all from scratch. Then it gets filled with content that is gotten by URL. Kind-of like how web-pages work. It's all text, no binaries. On Friday, June 13, 2014 7:00:08 PM, Mark Schonewille m.schonewi...@economy-x-talk.com wrote: It means that you can make it work. Go to url won't work, but you can download the data, set clipboarddata[objects] and paste. Not sure if it is a bug. It is if copied stacks lose properties that aren't part of the old format. Otherwise I'd call it a feature request. -- Best regards, Mark Schonewille Economy-x-Talk Consulting and Software Engineering Homepage: http://economy-x-talk.com Twitter: http://twitter.com/xtalkprogrammer KvK: 50277553 Installer Maker for LiveCode: http://qery.us/468 Buy my new book Programming LiveCode for the Real Beginner http://qery.us/3fi LiveCode on Facebook: https://www.facebook.com/groups/runrev/ On 6/13/2014 23:48, Richard Gaskin wrote: Mark Schonewille wrote: How do you paste the stack? If you use the copy command on a stack, the paste command will do the same as the clone command, duplicating the stack with a name prepended with Copy of. That said, it appears there's a difference in the binary data of a copied stack and a saved copy of the same stack file. For starters, LC 6.6.2 saved in the v5 format, but copied stacks have a 2700 header for the old 2.7 format. Bug maybe? But worse, even when I save a stack in the old 2.7 format, the data in the stack file still differs from the data in the clipboard is a surprisingly large number of ways, including an apparent replication of nearly the entire data in the clipboard, and with a different header than used in the stack file. So right now, my dream of being able to get a stack's data from RAM to save to a server without going to disk as an intermediary step is hosed. :( ___ 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
Re: Put a stack into a variable?
On Fri, Jun 13, 2014 at 3:42 PM, Mark Schonewille m.schonewi...@economy-x-talk.com wrote: If you want to add a new form to an existing application, you can save the card with the form on your server and download and save it locally when the app starts. No database involved. There is a local database for preferences, data, and so forth. Also, it is intrinsically networked. The installation at my office, for example, has the postgres server on my desk, which serves to itself, my paralegal, my laptop over vpn, a remote assistant via vpn, etc. When this is complete, it and every other central machine would also periodically update with the upstream root machine for updates (whether forms, dictionary of creditor additions, finding out if there's a new version, license keys, etc.). Anyway, for however many machines there are at a law office, they all need to have access to the same cards, and tho.se cards are going to come from an upstream postgreSQL server. Keeping them on the corporate db server (where they may well cache down to the local machines) seems the natural solution; otherwise I'm dealing with files syncing to the dbs. If your app needs to get new form data from the server, that's even easier. Just download the data and save them in the local database. It is important to treat interface and data separately. In this space, though, interface *is* data to some extent. There are something like 216 judicial districts in the US, and some attorneys regularly filing in up to a half dozen or so--and all issueing new forms at unpredictable intervals -- Dr. Richard E. Hawkins, Esq. (702) 508-8462 ___ 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
Re: Put a stack into a variable?
If I can find it, somewhere around here I have a rudimentary vcs that used the copy stack method. Seemed to work well (I could pop stacks into an array and save the array to a file then reconstitute a stacks structure from the array at a later date) unfortunately, catastrophic hardware failure assisted me in losing track of some things. Think I have a backup here somewhere maybe and can dig it up if it would be helpful, but from what richard says, i'd be a little leery of the concept. On Fri, Jun 13, 2014 at 6:40 PM, Dr. Hawkins doch...@gmail.com wrote: On Fri, Jun 13, 2014 at 3:42 PM, Mark Schonewille m.schonewi...@economy-x-talk.com wrote: If you want to add a new form to an existing application, you can save the card with the form on your server and download and save it locally when the app starts. No database involved. There is a local database for preferences, data, and so forth. Also, it is intrinsically networked. The installation at my office, for example, has the postgres server on my desk, which serves to itself, my paralegal, my laptop over vpn, a remote assistant via vpn, etc. When this is complete, it and every other central machine would also periodically update with the upstream root machine for updates (whether forms, dictionary of creditor additions, finding out if there's a new version, license keys, etc.). Anyway, for however many machines there are at a law office, they all need to have access to the same cards, and tho.se cards are going to come from an upstream postgreSQL server. Keeping them on the corporate db server (where they may well cache down to the local machines) seems the natural solution; otherwise I'm dealing with files syncing to the dbs. If your app needs to get new form data from the server, that's even easier. Just download the data and save them in the local database. It is important to treat interface and data separately. In this space, though, interface *is* data to some extent. There are something like 216 judicial districts in the US, and some attorneys regularly filing in up to a half dozen or so--and all issueing new forms at unpredictable intervals -- Dr. Richard E. Hawkins, Esq. (702) 508-8462 ___ 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