Re: sideloading updates to mobile

2024-02-28 Thread J. Landman Gay via use-livecode
"Revert this stack". That just means "reload from disk". Or you can specify 
a different stack.

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
On February 28, 2024 8:12:57 PM Mike Kerner via use-livecode 
 wrote:



so, how do we force LC to reload the stack?
i can force the script to reload, and replace it, but if i want to reload
the stack, do i have to close it, replace it, and then open it?

On Wed, Feb 21, 2024 at 8:28 PM Mike Kerner 
wrote:


thanks, jlg. that's kind-of what i was thinking.


On Wed, Feb 21, 2024 at 4:58 PM J. Landman Gay via use-livecode <
use-livecode@lists.runrev.com> wrote:


I've done this for several mobile apps. As long as the updates only
reside
in the app's sandboxed container, even the App Store doesn't care.

Basically, I put a short text file on the server listing the update
version(s) of the file(s), one per line if they are all different.  Every
stack in the app suite has a custom property named cVersion. If necessary
you can also add the download URL to the same line. On launch, the app
downloads and parses the text to see if the server version is different
from the installed one. If so, it uses "put URL  into URL
" to download and save the the updates to the mobile documents
folder,
overwriting the old ones.

It's pretty simple, if I understand what you need correctly. I also store
other info in the the text file occasionally, such as a text string
describing the updates so I can show an answer dialog if I want the user
to
agree or decline the update (which will reappear on the next launch if
they
decline.)

Sample text file is usually something like this:

   Stack 1  https://www.domain.com/updates/stack1.livecode
   Stack 2  https://www.domain.com/updates/stack2.livecode
   ..
   This update provides new functionality and bug fixes.

If you don't want to scan each stack for its cVersion, you can keep a
text
file in the mobile documents folder that lists the current versions so
you
can easily compare that to the one on the server. After updating the
stacks, update the stored text file as well.

If updates are mandatory, just skip the comparisons entirely and
force-download the updates. If only some of the stacks should be updated,
omit the ones that don't need to be updated from the server file.

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
On February 21, 2024 12:53:25 PM Mike Kerner via use-livecode
 wrote:

> right - no updating the engine + runtime in this scenario, just the
> stacks + scripts, and perhaps plugins.
> we are going to continue to only privately distribute to our corporate
> clients, so the app store won't be part of the equation. that does not
mean
> that apple won't object, though (but, i believe the rules for privately
> distributed apps are much more lenient than for app store apps - at
least,
> they have been for us, up until now)
>
> On Wed, Feb 21, 2024 at 12:53 PM Klaus major-k via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>
>> Hi Mike,
>>
>> > Am 21.02.2024 um 18:47 schrieb Mike Kerner via use-livecode <
>> use-livecode@lists.runrev.com>:
>> >
>> > sorry that i was not clear. we've been using private deploys since
around
>> > 2010, using airlaunch to generate the bundle, and then uploading to a
>> > private url. that's not what i meant.
>> > i'm talking about updating/patching an existing app, in place. the
>> devices
>> > are in single-app mode, so we would either have to pay for mdm and
then
>> use
>> > that service to push app updates, OR, if we didn't use mdm, we could
have
>> > the app pull the update and apply it.
>> > i can kind-of guess how to make it work, but i'm sure there are a
couple
>> of
>> > tricks that i don't want to have to figure out, if someone else has
>> already
>> > figured it out.
>>
>> you could use the "splashscreen" approach to update one or more stacks,
>> but that will
>> of course only work if you do not want to update the actual
engine/runtime.
>>
>> However I'm not sure if Apple will allow this, no problem on Android
>> however.
>>
>>
>> Best
>>
>> Klaus
>>
>> --
>> Klaus Major
>> https://www.major-k.de
>> https://www.major-k.de/bass
>> kl...@major-k.de
>>
>>
>> ___
>> 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
>>
>
>
> --
> On the first day, God created the heavens and the Earth
> On the second day, God created the oceans.
> On the third day, God put the animals on hold for a few hours,
>   and did a little diving.
> And God said, "This is good."
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> 

Re: sideloading updates to mobile

2024-02-28 Thread Mike Kerner via use-livecode
so, how do we force LC to reload the stack?
i can force the script to reload, and replace it, but if i want to reload
the stack, do i have to close it, replace it, and then open it?

