Re: Unicode Store in JSON

2018-10-14 Thread Monte Goulding via use-livecode


> On 15 Oct 2018, at 2:31 pm, Sannyasin Brahmanathaswami via use-livecode 
>  wrote:
> 
> First can you clarify if both of these should work.? We see both in
> dictionary...
> 
> *Example*
> 
> textEncode("A","UTF16")
> 
> *put*textEncode(field"output","UTF-8") intotOutput
> 
> will the 2nd param work with or without a hyphen?

Yes
> 
> ---
> unclarity --simply:
> 
> *Syntax*
> 
> textEncode(*stringToEncode*, encoding)
> 
> *Summary*
> 
> Converts from text to binary data.
> 
> 
> 
> doesn't stipulate an "exception" for
> 
> "different libraries that treat JSON text encoding differently. mergJSON 
> [snip] “

Well mergJSON is documented to return UTF-8 encoded JSON, however, I agree that 
JSONImport and JSONExport docs are a little ambiguous and should clarify that 
the JSON needs to be textDecoded before calling JSONImport and textEncoded 
after calling JSONExport.

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

mobile location question

2018-10-14 Thread Alan via use-livecode
Hi there

Can someone point me in the direction of the LC source code on Github that 
contains the mobile location-related code?

Wondering what is currently used for the properties:  desiredAccuracy  &  
distanceFilter

Thanks for any pointers! :-)

cheers

Alan


___
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: Unicode Store in JSON

2018-10-14 Thread Sannyasin Brahmanathaswami via use-livecode
First can you clarify if both of these should work.? We see both in
dictionary...

*Example*

textEncode("A","UTF16")

*put*textEncode(field"output","UTF-8") intotOutput

will the 2nd param work with or without a hyphen?

---
unclarity --simply:

*Syntax*

textEncode(*stringToEncode*, encoding)

*Summary*

Converts from text to binary data.



doesn't stipulate an "exception" for

"different libraries that treat JSON text encoding differently. mergJSON [snip] 
"


BR




On 10/14/18 2:55 PM, Monte Goulding via use-livecode wrote:
> Could you provide some detail where the docs are misleading. It is actually 
> true that you can’t JSON encode binary data.
>
> We do have different libraries that treat JSON text encoding differently. 
> mergJSON and therefore ArrayToJSON and JSONToArray deal with UTF-8 encoded 
> JSON only. ArrayToJSON and JSONToArray will do this encoding for you if you 
> give it text strings. If you give it binary strings then they must be UTF-8 
> encoded already otherwise mergJSON will throw an error.
>
> JSONImport and JSONExport on the other hand deals with JSON as text so you 
> need to textDecode/textDecode as a separate operation. If you give any LCB 
> API binary strings when it is expecting text strings then it will follow the 
> engine’s standard conversion which will be native encoding (eg ISO/MacRoman).
>
> Note while the previous JSON specs just say unicode encoding can be used 
> RFC8259 specifies UTF-8 encoding of JSON between systems.
>
> Cheers


-- 
Svasti Astu, Be Well!
Brahmanathaswami

Get the SivaSiva app, it's free:
https://www.himalayanacademy.com/apps/sivasiva

___
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


OT: The Principles of Clean Architecture

2018-10-14 Thread Sannyasin Brahmanathaswami via use-livecode
Hope you don't in my sharing on going research into high level architecture.

https://www.youtube.com/watch?v=o_TH-Y78tt4

This one came about because Andre (ha!) chided me on my lack of
encapsulation between modules, and spent time re-factoring to make it
better.  He has a license to tell what is on his mind...

No doubt many you have seen this. This is really the first time I have
understood where the "boundaries" live in code. So very clear.

You will also get a marvelous introduction to human DNS/Mitochondria.

Be prepared of 1:13 of time--at least for me, it was hard not watch all
the through.



___
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: Unicode Store in JSON

