Re: tsNet woes

2018-03-12 Thread Tom Glod via use-livecode
do yo have  a firewall app or anything that filters your traffic?
inconsistent behavior like that usually means something is acting on your
traffic

On Mon, Mar 12, 2018 at 7:11 PM, Dan Friedman via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Greetings!
>
> I have an app I am working on and it’s working perfectly on my Mac and in
> the iOS simulator.  However, on an Android device, once I do a couple of
> get urls, tsNet stops functioning.   I get a variety of results:
>
> Previous request not completed
> Sync request already in progress (most common)
> tsNet is not initialized
>
> Also, tsNetIsSyncBlocked() always returns true.
>
> I am using LC Indy 8.1.5.   Any thoughts or advise?
>
> -Dan
> ___
> 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: Dictionary Entry For TouchMove

2018-03-12 Thread Brian Milby via use-livecode
PR submitted to clarify the touchMove dictionary entry:
https://github.com/livecode/livecode/pull/6413

On Mon, Mar 12, 2018 at 5:24 PM, Brian Milby  wrote:

> Short answer, you need to track the location of each touch yourself and do
> the math.
>
> Check out this piece of code:
> https://raw.githubusercontent.com/bwmilby/lc-misc/master/
> PinchZoom/pinchzoom.livecodescript
>
> That is a piece of code that I translated into LCS that deals with
> tracking two touch points to zoom an object.  Depending on what you want to
> accomplish, you won't need anything that complicated.
>
> Looking at the Netflix app, you can either go vertical or horizontal.
> First movement direction locks it until all touches are released.  So you
> would need to capture the touchStart to get the ID and then 2 touchMove
> messages to establish direction (I didn't try using mouseloc to get the
> touchStart location).  You may want to pair the direction detection with a
> minimum to ensure you capture the correct direction.
>
> Hope this helps,
> Brian
>
> On Mon, Mar 12, 2018 at 4:39 PM, Sannyasin Brahmanathaswami via
> use-livecode  wrote:
>
>> I have a group control (made up smaller groups) they I want users to
>> scroll vertically. And the sub-groups, which want the user to scroller
>> horizontally. My current thinking is to turn off scrollers until we get
>> swipe direction, and turn them on, "mid-swipe"
>>
>> simply: how do you know if touchMove is a horizontal or vertical swipe?
>>
>> in the dictionary, it says (another cryptic entry!)
>>
>> touchMove pTouchID, pTouchX, pTouchY
>>
>> Summary
>>
>> Sent when the point at which the user is touching the screen changes.
>> Example
>>
>> on touchMove pTouchID, pX, pY
>>  if pX > lastX then
>>  -- user has moved to the right
>>  end if
>> end touchMove
>>
>> where does "lastX"  come from? It is not localized as a variable.
>>
>> Other touch handlers do not record the X,Y coords of touchRelease.
>>
>> should we
>>
>> local sLastMouseUp
>>
>> end touchRelease
>>   put the mouseloc to sLastMouseUp
>> end touchRelease
>>
>> on touchMove pTouchID, pX, pY
>>  if pX > (item 1 of sLastMouseUp) then
>>  -- user has moved to the right
>>  end if
>> end touchMove
>>
>> But this relative to the last swipe -  this is not "runtime" as the
>> dictionary says:
>>
>> "Handle the touchMove message if you want to perform some action when
>> the user changes the touch position without ending the touch or if you
>> want to keep continuous track of the touch position."
>>
>> 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
>>
>
>
___
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


tsNet woes

2018-03-12 Thread Dan Friedman via use-livecode
Greetings!

I have an app I am working on and it’s working perfectly on my Mac and in the 
iOS simulator.  However, on an Android device, once I do a couple of get urls, 
tsNet stops functioning.   I get a variety of results:

Previous request not completed
Sync request already in progress (most common)
tsNet is not initialized

Also, tsNetIsSyncBlocked() always returns true.

I am using LC Indy 8.1.5.   Any thoughts or advise?

-Dan
___
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: Dictionary Entry For TouchMove

2018-03-12 Thread Brian Milby via use-livecode
Short answer, you need to track the location of each touch yourself and do
the math.

