Re: Pass Javascript Session Cookie to LiveCode Variable?

2020-11-05 Thread Rick Harrison via use-livecode
Hi Matthias,

I found the problem.

You had:  put $_Cookie["username”] 

It shouldn’t have the quotes.

put  $_Cookie[username]

works fine.

I think I made the same mistake sometime!  LOL

Cookies reside in the client’s web-browser which is why
as users were are always clearing them out.

So, LiveCode can read Javascript cookies!  Yay!

It’s good enough for now.  I’ll revisit Javascript session variables later.

Thanks for your help!

Rick

> On Nov 4, 2020, at 2:04 PM, matthias rebbe via use-livecode 
>  wrote:
> 
> Hi Rick,
> 
> i just did a quick test and created an html file which wrote a cookie with 
> javascript
> 
>  
> document.cookie = "username=Rick"; 
> 
> 
> Then in LC Server i used the array $_cookie to read the content of the cookie
> 
> Doing a
> put $_Cookie["username"] 
> 
> returned  Rick
> 
> 
> Regards
> Matthias

___
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: New Google PlayStore Console

2020-11-05 Thread Tom Glod via use-livecode
following,

On Thu, Nov 5, 2020 at 12:46 PM Ralph DiMola via use-livecode <
use-livecode@lists.runrev.com> wrote:

> I received these 3 warnings when uploading APKs using the new Google Play
> Console. The first one I've been seeing for a while. Anyone know about the
> last 2? I assume the second one is LCs use of the JVM.
>
> Warning
> This APK results in unused code and resources being sent to users. Your
> app could be smaller if you used the Android App Bundle. By not optimizing
> your app for device configurations, your app is larger to download and
> install on users' devices than it needs to be. Larger apps see lower
> install success rates and take up storage on users' devices.
>
> Warning
> This APK contains Java/Kotlin code, which might be obfuscated. We
> recommend you upload a deobfuscation file to make your crashes and ANRs
> easier to analyze and debug. Learn More
>
> Warning
> This APK contains native code, and you've not uploaded debug symbols. We
> recommend you upload a symbol file to make your crashes and ANRs easier to
> analyze and debug. Learn More
>
> Ralph DiMola
> IT Director
> Evergreen Information Services
> rdim...@evergreeninfo.net
>
>
> ___
> 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
>


-- 
Tom Glod
Founder & Developer
MakeShyft R.D.A (www.makeshyft.com)
Mobile:647.562.9411
___
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: Segmented Control Widget

2020-11-05 Thread Bob Sneidar via use-livecode
The segmented control is fairly limited. Most of the widgets are. The 
properties you see are the properties you get. I did however, with a bit of 
clever scripting, develop a tabbed object group that works as well or better 
that the built in tabbed button. And for a bonus, it looks in Windows the same 
as it loos on the Mac. Really, the Windows UI is really horrible for LC. I just 
gotta say. It puts the Ugh in Ughly. 

Bob S


> On Nov 5, 2020, at 12:10 PM, J. Landman Gay via use-livecode 
>  wrote:
> 
> On 11/5/20 1:47 AM, Terence Heaford via use-livecode wrote:
>> I have been messing about with the Segmented Control Widget and have been 
>> trying to apply a tooltip.
>> I noted that the tooltip can only be applied to the whole control, it does 
>> not appear possible to have a tooltip for each segment.
>> Is this possible and if so could someone please advise.
> 
> I've done this with a custom control group, it should work with a widget too. 
> Calculate the rectangles (or at least the left and right edges) of each 
> segment and in a mouseEnter handler compare the mouseLoc to the rectangles to 
> see which one it's in. Then set the tooltip to the appropriate string. You 
> can also add a mouseMove handler to do the same thing if you want to change 
> tooltips as the mouseLoc changes inside the widget.
> 
> If the updated tooltip doesn't display reliably, set the tooltip to empty, 
> wait a millisecond or so, and then set it to the new string.
> 
> -- 
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software   | http://www.hyperactivesw.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: Segmented Control Widget

2020-11-05 Thread J. Landman Gay via use-livecode

On 11/5/20 1:47 AM, Terence Heaford via use-livecode wrote:

I have been messing about with the Segmented Control Widget and have been 
trying to apply a tooltip.

I noted that the tooltip can only be applied to the whole control, it does not 
appear possible to have a tooltip for each segment.

Is this possible and if so could someone please advise.


I've done this with a custom control group, it should work with a widget too. Calculate the 
rectangles (or at least the left and right edges) of each segment and in a mouseEnter handler 
compare the mouseLoc to the rectangles to see which one it's in. Then set the tooltip to the 
appropriate string. You can also add a mouseMove handler to do the same thing if you want to 
change tooltips as the mouseLoc changes inside the widget.


If the updated tooltip doesn't display reliably, set the tooltip to empty, wait a millisecond 
or so, and then set it to the new string.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.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


New Google PlayStore Console

2020-11-05 Thread Ralph DiMola via use-livecode
I received these 3 warnings when uploading APKs using the new Google Play 
Console. The first one I've been seeing for a while. Anyone know about the last 
2? I assume the second one is LCs use of the JVM.

Warning
This APK results in unused code and resources being sent to users. Your app 
could be smaller if you used the Android App Bundle. By not optimizing your app 
for device configurations, your app is larger to download and install on users' 
devices than it needs to be. Larger apps see lower install success rates and 
take up storage on users' devices.

Warning
This APK contains Java/Kotlin code, which might be obfuscated. We recommend you 
upload a deobfuscation file to make your crashes and ANRs easier to analyze and 
debug. Learn More

Warning
This APK contains native code, and you've not uploaded debug symbols. We 
recommend you upload a symbol file to make your crashes and ANRs easier to 
analyze and debug. Learn More

Ralph DiMola
IT Director
Evergreen Information Services
rdim...@evergreeninfo.net


___
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: Ideas on iOS GPS tracking needed

2020-11-05 Thread Jimmieson, Phil via use-livecode
Hi Graham,


PS The only test data I have been able to find for the XCode Simulator is a 
bike ride in California which runs along giving a succession of GPS . It is 
quite useful, but naturally it doesn’t involve anomalies.


You can make your own location simulations to run in the iOS simulator. They 
are .gpx files containing coordinate information in XML format.

I created one for my students to use on my App Development (in Swift) module. I 
managed to hack it together and made a simulated walk/run around part of the 
Liverpool University Campus. To make one these you need GPS coordinates (I got 
them from Google Maps) and times - the difference in time from the last step 
determines the speed that the marker travels from the previous step. Since it 
was done by hand, the times between steps don’t match well with the distances 
and so the walk turns into a very fast run once or twice, but it works as an 
example.

Copy and paste the text below into a text file and save it with a “.gpx” 
extension.






http://www.topografix.com/GPX/1/1;
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
 xsi:schemaLocation="http://www.topografix.com/GPX/1/1 
http://www.topografix.com/GPX/1/1/gpx.xsd;
 version="1.1"
 creator="Phil Jimmieson and Jodie Zhou">
 
Ashton Building
  2019-11-22T08:59:46Z
 

 
step 1
  2019-11-22T09:01:00Z
 

 
step 2
  2019-11-22T09:01:20Z
 

 
step 3
  2019-11-22T09:01:40Z
 

 
step 4
  2019-11-22T09:02:00Z
 

 
step 5
  2019-11-22T09:02:20Z
 

 
step 6
  2019-11-22T09:02:40Z
 

 
step 7
  2019-11-22T09:03:00Z
 

 
step 8
  2019-11-22T09:03:20Z
 

 
step 9
  2019-11-22T09:03:40Z
 

 
step 10
  2019-11-22T09:04:00Z
 

 
step 11
  2019-11-22T09:04:20Z
 
 
step 12
  2019-11-22T09:04:40Z
 


--
Phil Jimmieson
University of Liverpool, Computer Science Department
Ashton Bldg, Ashton Street, Liverpool. L69 3BX
0151 795 4236
___
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: mergeJSON on server problem

2020-11-05 Thread David Bovill via use-livecode
Let me dig into this in more detail with some tests - other data encoding is 
causing problems. Note I only find this on the unix server not with the local 
MacOS version of the same code and data.

I’m going to refer to this stack overflow answer regarding encoding:

https://stackoverflow.com/questions/583562/json-character-encoding-is-utf-8-well-supported-by-browsers-or-should-i-use-nu
On 2 Nov 2020, 09:28 +, Monte Goulding via use-livecode 
, wrote:
>
>
> > On 1 Nov 2020, at 6:21 am, David Bovill via use-livecode 
> >  wrote:
> >
> > Thanks Mark - I may give fastjson a go.
> >
> > I tracked down the problem to the "\u00a0” unicode character in the json I 
> > fetched, which was causing mergeJSON to fail. This hack fixed the issue in 
> > a temporary way.
> > replace "\u00a0” with empty in episodeJson -- hack to remove "¬"
> >
> > Any thoughts on safe encoding of data I fetch fro jsonrpc calls so that it 
> > plays nicely with Livecode?
>
> Hi David
>
> The following seems to work without error:
> put format("[ \"\\u00a0\" ]") into tJSON; get JSONToArray(tJSON); put tJSON 
> && it[1]
>
> Cheers
>
> Monte
> ___
> 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: Pass Javascript Session Cookie to LiveCode Variable?

2020-11-05 Thread matthias rebbe via use-livecode
Rick,

you are mixing something.

$_session array is stored on the server while sessionstorage is stored on the 
clients computer.

I am not sure that there is a direct way to let Livecode Server read 
sessionstorage directly from the clients computer, but i might be wrong.
At least PHP is not able.

One way would be to use Javascript to read the storagesession and post it to a 
LC Server script using Ajax. 
You could even do this from one single LC server script.
In the script you would check if the $_POST array contains any data. 
If the $_POST array is empty, then you have to execute  the javascript that 
fetches the sessionstorage data and if there is sessionstorage  then it posts 
that data to the script again.
If the $_POST array is not empty, then you can continue the script using the 
sessionstorage data.

At least this is the way how it is done in .php

I've used this method a lot for processing form data.

HTH

Matthias




> Am 05.11.2020 um 02:12 schrieb Rick Harrison via use-livecode 
> :
> 
> Hi Matthias,
> 
> Session Variables are like cookies except they auto-expire at the end of a 
> browser session
> like when you close a tab or window.
> 
> In Javascript one would set a session variable this way:
> 
> 
> 
> 
> 
> 
> One would retrieve the session variable in Javascript this way:
> 
> 
> 
> 
> 
> 
> 
> In LiveCode one would set a session variable like this:
> 
>  
> start session
> 
> put “Matthias” into VarFirstName
> 
> put VarFirstName into $_SESSION["NewFirstName”]
> 
> stop session 
> 
> ?>
> 
> To retrieve the session variable in LiveCode:
> 
>  
> start session
> 
> put  $_SESSION["NewFirstName”] into VarFirstName 
> 
> stop session 
> 
> ?>
> 
> So, I’m wondering that since we are able to have LiveCode retrieve Javascript 
> cookies,
> then perhaps it can retrieve Javascript session variables too.
> 
> I just haven’t quite made the connection yet.
> 
> Your thoughts?
> 
> Rick
> 
>> On Nov 4, 2020, at 7:00 PM, matthias rebbe via use-livecode 
>>  wrote:
>> 
>> What do you mean with session variables? 
>> 
>> To be honest i am not very used with Javascript. 
>> I just did a quick test to write a cookie with JS and read it with LC 
>> server. ;)
>> 
>> Regards,
>> Matthias
> 
> ___
> 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



-
Matthias Rebbe
Life Is Too Short For Boring Code


___
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