2018-10-14 Thread Monte Goulding via use-livecode


> On 15 Oct 2018, at 11:35 am, Sannyasin Brahmanathaswami via use-livecode 
>  wrote:
> 
> Wow, that worked! And I thought that JSON could not be a container for
> "binaryData" as described on the dictionary.

Could you provide some detail where the docs are misleading. It is actually 
true that you can’t JSON encode binary data.

We do have different libraries that treat JSON text encoding differently. 
mergJSON and therefore ArrayToJSON and JSONToArray deal with UTF-8 encoded JSON 
only. ArrayToJSON and JSONToArray will do this encoding for you if you give it 
text strings. If you give it binary strings then they must be UTF-8 encoded 
already otherwise mergJSON will throw an error.

JSONImport and JSONExport on the other hand deals with JSON as text so you need 
to textDecode/textDecode as a separate operation. If you give any LCB API 
binary strings when it is expecting text strings then it will follow the 
engine’s standard conversion which will be native encoding (eg ISO/MacRoman).

Note while the previous JSON specs just say unicode encoding can be used 
RFC8259 specifies UTF-8 encoding of JSON between systems.

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

Re: Unicode Store in JSON

2018-10-14 Thread Sannyasin Brahmanathaswami via use-livecode
On 10/14/18 8:43 AM, J. Landman Gay via use-livecode wrote:
> I'd store the text normally, without alteration, in the JSON. TextEncode 
> it when you send it to the database and textDecode when you retrieve it 
> from the database.

Wow, that worked! And I thought that JSON could not be a container for
"binaryData" as described on the dictionary.

BR


___
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


Widget baseClock_v100

2018-10-14 Thread hh via use-livecode


BaseClock is a new widget that displays by special "digits" the
time encoded to a number base in range 2-60.
Encoded is each of the time items (hours, minutes, seconds).
For base 2 this is known as "Binary encoded decimals".

The display is unique (I invented that) as it doesn't use
characters for digits  > 9 but decimal "columns". This is very
easy to read and (manually) to write.

Download the widget from "Sample Stacks" or from
http://livecodeshare.runrev.com/stack/911 

The sample stack contains an installer and displays 17 clocks
to different number bases. One display cycle for a seconds display
is done by each widget in < 3 millisecs (compute and paint).

This stack shows an essential improvement of LCB 9 over LCB 8:
The clocks are much more "in sync" than in LC 8.
And it has a substack that is prepared for displaying a baseClock
"window shaped".

There are 16 options for the display, see the dictionary or open
the property inspector.

Note.
Some properties of the widget are triggered by the timer, which is
(as all timers) stopped in the property inspector. So you may see
the changes not before going back to browse mode.

The widget is free for non-commercial use and has the source code
included. For commercial use please give a (small) fee to the LC
developer help fund.


___
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: Unicode Store in JSON

2018-10-14 Thread J. Landman Gay via use-livecode
I'd store the text normally, without alteration, in the JSON. TextEncode 
it when you send it to the database and textDecode when you retrieve it 
from the database.


On 10/14/18 9:26 AM, Sannyasin Brahmanathaswami via use-livecode wrote:

I need to store unicode in JSON on Mobile; and store that in SQLLite dBase

If you do a "direct" transfer

*put*(char1to35oftQuote)& "..."intosTruncFirstLine

 "Yea, jīva is actually Śiva."

# putting sTruncFirstLine into an SQLLite column
# when you get the data out, it becomes

 "Yea, jƒ´va is actually ≈öiva"

"textEncode" won't work because it produces binary code, can't store in
JSON...

base64 should work, but I get similar results,

*put*(char1to35oftQuote)& "..."intosTruncFirstLine

*put*base64Encode(sTruncFirstLine) intosTruncFirstLine

   # restore later

*put*base64Decode(pEntryA["label"]) intotLab*el**
*

*set*thetextoffieldtName totLabel

 # returns "garble"

