Re: What the heck? Writing and reading ios files??

2020-06-25 Thread Prothero-ELS via use-livecode
JB,
Thanks for the comment. Yes, I went back to my previous use of “_” in the file 
name. All is working now. It was the difference between “l” and “L” in a file 
name. Sheesh!
Bill

William Prothero
https://earthlearningsolutions.org

> On Jun 25, 2020, at 2:27 PM, JB via use-livecode 
>  wrote:
> 
> I don’t think the underscore character “_” should cause any problems
> in the pathname but if you use a space in the name you need to be
> sure and enclose the pathname in quotes or it will fail.
> 
> JB
> 
>> On Jun 25, 2020, at 1:53 PM, Terry Judd via use-livecode 
>>  wrote:
>> 
>> On 26/06/2020, 02:40, "use-livecode on behalf of William Prothero via 
>> use-livecode" > use-livecode@lists.runrev.com> wrote:
>> 
>>   Jacqueline:
>>   Thanks for responding. I am really stuck on this. 
>> 
>>   I can write the file, and get a list of the files I write, but when I try 
>> to read the file using the same code to create the filepaths, etc, the read 
>> routine says the file doesn’t exist. It all works in the dev environment. I 
>> had used a “_” char in the filenames, so I removed it. The read routine 
>> can’t find the file. Very wierd.
>> 
>>   I’m going to try to make a very simple test case that I can run on my 
>> phone and post it, but I’m going to take a break. I’ve posted my file 
>> reading and writing code here, but there is probably too much to go through. 
>> 
>>   Thanks for responding,
>>   Bill
>> 
>> 
>> Hi  Bill - here's an example script that I use cross-platform (desktop, iOS 
>> and Android) for reading and writing a settings file using 
>> specialFoderPath("documents") on mobile and specialFolderPath("support") on 
>> desktop. In this case the 'settings' are an array that are stored in a 
>> multipurpose global array (gData).
>> 
>> Terry... 
>> 
>> global gData
>> 
>> on setPaths
>>  switch environment()
>> case "mobile"
>>put specialFolderPath("documents")&"/" into tFolder
>>break
>> default
>>put specialFolderPath("support")&"/myAppName/" into tFolder
>>if not (there is a folder tFolder) then
>>   create folder tFolder
>>end if
>>  end switch
>>  put tFolder&"settings.dat" into gData["paths"]["settings"]
>> end setPaths
>> 
>> on loadSettings
>>  put gData["paths"]["settings"] into tPath
>>  put url ("binfile:") into tSettings
>>  if tSettings is not empty then
>> put arrayDecode(tSettings) into tSettingsA
>> if tSettingsA is an array then
>>put tSettingsA into gData["settings"]
>> else
>># invalid settings data
>> end if
>>  else
>> # no settings file
>>  end if
>> end loadSettings
>> 
>> on updateSettings
>>  put gData["paths"]["settings"] into tPath
>>  put gData["settings"] into tSettings
>>  put arrayEncode(tSettings) into tSettings
>>  put tSettings into url ("binfile:")
>> end updateSettings
>> 
>> on clearSettings
>>  put gData["paths"]["settings"] into tPath
>>  if there is a file tPath then delete file tPath
>> end clearSettings
>> 
>> ___
>> 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


Re: Chromebook apps?

2020-06-22 Thread Prothero-ELS via use-livecode
Thanks for the info, folks! I don’t see anything that would draw me to 
Chromebooks.
Seems it’s another world. Too bad. Education really needs good apps at all 
levels and chromebooks are a bright target.

 EST,
Bill

William Prothero
https://earthlearningsolutions.org

> On Jun 22, 2020, at 2:02 PM, John McKenzie via use-livecode 
>  wrote:
> 
> 
> Despite using Raspberry Pi devices allot I somehow did not think of
> ARM chips. I did not know Chromebooks were based on them.
> 
> ___
> 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: Set Line color in dG?

2020-06-16 Thread Prothero-ELS via use-livecode
Zryp,
Crap, accidentally sent the response without finishing.

I was checking that the code in my test button was actually talking to the 
datagrid in question, and it returned the correct values, so I assumed it was. 

I don’t understand how “myBtn” would participate. I need to change colors from 
some other script.

Best,
Bill

William Prothero
https://earthlearningsolutions.org