Check out this piece of code:
https://raw.githubusercontent.com/bwmilby/lc-misc/master/PinchZoom/pinchzoom.livecodescript

That is a piece of code that I translated into LCS that deals with tracking
two touch points to zoom an object.  Depending on what you want to
accomplish, you won't need anything that complicated.

Looking at the Netflix app, you can either go vertical or horizontal.
First movement direction locks it until all touches are released.  So you
would need to capture the touchStart to get the ID and then 2 touchMove
messages to establish direction (I didn't try using mouseloc to get the
touchStart location).  You may want to pair the direction detection with a
minimum to ensure you capture the correct direction.

Hope this helps,
Brian

On Mon, Mar 12, 2018 at 4:39 PM, Sannyasin Brahmanathaswami via
use-livecode  wrote:

> I have a group control (made up smaller groups) they I want users to
> scroll vertically. And the sub-groups, which want the user to scroller
> horizontally. My current thinking is to turn off scrollers until we get
> swipe direction, and turn them on, "mid-swipe"
>
> simply: how do you know if touchMove is a horizontal or vertical swipe?
>
> in the dictionary, it says (another cryptic entry!)
>
> touchMove pTouchID, pTouchX, pTouchY
>
> Summary
>
> Sent when the point at which the user is touching the screen changes.
> Example
>
> on touchMove pTouchID, pX, pY
>  if pX > lastX then
>  -- user has moved to the right
>  end if
> end touchMove
>
> where does "lastX"  come from? It is not localized as a variable.
>
> Other touch handlers do not record the X,Y coords of touchRelease.
>
> should we
>
> local sLastMouseUp
>
> end touchRelease
>   put the mouseloc to sLastMouseUp
> end touchRelease
>
> on touchMove pTouchID, pX, pY
>  if pX > (item 1 of sLastMouseUp) then
>  -- user has moved to the right
>  end if
> end touchMove
>
> But this relative to the last swipe -  this is not "runtime" as the
> dictionary says:
>
> "Handle the touchMove message if you want to perform some action when
> the user changes the touch position without ending the touch or if you
> want to keep continuous track of the touch position."
>
> 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
>
___
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


Dictionary Entry For TouchMove

2018-03-12 Thread Sannyasin Brahmanathaswami via use-livecode
I have a group control (made up smaller groups) they I want users to scroll 
vertically. And the sub-groups, which want the user to scroller horizontally. 
My current thinking is to turn off scrollers until we get swipe direction, and 
turn them on, "mid-swipe"

simply: how do you know if touchMove is a horizontal or vertical swipe?

in the dictionary, it says (another cryptic entry!) 

touchMove pTouchID, pTouchX, pTouchY

Summary

Sent when the point at which the user is touching the screen changes.
Example

on touchMove pTouchID, pX, pY
 if pX > lastX then
 -- user has moved to the right
 end if
end touchMove

where does "lastX"  come from? It is not localized as a variable.

Other touch handlers do not record the X,Y coords of touchRelease. 

should we 

local sLastMouseUp

end touchRelease 
  put the mouseloc to sLastMouseUp
end touchRelease

on touchMove pTouchID, pX, pY
 if pX > (item 1 of sLastMouseUp) then
 -- user has moved to the right
 end if
end touchMove

But this relative to the last swipe -  this is not "runtime" as the dictionary 
says:

"Handle the touchMove message if you want to perform some action when
the user changes the touch position without ending the touch or if you
want to keep continuous track of the touch position."

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


Re: Issues with storage of data in stack

2018-03-12 Thread Lagi Pittas via use-livecode
Hi Mark,

Thanks for the detailed explanation but I have a few (ish) questions ...

Hope you don't mind me asking these questions because I did have to
write my own access routines in those bad old days before I started on
Clipper/Foxpro/Delphi/Btrieve  and I do enjoy learning from others on
the list and the forums - those AHA! moments when you finally get how
the Heapsort works the night before the exam.