On Wed, Feb 21, 2024 at 8:28 PM Mike Kerner 
wrote:

> thanks, jlg. that's kind-of what i was thinking.
>
>
> On Wed, Feb 21, 2024 at 4:58 PM J. Landman Gay via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>
>> I've done this for several mobile apps. As long as the updates only
>> reside
>> in the app's sandboxed container, even the App Store doesn't care.
>>
>> Basically, I put a short text file on the server listing the update
>> version(s) of the file(s), one per line if they are all different.  Every
>> stack in the app suite has a custom property named cVersion. If necessary
>> you can also add the download URL to the same line. On launch, the app
>> downloads and parses the text to see if the server version is different
>> from the installed one. If so, it uses "put URL  into URL
>> > path>" to download and save the the updates to the mobile documents
>> folder,
>> overwriting the old ones.
>>
>> It's pretty simple, if I understand what you need correctly. I also store
>> other info in the the text file occasionally, such as a text string
>> describing the updates so I can show an answer dialog if I want the user
>> to
>> agree or decline the update (which will reappear on the next launch if
>> they
>> decline.)
>>
>> Sample text file is usually something like this:
>>
>>Stack 1  https://www.domain.com/updates/stack1.livecode
>>Stack 2  https://www.domain.com/updates/stack2.livecode
>>..
>>This update provides new functionality and bug fixes.
>>
>> If you don't want to scan each stack for its cVersion, you can keep a
>> text
>> file in the mobile documents folder that lists the current versions so
>> you
>> can easily compare that to the one on the server. After updating the
>> stacks, update the stored text file as well.
>>
>> If updates are mandatory, just skip the comparisons entirely and
>> force-download the updates. If only some of the stacks should be updated,
>> omit the ones that don't need to be updated from the server file.
>>
>> --
>> Jacqueline Landman Gay | jac...@hyperactivesw.com
>> HyperActive Software | http://www.hyperactivesw.com
>> On February 21, 2024 12:53:25 PM Mike Kerner via use-livecode
>>  wrote:
>>
>> > right - no updating the engine + runtime in this scenario, just the
>> > stacks + scripts, and perhaps plugins.
>> > we are going to continue to only privately distribute to our corporate
>> > clients, so the app store won't be part of the equation. that does not
>> mean
>> > that apple won't object, though (but, i believe the rules for privately
>> > distributed apps are much more lenient than for app store apps - at
>> least,
>> > they have been for us, up until now)
>> >
>> > On Wed, Feb 21, 2024 at 12:53 PM Klaus major-k via use-livecode <
>> > use-livecode@lists.runrev.com> wrote:
>> >
>> >> Hi Mike,
>> >>
>> >> > Am 21.02.2024 um 18:47 schrieb Mike Kerner via use-livecode <
>> >> use-livecode@lists.runrev.com>:
>> >> >
>> >> > sorry that i was not clear. we've been using private deploys since
>> around
>> >> > 2010, using airlaunch to generate the bundle, and then uploading to a
>> >> > private url. that's not what i meant.
>> >> > i'm talking about updating/patching an existing app, in place. the
>> >> devices
>> >> > are in single-app mode, so we would either have to pay for mdm and
>> then
>> >> use
>> >> > that service to push app updates, OR, if we didn't use mdm, we could
>> have
>> >> > the app pull the update and apply it.
>> >> > i can kind-of guess how to make it work, but i'm sure there are a
>> couple
>> >> of
>> >> > tricks that i don't want to have to figure out, if someone else has
>> >> already
>> >> > figured it out.
>> >>
>> >> you could use the "splashscreen" approach to update one or more stacks,
>> >> but that will
>> >> of course only work if you do not want to update the actual
>> engine/runtime.
>> >>
>> >> However I'm not sure if Apple will allow this, no problem on Android
>> >> however.
>> >>
>> >>
>> >> Best
>> >>
>> >> Klaus
>> >>
>> >> --
>> >> Klaus Major
>> >> https://www.major-k.de
>> >> https://www.major-k.de/bass
>> >> kl...@major-k.de
>> >>
>> >>
>> >> ___
>> >> 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
>> >>
>> >
>> >
>> > --
>> > On the first day, God created the heavens and the Earth
>> > On the second day, God created the oceans.
>> > On the third day, God put the animals on hold for a few hours,
>> >   and did a little diving.
>> > And God said, "This is good."
>> > ___
>> > use-livecode mailing list
>> > use-livecode@lists.runrev.com
>> > Please visit 