> On Jun 16, 2020, at 1:04 PM, Prothero-ELS 
>  wrote:
> 
> Zryp,
> What I wanted to do is make a distinction between data that was retrieved 
> from a database and data that was entered but not yet stored. A datagrid is. 
> Way overkill for what I’m doing, but  the button that accesses the 
> datagrid data to get the specific line is for testing only. 
> 
> William Prothero
> https://earthlearningsolutions.org
> 
>> On Jun 16, 2020, at 12:52 PM, zryip theSlug via use-livecode 
>>  wrote:
>> 
>> Bill,
>> 
>> The example you mention is probably using a custom column behavior script
>> for accomplishing this.
>> Do you have copied the button in your project? The button must be linked to
>> your datagrid by using the following code:
>> 
>> set the dgProp["default column behavior"] of grp "myDatagrid" to the long
>> id of btn "myBtn"
>> 
>> 
>> Best Regards,
>> 
>> 
>>> On Tue, Jun 16, 2020 at 8:55 PM William Prothero via use-livecode <
>>> use-livecode@lists.runrev.com> wrote:
>>> 
>>> Folks:
>>> I’m having trouble getting the line color of a dataGrid to change. The
>>> lessons shows a very simple tutorial and the download example works.
>>> However, in my application, it doesn’t.
>>> 
>>> The code is:
>>> on mouseup
>>> 
>>>   put the dgDataOfLine[3] of group "meterReadings" of this cd into
>>> theDataA
>>> 
>>>   put not theDataA["line has error"] into theDataA["line has error"]
>>> 
>>>   set the dgDataOfLine[3] of group "meterReadings" of this cd to theDataA
>>> 
>>> end mouseup
>>> 
>>> I get the expected values for the line shown on the datagrid, but the
>>> color doesn’t change. I’m running Catalina 10.15.5 on a pretty new Mac
>>> laptop. I’m using livecode 9.6.0 Business.
>>> 
>>> The mystery is that the downloaded example works as expected, but not on
>>> my app.
>>> 
>>> Have I missed something?
>>> 
>>> Best,
>>> Bill
>>> 
>>> 
>>> William A. Prothero
>>> https://earthlearningsolutions.org
>>> 
>>> 
>>> ___
>>> 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
>>> 
>> 
>> 
>> -- 
>> Zryip TheSlug
>> http://www.aslugontheroad.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: Set Line color in dG?

2020-06-16 Thread Prothero-ELS via use-livecode
Zryp,
What I wanted to do is make a distinction between data that was retrieved from 
a database and data that was entered but not yet stored. A datagrid is. Way 
overkill for what I’m doing, but  the button that accesses the datagrid 
data to get the specific line is for testing only. 

William Prothero
https://earthlearningsolutions.org

> On Jun 16, 2020, at 12:52 PM, zryip theSlug via use-livecode 
>  wrote:
> 
> Bill,
> 
> The example you mention is probably using a custom column behavior script
> for accomplishing this.
> Do you have copied the button in your project? The button must be linked to
> your datagrid by using the following code:
> 
> set the dgProp["default column behavior"] of grp "myDatagrid" to the long
> id of btn "myBtn"
> 
> 
> Best Regards,
> 
> 
>> On Tue, Jun 16, 2020 at 8:55 PM William Prothero via use-livecode <
>> use-livecode@lists.runrev.com> wrote:
>> 
>> Folks:
>> I’m having trouble getting the line color of a dataGrid to change. The
>> lessons shows a very simple tutorial and the download example works.
>> However, in my application, it doesn’t.
>> 
>> The code is:
>> on mouseup
>> 
>>put the dgDataOfLine[3] of group "meterReadings" of this cd into
>> theDataA
>> 
>>put not theDataA["line has error"] into theDataA["line has error"]
>> 
>>set the dgDataOfLine[3] of group "meterReadings" of this cd to theDataA
>> 
>> end mouseup
>> 
>> I get the expected values for the line shown on the datagrid, but the
>> color doesn’t change. I’m running Catalina 10.15.5 on a pretty new Mac
>> laptop. I’m using livecode 9.6.0 Business.
>> 
>> The mystery is that the downloaded example works as expected, but not on
>> my app.
>> 
>> Have I missed something?
>> 
>> Best,
>> Bill
>> 
>> 
>> William A. Prothero
>> https://earthlearningsolutions.org
>> 
>> 
>> ___
>> 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
>> 
> 
> 
> -- 
> Zryip TheSlug
> http://www.aslugontheroad.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: Map Widget - how does it actually work?

2020-05-30 Thread Prothero-ELS via use-livecode
Graham,
My demo stack was enhanced a lot by Hermann but I don’t know where it is, after 
a cursory search. He added a bunch of other capabilities, but I felt a quick 
look at the Google map docs would make it easy to add them. His expanded 
version may be in the examples repository. I didn’t check it.

My main problem was to calculate the bounding lat/lons of the displayed map.

Good luck with it.

William Prothero
https://earthlearningsolutions.org