Many moons ago I wrote a multi-way B-TREE based  on the explanation in
Wirth's Book "Algorithms + Data Structures = Programs" -  in UCSD
Pascal for the Apple 2,  I  had a 5MB hard Drives for the bigger
companies when I was lucky, for the smaller companies I made do with 2
143k floppy disks and Hashing for a "large" data set- oh the memories.
I used   the B-Trees  if the codes were alphanumeric. I also had my
own method where I kept the index in the first X Blocks of the file
and loaded the parts in memory as they were needed - a brain dead
version of yours I suppose.  I think we had about 40k of free ram to
Play with so couldn't always keep everything in RAM. I even made the
system multi-user and ran 20 Apple ][s on a network using a
proprietary Nestar/Zynar network using Ribbon Cables -  it worked but
am I glad we have Ethernet!

Anyway - I digress. I can understand the general idea of what you are
explaining but it's the low level code for writing to the
clusters/file on disk I'm not quite sure of.
Which way do you build your initial file? Is it "Sparse" or prebuilt,
or does each cluster  have a "pointer" to previous or next clusters?
Do you have records "spanning" clusters or do you leave any spare
space in a cluster empty. Do you mark a "record" as deleted but don't
remove the record until it's overwritten or do what Foxpro/Dbase does
and "PACK" them with a utility routine.
I also presume you use the "AT" option in the write command to write
the clusters randomly since you don't wriite the whole in memory table

Which brings me onto my final questions - I presume your system is
multi-user because you have a server program that receives calls and
executes them sequentially? And lastly what are the file size
limitations doing it this way - do You also virtualize the data in
memory?

Sorry for all the question but this is the interesting stuff

Regards Lagi

On 11 March 2018 at 20:02, Mark Talluto  wrote:
> Hi Lagi,
>
> Our LiveCode array database does not use SQL or any other database. In terms
> of local only database, we do not rely on anything but LiveCode. It is
> purely a LiveCode derived system. Data is manipulated using familiar
> methodologies to other databases. The data is encrypted using ‘encrypt’ and
> stored using 'arrayEncode()’.
>
> The full array of the database is stored in memory. This method provides
> very quick access to your data thanks to the amazing performance provided by
> LiveCode.
>
> This might get a little long. I am happy to take this off list for more
> details. I will try to be as succinct as possible.
>
> -A little more explanation on storing data-
> Each record is stored in array that looks like this:
> tableID/clusterID/recordID/recordData…
> When a given record/s is updated, we cache the recordIDs that were touched.
> All data is updated first in memory then cached to disk. We then refer to
> the cached records and conclude which clusterIDs we affected. Thus, you can
> very quickly save only the clusters that have been modified. Each cluster
> will have one or more records associated with it. The clusters are the first
> ’n’ characters of the recordIDs. We use UUIDs as recordIDs. The cluster
> sizes are definable, giving us the power to decide where to apply the
> optimization. Clusters of only one or two characters will generate less
> clusters to be stored. This makes loading of tables from disk to RAM very
> fast. A cluster of 3 chars or more allows for less records per cluster thus
> improving saving from RAM to disk to be faster.
>
> The pseudo code for this might looks like this:
> -receive request for update in your API
> -store the changes to your master array in RAM
> -remember the recordIDs touched in a variable
> -calculate the clusters touched by taking the first ’n’ characters of the
> records touched and make a new list of the clusters you need to write to
> disk
> -write appropriate clusters to disk
> -return the results of the action (any errors, recordIDs…)
>
> You will find this method to be very performant and easy to manage. This is
> not particularly complicated to write. Once you get it all working you might
> add other niceties like:
> -error checking the input before storing anything
> -store metadata on each updated record: recordVersion, recordTime,
> updateTime
> -add security using ‘encrypt’
> -build simple APIs to do your CRUD first
> -add other APIs as needed to make accessing your data easier
>
> Here is an example API for storing data that you may find useful when making
> your own system.
>
> -Input (array)-

Re: When me is not me

2018-03-12 Thread Bob Sneidar via use-livecode
It is this sort of thing which inspired me to start using long id's for 
everything whenever I make calls to cards or stacks not the one I am currently 
on. That is why I created getParentCard() and getParentStack(). I then pass the 
local long id of the callign object to whatever script I am callign in another 
place. 

I have posted these in the past, let me know if you need them. All I do is pass 
the long ID of the object that is calling these functions, and all they do is 
parse the long id string by eliminating everything before the first occurrance 
of the word "card" or "stack" respectively. 

Bob S
___
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: Standalone compile problem including more than two stack files to the mainstack

2018-03-12 Thread R.H. via use-livecode
I like to thank everyone for help and suggestions !)