Re: formatDate() Function Update

2024-02-28 Thread Phil Hudson via use-livecode
Very useful function, thanks for sharing.

I believe the format you call "SQL format" is literally *the* standard
format, as in ISO 8601.

https://www.startpage.com/do/dsearch?query=iso+date+format=web=opensearch=english

I'd suggest "North American format" for the other one, assuming they
use it in Mexico too. Otherwise I'm at a loss.

On Wed, 28 Feb 2024 at 18:44, Bob Sneidar via use-livecode
 wrote:
>
> Not to be confused with the built-in dateFormat() function, I wrote a special 
> formatDate() function a few years back because I had a need to get a given 
> date in unsupported formats. Particularly I needed an SQL Date format in the 
> form of -mm-dd.
>
> I have been frustrated also that there is no built-in function to return a 
> date in the mm/dd/ format, so I just updated my function to include that 
> form using “standard date” as the format parameter. (I can’t think what else 
> to call it. "Y2K Date” seems cheesy.)
>
> Here is the code if anyone is interested. I should also submit it to the 
> Master Library. I will have to grok how to do that again.
>
> Bob S
>
>
>
> FUNCTION formatDate theDate, theFormat
>/*
>Accepts any valid date for the first parameter. If not a valid date, it 
> simply returns
>what was passed. Second parameter can be any of the following:
>sql date: date in the -mm-dd format
>short date, abbreviated date, internet date, long date: LC versions of the 
> same
>julian date: Julian number based on (I believe) Jacques formula
>standard date: The date in the form of theFormat
>*/
>
>put theDate into tSavedDate
>put the itemdelimiter into theOldDelim
>set the itemdelimiter to "-"
>
>IF the length of item 1 of theDate = 4 AND \
>  the number of items of theDate = 3 AND \
>  item 1 of theDate is a number AND \
>  item 2 of theDate is a number AND \
>  item 3 of theDate is a number THEN
>   put item 2 of theDate & "/" & \
> item 3 of theDate & "/" & \
> item 1 of theDate into theDate
>END IF
>
>-- replace "." with "/" in theDate
>convert theDate to dateitems
>set the itemdelimiter to theOldDelim
>
>if the number of items of theDate <> 7 then
>   answer "'" & theDate & "' is not a valid date format!"
>   return tSavedDate
>end if
>
>SWITCH theFormat
>   CASE "sql date"
>  /*
>  put item 1 of theDate & "-" & \
>format("%02d",item 2 of theDate) & "-" & \
>format("%02d",item 3 of theDate) into theDate
>  */
>  put format("%s-%02d-%02d", item 1 of theDate, item 2 of theDate, \
>item 3 of theDate) into theDate
>  break
>   CASE "short date"
>  convert theDate from dateitems to short date
>  break
>   CASE "abbreviated date"
>  convert theDate from dateitems to abbreviated date
>  break
>   CASE "abbr date"
>  convert theDate from dateitems to abbreviated date
>  break
>   CASE "internet date"
>  convert theDate from dateitems to internet date
>  break
>   CASE "long date"
>  convert theDate from dateitems to long date
>  break
>   CASE "julian date"
>  put the date into theDate
>  convert theDate to dateItems
>  IF  ((item 2 of theDate = 1) OR (item 2 of theDate = 2)) THEN
> put 1 into theDay
>  ELSE
> put 0 into theDay
>  END IF
>  put item 1 of theDate + 4800 - theDay into theYear
>  put item 2 of theDate + (12 * theDay) - 3 into theMonth
>  put item 3 of theDate + \
>((153 * theMonth + 2) div 5) + \
>(365 * theYear) + \
>(theYear div 4) - \
>(theYear div 100) + \
>(theYear div 400) - \
>32045 into theDate
>  break
>   case "standard date"
>  put format("%02d/%02d/%04d", item 2 of theDate, item 3 of theDate, \
>item 1 of theDate) into theDate
>  break
>   default
>  Answer info “‘“ & theFormat & “‘ is not a validate parameter.” As 
> sheet
>  put tSavedDate into theDate
>END SWITCH
>
>return theDate
> END formatDate
>
> ___
> 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: formatDate() Function Update

2024-02-28 Thread Bob Sneidar via use-livecode
Should read:


standard date: The date in the form of "mm/dd/"

On Feb 28, 2024, at 10:42 AM, Bob Sneidar via use-livecode 
 wrote:

  standard date: The date in the form of theFormat

___
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


formatDate() Function Update

2024-02-28 Thread Bob Sneidar via use-livecode
Not to be confused with the built-in dateFormat() function, I wrote a special 
formatDate() function a few years back because I had a need to get a given date 
in unsupported formats. Particularly I needed an SQL Date format in the form of 
-mm-dd. 

I have been frustrated also that there is no built-in function to return a date 
in the mm/dd/ format, so I just updated my function to include that form 
using “standard date” as the format parameter. (I can’t think what else to call 
it. "Y2K Date” seems cheesy.) 

Here is the code if anyone is interested. I should also submit it to the Master 
Library. I will have to grok how to do that again. 

Bob S



FUNCTION formatDate theDate, theFormat
   /*
   Accepts any valid date for the first parameter. If not a valid date, it 
simply returns
   what was passed. Second parameter can be any of the following:
   sql date: date in the -mm-dd format
   short date, abbreviated date, internet date, long date: LC versions of the 
same
   julian date: Julian number based on (I believe) Jacques formula
   standard date: The date in the form of theFormat
   */
   
   put theDate into tSavedDate
   put the itemdelimiter into theOldDelim
   set the itemdelimiter to "-"
   
   IF the length of item 1 of theDate = 4 AND \
 the number of items of theDate = 3 AND \
 item 1 of theDate is a number AND \
 item 2 of theDate is a number AND \
 item 3 of theDate is a number THEN
  put item 2 of theDate & "/" & \
item 3 of theDate & "/" & \
item 1 of theDate into theDate
   END IF
   
   -- replace "." with "/" in theDate
   convert theDate to dateitems
   set the itemdelimiter to theOldDelim
   
   if the number of items of theDate <> 7 then
  answer "'" & theDate & "' is not a valid date format!"
  return tSavedDate
   end if
   
   SWITCH theFormat
  CASE "sql date"
 /*
 put item 1 of theDate & "-" & \
   format("%02d",item 2 of theDate) & "-" & \
   format("%02d",item 3 of theDate) into theDate
 */
 put format("%s-%02d-%02d", item 1 of theDate, item 2 of theDate, \
   item 3 of theDate) into theDate
 break
  CASE "short date"
 convert theDate from dateitems to short date
 break
  CASE "abbreviated date"
 convert theDate from dateitems to abbreviated date
 break
  CASE "abbr date"
 convert theDate from dateitems to abbreviated date
 break
  CASE "internet date"
 convert theDate from dateitems to internet date
 break
  CASE "long date"
 convert theDate from dateitems to long date
 break
  CASE "julian date"
 put the date into theDate
 convert theDate to dateItems
 IF  ((item 2 of theDate = 1) OR (item 2 of theDate = 2)) THEN
put 1 into theDay
 ELSE
put 0 into theDay
 END IF
 put item 1 of theDate + 4800 - theDay into theYear
 put item 2 of theDate + (12 * theDay) - 3 into theMonth
 put item 3 of theDate + \
   ((153 * theMonth + 2) div 5) + \
   (365 * theYear) + \
   (theYear div 4) - \
   (theYear div 100) + \
   (theYear div 400) - \
   32045 into theDate
 break
  case "standard date"
 put format("%02d/%02d/%04d", item 2 of theDate, item 3 of theDate, \
   item 1 of theDate) into theDate
 break
  default 
 Answer info “‘“ & theFormat & “‘ is not a validate parameter.” As sheet
 put tSavedDate into theDate
   END SWITCH
   
   return theDate
END formatDate

___
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: Enhanced HTTPD - native HTTP 1.1 Livecode Socket Server

2024-02-28 Thread Richard Gaskin via use-livecode
FWIW I haven't heard from David, but with the economic numbers off to a good 
start this year I suspect he's just been as busy as most I know.

I know of at least one other LC fan with an interest in decentralized 
protocols, but I'm not sure how far he's gotten with his implementations.  I've 
mentioned LC in some of those circles, but those communities tend to make and 
use FOSS tools, so the conversation is usually very short.

Richard Gaskin
FourthWorld.com



On February 28, 2024 at 9:00 AM, Mike Kerner wrote:
> 
> just pinging to see if anything more has happened on this
> 
> and the how list is really quiet
> 
> On Tue, Feb 6, 2024 at 11:09?PM ambassador--- via use-livecode <
> 
> use-livecode@lists.runrev.com> wrote:
> 
> > David Bovill wrote:
> > 
> >  I've been working for a while on a native server written in Livecode 
> >  using sockets. I feel it is definitely something that is sorely needed
> >  - but to do it properly is more work that I initially thought. I need
> >  to add HTTP 206 partial content support -
> >  https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/206. I expect
> >  there to be other things that will need to be added.
> >  Is anyone interested / need this? Or does anyone already have something
> >  they use?
> > 
> MC shipped with a simple HTTPd example included, and many years ago back
> 
>  when Pierre was still active here I dusted it off to add support for HTTP
>  1.1 so it would work with modern browsers: 
>  https://fourthworld.net/lc/mchttpd-4W.zip
> 
> It's been years since I touched it, and IIRC the only other change I made 
> was to use callbacks for both ends of the network I/O (for some reason
> Raney had used callbacks only on one side, tho I can't recall if his was on
> the write or read end). Callbacks for net I/O help a lot.
> 
> If you're already far enough down the road to be thinking of 206 errors,
> there's likely nothing here you haven't already written. But as an example 
> (slightly updated) of the sort of thing that used to ship with old versions 
> to encourage exploration of network apps, it may be a fun trip down memory 
> lane.
> 
> A question, if interesting to answer: one of the reasons I set this aside 
> was the beginning of a process of moving away from my own homegrown tools 
> for generic commodities like socket servers. Apache and Node cover most of 
> what I've needed since, and I don't have to maintain them, so I can focus
> on the stuff specific to my app. What are you working on these days? I 
> stumbled across your chat with Ward Cunningham in the Full Moon Happening 
> just a few months ago; good stuff. Curious if your interest in
> decentralization is still a focus, and whether it also includes things like 
> IPSF and blockchains. Maybe offlist if it's not too LiveCodey is fine.
>
> Richard Gaskin 
> 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: Enhanced HTTPD - native HTTP 1.1 Livecode Socket Server

2024-02-28 Thread Mike Kerner via use-livecode
just pinging to see if anything more has happened on this
and the how list is really quiet

On Tue, Feb 6, 2024 at 11:09 PM ambassador--- via use-livecode <
use-livecode@lists.runrev.com> wrote:

> David Bovill wrote:
>
> > I've been working for a while on a native server written in Livecode
> > using sockets. I feel it is definitely something that is sorely needed
> > - but to do it properly is more work that I initially thought. I need
> > to add HTTP 206 partial content support -
> > https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/206. I expect
> > there to be other things that will need to be added.
> >
> > Is anyone interested / need this? Or does anyone already have something
> > they use?
>
>
> MC shipped with a simple HTTPd example included, and many years ago back
> when Pierre was still active here I dusted it off to add support for HTTP
> 1.1 so it would work with modern browsers:
>
> https://fourthworld.net/lc/mchttpd-4W.zip
>
> It's been years since I touched it, and IIRC the only other change I made
> was to use callbacks for both ends of the network I/O (for some reason
> Raney had used callbacks only on one side, tho I can't recall if his was on
> the write or read end). Callbacks for net I/O help a lot.
>
> If you're already far enough down the road to be thinking of 206 errors,
> there's likely nothing here you haven't already written.  But as an example
> (slightly updated) of the sort of thing that used to ship with old versions
> to encourage exploration of network apps, it may be a fun trip down memory
> lane.
>
>
> A question, if interesting to answer: one of the reasons I set this aside
> was the beginning of a process of moving away from my own homegrown tools
> for generic commodities like socket servers.  Apache and Node cover most of
> what I've needed since, and I don't have to maintain them, so I can focus
> on the stuff specific to my app.  What are you working on these days? I
> stumbled across your chat with Ward Cunningham in the Full Moon Happening
> just a few months ago; good stuff. Curious if your interest in
> decentralization is still a focus, and whether it also includes things like
> IPSF and blockchains.  Maybe offlist if it's not too LiveCodey is fine.
>
>
> Richard Gaskin
> 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
>


-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."
___
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