> On May 29, 2020, at 11:24 PM, Graham Samuel via use-livecode 
>  wrote:
> 
> Bill, thanks for all this. I will study it today (it’s breakfast time in 
> France as I write this).
> 
> I did some internet searching to look at the underlying Apple Map system - 
> which is used for the LC version of the Map widget for iOS - and its API. 
> It’s rich and complex, so the widget just scratches the surface of the 
> available functionality, 
> 
> This saddened my a bit, but then I reflected on the enormous simplification 
> that LC represents for a developer compared with what you’d have to learn and 
> apply before getting anywhere at all coding a mobile app ‘outside’ LC. It 
> really is quite alarming. I was a geek once, and learned and applied some 
> very obscure languages within very primitive and obscure systems, but I have 
> zero taste for that sort of thing now. As a further example, take a quick 
> look at what Apple say to attract you to their Swift language. They want to 
> tell you it’s easy and fun - I think one can have a contrary opinion, 
> especially if one has never coded in Objective-C or anything like it. [That 
> was a pro-LiveCode rant, in case you didn’t notice.]
> 
> Graham
> 
>> On 30 May 2020, at 00:44, prothero--- via use-livecode 
>>  wrote:
>> 
>> Graham:
>> If that doesn’t have everything, I have a zip file at:
>> http://earthlearningsolutions.org/google-static-maps-demo/ 
>> 
>> William A. Prothero
>> Santa Barbara, CA. 93105
>> http://earthlearningsolutions.org/
>> 
 On May 29, 2020, at 3:42 PM, William Prothero via use-livecode 
  wrote:
>>> 
>>> Graham:
>>> Here is a link to an example that I, with lots of help from Hermann 
>>> created. Maybe it will be useful. All done in livecode, so it should work. 
>>> Haven’t tried it since 2017, tho.
>>> Bill
>>> 
>>> https://www.dropbox.com/s/kg5l80bi82u1sap/google-maps-demo.livecode?dl=0 
>>> 
>>> 
>>> William A. Prothero
>>> https://earthlearningsolutions.org
>>> 
 On May 25, 2020, at 1:57 PM, Graham Samuel via use-livecode 
  wrote:
 
 Back to my problems with inadequate documentation on widgets. The Map 
 widget is probably very powerful, but the Dictionary entry simple tells 
 you the names of the parameters. I can’t work out anything about the 
 format of the data you can feed in, or what it looks like when it comes 
 out. There isn’t even enough info to start a meaningful experiment, IMHO.
 
 Does anyone know of a source of helpful documentation on this? I am as 
 ever interested in the iOS version.
 
 Thanks for any info.
 
 Graham
 ___
 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
> 
> 
> ___
> 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: Our Next Community Zoom Meeting

2020-05-18 Thread Prothero-ELS via use-livecode
Folks,
Sometimes Apple’s auto-correct embarrasses me, especially if I carelessly don’t 
read what I just typed.

I know Heather” is not spelled “Hear her”.

The time zone for the meeting time will help me not miss it by hours.

Best,
Bill

William Prothero
https://earthlearningsolutions.org

> On May 18, 2020, at 7:51 AM, Prothero-ELS 
>  wrote:
> 
> Hear her,
> Friday, 4PM... time zone? 
> Thanks,
> Bill
> 
> William Prothero
> https://earthlearningsolutions.org
> 
>> On May 18, 2020, at 6:31 AM, Heather Laine via use-livecode 
>>  wrote:
>> 
>> Dear List Folks,
>> 
>> I have scheduled our next use-list/community zoom meeting for 4pm, Friday, 
>> 22nd May. I hope as many as possible of you can join me. 
>> 
>> These meetings are open to anyone who wishes to discuss LiveCode, share 
>> hints and tips and see a friendly face during this period of isolation for 
>> many. I will be there in a moderation capacity, to facilitate discussion. 
>> The actual debate, discussion, conversation and topics is down to you guys 
>> and gals! Come along and bring a topic you'd like to share/learn information 
>> on. Just to reiterate, the usual list rules apply: we're talking LiveCode, 
>> we're not talking religion or politics, and cheese should be kept to a 
>> minimum :)
>> 
>> Registration link:
>> 
>> https://us02web.zoom.us/meeting/register/tZckc-Guqz4pGtbgnkR6LW64h2ml_Y2FpMjU
>>  
>> 
>> 
>> 
>> Best Regards,
>> 
>> Heather
>> 
>> 
>> Heather Laine
>> Customer Services Manager
>> LiveCode Ltd
>> www.livecode.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: Our Next Community Zoom Meeting

2020-05-18 Thread Prothero-ELS via use-livecode
Hear her,
Friday, 4PM... time zone? 
Thanks,
Bill

William Prothero
https://earthlearningsolutions.org