What are my other options?


--
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

Re: OT: Seven Ineffective Coding Habits of Many Programmers

2018-10-14 Thread J. Landman Gay via use-livecode

On 10/12/18 4:37 PM, Mark Wieder via use-livecode wrote:

On 10/12/2018 11:12 AM, J. Landman Gay via use-livecode wrote:


That's not a term, it's a sentence.


So... time served only?


That's reserved for bad punsters who must show remorse by writing 
mergBLEPeripheralDiscoverDescriptorsForCharacteristic 100 times on the 
blackboard.


--
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


Unicode Store in JSON

2018-10-14 Thread Sannyasin Brahmanathaswami via use-livecode
I need to store unicode in JSON on Mobile; and store that in SQLLite dBase

If you do a "direct" transfer

*put*(char1to35oftQuote)& "..."intosTruncFirstLine

"Yea, jīva is actually Śiva."

# putting sTruncFirstLine into an SQLLite column
# when you get the data out, it becomes

"Yea, jƒ´va is actually ≈öiva"

"textEncode" won't work because it produces binary code, can't store in
JSON...

base64 should work, but I get similar results,

*put*(char1to35oftQuote)& "..."intosTruncFirstLine

*put*base64Encode(sTruncFirstLine) intosTruncFirstLine

  # restore later

*put*base64Decode(pEntryA["label"]) intotLab*el**
*

*set*thetextoffieldtName totLabel

# returns "garble"

What are my other options?

BR


 



 




___
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

Accessible Apps

2018-10-14 Thread Kaveh Bazargan via use-livecode
I am interested in creating an App in LiveCode, for iOS and Android,
primarily for reading html content (live or local). It needs
functionalities such as bookmarking, searching and commenting.

I want the App to be "accessible" if possible, so allowing say visually
impaired to use it. Any pointers pls? I cannot find much literature
on LiveCode and accessibility.

-- 
Kaveh Bazargan
Director
River Valley Technologies  • Twitter
 • LinkedIn

___
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: Password Protected Stack

2018-10-14 Thread Randy Hengst via use-livecode
Thank you Jacque. I used the Project Browser for the first time… yes, really… 
and found a library stack from one of Scott Rossi’s add-ons that I no longer 
was using.  It is an old stack… 

I didn’t have problems building with LC 7.x or 8.x even with that add-on. So, 
something in the build process must have changed in 9.x.

Anyway, the library stack is removed and all is well with the build.

be well,
randy
www.classroomFocusedSoftware.com


> On Oct 13, 2018, at 11:10 PM, J. Landman Gay via use-livecode 
>  wrote:
> 
> Do you have any private libraries or substacks that might be password 
> protected?
> --
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software | http://www.hyperactivesw.com
> On October 13, 2018 10:56:01 AM Randy Hengst via use-livecode 
>  wrote:
> 
>> Hi All,
>> 
>> I have a problem I’ve not seen before. I’m working on an update to an iOS 
>> app first made years ago and last updated in 2017.
>> 
>> When I save it as a standalone … things go well in that a standalone is made 
>> (and seems to work fine on my iPad), but at the end of the build process, I 
>> get a warning: Could not auto-detect inclusions or security categories 
>> because stack is password protected
>> 
>> The catch is, I’ve never intentionally set a password on any of my work with 
>> LC.
>> • I’ve checked all the settings and can’t find a place even set a password.
>> • As noted in the dictionary, I’ve used the message box and entered …. set 
>> the password of this stack to empty … but the problem still persists.
>> 
>> The other apps I’ve been updating over the past several weeks have worked 
>> just fine with my current set up:
>> LC 9.0.1Xcode 9.2Mac Sierra 10.12.6
>> 
>> I assume I’m missing something obvious, but it escapes me. Any thoughts?
>> 
>> be well,
>> randy
>> www.classroomFocusedSoftware.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

___
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