The suggestion from Jaqueline Landman gave me the workaround that I was
knowing that it would work: Using the "Copy Files" pane in the Standalone
Settings instead of using "Stacks".

So, thank you especially for this hint that saved me.

(For new and casual users: After compiling at least 50 x to find my error
and to know about errors generated in the Standalone and NOT in the IDE, I
created a handler that would receive information from each and every
statement writing "the result" and other information to a text file on disk
with a timestamp and some execution details. Simply setting a flag using a
hidden checkbox would stop executing this error catching. So, I am using a
"command catchError pMessage" handler in the lowest (or highest?) message
level (in my case library stack) that can be invoked from anywhere and
opens the error text file for append and immediately closes it. This works
pretty well even in a standalone for debugging purposes. The overhead is
manageable. Even on mobile that should work.)

I found one error in my code that had some bad influence. When the main
stack is opened from the complied splash stack and turning focus to the
main stack, trying to execute further instructions in the same handler
reverts back to the Splash stack and may find it impossible to execute.
Once the main stack is opened and control is given to it, Splash stack must
simply close and do nothing more.

Context Sensitive Help Suggestion

I was thinking of what especially new users might benefit from. I think it
is mainly information that might be missing. For example, what is the
meaning of a field "Destination Folder:" when it does not allow to enter a
path selected from disk? Or it should explain that these folders are
folders inside the specialfolderpath("resources") folder and that this
specialfolderpath("resources") changes for the compiled version, of course.
But what seems obvious is not always so obvious to a casual or new user.

The meaning and consequences of certain settings for compilation work (and
elsewhere) should ideally be available with a context-sensitive help right
at the spot describing more than just giving a title, and it could be
realized simply using a pop-up pane or opening a help window or opening an
appropriate help page in the browser. I would favor a context-sensitive
webpage help. This is a task that could be assigned to us in the community
may be. I would at least try to spend some time here.

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


[ANN] This Week in LiveCode 120

2018-03-12 Thread panagiotis merakos via use-livecode
Hi all,

Read about new developments in LiveCode open source and the open source
community in today's edition of the "This Week in LiveCode" newsletter!

Read issue #120 here: https://goo.gl/Bjvb1Z

This is a weekly newsletter about LiveCode, focussing on what's been
going on in and around the open source project. New issues will be
released weekly on Mondays. We have a dedicated mailing list that will
deliver each issue directly to you e-mail, so you don't miss any!

If you have anything you'd like mentioned (a project, a discussion
somewhere, an upcoming event) then please get in touch.


-- 
Panagiotis Merakos 
LiveCode Software Developer

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


Re: Callbacks fail

2018-03-12 Thread Sean Cole (Pi) via use-livecode
Hi Peter

325625625 is only 32.5sec of video. 552892592040 would be 55290 seconds,
which is 921 mins, which is 15.35hrs! If it was 55 billion, that would make
more sense. Can you just recheck your numbers and also let us know what
format video you are using, codec, wrapper, etc. Also, which version of LC
are you using?

Cheers

Sean Cole
*Pi Digital *

On 11 March 2018 at 20:15, Peter Bogdanoff via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hi,
>
> I’m working on a project that has a 1-1/2 hour video playing. I’m using
> callbacks to display subtitle text in a field. When a callback is sent from
> the player, the appropriate text is shown.
>
> This work great on Mac, not so good on Windows. On Windows, the callbacks
> seem to stop arriving after about a minute, and the player stops
> functioning correctly. The player timeScale and subsequent callbacks are
> set up:
>
> Mac timeScale = 2997, last callback in the video = 16661913
> Win timeScale = 10,000,000, last callback in the video = 552892592040
>
> So, should I be surprised that in Windows a callback of 552 billion might
> not work? The callbacks seem to stop coming around 325625625.
>
> Peter
> ArtsInteractive
> ___
> 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