> On May 18, 2020, at 6:31 AM, Heather Laine via use-livecode 
>  wrote:
> 
> Dear List Folks,
> 
> I have scheduled our next use-list/community zoom meeting for 4pm, Friday, 
> 22nd May. I hope as many as possible of you can join me. 
> 
> These meetings are open to anyone who wishes to discuss LiveCode, share hints 
> and tips and see a friendly face during this period of isolation for many. I 
> will be there in a moderation capacity, to facilitate discussion. The actual 
> debate, discussion, conversation and topics is down to you guys and gals! 
> Come along and bring a topic you'd like to share/learn information on. Just 
> to reiterate, the usual list rules apply: we're talking LiveCode, we're not 
> talking religion or politics, and cheese should be kept to a minimum :)
> 
> Registration link:
> 
> https://us02web.zoom.us/meeting/register/tZckc-Guqz4pGtbgnkR6LW64h2ml_Y2FpMjU 
> 
> 
> 
> Best Regards,
> 
> Heather
> 
> 
> Heather Laine
> Customer Services Manager
> LiveCode Ltd
> www.livecode.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: Sad truth about iOS apps

2020-05-15 Thread Prothero-ELS via use-livecode
Graham,
You may be able to find a used Mac that will run Catalina. My old MacBook Pro 
was one of the earliest that had 64 bit processor, but when it’s battery 
started interfering with the trackpad, I panicked and bought a new MacBook Pro. 
Then I took my old MacBook Pro to be fixed and it returned looking like new and 
working perfectly. So, I set it up for my wife, who had an even older Mac. 
Anyway, my new MacBook Pro is way faster and is a joy to use. I did have to buy 
a number of adapters to get my older usb devices to work.

I get this in a Google search.

“Apple advises that macOS Catalina will run on the following Macs: MacBook 
models from early 2015 or later. MacBook Air models from mid-2012 or later. 
MacBook Promodels from mid-2012 or later.”

Good luck,
Bill

William Prothero
https://earthlearningsolutions.org

> On May 15, 2020, at 9:04 AM, Graham Samuel via use-livecode 
>  wrote:
> 
> As many of you will know, I have been struggling to create an iPhone app - 
> very unfamiliar territory for  me. It’s been an education. Without help from 
> this list and the mother ship I would have been dead in the water long ago. 
> Finally I can see the (beta version of) the app running on my iPhones - 
> yipee! The next step is to get it out there via TestFlight so that a few 
> friends can mess with it.
> 
> I just went through all the hoops with the Apple App Store to reach the magic 
> TestFlight stage, using the XCode Application Loader. Things looked good 
> until this:
> 
>> ERROR ITMS-90725: "SDK Version Issue. This app was built with the iOS 12.1 
>> SDK. New apps for iPhone or iPad must be built with the iOS 13 SDK or later.”
> 
> My iMac can only run High Sierra, and High Sierra can only run XCode 10.1, 
> and AFAIK that version of XCode only runs SDK 12.1. I think that means I get 
> a new Mac or give up.
> 
> Please tell me if I’m wrong.
> 
> Graham
> 
> PS I would really like a new Mac, but the budget is the problem!
> ___
> 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: Has anyone experience of GPS on iPhone?

2020-05-06 Thread Prothero-ELS via use-livecode
Graham,
Mark’s comments make sense. Your quality test where you set the phone down in a 
fixed location and look at the results seems good also. If it can’t pass that 
test, nothing else will work.
Best,
Bill

William Prothero
https://earthlearningsolutions.org

> On May 6, 2020, at 7:52 AM, Mark Waddingham via use-livecode 
>  wrote:
> 
> On 2020-05-06 14:09, Graham Samuel via use-livecode wrote:
>> Bill, I think you are confirming that there is some mystery here.
>> There are a lot of apps that seem to get location, and measures
>> derived from location, almost completely right, whereas I am having
>> trouble doing so with what must be the same essential data.
>> How then to avoid either under- or over-estimating the trip distance?
>> Plenty of apps have done it but I just can’t see how, although I keep
>> tinkering with the parameters. Of course I can never forget that my
>> scripting might just be plain wrong, but so far my incremental method
>> hasn’t worked sufficiently well, in the sense that if run the app and
>> choose to walk in an exact straight line, I can compare a single
>> measure of distance from the starting point with my integral approach.
>> So far the result is not even close. As you say, intensive Internet
>> searches are called for.
> 
> I'm pretty sure that the data you are getting is precisely what all other 
> apps will get - we are just returning the location data as provided by 
> CoreLocation. The difference will be the analysis which these apps are doing 
> on the data to derive an accurate assessment of the route taken I'd imagine. 
> Indeed, it could be they also take into account other senses (compass and 
> accelerometer) to help - but I don't know that for sure.
> 
> There are two functions which might help you with your endeavour:
> 
>  mobileSetLocationHistoryLimit
>  mobileGetLocationHistory()
> 
> The details are in the docs, but basically the engine can collect and keep a 
> list of locations which you can collect periodically.
> 
> I suspect the way to think about this is not to think about it as an 
> incremental thing at all as any outliers will completely destroy the 
> accuracy. Instead imagine it as a 'curve-fitting' exercise (piece-wise linear 
> approximation is probably sufficient!) - i.e. taking sets of (slightly) 
> overlapping samples and derive a 'best-guess' path which fits the data.
> 
> It is likely that some cleaning of the data would be needed first to 
> eliminate outliers also. e.g. You can compute speed needed to get between 
> individual points, if any given point is outside of a reasonable range of 
> 'current' speed with approximated acceleration/deceleration taken into 
> account then it should be discarded.
> 
> Doing a google search for "deriving a approximate path from gps data" turns 
> up quite a lot of literature on the subject, so this is definitely something 
> which has/is studied in depth...
> 
> Warmest Regards,
> 
> Mark.
> 
> -- 
> Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
> LiveCode: Everyone can create apps
> 
> ___
> 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: Has anyone experience of GPS on iPhone?

2020-05-06 Thread Prothero-ELS via use-livecode
Graham,
You have probably done this, but maybe not, so...
I would not process each location changed value as a distance moved. I would 
use them to average a new location, and use that location, after averaging, to 
calculate the distance moved. Also, location changed messages may not come at 
equal time intervals, so bad values may induce bias in an average, and that 
could be be source of spurious distances.

So, the first calculation would be to get a good location. Then that location 
would be used to calculate a distance moved. You could try to calculate the 
standard deviation of the location average to try to get an estimate of quality 
and possibly reject bad ones. Also, if location changed messages come in 
unequal intervals, and you include a burst of bad values in your average, it 
will bias the average. You might want to simply query the gps location at equal 
time intervals for your average location calculation.

I haven’t tried to use the iPhone gps to do these calcs, so I’m just thinking 
off the “top” of my head. It is an interesting problem, though, so please keep 
me informed when you figure it out. 

Have fun! It’s science!

Best,
Bill



William Prothero
https://earthlearningsolutions.org

> On May 6, 2020, at 6:10 AM, Graham Samuel via use-livecode 
>  wrote:
> 
> Bill, I think you are confirming that there is some mystery here. There are 
> a lot of apps that seem to get location, and measures derived from location, 
> almost completely right, whereas I am having trouble doing so with what must 
> be the same essential data.
> 
> Take the problem of measuring the length of a country walk (I mean a walk not 
> in a straight line). My basic approach is to process locationChanged 
> messages, which unsurprisingly are triggered every time the GPS-measured 
> location changes. So as not to get overwhelmed with very small, frequent 
> changes, I only process a locationChanged message every 3 seconds - I know at 
> least one other app that does this. As a person probably walks up to two 
> metres a second, this fits in with what we know about accuracy, I think. The 
> method is very simple. Every time we respond to a locationChanged message, we 
> work out the straight line distance delta as in
> 
>  delta = (where we were 3 seconds ago) - (where we are now)
> 
> Ignoring the sign of the result, of course. This can be done by Haversine or 
> similar algorithms for measuring short distances on the Earth’s surface - 
> it’s essentially a Pythagoras calculation. Then we add up all the deltas and 
> we know how far we walked on the trip with a fair if not complete degree of 
> accuracy - easy! 
> 
> Only there are complications. Of course if any delta is zero, it doesn’t 
> contribute to the trip; but what if it’s **nearly** zero - is it sensible to 
> ignore very small deltas on the grounds that they are due to GPS wobble, or 
> should we put them all in? 
> 
> Here’s what happened when I tried to do it: first I calculated the deltas to 
> two decimal places, and I found that I was badly underestimating the distance 
> walked; so then I pushed up the accuracy of the calculation to 5 decimal 
> places. Sure enough, the measured route got longer in kilometers, until I 
> noticed that if I simply put the phone on the grass and left it, so it wasn’t 
> moving at all, in about 45 minutes I’d accumulated a completely spurious half 
> a kilometre of walking! The small variations in the GPS signal (what I call 
> the wobble) must have been responsible, since there was no other source of 
> data but the GPS reading.
> 
> How then to avoid either under- or over-estimating the trip distance? Plenty 
> of apps have done it but I just can’t see how, although I keep tinkering with 
> the parameters. Of course I can never forget that my scripting might just be 
> plain wrong, but so far my incremental method hasn’t worked sufficiently 
> well, in the sense that if run the app and choose to walk in an exact 
> straight line, I can compare a single measure of distance from the starting 
> point with my integral approach. So far the result is not even close. As you 
> say, intensive Internet searches are called for.
> 
> I wish all this were easier.
> 
> Graham
> 
>> On 5 May 2020, at 15:58, Prothero-ELS via use-livecode 
>>  wrote:
>> 
>> Graham,
>> This makes me wonder how the Google and Apple Maps get their accuracy. When 
>> driving or walking, trying to figure out how to get to an address, it shows 
>> me walking along a street, certainly more accurate than 20meters. Yet, when 
>> I’m wondering where my wife is, and load up “Find My iphone”, the location 
>> does jump around (easily 20 meters) for awhile, then seems to settle down. 
>> Hmm... In the olden days, NASA used to add error i

Re: OT: How to graph a specific data set?

2020-05-05 Thread Prothero-ELS via use-livecode
Paul,
Still, if there is some parameter that you want to examine that correlates to 
the intersections, that would influence your chart. I am suspecting you want to 
keep the experiment confidential, but I would need a lot more information about 
the source of the data and goals of the experiment to make useful comments. 
But, I think if you carefully state the questions that are being asked about 
the data, the answer will become more clear to you.

I suspect the researchers would want to assess correlations between 
intersections, or the lack of, with other variables. Offhand, you could map the 
intersections and color code them with the magnitude of the variable you are 
trying to correlate them with. Just guessing That assumes the intersections 
are geographic and there are other variables related to the intersection.

I’d be glad to brainstorm with you off-list, if you think it would be helpful.

Best,
Bill

William Prothero
https://earthlearningsolutions.org

> On May 5, 2020, at 8:30 AM, Paul Dupuis via use-livecode 
>  wrote:
> 
> On 5/5/2020 11:17 AM, Prothero-ELS via use-livecode wrote:
>> Paul,
>> The first question I have is: “what are you trying to communicate with your 
>> chart?” The answer to that question will point to a charting strategy.
>> Bill
> 
> I am trying to visually call attention to those intersections with high 
> occurrences.
> 
> However, the labels that I replaced with the alphabet for confidentiality 
> have meaning to the researchers looking at this and they may equally be 
> fascinated when a pair has NO intersections in the data.
> 
> ___
> 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: OT: How to graph a specific data set?

2020-05-05 Thread Prothero-ELS via use-livecode
Paul,
The first question I have is: “what are you trying to communicate with your 
chart?” The answer to that question will point to a charting strategy.
Bill

William Prothero
https://earthlearningsolutions.org

> On May 5, 2020, at 7:53 AM, Paul Dupuis via use-livecode 
>  wrote:
> 
> This is NOT a "How to do this in LiveCode" question.
> 
> I have a data set (below), produced by a LiveCode program and the data is 
> exported to Excel.
> 
> I am trying to figure out:
> 
> 1) What the "best" style of graph to visualize this data is? I thought 
> perhaps a "Bubble Chart" but  - in Excel at least - does not seem to work for 
> this data.
> 
> 
> 2) After determining the "best" chart style is, what charting tool (if not 
> Excel) can generate that style of chart for this data?
> 
> Any tips anyone may have would be very welcome.
> 
> The data set is below. This shows that "A" intersects with B once and C 
> intersects with J 4 times (as example of how to read the data). I have 
> replaced the actual labels (text strings for rows and columns) with the 
> English alphabet for simplicity.
> 
> 
> 
>ABCDEFGHIJKLMNO
> PQRSTUVWX YZ
> A010000000000000  
>   00000000 000
> B
>000000000000000
> 0000000000
> C
>
>000001041020011
> 001001011
> D
>
>
>000100010001000
> 10000010
> E
>
>
>
>010000101000000
> 0000000
> F
>
>
>
>
>000000000000000
> 000000
> G
>
>
>
>
>
>000000000000000
> 00010
> H
>
>
>
>
>
>
>000000001000000
> 0000
> I
>
>
>
>
>
>
>
>000100000000000
> 000
> J
>
>
>
>
>
>
>
>
>010100000000000
> 00
> K
>
>
>
>
>
>
>
>
>
>001000001001100> 0
> L
>
>
>
>
>
>
>
>
>
>
>000200000000000
> M
>
>
>
>
>
>
>
>
>
>
>
>00000000000000
> N
>
>
>
>
>
>
>
>
>
>
>
>
>0000000000000
> O
>
>
>
>
>
>
>
>
>
>
>
>
>
>100010000100
> P
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>00101000011
> Q
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>0000000000
> R
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>000000000
> S
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>00000000
> T
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>0000011
> U
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>000000
> V
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>00000
> W
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>0100
> X
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>000
> Y
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>01
> Z
>
>
>
>
>
>
>
>
>
>
>
>  

Re: OT: Need some offlist help with PHP-SQL

2020-05-05 Thread Prothero-ELS via use-livecode
Tiemo,
I have some demo code that uses AES encryption to communicate securely with A 
mysql database. It might help.

http://earthlearningsolutions.org/google-static-maps-demo/

Good luck, Bill

William Prothero
https://earthlearningsolutions.org

> On May 5, 2020, at 6:16 AM, Tiemo via use-livecode 
>  wrote:
> 
> Hello,
> 
> 
> 
> I have some LC front end software, calling PHP scripts going on a SQL db.
> 
> The PHP scripts are not made by me and they are about 10 years old. I have
> to upgrade the PHP version on the webserver of my hosting provider from 7.1
> to 7.4 and within my test environment I am getting some PHP errors when
> testing with 7.4. Probably the issue is only a very small syntax thing with
> missing parentheses or something like that, but I am not good enough in PHP
> to find the issue.
> 
> If you are willing to help me updating my PHP scripts to 7.4, please give me
> a note offlist. I would also like to pay for your work!
> 
> Thank you!
> 
> 
> 
> Tiemo
> 
> 
> 
> 
> 
> 
> 
> ___
> 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: Has anyone experience of GPS on iPhone?

2020-05-05 Thread Prothero-ELS via use-livecode
Graham,
This makes me wonder how the Google and Apple Maps get their accuracy. When 
driving or walking, trying to figure out how to get to an address, it shows me 
walking along a street, certainly more accurate than 20meters. Yet, when I’m 
wondering where my wife is, and load up “Find My iphone”, the location does 
jump around (easily 20 meters) for awhile, then seems to settle down. Hmm... In 
the olden days, NASA used to add error into publicly available gps readings, 
for security reasons. But now errors are not added and geo scientists are 
measuring very small fault motion with gps, but it’s comparing relative motion 
between two stations so wouldn’t apply in your case. I think some serious 
internet searching may be in order.

You must have tried Google Maps with satellite view, to see where it puts you 
relative to your house. You might be interested in this demo of getting google 
maps from Livecode.

http://earthlearningsolutions.org/google-static-maps-demo/

I  made a basic version of this and a hermann (hh), who helped me figure out 
the boundary coordinate calculation, added to it. I think it’s also in the 
livecode repository. It’s a couple of years old, so  

Best,
Bill

William Prothero
https://earthlearningsolutions.org

> On May 5, 2020, at 2:30 AM, Graham Samuel via use-livecode 
>  wrote:
> 
> Thanks Bill for your two messages. I see from the link you gave that the LC 
> system is (as expected) simply a wrapper for the iOS API, and indeed the term 
> “horizontal accuracy” is actually used internally in iOS. So it’s unlikely 
> that LC itself is adding to my problems.
> 
> I don’t have access to an entirely different GPS system - all mine are on 
> iPhones and I’m in lockdown. Google Earth reckons my reference point is at 
> 43.276693, 2.160029. (The curious can see where I live).
> 
> Here is a little test done by simply sitting on a bench in my garden - as far 
> as possible, this is what Google Earth is looking at.
> 
> Another app - “MyAltitude” on my phone. Location 43.2766, 2.1601
> 
> Built-in “Compass” app. Location 43.2766, 2.1600
> 
> My app - successive calls to mobileCurrentLocation a few seconds apart differ 
> only beyond the fourth decimal place, a typical one is 43.276732 (so 43.277), 
> 2.160163 (so 2.1602). During this set of about 20 measurements, horizontal 
> accuracy varied from a minimum of 5 to a maximum of 23, tending to settle 
> down to the lower end - but on other days I’ve seen much higher maxima, 
> certainly above 60 and very occasionally a lot more.
> 
> So the readings agree, at least to three decimal places. Presumably the 
> accuracy is supposed to tell me the amount of wobble to expect, although it’s 
> measured in metres, whereas longitude and latitude are not so 
> straightforward, since the grid covers a spherical earth. Where I live 
> (England and the South of France), the North-South distance of a second of 
> arc (or .000278 in decimal measurement) is about 20 metres, which is perhaps 
> acceptable in short journeys such as walks, so I need to take account of say 
> four or five decimal places if I’m going to hope for reasonable accuracy. 
> This certainly looks feasible - my only real problem therefore is the wild 
> variation in horizontal accuracy that I’m seeing.
> 
> All this makes me think that I should not have a target accuracy, since I may 
> never hit the target and my user will be waiting forever to start his or her 
> trip. I am therefore about to modify the app so it only looks for consistency 
> - as soon as the horizontal accuracy settles down to a value without say more 
> than five percent of variation, I will allow the trip to start. Seems weird 
> but it’s the best I can do. Without access to anyone else’s coding for an iOS 
> app, I can’t see a way to improve on that strategy. Obviously I will now run 
> tests to see how my app compared with others that measure on-the-ground trip 
> distance, particularly for short distances. 
> 
> In case anyone else thinks this is interesting (!), I’ll report back.
> 
> Graham
> 
>> On 4 May 2020, at 16:02, Prothero-ELS via use-livecode 
>>  wrote:
>> 
>> Graham,
>> I would want to be verifying the coordinates with another gps device. I’d 
>> also check it against apps that give lat/Lon. 
>> 
>> Bill
>> 
>> William Prothero
>> https://earthlearningsolutions.org
>> 
>>>> On May 4, 2020, at 5:07 AM, Graham Samuel via use-livecode 
>>>>  wrote:
>>> 
>>> I’m using GPS on iPhone using the various commands and functions available 
>>> in LC. Most of this works, but I am having difficulty with the quantity 
>>> “horizontal accuracy”. This can be queried via an array which is returned 
>>> when mob

Re: Has anyone experience of GPS on iPhone?

2020-05-04 Thread Prothero-ELS via use-livecode
Graham,
You may be way beyond this, but I did a bit of googling and this link looked 
relevant.

https://www.smaato.com/blog/optimize-your-location-data-accuracy/

Best,
Bill

William Prothero
https://earthlearningsolutions.org

> On May 4, 2020, at 5:07 AM, Graham Samuel via use-livecode 
>  wrote:
> 
> I’m using GPS on iPhone using the various commands and functions available 
> in LC. Most of this works, but I am having difficulty with the quantity 
> “horizontal accuracy”. This can be queried via an array which is returned 
> when mobileCurrentLocation() is executed. 
> 
> Looking at other iOS apps that use GPS and allow one to examine their data, I 
> find that in my part of the world, accuracy for them is of the order of 5 
> metres: but when I query it using LC I get much higher numbers, indeed some 
> of them look like nonsense, being hundreds of metres!
> 
> I am aware that it takes time for a GPS signal to settle down after 
> mobileStartTrackingSensor “location” has been called, but even if I script 
> the examination of accuracy to wait for it to settle down (I look for a run 
> of similar or identical readings against a ‘reasonable’ criterion, such as 5 
> metres), it still sometimes settles on very large numbers comparatively 
> speaking, for example it might stabilise at 65 metres. With that level of 
> inaccuracy any cumulative use, as in working out the number of kilometres in 
> a trip, would not be reliable.
> 
> I wonder if my expectation is wrong, or if there is something different about 
> LC’s encapsulation of these iOS outputs, or if there is some other 
> explanation.
> 
> In the short term, I’m simply going to have to relax my search for a 
> reasonable accuracy of the order of 5 metres, and just go for the first run 
> of stable readings. But I would love to hear any further insight from anyone 
> who’s already tried it.
> 
> Graham
> ___
> 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: Has anyone experience of GPS on iPhone?

2020-05-04 Thread Prothero-ELS via use-livecode
Graham,
I would want to be verifying the coordinates with another gps device. I’d also 
check it against apps that give lat/Lon. 

Bill

William Prothero
https://earthlearningsolutions.org

> On May 4, 2020, at 5:07 AM, Graham Samuel via use-livecode 
>  wrote:
> 
> I’m using GPS on iPhone using the various commands and functions available 
> in LC. Most of this works, but I am having difficulty with the quantity 
> “horizontal accuracy”. This can be queried via an array which is returned 
> when mobileCurrentLocation() is executed. 
> 
> Looking at other iOS apps that use GPS and allow one to examine their data, I 
> find that in my part of the world, accuracy for them is of the order of 5 
> metres: but when I query it using LC I get much higher numbers, indeed some 
> of them look like nonsense, being hundreds of metres!
> 
> I am aware that it takes time for a GPS signal to settle down after 
> mobileStartTrackingSensor “location” has been called, but even if I script 
> the examination of accuracy to wait for it to settle down (I look for a run 
> of similar or identical readings against a ‘reasonable’ criterion, such as 5 
> metres), it still sometimes settles on very large numbers comparatively 
> speaking, for example it might stabilise at 65 metres. With that level of 
> inaccuracy any cumulative use, as in working out the number of kilometres in 
> a trip, would not be reliable.
> 
> I wonder if my expectation is wrong, or if there is something different about 
> LC’s encapsulation of these iOS outputs, or if there is some other 
> explanation.
> 
> In the short term, I’m simply going to have to relax my search for a 
> reasonable accuracy of the order of 5 metres, and just go for the first run 
> of stable readings. But I would love to hear any further insight from anyone 
> who’s already tried it.
> 
> Graham
> ___
> 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