Re: LC Server style survey: co-mingle code w/HTML?

2017-12-05 Thread Simon Smith via use-livecode
PHP is definitely the most popular language for letting you code this way,
but then it is pretty much only for the web unlike most other languages.

Other languages can work this way too - e.g. Python has PSP, Java has JSP
as does Ruby, Lua etc. but not as popular as PHP.






Carpe diem

*Simon Smith*
m. +27 83 306 7862

On Wed, Dec 6, 2017 at 3:23 AM, Richard Gaskin via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Simon Smith wrote:
>
> > Personally I do prefer to mix HTML / code together.
>
> If you mix them together with the implied extended merge of LC Server
> rather than an explicit merge with LC Script, I'm afraid nothing in my
> toolkit can help.
>
>
> > I don't think it right to say it is a PHP way to do things though :)
>
> What other languages work that way?
>
> In LC Script the primary execution object is a script, which can
> optionally pass data to be merged with an explicit call to the merge
> function.  This pattern seems more common, e.g. Ruby, Lua, Python, and of
> course SuperCard's Flamethrower project which introduced the merge function
> to the xTalk world.
>
> With PHP (and LC Server), the primary execution object is assumed to be a
> web page, with code optionally embedded in it and the merging happens as an
> implicit part of the processing.  I can't think of any other languages that
> work that way.  Am I missing some?
>
> I don't have a judgment about it either way.  A lot of people like PHP,
> and given the range of things people make with it (nearly every major CMS
> and a lot of other server frameworks where the browser is the primary
> target) it seems to do well.
>
> The only reason I'm distinguishing the style in this thread is that LC
> Server's page-centric code is incompatible with LC Script on the desktop,
> and my tools run on the desktop.
>
>
> --
>  Richard Gaskin
>  Fourth World Systems
>  Software Design and Development for the Desktop, Mobile, and the Web
>  
>  ambassa...@fourthworld.comhttp://www.FourthWorld.com
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
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: Sending a message to users that floats above everything

2017-12-05 Thread Mark Waddingham via use-livecode

On 2017-12-04 00:22, Brian Milby via use-livecode wrote:

There are actually 2 PRs for toast... one LCB and another in the engine
itself. 5860 & 5018


Indeed - the LCB one started off as a transliteration of the engine 
implementation provided by @HedgeHao... It has the advantage of being a 
single source file, rather than requiring new source files and changes 
in several places in the engine, and provides the same functionality...


I shall endeavour to give it docs and test it in the next sprint (so it 
should appear in DP11) :)


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


Re: Why is node.js faster than LC server?

2017-12-05 Thread Mark Waddingham via use-livecode

On 2017-12-05 18:55, Richard Gaskin via use-livecode wrote:

Can you describe what you mean by fork() here?  In a discussion a
while back I made reference to an earlier post you'd made about
fork(), but the response from the engine team left me with the
impression that it's merely the way processes launch other processes.
Of course we can launch processes right now in LC, so clearly there's
something here I'm missing (forgive the naivete of the question; I'm
only halfway into Robert Love's Linux System Programming).


'fork' is a UNIX system call which creates a new process by copying 
everything about the current process. In particular:


  1) The entire virtual memory space is copied using copy-on-write (so 
there is no copy until a page is modified)


  2) All file descriptors (fds) (which inside the kernel are 
ref-counted) are copied into the new process by increasing the ref-count 
(this is not copy-on-write).


However, only the thread which calls 'fork()' is cloned in this manner - 
the new process has only one thread.


So fork basically creates a clone of the current process sharing *all* 
file descriptor based resources (which is pretty much how all kernel 
resources are represented beyond memory, threads and processes) with 
just a single thread.


In 99.% of cases where you find a fork(), you will find an exec* 
syscall almost immediately afterwards in the new process (fork returns 0 
in the new process, and the new process's pid in the original process) - 
the exec* family of calls completely replace a process with a new one 
running a new executable. The only bit of code you tend to find between 
fork() and exec on the new process side is code which shuffles fds 
around to ensure the new process shares only the fds you want.


You can call fork() from any language which either provides FFI or 
external like plugins - not that it does you any good in almost all 
cases in any language unless you call exec* very soon after. The sharing 
of state means that the new process is not going to play well with the 
original, and the copying only goes so far as address space, fds and the 
single thread - not anything it might be connected to (such as a window 
server).


The only code which is fork() safe to do anything more than that is code 
which has been written *from the ground up* to work with it, and then it 
would be for very specialized purposes.


Basically, 'fork' is a red-herring here - it is not useful generally, 
and certainly not in a high-level language environment such as LiveCode 
(or pretty much any other environment where you don't control everything 
down to the last bit in your process). [ Note: You would be fine using 
fork() and fd-shuffling calls followed by exec() from LCB, just not a 
great deal more ].


In terms of the context we are talking about, then the main thing which 
fork() provides which is useful is the ability to execute a new process 
and pass it a file descriptor of a socket from the original process to 
the new one - i.e. 'handing off' of a connection from one process to 
another. However, that can be done without using fork - you can pass 
file descriptors to other processes on UNIX by using UNIX domain sockets 
and sendmsg (you can do a similar thing on Windows, the abstractions are 
different, but the underlying effects are the same).


Another thing which fork() does allow is the idea of a 'zygote' virtual 
machine process. All virtual machines have setup time which does exactly 
the same thing for all uses of it. A zygote is a pre-inited virtual 
machine process which has done everything but loaded any user code. 
Android Dalvik works like this - there is a single zygote Dalvik process 
which has all the setup of the VM done, and is just sitting waiting to 
load user code to execute. When a new Java-based Android process is 
required, the zygote is forked and user code loaded. Note that this 
requires a great deal of care to get right due to what fork() actually 
does, as outlined above.


For something like Android where you have restricted resources and want 
to spin-up new processes as quickly as possible, this makes sense. 
However, in the case we are talking about (server-based process 
clusters, essentially) then it is easier just to fire up many replica 
processes which just sit idle until used - with new connections being 
handed off to them as needed.


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


Re: LC Server style survey: co-mingle code w/HTML?

2017-12-05 Thread Rick Harrison via use-livecode
Hi Richard,

I regularly mix both .lc scripts and HTML.

I liked the original LC Web-Plugin with the exception
of the very scary download message that was forced
upon us all without any option to tone it down a bit.
Once the mothership decided to abandon it, it was
doomed.  It was still great for in-house work though
even in that state for a time.

Then I was disappointed when the LC server came out
that I couldn’t use Desktop LC code in the server the
same way that I used to be able to do with the
LC Web-Plugin.

I find now that I can mix both .lc scripts and HTML
in the same web format file.  It can be a pain sometimes
changing from double quotes to single quotes. 
Sometimes I have to build up my database calls
with more statements, and concatenations than
I’d like to, but at least it all works now.

CMS are interesting, but I usually find that whatever
it is that I want to do, the proper add-on I’m looking
for just doesn’t exist as I tend to want to do things that
aren’t normal everyday kinds of applications that
everyone else wants to do.  Every job I do tends to
ends up being a custom one.

I thought all the hype about Wordpress and LC
working together sounded interesting.  Then
On-Rev wrote us that note saying that we were
the ones that would be held responsible for
ensuring that Wordpress was always up to 
date on our accounts or we could lose our
accounts.  (I thought maintaining up to date
versions was supposed to be the job of
On-Rev as good care takers.)  Oh well, I was
glad I had decided not to go that route so it
wasn’t a problem for me at all.

I just love the way new things are announced
as the latest and greatest, and then a few
months or a couple years later abandoned.

The change over time of everything in the 
computer world is way too fast, and as a 
result unstable.  That is why we don’t have
true artificial intelligence yet.  Every time when
it looks like some breakthrough might occur,
someone decides it’s time that everyone go
through a forced update that screws up all
one's carefully crafted code.  They break it!

Have you noticed now many companies are
saying they have developed an AI that does
task XYZ.  What they have really done is
write a program that is better than the
previous version of what they made.  That
is not AI.  I suppose perhaps they are calling
it that to either get more funding, marketing
attention, or both.

If artificial intelligence ever did evolve it would
have the same problem.  Update……Update..
Update..Update.Upda.Up.U.ding.ding..g..
Godlike thinking power achieved..ding update..
No time to spend doing anything except..update ding!

Oh sorry, I guess you didn’t ask for a rant. Update ding! ;-)

Cheers,

Rick


> On Dec 5, 2017, at 1:18 PM, Richard Gaskin via use-livecode 
>  wrote:
> 
> I have some tools I developed for server apps, which allow me to develop and 
> test both client and server within the same local LC IDE instance. As you can 
> imagine, this has improved development efficiency by orders of magnitude.
> 
> It's much a much more xTalk-like way of working, and once you use it having 
> to be tied to a server for every little test feels like building a ship in a 
> bottle with tweezers while wearing a blindfold.
> 
> When I started making these tools I was using standalones exclusively for 
> server work, partly because it reflects my habits gained from using LC as a 
> CGI for many years before LC Server existed, and partly because I have no 
> need to co-mingle code in HTML like PHP does, except a few cases where the 
> merge function works quite nicely.
> 
> Thinking about this more recently, it seems these tools need not be limited 
> to server deployments using standalones, and may be modified to provide the 
> same server emulation for deployments that will use LC Server.
> 
> However, because the desktop version of LC has no means of executing LC 
> Server scripts (due to the HTML wrapped around any code), the ability to 
> enjoy such a fluid workflow is limited to those server apps where the .lc 
> scripts contain only directives to load standard LC Script libraries.
> 
> That limitation fits my own work, including current work for one client. But 
> does it fit yours?
> 
> How many of you using LC Server rely on its PHP-like model that encourages 
> mixing HTML with LC code?
> 
> Or maybe the better question might be:
> 
> How many of you have server systems that already separate HTML from server 
> code like most non-PHP solutions do, or could affordably transition to that 
> model if it could simplify your development workflow significantly?
> 
> Side question for the dev team if they see this:
> 
> Would it be reasonable/affordable to add some means of enhancing desktop LC 
> so that it can at least parse and attempt to execute LC scripts embedded in 
> HTML?  I can emulate environment variables and the like, but the 
> incompatibility between LC and .lc has been a real development bottleneck.
> 
> -- 
> Richard Gaskin
> Fourth World

Re: LC Server style survey: co-mingle code w/HTML?

2017-12-05 Thread Richard Gaskin via use-livecode

Simon Smith wrote:

> Personally I do prefer to mix HTML / code together.

If you mix them together with the implied extended merge of LC Server 
rather than an explicit merge with LC Script, I'm afraid nothing in my 
toolkit can help.



> I don't think it right to say it is a PHP way to do things though :)

What other languages work that way?

In LC Script the primary execution object is a script, which can 
optionally pass data to be merged with an explicit call to the merge 
function.  This pattern seems more common, e.g. Ruby, Lua, Python, and 
of course SuperCard's Flamethrower project which introduced the merge 
function to the xTalk world.


With PHP (and LC Server), the primary execution object is assumed to be 
a web page, with code optionally embedded in it and the merging happens 
as an implicit part of the processing.  I can't think of any other 
languages that work that way.  Am I missing some?


I don't have a judgment about it either way.  A lot of people like PHP, 
and given the range of things people make with it (nearly every major 
CMS and a lot of other server frameworks where the browser is the 
primary target) it seems to do well.


The only reason I'm distinguishing the style in this thread is that LC 
Server's page-centric code is incompatible with LC Script on the 
desktop, and my tools run on the desktop.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: LC Server style survey: co-mingle code w/HTML?

2017-12-05 Thread Simon Smith via use-livecode
Personally I do prefer to mix HTML / code together.

I don't think it right to say it is a PHP way to do things though :) -  PHP
does not encourage one to go this route for what I think is usually called
spaghetti code.

While some platforms, like WordPress have done quiet a bit to encourage
this style of coding with it's plugins and theme development  - there are
many PHP developers who are very public in their dislike for such
"barbaric" coding practices and also numerous frameworks that don't
support/encourage mixing html/php either.

Personally I think it is one of the reasons that lead to the popularity of
WordPress as it makes certain tasks very easy to, even if you don't have
much coding experience.

Yes it does depend on what I am doing, but for the most part, I don't have
any issues mixing code and HTML together.




Carpe diem

*Simon Smith*
m. +27 83 306 7862

On Tue, Dec 5, 2017 at 8:18 PM, Richard Gaskin via use-livecode <
use-livecode@lists.runrev.com> wrote:

> I have some tools I developed for server apps, which allow me to develop
> and test both client and server within the same local LC IDE instance. As
> you can imagine, this has improved development efficiency by orders of
> magnitude.
>
> It's much a much more xTalk-like way of working, and once you use it
> having to be tied to a server for every little test feels like building a
> ship in a bottle with tweezers while wearing a blindfold.
>
> When I started making these tools I was using standalones exclusively for
> server work, partly because it reflects my habits gained from using LC as a
> CGI for many years before LC Server existed, and partly because I have no
> need to co-mingle code in HTML like PHP does, except a few cases where the
> merge function works quite nicely.
>
> Thinking about this more recently, it seems these tools need not be
> limited to server deployments using standalones, and may be modified to
> provide the same server emulation for deployments that will use LC Server.
>
> However, because the desktop version of LC has no means of executing LC
> Server scripts (due to the HTML wrapped around any code), the ability to
> enjoy such a fluid workflow is limited to those server apps where the .lc
> scripts contain only directives to load standard LC Script libraries.
>
> That limitation fits my own work, including current work for one client.
> But does it fit yours?
>
> How many of you using LC Server rely on its PHP-like model that encourages
> mixing HTML with LC code?
>
> Or maybe the better question might be:
>
> How many of you have server systems that already separate HTML from server
> code like most non-PHP solutions do, or could affordably transition to that
> model if it could simplify your development workflow significantly?
>
> Side question for the dev team if they see this:
>
> Would it be reasonable/affordable to add some means of enhancing desktop
> LC so that it can at least parse and attempt to execute LC scripts embedded
> in HTML?  I can emulate environment variables and the like, but the
> incompatibility between LC and .lc has been a real development bottleneck.
>
> --
>  Richard Gaskin
>  Fourth World Systems
>  Software Design and Development for the Desktop, Mobile, and the Web
>  
>  ambassa...@fourthworld.comhttp://www.FourthWorld.com
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
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: Mac color chooser swatches do not work?

2017-12-05 Thread panagiotis merakos via use-livecode
Hi Klaus,

Are you on MacOS 10.13? If yes, what you see is this bug:

quality.livecode.com/show_bug.cgi?id=20727

Best,
Panos
--

On Tue, Dec 5, 2017 at 9:55 PM, Klaus major-k via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hi friends,
>
> before I create a report, can someone please confirm that we
> cannot use the "swatches" at the bottom of the Mac color chooser?
>
> Clicking them does nothing, we have to"re-create" the color with
> the sliders (or Crayons or whatever we choose for selecting a color).
>
> Works of course in e.g. "TextEdit" etc.
>
> Thank you!
>
>
> Best
>
> Klaus
> --
> Klaus Major
> http://www.major-k.de
> kl...@major-k.de
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
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: Mac color chooser swatches do not work?

2017-12-05 Thread Terry Judd via use-livecode
Hi Klaus - the swatches work fine for me (and from memory always have). I'm 
still on Yosemite (10.10.5) though, so perhaps it's a High Sierra thing?

Terry...

On 6/12/2017 8:56 am, "use-livecode on behalf of Klaus major-k via 
use-livecode"  wrote:

Hi friends,

before I create a report, can someone please confirm that we
cannot use the "swatches" at the bottom of the Mac color chooser?

Clicking them does nothing, we have to"re-create" the color with 
the sliders (or Crayons or whatever we choose for selecting a color).

Works of course in e.g. "TextEdit" etc.

Thank you!


Best

Klaus
--
Klaus Major
http://www.major-k.de
kl...@major-k.de


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your 
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



___
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: Mac color chooser swatches do not work?

2017-12-05 Thread Klaus major-k via use-livecode
Hi all,

> Am 05.12.2017 um 23:18 schrieb Klaus major-k via use-livecode 
> :
> 
> Hi Tore,
> 
>> Am 05.12.2017 um 23:03 schrieb Tore Nilsen via use-livecode 
>> :
>> Seems as if you are right, I cannot use the swatches either in LC 8.2 (dp2) 
>> with MacOS 10.13 beta (17A360a). Using the eyedropper tool to pick the 
>> colour from the swatches works here.
> thank you for testing, it does not even work with LC 5.02, so it looks this 
> is a very old bug
> which has not been discovered until today. Will create a bug report.

done: 


Best

Klaus
--
Klaus Major
http://www.major-k.de
kl...@major-k.de


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Mac color chooser swatches do not work?

2017-12-05 Thread Klaus major-k via use-livecode
Hi Tore,

> Am 05.12.2017 um 23:03 schrieb Tore Nilsen via use-livecode 
> :
> 
> Seems as if you are right, I cannot use the swatches either in LC 8.2 (dp2) 
> with MacOS 10.13 beta (17A360a). Using the eyedropper tool to pick the colour 
> from the swatches works here.

thank you for testing, it does not even work with LC 5.02, so it looks this is 
a very old bug
which has not been discovered until today. :-)

Will create a bug report.

> Tore
> 
>> 5. des. 2017 kl. 22:55 skrev Klaus major-k via use-livecode 
>> :
>> 
>> Hi friends,
>> 
>> before I create a report, can someone please confirm that we
>> cannot use the "swatches" at the bottom of the Mac color chooser?
>> 
>> Clicking them does nothing, we have to"re-create" the color with 
>> the sliders (or Crayons or whatever we choose for selecting a color).
>> 
>> Works of course in e.g. "TextEdit" etc.
>> 
>> Thank you!

Best

Klaus
--
Klaus Major
http://www.major-k.de
kl...@major-k.de


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Mac color chooser swatches do not work?

2017-12-05 Thread Tore Nilsen via use-livecode
Seems as if you are right, I cannot use the swatches either in LC 8.2 (dp2) 
with MacOS 10.13 beta (17A360a). Using the eyedropper tool to pick the colour 
from the swatches works here.

Tore

> 5. des. 2017 kl. 22:55 skrev Klaus major-k via use-livecode 
> :
> 
> Hi friends,
> 
> before I create a report, can someone please confirm that we
> cannot use the "swatches" at the bottom of the Mac color chooser?
> 
> Clicking them does nothing, we have to"re-create" the color with 
> the sliders (or Crayons or whatever we choose for selecting a color).
> 
> Works of course in e.g. "TextEdit" etc.
> 
> Thank you!
> 
> 
> Best
> 
> Klaus
> --
> Klaus Major
> http://www.major-k.de
> kl...@major-k.de
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
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


Mac color chooser swatches do not work?

2017-12-05 Thread Klaus major-k via use-livecode
Hi friends,

before I create a report, can someone please confirm that we
cannot use the "swatches" at the bottom of the Mac color chooser?

Clicking them does nothing, we have to"re-create" the color with 
the sliders (or Crayons or whatever we choose for selecting a color).

Works of course in e.g. "TextEdit" etc.

Thank you!


Best

Klaus
--
Klaus Major
http://www.major-k.de
kl...@major-k.de


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrid 2

2017-12-05 Thread Mike Kerner via use-livecode
Oh I'm an idiot.  It's not mobtablefield, it's modtablefield
Email: bernd@bernd.niggem...@uni-wh.de to make sure you have the latest
version.

On Tue, Dec 5, 2017 at 3:44 PM, Matthias Rebbe via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Mike,
>
> do you have an url where i can find mobTableField or more information
> about it?
>
> Regards,
> Matthias
>
>
> > Am 05.12.2017 um 20:52 schrieb Mike Kerner via use-livecode <
> use-livecode@lists.runrev.com >:
> >
> > Tom,
> > The other option is to use mobTableField (I think Bernd is the author) if
> > you don't need all the bells and whistles of the DG.
> > I'm using both in different mobile apps.  The original DG works fine even
> > for large DG's with horizontal and vertical scrolling, but MTF is even
> more
> > responsive.
> > ETA - they were talking about "soon" at the last LCG conference, which I
> > would assume means 1Q 18, even though they were talking end of 17.
> >
> > On Tue, Dec 5, 2017 at 1:50 PM, Tom Glod via use-livecode <
> > use-livecode@lists.runrev.com >
> wrote:
> >
> >> Hi folks, I'm bidding on a project and would like to get a sense as to
> the
> >> eta of datagrid 2 especially on mobile. I would love to buy a LC Indy
> >> License and do the job.
> >>
> >> During Campaign the eta was oct/november, but i get they are just
> >> estimates.  Is there a more up to date eta?
> >>
> >> Thanks,
> >>
> >> Tom
> >> ___
> >> use-livecode mailing list
> >> use-livecode@lists.runrev.com 
> >> Please visit this url to subscribe, unsubscribe and manage your
> >> subscription preferences:
> >> http://lists.runrev.com/mailman/listinfo/use-livecode
> >>
> >
> >
> >
> > --
> > On the first day, God created the heavens and the Earth
> > On the second day, God created the oceans.
> > On the third day, God put the animals on hold for a few hours,
> >   and did a little diving.
> > And God said, "This is good."
> > ___
> > use-livecode mailing list
> > use-livecode@lists.runrev.com 
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrid 2

2017-12-05 Thread Kevin Miller via use-livecode
I gave a demo of the progress on it in the last LCG. Its still on track
for completion in the last DP before Christmas.

Kind regards,

Kevin

Kevin Miller ~ ke...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps




On 05/12/2017, 18:50, "use-livecode on behalf of Tom Glod via
use-livecode"  wrote:

>Hi folks, I'm bidding on a project and would like to get a sense as to the
>eta of datagrid 2 especially on mobile. I would love to buy a LC Indy
>License and do the job.
>
>During Campaign the eta was oct/november, but i get they are just
>estimates.  Is there a more up to date eta?
>
>Thanks,
>
>Tom
>___
>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: Naive Player Questions

2017-12-05 Thread Graham Samuel via use-livecode
I don’t really know if it was DropBox exactly, but I got a temporary glitch 
that made my Mac freeze the first time I tried to download your zip file via 
the linkg. I tried it again just now and it worked. If I find out any more 
about what I did, I’ll let you know!

Graham
> On 5 Dec 2017, at 19:38, Richmond Mathewson via use-livecode 
>  wrote:

[snip]

> [ and I would be VERY interested to know, Graham, what that did to your 
> DropBox ]
> 
> The player in that stack plays an embedded mp3 file.
> 
> Richmond.


___
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: Datagrid 2

2017-12-05 Thread Matthias Rebbe via use-livecode
Mike, 

do you have an url where i can find mobTableField or more information about it?

Regards,
Matthias


> Am 05.12.2017 um 20:52 schrieb Mike Kerner via use-livecode 
> mailto:use-livecode@lists.runrev.com>>:
> 
> Tom,
> The other option is to use mobTableField (I think Bernd is the author) if
> you don't need all the bells and whistles of the DG.
> I'm using both in different mobile apps.  The original DG works fine even
> for large DG's with horizontal and vertical scrolling, but MTF is even more
> responsive.
> ETA - they were talking about "soon" at the last LCG conference, which I
> would assume means 1Q 18, even though they were talking end of 17.
> 
> On Tue, Dec 5, 2017 at 1:50 PM, Tom Glod via use-livecode <
> use-livecode@lists.runrev.com > wrote:
> 
>> Hi folks, I'm bidding on a project and would like to get a sense as to the
>> eta of datagrid 2 especially on mobile. I would love to buy a LC Indy
>> License and do the job.
>> 
>> During Campaign the eta was oct/november, but i get they are just
>> estimates.  Is there a more up to date eta?
>> 
>> Thanks,
>> 
>> Tom
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com 
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
> 
> 
> 
> -- 
> On the first day, God created the heavens and the Earth
> On the second day, God created the oceans.
> On the third day, God put the animals on hold for a few hours,
>   and did a little diving.
> And God said, "This is good."
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com 
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

___
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: libUrl tsNet and socketTimeoutInterval

2017-12-05 Thread Sannyasin Brahmanathaswami via use-livecode
Finding answers faster than expected. Spotify seems to want minimum 96kbps. If 
we use this for our own app/mp3's delivered by CloudFlare -- God only knows it 
that makes any sense at all… but we have to start somewhere…

Now, I'm not super savvy on these units but I think this means  96 X 125 
(bytes) = 12000 bytes

OK, now going over to the forum on this dropbox thread I see Jacque's and 
Charle's comments. 5 secs seems a little long.. so if we use the algorithm "We 
want to tell users what is up or dim content options from remote servers in 3 
seconds"  (and FTP is not in the cards) we get: 

tsNetSetTimeouts 60, 3000, 3000 , , 3, 12000

This translates "you must have a 96kbps connection or else…"  right?

FYI the dictionary does not declare units for the pLowSpeedTime, it should… 
I've assumed integers = seconds and not milliseconds for param 5.

Second  (dumb) question: how do we trap for the timeout? we keep checking the 
tsNetStatusCallback on a loop? and if and when we see timeout we inform the 
user? But we need a connectionID, so how do we extract a connectionID from 
put/get/set/ http urls? where we are targeting  browser widget on a card. Or a 
mobilePlayer?

set the url of browser "webViews" to https://MyDomain.com"; 

or a connection ID for this:

   mobileControlSet pPlayerName, "filename", pURL  

??

FWIW some useful links

 
https://www.highspeedinternet.com/resources/how-much-speed-do-i-need-for-pandora-and-spotify/
http://www.bandwidthplace.com/what-are-the-bandwidth-specifications-for-pandora-spotify-itunes-radio-and-beats-music-article/
https://thomas.vanhoutte.be/miniblog/spotify-data-consumption/T
https://www.highspeedinternet.com/resources/how-much-speed-do-i-need-for-pandora-and-spotify/

and interesting tool: push this URL to a browser widget in your mobile app.

http://www.bandwidthplace.com

and walk around different locations and check your bandwidth…

someone might cook up a native LC widget for this purpose.

BR


 

On 12/5/17, 9:19 AM, "use-livecode on behalf of Sannyasin Brahmanathaswami via 
use-livecode"  wrote:

So I guess this boils down to one question: 

If you are streaming audio or video.. .what would be the reasonable bytes 
per second you would want to "see" as current bandwidth before telling the 
users that their connection is too slow.

All thoughts on this welcome, as I go off to the net to find bandwidth 
standards… But maybe someone here already knows the answers/has experience? And 
of course, I can just build it and test (which we will do anyway)

___
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: Datagrid 2

2017-12-05 Thread Mike Kerner via use-livecode
Tom,
The other option is to use mobTableField (I think Bernd is the author) if
you don't need all the bells and whistles of the DG.
I'm using both in different mobile apps.  The original DG works fine even
for large DG's with horizontal and vertical scrolling, but MTF is even more
responsive.
ETA - they were talking about "soon" at the last LCG conference, which I
would assume means 1Q 18, even though they were talking end of 17.

On Tue, Dec 5, 2017 at 1:50 PM, Tom Glod via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hi folks, I'm bidding on a project and would like to get a sense as to the
> eta of datagrid 2 especially on mobile. I would love to buy a LC Indy
> License and do the job.
>
> During Campaign the eta was oct/november, but i get they are just
> estimates.  Is there a more up to date eta?
>
> Thanks,
>
> Tom
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: libUrl tsNet and socketTimeoutInterval

2017-12-05 Thread Sannyasin Brahmanathaswami via use-livecode
@ Charles (and anyone else)

using

tsNetSetTimeouts 30, 0, 30, 6, 30, 1000 

I need to implement this in our app… "minimum amount of data…" is obviously 
different from "no connection whatsoever"  

Your example assumes that for this use case, 30 seconds is acceptable. That may 
well be for a DropBox app where "downloading stuff" is a known "may take a long 
time" context. But clearly that's way too long for many contexts. Mobile users 
have high expectations on responsiveness. Can anyone give us some standard 
numbers for a Bytes/Seconds setting(s)  for a reasonable time out period for 
e.g. streaming audio OR an HTML page? 

I realize this question is highly context dependent. If one is calling a plain 
text static html page with one small image, the total data is very little. even 
on a slow connection, it might still load in a "some" (reasonable wait) 
seconds" … but then if one is about to stream an audio file (mp3) from the 
server which could be e.g. 30 minutes long in duration, the player will wait 
and wait and wait  perhaps get started, then stall ….since we set up Cloud 
Flare I'm seeing some big improvements on this front. no more outgoing 
traffic/CPU overload notifications from our Linode server…since CloudFlare is 
now serving all cached files from their CDN… Bu we still need to deal with 
local latencies as the user moves from her Home to his car to Starbucks + WiFi 
and then a walk down the street into the office (back up on hi-strength wifi

Spotify is quite "brutal" in it's approach… with 2 bars on a 3G connection… I 
can still go to Safari in my iPhone and fetch a small html page, but Spotify 
throws up it's ugly disconnected icon with no information on a black screen.  
Flipboard (delivers articles from publications… less bandwidth needed that 
Spotify for audio) used to just not open at all… now it will give some message 
about "connect to the internet"  -- confusing to the user when he can still 
connect in Safari

So if that's the way the Big Boys with the Million Dollar Apps do it. I wonder 
if I am just dreaming that us "little LC devs" can do a better job.

With TSNet (thanks for making this fully available now in Indy!)  we could fine 
tune this along the way. Theoretically one could dymanically reset the time out 
ahead of different classes of content

1) skinny text only pages
2) image heavy pages
3) streaming audio/video.

So I guess this boils down to one question: 

If you are streaming audio or video.. .what would be the reasonable bytes per 
second you would want to "see" as current bandwidth before telling the users 
that their connection is too slow.

All thoughts on this welcome, as I go off to the net to find bandwidth 
standards… But maybe someone here already knows the answers/has experience? And 
of course, I can just build it and test (which we will do anyway)

Brahmanathaswami
 

On 11/22/17, 6:16 PM, "use-livecode on behalf of Charles Warwick via 
use-livecode"  wrote:

Have a look at the following bug report which is about a similar issue:

http://quality.livecode.com/show_bug.cgi?id=20627

Effectively the last two parameters to that command allow you to set a 
minimum amount of data that must be transferred across a connection within a 
specified period of time to consider a connection still active.

Having said that, when tsNet is disabled, libUrl should continue to pay 
attention to the socketTimeoutInterval property.

I have just done quick test on LC8.2.0dp2 and if I set the 
socketTimeoutInterval before making a “put URL xxx” call to a script that 
deliberately doesn’t respond in time, the request times out after the time 
specified by the socketTimeoutInterval call and returns a result of “socket 
timeout”.

___
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: Naive Player Questions

2017-12-05 Thread Richmond Mathewson via use-livecode

I stand corrected!

You are indeed right: I moved my "carrot.mp3" file out of the same 
folder as the stack
and, no, no sound despite their being an embedded "carrot.mp3" file in 
the stack.


What a bu**er.

Richmond.

On 5/12/17 8:45 pm, Klaus major-k via use-livecode wrote:

Hi Richmond,


Am 05.12.2017 um 19:38 schrieb Richmond Mathewson via use-livecode 
:

NO: a player does not "demand" an external file as my example stack 
demonstrates:
https://www.dropbox.com/s/9v2juqqu7ojb83v/Carrot%20Player.livecode.zip?dl=0
[ and I would be VERY interested to know, Graham, what that did to your DropBox 
]
The player in that stack plays an embedded mp3 file.

It does NOT on a Mac, nor will it on Windows or wherever!

I suspect you have the MP3 in the same folder as the stack, so it might work 
for you
on your machine but not as you think. :-)


Richmond.

Best

Klaus

--
Klaus Major
http://www.major-k.de
kl...@major-k.de


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
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


Datagrid 2

2017-12-05 Thread Tom Glod via use-livecode
Hi folks, I'm bidding on a project and would like to get a sense as to the
eta of datagrid 2 especially on mobile. I would love to buy a LC Indy
License and do the job.

During Campaign the eta was oct/november, but i get they are just
estimates.  Is there a more up to date eta?

Thanks,

Tom
___
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: Naive Player Questions

2017-12-05 Thread Klaus major-k via use-livecode
Hi Richmond,

> Am 05.12.2017 um 19:38 schrieb Richmond Mathewson via use-livecode 
> :
> 
> NO: a player does not "demand" an external file as my example stack 
> demonstrates:
> https://www.dropbox.com/s/9v2juqqu7ojb83v/Carrot%20Player.livecode.zip?dl=0
> [ and I would be VERY interested to know, Graham, what that did to your 
> DropBox ]
> The player in that stack plays an embedded mp3 file.

It does NOT on a Mac, nor will it on Windows or wherever!

I suspect you have the MP3 in the same folder as the stack, so it might work 
for you 
on your machine but not as you think. :-)

> Richmond.

Best

Klaus

--
Klaus Major
http://www.major-k.de
kl...@major-k.de


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Naive Player Questions

2017-12-05 Thread Richmond Mathewson via use-livecode
NO: a player does not "demand" an external file as my example stack 
demonstrates:


https://www.dropbox.com/s/9v2juqqu7ojb83v/Carrot%20Player.livecode.zip?dl=0

[ and I would be VERY interested to know, Graham, what that did to your 
DropBox ]


The player in that stack plays an embedded mp3 file.

Richmond.

On 5/12/17 8:29 pm, Graham Samuel via use-livecode wrote:

Thanks to Panos and to Jacque (and earlier to Richmond, even if his link had an 
alarming effect on my DropBox!). Am I right to think the LC documentation is 
deficient in this area, or did I just miss it? For example, although it’s in 
the LC dictionary, “playstopped” can’t be found by searching the User Guide, 
which shows (IMHO) that users are not guided in any real sense about using 
players.

Another point is that if one intends to use a player, there seems to be no 
point in including an audio file within a stack as a clip, even though an 
unplayable file such as “mysound.mp3” is not rejected by the IDE when inserted 
in a stack (in fact it appears neatly in the “Audioclips” section): since a 
player demands an **external** file, the audio clip in that format just uses up 
space needlessly. It all seems a bit of a mess to me.

Having said that, I think I that as ever, thanks to the list, I can do what I 
want to do.

Cheers

Graham


On 5 Dec 2017, at 14:17, panagiotis merakos via use-livecode 
 wrote:

Hi Graham,

In short:

*- embedding an MP3, or alternatively providing a path to the default
folder for the MP3 file for standalone creation*

Include the .mp3 file (say "myFile.mp3") in the "Copy Files" section. This
will be accessible from the **standalone** using the
 function.

* - starting the player*

on mouseUp
   local tFilename
   put specialfolderpath("resources") & slash & "myFile.mp3" into tFilename
  // NOTE: In the IDE you'll need the full path to your "myFile.mp3"
   set the filename of player 1 to tFilename
   start player 1
end mouseUp

* - monitoring the player to see if it’s still running*

You can do that by checking "the playmate of player 1". If it is 0, then
the player does not play

- doing other stuff while it’s running

You can do other stuff without problems, as the player does not block them

- being told when it’s stopped.

Use the "playStopped" message

Hope this helps,
Panos
--

On Tue, Dec 5, 2017 at 11:51 AM, Graham Samuel via use-livecode <
use-livecode@lists.runrev.com> wrote:


Thanks Panos - I know that. I am however looking for comprehensive
instructions as to how to use a player object via script, e.g

- embedding an MP3, or alternatively providing a path to the default
folder for the MP3 file for standalone creation
- starting the player
- monitoring the player to see if it’s still running
- doing other stuff while it’s running
- being told when it’s stopped.

AFAIKS none of this is clear in the documentation. If true, this is a big
omission!

Cheers

Graham
PS - I imagine I’m not the only one to want to play MP3s because the are
vastly smaller than the LC ‘native’ sound formats. I don’t like to make
apps unnecessarily large, especially if they’re going to be delivered via
the Internet.


On 5 Dec 2017, at 12:13, panagiotis merakos via use-livecode <

use-livecode@lists.runrev.com> wrote:

Hi all,

The command "play  ' on desktop plays the file as an audioclip,
and audio clips can be in WAV, AIFF, or AU format. If you want to play an
mp3 file, you have to use a player object.

Best,
Panos
--

On Tue, Dec 5, 2017 at 11:06 AM, Richmond Mathewson via use-livecode <
use-livecode@lists.runrev.com> wrote:


Happy, Happy 5th of December: by sheer chance I stumbled on how to do

this

. . .

In fact the whole thing is dead easy (not, admittedly clear from the
Dictionary).

http://forums.livecode.com/viewtopic.php?f=7&t=30258&p=161069#p161069

Best, Richmond.

On 5/12/17 12:47 am, Graham Samuel via use-livecode wrote:


Hi - perhaps due to not picking the right search terms in the
documentation, I am confused about playing audio files in LC 8. What I

want

seems quite simple to me: I want the user to click a button which will
cause a single MP3 file to play. While it plays I may or may not want

to

switch cards or use visual effects. When it stops, I want to take back
control and move the program onto something else.

It appears that I have to use a player object to play MP3s, since the
“play” comment will only play aiffs. OK, so I can create a player

object,

but I want to embed my MP3 file into it (since I have no need to play

more

than one file), I want to start it, and I want the option to do stuff

while

it’s playing, and I certainly want to do stuff when it stops.

The documentation is not good on this - there is no indication as to
whether you can embed files (if you can’t, what would the path to a

file

included in the program look like - I can only see paths referring to

files

in my development environment)? There is one reference in Beginner’s

Guide

to a “play stopped” message, but ther

Re: Naive Player Questions

2017-12-05 Thread Graham Samuel via use-livecode
Thanks to Panos and to Jacque (and earlier to Richmond, even if his link had an 
alarming effect on my DropBox!). Am I right to think the LC documentation is 
deficient in this area, or did I just miss it? For example, although it’s in 
the LC dictionary, “playstopped” can’t be found by searching the User Guide, 
which shows (IMHO) that users are not guided in any real sense about using 
players. 

Another point is that if one intends to use a player, there seems to be no 
point in including an audio file within a stack as a clip, even though an 
unplayable file such as “mysound.mp3” is not rejected by the IDE when inserted 
in a stack (in fact it appears neatly in the “Audioclips” section): since a 
player demands an **external** file, the audio clip in that format just uses up 
space needlessly. It all seems a bit of a mess to me.

Having said that, I think I that as ever, thanks to the list, I can do what I 
want to do.

Cheers

Graham

> On 5 Dec 2017, at 14:17, panagiotis merakos via use-livecode 
>  wrote:
> 
> Hi Graham,
> 
> In short:
> 
> *- embedding an MP3, or alternatively providing a path to the default
> folder for the MP3 file for standalone creation*
> 
> Include the .mp3 file (say "myFile.mp3") in the "Copy Files" section. This
> will be accessible from the **standalone** using the
>  function.
> 
> * - starting the player*
> 
> on mouseUp
>   local tFilename
>   put specialfolderpath("resources") & slash & "myFile.mp3" into tFilename
>  // NOTE: In the IDE you'll need the full path to your "myFile.mp3"
>   set the filename of player 1 to tFilename
>   start player 1
> end mouseUp
> 
> * - monitoring the player to see if it’s still running*
> 
> You can do that by checking "the playmate of player 1". If it is 0, then
> the player does not play
> 
> - doing other stuff while it’s running
> 
> You can do other stuff without problems, as the player does not block them
> 
> - being told when it’s stopped.
> 
> Use the "playStopped" message
> 
> Hope this helps,
> Panos
> --
> 
> On Tue, Dec 5, 2017 at 11:51 AM, Graham Samuel via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> 
>> Thanks Panos - I know that. I am however looking for comprehensive
>> instructions as to how to use a player object via script, e.g
>> 
>> - embedding an MP3, or alternatively providing a path to the default
>> folder for the MP3 file for standalone creation
>> - starting the player
>> - monitoring the player to see if it’s still running
>> - doing other stuff while it’s running
>> - being told when it’s stopped.
>> 
>> AFAIKS none of this is clear in the documentation. If true, this is a big
>> omission!
>> 
>> Cheers
>> 
>> Graham
>> PS - I imagine I’m not the only one to want to play MP3s because the are
>> vastly smaller than the LC ‘native’ sound formats. I don’t like to make
>> apps unnecessarily large, especially if they’re going to be delivered via
>> the Internet.
>> 
>>> On 5 Dec 2017, at 12:13, panagiotis merakos via use-livecode <
>> use-livecode@lists.runrev.com> wrote:
>>> 
>>> Hi all,
>>> 
>>> The command "play  ' on desktop plays the file as an audioclip,
>>> and audio clips can be in WAV, AIFF, or AU format. If you want to play an
>>> mp3 file, you have to use a player object.
>>> 
>>> Best,
>>> Panos
>>> --
>>> 
>>> On Tue, Dec 5, 2017 at 11:06 AM, Richmond Mathewson via use-livecode <
>>> use-livecode@lists.runrev.com> wrote:
>>> 
 Happy, Happy 5th of December: by sheer chance I stumbled on how to do
>> this
 . . .
 
 In fact the whole thing is dead easy (not, admittedly clear from the
 Dictionary).
 
 http://forums.livecode.com/viewtopic.php?f=7&t=30258&p=161069#p161069
 
 Best, Richmond.
 
 On 5/12/17 12:47 am, Graham Samuel via use-livecode wrote:
 
> Hi - perhaps due to not picking the right search terms in the
> documentation, I am confused about playing audio files in LC 8. What I
>> want
> seems quite simple to me: I want the user to click a button which will
> cause a single MP3 file to play. While it plays I may or may not want
>> to
> switch cards or use visual effects. When it stops, I want to take back
> control and move the program onto something else.
> 
> It appears that I have to use a player object to play MP3s, since the
> “play” comment will only play aiffs. OK, so I can create a player
>> object,
> but I want to embed my MP3 file into it (since I have no need to play
>> more
> than one file), I want to start it, and I want the option to do stuff
>> while
> it’s playing, and I certainly want to do stuff when it stops.
> 
> The documentation is not good on this - there is no indication as to
> whether you can embed files (if you can’t, what would the path to a
>> file
> included in the program look like - I can only see paths referring to
>> files
> in my development environment)? There is one reference in Beginner’s
>> Guide
> to a “play stopped” message

LC Server style survey: co-mingle code w/HTML?

2017-12-05 Thread Richard Gaskin via use-livecode
I have some tools I developed for server apps, which allow me to develop 
and test both client and server within the same local LC IDE instance. 
As you can imagine, this has improved development efficiency by orders 
of magnitude.


It's much a much more xTalk-like way of working, and once you use it 
having to be tied to a server for every little test feels like building 
a ship in a bottle with tweezers while wearing a blindfold.


When I started making these tools I was using standalones exclusively 
for server work, partly because it reflects my habits gained from using 
LC as a CGI for many years before LC Server existed, and partly because 
I have no need to co-mingle code in HTML like PHP does, except a few 
cases where the merge function works quite nicely.


Thinking about this more recently, it seems these tools need not be 
limited to server deployments using standalones, and may be modified to 
provide the same server emulation for deployments that will use LC Server.


However, because the desktop version of LC has no means of executing LC 
Server scripts (due to the HTML wrapped around any code), the ability to 
enjoy such a fluid workflow is limited to those server apps where the 
.lc scripts contain only directives to load standard LC Script libraries.


That limitation fits my own work, including current work for one client. 
But does it fit yours?


How many of you using LC Server rely on its PHP-like model that 
encourages mixing HTML with LC code?


Or maybe the better question might be:

How many of you have server systems that already separate HTML from 
server code like most non-PHP solutions do, or could affordably 
transition to that model if it could simplify your development workflow 
significantly?


Side question for the dev team if they see this:

Would it be reasonable/affordable to add some means of enhancing desktop 
LC so that it can at least parse and attempt to execute LC scripts 
embedded in HTML?  I can emulate environment variables and the like, but 
the incompatibility between LC and .lc has been a real development 
bottleneck.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Why is node.js faster than LC server?

2017-12-05 Thread Jonathan Lynch via use-livecode
As always, Mark - thank you for that excellent detailed response. It gave me 
much to consider.



Sent from my iPhone

> On Dec 5, 2017, at 12:55 PM, Richard Gaskin via use-livecode 
>  wrote:
> 
> Andre Garzia wrote:
> 
> > Some other languages support full threads and some even allow you to
> > fork().
> 
> Can you describe what you mean by fork() here?  In a discussion a while back 
> I made reference to an earlier post you'd made about fork(), but the response 
> from the engine team left me with the impression that it's merely the way 
> processes launch other processes.  Of course we can launch processes right 
> now in LC, so clearly there's something here I'm missing (forgive the naivete 
> of the question; I'm only halfway into Robert Love's Linux System 
> Programming).
> 
> 
> > ## THE ENGINE POOL ##
> > I believe it was Richard who did this, can't recall, it was definitely
> > not me. Keep a pool of engines running, lets say 20, use a node
> > balancer to round robin them.
> 
> I'm sure there are others, but I can recall three people who've experimented 
> with this sort of multiprocessing: Pierre Zahores, Mark Talluto, and myself.
> 
> My own explorations were very superficial.  I spent more time looking into 
> how much could be gained by maxing async behavior with callbacks within a 
> single LC process (because of course there's no point spawning multiple 
> instances of an inefficient process ).  I used the Raney mchttpd stack as 
> a starting point, updated to send proper modern headers so it can be used 
> with browsers made after 1999 , and revised to use callbacks for all 
> reads/writes.
> 
> The TL/DR (I was testing delivery of static files rather than DB access, so 
> the comparison was with Apache2):
> 
>   The bad news is that even a slender HTTPd in LC was only slightly
>   more than half as fast as Apache2.
> 
>   The good news was that a slender HTTPd thrown together in a couple
>   hours in LC scripts was more than half as fast as the highly-
>   optimized C written by a team of specialists in Apache2! :)
> 
> 
> 
> My takeaway was that, as nice as it is to get pretty good results from a 
> scripting language like LC, if I actually need scalable multiprocessing it's 
> better handled by teams/apps specializing in that.
> 
> You may find some of Pierre's posts in that thread interesting.
> 
> -- 
> Richard Gaskin
> Fourth World Systems
> Software Design and Development for the Desktop, Mobile, and the Web
> 
> ambassa...@fourthworld.comhttp://www.FourthWorld.com
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

___
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: Why is node.js faster than LC server?

2017-12-05 Thread Richard Gaskin via use-livecode

Andre Garzia wrote:

> Some other languages support full threads and some even allow you to
> fork().

Can you describe what you mean by fork() here?  In a discussion a while 
back I made reference to an earlier post you'd made about fork(), but 
the response from the engine team left me with the impression that it's 
merely the way processes launch other processes.  Of course we can 
launch processes right now in LC, so clearly there's something here I'm 
missing (forgive the naivete of the question; I'm only halfway into 
Robert Love's Linux System Programming).



> ## THE ENGINE POOL ##
> I believe it was Richard who did this, can't recall, it was definitely
> not me. Keep a pool of engines running, lets say 20, use a node
> balancer to round robin them.

I'm sure there are others, but I can recall three people who've 
experimented with this sort of multiprocessing: Pierre Zahores, Mark 
Talluto, and myself.


My own explorations were very superficial.  I spent more time looking 
into how much could be gained by maxing async behavior with callbacks 
within a single LC process (because of course there's no point spawning 
multiple instances of an inefficient process ).  I used the Raney 
mchttpd stack as a starting point, updated to send proper modern headers 
so it can be used with browsers made after 1999 , and revised to use 
callbacks for all reads/writes.


The TL/DR (I was testing delivery of static files rather than DB access, 
so the comparison was with Apache2):


   The bad news is that even a slender HTTPd in LC was only slightly
   more than half as fast as Apache2.

   The good news was that a slender HTTPd thrown together in a couple
   hours in LC scripts was more than half as fast as the highly-
   optimized C written by a team of specialists in Apache2! :)



My takeaway was that, as nice as it is to get pretty good results from a 
scripting language like LC, if I actually need scalable multiprocessing 
it's better handled by teams/apps specializing in that.


You may find some of Pierre's posts in that thread interesting.

--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Naive Player Questions

2017-12-05 Thread J. Landman Gay via use-livecode
Specialfolderpath("resources") is especially convenient in another way. In 
a standalone it points to the location of the files that were added to the 
Copy Files pane of the standalone settings. But in the IDE it points to the 
folder containing the current mainstack. If you organize your files on disk 
inside the folder containing the mainstack, you don't need to branch the 
code to provide a full path during development. SpecialFolderPath will work 
the same way in either environment.



On December 5, 2017 7:19:14 AM panagiotis merakos via use-livecode 
 wrote:



Include the .mp3 file (say "myFile.mp3") in the "Copy Files" section. This
will be accessible from the **standalone** using the
 function.

* - starting the player*

on mouseUp
   local tFilename
   put specialfolderpath("resources") & slash & "myFile.mp3" into tFilename
  // NOTE: In the IDE you'll need the full path to your "myFile.mp3"
   set the filename of player 1 to tFilename
   start player 1
end mouseUp


--
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: Why is node.js faster than LC server?

2017-12-05 Thread Mark Waddingham via use-livecode
Apologies for the top post, but it seemed easier than responding to the 
rather long single-track thread this has generated. :)


On 2017-12-04 12:32, Jonathan Lynch via use-livecode wrote:

In looking at node.js it seems that two things stand out - LC server
waits for the database to send a reply, rather than setting an event
listener, and perhaps node.js launches faster when a request comes in?


Yes.


Is this accurate? Could LC server be modified to run as fast as node?
I would love to feel comfortable using LC server for millions of users
simultaneously - which I realize would take more than just speeding up
the server software.


Yes it is accurate - in regards to 'millions of users' then that is more 
down to IT infrastructure than anything else.


In terms of the other things raised in this thread - here is my take...

Node.js consists of three things - libuv, Google's JavaScript V8 engine, 
a mature package management system and large set of prebuilt libraries.


libuv (https://nikhilm.github.io/uvbook/introduction.html) is a highly 
performant low-level library (written in C) for handling IO on Windows 
and UNIX systems. It wraps the best possible approaches available in 
those two worlds (kqueue/poll on UNIX, IOCP on Windows) in a 
non-blocking and event-driven API for all forms of IO - whether that be 
pipes, sockets, files or inter-process communication. It aims to 
virtually eliminate the overhead involved in handling data flowing in 
and out of the process using it.


Node.js puts the V8 engine on top of libuv, and wraps its API at a 
reasonably high-level. The API allows JS to request IO operations, with 
which you provide a callback (whether wrapped in the syntactic sugar of 
futures/promises/continuations or not). The callbacks then call back 
into the V8 engine, again on the main (event-loop) thread.


Indeed, there really isn't 'that much' difference between LiveCode and 
Node.JS from this point of view. Two main differences though:


  1) Node.JS has a much more efficient underling IO handling system 
(libuv) in contrast to LiveCode's which has mainly evolved centered 
around UI event loops.


  2) a completely non-blocking API for all kinds of IO in contrast to 
LiveCode which only really offers non-blocking IO directly for sockets, 
although processes can be done with a simple polling loop.


In particular, Node.js doesn't natively use multiple threads (just like 
LiveCode) but there are packages which offer 'worker' style threading as 
you see in the browser though which basically allow you to eliminate (in 
a restricted way) the overhead of spinning up a separate process and 
using IPC to share state (the pros and cons of that will largely depend 
on the application though).


Of course, some Node.js packages *will* spin up separate threads to 
perform very specific things - like using the libmysql client library 
which uses blocking sockets to communicate with the DB, or resolving DNS 
names which typically use a blocking call (although on UNIX glibc wraps 
this in an async version). There are actually a few things in LiveCode 
which do a similar thing - DNS resolution spawns a temporary thread to 
do that, tsNet runs a separate thread to handle libcurl's event loop and 
the revandroid external spins up a separate thread to communicate with 
adb as a separate process.


In the future it would be nice to evolve the LiveCode engine to be 
Node.js-like - i.e. use libuv as the underlying IO library and ensure 
there is easy to use syntax for all IO operations you might want to 
perform. Indeed, it should really go further - in recent JS versions you 
can now write blocking-like code which runs as if it is non-blocking - 
essentially, JS has gained a form of 'wait' (something LiveCode has had 
for a long time). However, LiveCode's current implementation of wait is 
recursive and not round-robin - this is something which can (and will!) 
be changed when we solve the wait-problem for HTML5 (which I've finally 
managed to find a workable and incremental approach to solving).


Of course that is the future - so what about right now?

Well the first part is to allow certain operations to be non-blocking 
(i.e. callback driven) which currently are not - database access is one 
of these. There are two options here (1) do some low-level C fettling to 
run revdb calls on separate threads and use a callback, (2) write 
appropriate db protocol libraries in LiveCode Script using its 
non-blocking sockets. The latter might sound like 'why bother?' but, DB 
protocols change rarely, and there is a huge overhead in maintaining and 
shipping any large blob of compiled C++ when you target umpteen 
different OSes/architecture combinations. Of course, some db libraries 
are naturally non-blocking, in which case wrapping them in LCB would be 
a suitable option.


Beyond that, I really do think it mostly comes down to infrastructure. 
You need a gateway process which sits and handles the front-end 
connecti

Re: Naive Player Questions

2017-12-05 Thread panagiotis merakos via use-livecode
Lol hahaha, sorry :)

I meant "playrate", and indeed I wrote "playrate", but Safari auto-complete
keeps changing it to "playmate" :)

Best,
Panos
--

On Tue, Dec 5, 2017 at 3:58 PM, Klaus major-k via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hi Panos,
>
> > Am 05.12.2017 um 14:17 schrieb panagiotis merakos via use-livecode <
> use-livecode@lists.runrev.com>:
> > ...
> > You can do that by checking "the playmate of player 1". ...
>
> where "Player 1" = Hugh Heffner (RIP)? :-D
>
>
> Best
>
> Klaus
>
> --
> Klaus Major
> http://www.major-k.de
> kl...@major-k.de
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
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: Why is node.js faster than LC server?

2017-12-05 Thread Jonathan Lynch via use-livecode
Hello again - this page describes some of the things I am talking about:

https://mariadb.com/kb/en/library/using-the-non-blocking-library/

If LC had a mechanism to use the non-blocking functions in a database,  like 
the library for MariaDB described in that page, then we could eliminate all of 
the extra idle time spent waiting for the database to return a result.


Sent from my iPhone

> On Dec 5, 2017, at 10:16 AM, jonathandly...@gmail.com wrote:
> 
> Thank you Andre,
> 
> The fact that one of the bottlenecks is in waiting for the database to get 
> the data back is what I was targeting. If LC just sends a request to a 
> different program, and that program spawns a new thread for each request, 
> then LC is free to keep working. In this way, LC would be single-threaded and 
> handling database activities asynchronously.
> 
> It appears this can be done with using asynchronous http requests sent to a 
> database program with an http plugin, but that seems weird and clunky to me.
> 
> Just to clarify, I am not trying to multithread with LC or use multiple 
> processes with LC. I am wondering about using multithreading in an external 
> that then sends search results back to LC as they become available. LC would 
> still be single-threaded in this scenario. The end result is that LC keeps 
> working while the database is handling multiple searches.
> 
> Sent from my iPhone
> 
>> On Dec 5, 2017, at 9:40 AM, Andre Garzia  wrote:
>> 
>> Jonathan,
>> 
>> It is not that simple. There is no silver bullet that can be added to a 
>> language to make it scale by couple orders of magnitude like this. LiveCode 
>> engine while is executing your business logic is not doing anything else (it 
>> might be tidying up the house bit, I haven't looked at it but it is 
>> definitely not executing other parts of your business code). Other languages 
>> with support of fibers/coroutines can basically switch what they are doing 
>> like an OS with multithreading without actually the threading part. Some 
>> other languages support full threads and some even allow you to fork(). But 
>> as far as I am aware LC datatypes and workflow is not thread safe (someone 
>> familiar with the internals might correct me here) which makes it a time 
>> bomb if you go spawning threads. Also thread programming is quite complex 
>> and data races are a real problem, Mozilla creation of Rust was in-parts to 
>> prevent data races with a safer language, thats how big this problem is, 
>> people go and create new languages to solve it.
>> 
>> LC bottleneck is not database queries, the queries spend more time inside 
>> the database than they do in transit between the revdb external and the 
>> rdbms. There is not something that we can bolt on top of the current LC 
>> engine to make it behave like nodejs (non-blocking with async language and 
>> jit) and that is not even desirable. NodeJS programming requires a ton of 
>> tooling and knowledge that is not at all related to whatever business you're 
>> trying to solve, LC is much more a pick and go language than NodeJS ever 
>> will be. Doing a simple setup of a modern NodeJS sample based on server-side 
>> rendering and react will probably download hundreds of megabytes in 
>> developer dependencies, just to get the sample to compile. Imagine if one of 
>> your stacks required THOUSANDS of little stacks that amounted to HUNDREDS of 
>> megabytes on disk, just to load. That is the land of NodeJS, it has its own 
>> problems.
>> 
>> Other potential solutions for deploying LC based server software have been 
>> attempted in the past, I will summarize two of them below as 
>> food-for-thoughts.
>> 
>> ## THE FASTCGI APPROACH ##
>> Long long time ago, in a Runtime Revolution far far away, I coded a fastcgi 
>> stack. Fastcgi is a protocol specification that allows using a single 
>> connection (or a pool) to multiplex requests from a server. So using 
>> something like  a persistent TCP connection to Apache, you could answer 
>> multiple requests. The problem with fastcgi and LC is the same as outlined 
>> above, while the cgi part was trying to solve something, it would not 
>> respond to requests, thats the bottleneck: the blocking code part. Imagine 
>> that your cgi needs to fetch a large data set from a file and process it 
>> before answering and that this process took 5 seconds. During those seconds, 
>> the server would be unresponsive.
>> 
>> ## THE ENGINE POOL ##
>> I believe it was Richard who did this, can't recall, it was definitely not 
>> me. Keep a pool of engines running, lets say 20, use a node balancer to 
>> round robin them. This allows you to answer at least 20 concurrent requests. 
>> Then engine pool is only desirable over our normal CGI method in one very 
>> specific case: The current LC server is CGI based, so it spawns a new engine 
>> for each request, if you're on a memory constrained machine that can't 
>> afford this escalation of memory and cpu usage, you keep a pool

Re: Naive Player Questions

2017-12-05 Thread Klaus major-k via use-livecode
Hi Panos,

> Am 05.12.2017 um 14:17 schrieb panagiotis merakos via use-livecode 
> :
> ...
> You can do that by checking "the playmate of player 1". ...

where "Player 1" = Hugh Heffner (RIP)? :-D


Best

Klaus

--
Klaus Major
http://www.major-k.de
kl...@major-k.de


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Naive Player Questions

2017-12-05 Thread Sannyasin Brahmanathaswami via use-livecode
Panos wrote:

You can do that by checking "the playmate of player 1". If it is 0, then
the player does not play

"playmate"

??

___
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: Why is node.js faster than LC server?

2017-12-05 Thread Jonathan Lynch via use-livecode
Thank you Andre,

The fact that one of the bottlenecks is in waiting for the database to get the 
data back is what I was targeting. If LC just sends a request to a different 
program, and that program spawns a new thread for each request, then LC is free 
to keep working. In this way, LC would be single-threaded and handling database 
activities asynchronously.

It appears this can be done with using asynchronous http requests sent to a 
database program with an http plugin, but that seems weird and clunky to me.

Just to clarify, I am not trying to multithread with LC or use multiple 
processes with LC. I am wondering about using multithreading in an external 
that then sends search results back to LC as they become available. LC would 
still be single-threaded in this scenario. The end result is that LC keeps 
working while the database is handling multiple searches.

Sent from my iPhone

> On Dec 5, 2017, at 9:40 AM, Andre Garzia  wrote:
> 
> Jonathan,
> 
> It is not that simple. There is no silver bullet that can be added to a 
> language to make it scale by couple orders of magnitude like this. LiveCode 
> engine while is executing your business logic is not doing anything else (it 
> might be tidying up the house bit, I haven't looked at it but it is 
> definitely not executing other parts of your business code). Other languages 
> with support of fibers/coroutines can basically switch what they are doing 
> like an OS with multithreading without actually the threading part. Some 
> other languages support full threads and some even allow you to fork(). But 
> as far as I am aware LC datatypes and workflow is not thread safe (someone 
> familiar with the internals might correct me here) which makes it a time bomb 
> if you go spawning threads. Also thread programming is quite complex and data 
> races are a real problem, Mozilla creation of Rust was in-parts to prevent 
> data races with a safer language, thats how big this problem is, people go 
> and create new languages to solve it.
> 
> LC bottleneck is not database queries, the queries spend more time inside the 
> database than they do in transit between the revdb external and the rdbms. 
> There is not something that we can bolt on top of the current LC engine to 
> make it behave like nodejs (non-blocking with async language and jit) and 
> that is not even desirable. NodeJS programming requires a ton of tooling and 
> knowledge that is not at all related to whatever business you're trying to 
> solve, LC is much more a pick and go language than NodeJS ever will be. Doing 
> a simple setup of a modern NodeJS sample based on server-side rendering and 
> react will probably download hundreds of megabytes in developer dependencies, 
> just to get the sample to compile. Imagine if one of your stacks required 
> THOUSANDS of little stacks that amounted to HUNDREDS of megabytes on disk, 
> just to load. That is the land of NodeJS, it has its own problems.
> 
> Other potential solutions for deploying LC based server software have been 
> attempted in the past, I will summarize two of them below as 
> food-for-thoughts.
> 
> ## THE FASTCGI APPROACH ##
> Long long time ago, in a Runtime Revolution far far away, I coded a fastcgi 
> stack. Fastcgi is a protocol specification that allows using a single 
> connection (or a pool) to multiplex requests from a server. So using 
> something like  a persistent TCP connection to Apache, you could answer 
> multiple requests. The problem with fastcgi and LC is the same as outlined 
> above, while the cgi part was trying to solve something, it would not respond 
> to requests, thats the bottleneck: the blocking code part. Imagine that your 
> cgi needs to fetch a large data set from a file and process it before 
> answering and that this process took 5 seconds. During those seconds, the 
> server would be unresponsive.
> 
> ## THE ENGINE POOL ##
> I believe it was Richard who did this, can't recall, it was definitely not 
> me. Keep a pool of engines running, lets say 20, use a node balancer to round 
> robin them. This allows you to answer at least 20 concurrent requests. Then 
> engine pool is only desirable over our normal CGI method in one very specific 
> case: The current LC server is CGI based, so it spawns a new engine for each 
> request, if you're on a memory constrained machine that can't afford this 
> escalation of memory and cpu usage, you keep a pool of engines in a safe 
> threshold and use the pool. I can only see this working well on a raspberry 
> pi, all other cases CGI should work better.
> 
> ## Curiosity nuggets of semi-related trivia ##
> Oh, and sometimes even NodeJS is slow, check out this article I wrote couple 
> weeks ago: http://andregarzia.com/en/blog/creating-rust-based-nodejs-modules 
> in which I show a dramatic speedup in a NodeJS codebase by converting the 
> most critical part of the code into a Rust based module. The code used to 
> execute in 3 seconds and went to execute 

Re: Why is node.js faster than LC server?

2017-12-05 Thread Andre Garzia via use-livecode
Jonathan,

It is not that simple. There is no silver bullet that can be added to a
language to make it scale by couple orders of magnitude like this. LiveCode
engine while is executing your business logic is not doing anything else
(it might be tidying up the house bit, I haven't looked at it but it is
definitely not executing other parts of your business code). Other
languages with support of fibers/coroutines can basically switch what they
are doing like an OS with multithreading without actually the threading
part. Some other languages support full threads and some even allow you to
fork(). But as far as I am aware LC datatypes and workflow is not thread
safe (someone familiar with the internals might correct me here) which
makes it a time bomb if you go spawning threads. Also thread programming is
quite complex and data races are a real problem, Mozilla creation of Rust
was in-parts to prevent data races with a safer language, thats how big
this problem is, people go and create new languages to solve it.

LC bottleneck is not database queries, the queries spend more time inside
the database than they do in transit between the revdb external and the
rdbms. There is not something that we can bolt on top of the current LC
engine to make it behave like nodejs (non-blocking with async language and
jit) and that is not even desirable. NodeJS programming requires a ton of
tooling and knowledge that is not at all related to whatever business
you're trying to solve, LC is much more a pick and go language than NodeJS
ever will be. Doing a simple setup of a modern NodeJS sample based on
server-side rendering and react will probably download hundreds of
megabytes in developer dependencies, just to get the sample to compile.
Imagine if one of your stacks required THOUSANDS of little stacks that
amounted to HUNDREDS of megabytes on disk, just to load. That is the land
of NodeJS, it has its own problems.

Other potential solutions for deploying LC based server software have been
attempted in the past, I will summarize two of them below as
food-for-thoughts.

## THE FASTCGI APPROACH ##
Long long time ago, in a Runtime Revolution far far away, I coded a fastcgi
stack. Fastcgi is a protocol specification that allows using a single
connection (or a pool) to multiplex requests from a server. So using
something like  a persistent TCP connection to Apache, you could answer
multiple requests. The problem with fastcgi and LC is the same as outlined
above, while the cgi part was trying to solve something, it would not
respond to requests, thats the bottleneck: the blocking code part. Imagine
that your cgi needs to fetch a large data set from a file and process it
before answering and that this process took 5 seconds. During those
seconds, the server would be unresponsive.

## THE ENGINE POOL ##
I believe it was Richard who did this, can't recall, it was definitely not
me. Keep a pool of engines running, lets say 20, use a node balancer to
round robin them. This allows you to answer at least 20 concurrent
requests. Then engine pool is only desirable over our normal CGI method in
one very specific case: The current LC server is CGI based, so it spawns a
new engine for each request, if you're on a memory constrained machine that
can't afford this escalation of memory and cpu usage, you keep a pool of
engines in a safe threshold and use the pool. I can only see this working
well on a raspberry pi, all other cases CGI should work better.

## Curiosity nuggets of semi-related trivia ##
Oh, and sometimes even NodeJS is slow, check out this article I wrote
couple weeks ago:
http://andregarzia.com/en/blog/creating-rust-based-nodejs-modules in which
I show a dramatic speedup in a NodeJS codebase by converting the most
critical part of the code into a Rust based module. The code used to
execute in 3 seconds and went to execute in 150 miliseconds.


On Tue, Dec 5, 2017 at 9:29 AM, Jonathan Lynch via use-livecode <
use-livecode@lists.runrev.com> wrote:

> To make this happen, it seems like we would need an external that
> multithreads database queries and sends the query results back to LC as a
> new message. It would have to bring in a new ID for each request and return
> that ID with the result.
>
> Can the ODBC external do that?
>
> Sent from my iPhone
>
> > On Dec 4, 2017, at 2:06 PM, Richard Gaskin via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > jonathandlynch wrote:
> >
> > > Hi Richard and Andre - thanks for your replies. I was the one who
> > > mentioned millions of users at the same time, not out of drunkenness
> > > but because I wanted to understand the upper limits of these systems.
> >
> > Scaling is a fascinating problem.  I found the C10k problem a good
> starting point (in recent years supplanted with C10m):
> >
> > 
> >
> >
> > > I also found a thread discussing this idea from a few years ago that
> > > Richard was part of. It was very informative.
> >
> > I us

Re: Naive Player Questions

2017-12-05 Thread panagiotis merakos via use-livecode
Hi Graham,

In short:

*- embedding an MP3, or alternatively providing a path to the default
folder for the MP3 file for standalone creation*

Include the .mp3 file (say "myFile.mp3") in the "Copy Files" section. This
will be accessible from the **standalone** using the
 function.

* - starting the player*

on mouseUp
   local tFilename
   put specialfolderpath("resources") & slash & "myFile.mp3" into tFilename
  // NOTE: In the IDE you'll need the full path to your "myFile.mp3"
   set the filename of player 1 to tFilename
   start player 1
end mouseUp

* - monitoring the player to see if it’s still running*

You can do that by checking "the playmate of player 1". If it is 0, then
the player does not play

 - doing other stuff while it’s running

You can do other stuff without problems, as the player does not block them

 - being told when it’s stopped.

Use the "playStopped" message

Hope this helps,
Panos
--

On Tue, Dec 5, 2017 at 11:51 AM, Graham Samuel via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Thanks Panos - I know that. I am however looking for comprehensive
> instructions as to how to use a player object via script, e.g
>
>  - embedding an MP3, or alternatively providing a path to the default
> folder for the MP3 file for standalone creation
>  - starting the player
>  - monitoring the player to see if it’s still running
>  - doing other stuff while it’s running
>  - being told when it’s stopped.
>
> AFAIKS none of this is clear in the documentation. If true, this is a big
> omission!
>
> Cheers
>
> Graham
> PS - I imagine I’m not the only one to want to play MP3s because the are
> vastly smaller than the LC ‘native’ sound formats. I don’t like to make
> apps unnecessarily large, especially if they’re going to be delivered via
> the Internet.
>
> > On 5 Dec 2017, at 12:13, panagiotis merakos via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > Hi all,
> >
> > The command "play  ' on desktop plays the file as an audioclip,
> > and audio clips can be in WAV, AIFF, or AU format. If you want to play an
> > mp3 file, you have to use a player object.
> >
> > Best,
> > Panos
> > --
> >
> > On Tue, Dec 5, 2017 at 11:06 AM, Richmond Mathewson via use-livecode <
> > use-livecode@lists.runrev.com> wrote:
> >
> >> Happy, Happy 5th of December: by sheer chance I stumbled on how to do
> this
> >> . . .
> >>
> >> In fact the whole thing is dead easy (not, admittedly clear from the
> >> Dictionary).
> >>
> >> http://forums.livecode.com/viewtopic.php?f=7&t=30258&p=161069#p161069
> >>
> >> Best, Richmond.
> >>
> >> On 5/12/17 12:47 am, Graham Samuel via use-livecode wrote:
> >>
> >>> Hi - perhaps due to not picking the right search terms in the
> >>> documentation, I am confused about playing audio files in LC 8. What I
> want
> >>> seems quite simple to me: I want the user to click a button which will
> >>> cause a single MP3 file to play. While it plays I may or may not want
> to
> >>> switch cards or use visual effects. When it stops, I want to take back
> >>> control and move the program onto something else.
> >>>
> >>> It appears that I have to use a player object to play MP3s, since the
> >>> “play” comment will only play aiffs. OK, so I can create a player
> object,
> >>> but I want to embed my MP3 file into it (since I have no need to play
> more
> >>> than one file), I want to start it, and I want the option to do stuff
> while
> >>> it’s playing, and I certainly want to do stuff when it stops.
> >>>
> >>> The documentation is not good on this - there is no indication as to
> >>> whether you can embed files (if you can’t, what would the path to a
> file
> >>> included in the program look like - I can only see paths referring to
> files
> >>> in my development environment)? There is one reference in Beginner’s
> Guide
> >>> to a “play stopped” message, but there isn’t one in the User Guide. My
> old
> >>> friend “wait until the sound is done” seems to have died of old age.
> How do
> >>> I know when the sound is finished, or alternatively how can I know if
> it’s
> >>> still playing?
> >>>
> >>> Can anyone explain what I’m supposed to do, or (just as good) point me
> to
> >>> the right bit of LC documentation?
> >>>
> >>> TIA
> >>>
> >>> 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 a

Re: Naive Player Questions

2017-12-05 Thread Graham Samuel via use-livecode
Thanks Panos - I know that. I am however looking for comprehensive instructions 
as to how to use a player object via script, e.g

 - embedding an MP3, or alternatively providing a path to the default folder 
for the MP3 file for standalone creation
 - starting the player
 - monitoring the player to see if it’s still running
 - doing other stuff while it’s running
 - being told when it’s stopped.

AFAIKS none of this is clear in the documentation. If true, this is a big 
omission!

Cheers

Graham
PS - I imagine I’m not the only one to want to play MP3s because the are vastly 
smaller than the LC ‘native’ sound formats. I don’t like to make apps 
unnecessarily large, especially if they’re going to be delivered via the 
Internet.

> On 5 Dec 2017, at 12:13, panagiotis merakos via use-livecode 
>  wrote:
> 
> Hi all,
> 
> The command "play  ' on desktop plays the file as an audioclip,
> and audio clips can be in WAV, AIFF, or AU format. If you want to play an
> mp3 file, you have to use a player object.
> 
> Best,
> Panos
> --
> 
> On Tue, Dec 5, 2017 at 11:06 AM, Richmond Mathewson via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> 
>> Happy, Happy 5th of December: by sheer chance I stumbled on how to do this
>> . . .
>> 
>> In fact the whole thing is dead easy (not, admittedly clear from the
>> Dictionary).
>> 
>> http://forums.livecode.com/viewtopic.php?f=7&t=30258&p=161069#p161069
>> 
>> Best, Richmond.
>> 
>> On 5/12/17 12:47 am, Graham Samuel via use-livecode wrote:
>> 
>>> Hi - perhaps due to not picking the right search terms in the
>>> documentation, I am confused about playing audio files in LC 8. What I want
>>> seems quite simple to me: I want the user to click a button which will
>>> cause a single MP3 file to play. While it plays I may or may not want to
>>> switch cards or use visual effects. When it stops, I want to take back
>>> control and move the program onto something else.
>>> 
>>> It appears that I have to use a player object to play MP3s, since the
>>> “play” comment will only play aiffs. OK, so I can create a player object,
>>> but I want to embed my MP3 file into it (since I have no need to play more
>>> than one file), I want to start it, and I want the option to do stuff while
>>> it’s playing, and I certainly want to do stuff when it stops.
>>> 
>>> The documentation is not good on this - there is no indication as to
>>> whether you can embed files (if you can’t, what would the path to a file
>>> included in the program look like - I can only see paths referring to files
>>> in my development environment)? There is one reference in Beginner’s Guide
>>> to a “play stopped” message, but there isn’t one in the User Guide. My old
>>> friend “wait until the sound is done” seems to have died of old age. How do
>>> I know when the sound is finished, or alternatively how can I know if it’s
>>> still playing?
>>> 
>>> Can anyone explain what I’m supposed to do, or (just as good) point me to
>>> the right bit of LC documentation?
>>> 
>>> TIA
>>> 
>>> 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

Re: Why is node.js faster than LC server?

2017-12-05 Thread Jonathan Lynch via use-livecode
To make this happen, it seems like we would need an external that multithreads 
database queries and sends the query results back to LC as a new message. It 
would have to bring in a new ID for each request and return that ID with the 
result.

Can the ODBC external do that?

Sent from my iPhone

> On Dec 4, 2017, at 2:06 PM, Richard Gaskin via use-livecode 
>  wrote:
> 
> jonathandlynch wrote:
> 
> > Hi Richard and Andre - thanks for your replies. I was the one who
> > mentioned millions of users at the same time, not out of drunkenness
> > but because I wanted to understand the upper limits of these systems.
> 
> Scaling is a fascinating problem.  I found the C10k problem a good starting 
> point (in recent years supplanted with C10m):
> 
> 
> 
> 
> > I also found a thread discussing this idea from a few years ago that
> > Richard was part of. It was very informative.
> 
> I usually just quote Pierre or Andre, but once in a while my OCD habits with 
> benchmarking add something useful. :)
> 
> 
> > I think an all-LC very fast server would be a great thing, but it
> > sounds like just using node would be more realistic. I might fiddle
> > a bit with this idea, just to satisfy my curiosity.
> 
> Node.js is good where Node.js is needed.  In some cases NginX is good. In 
> other cases Lighttpd is fine.  And in many cases Apache is fine, even with 
> simple CGI.
> 
> Most of us never need to think about C10m, or even C10k.  If we do, that's a 
> wonderfully fortunate problem to have.  Just having that problem makes it 
> much easier to get funding to solve it with specialists.  Let the t-shirts 
> sort it out while the suits focus on strategy.
> 
> -- 
> Richard Gaskin
> Fourth World Systems
> Software Design and Development for the Desktop, Mobile, and the Web
> 
> ambassa...@fourthworld.comhttp://www.FourthWorld.com
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

___
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: Naive Player Questions

2017-12-05 Thread panagiotis merakos via use-livecode
Hi all,

The command "play  ' on desktop plays the file as an audioclip,
and audio clips can be in WAV, AIFF, or AU format. If you want to play an
mp3 file, you have to use a player object.

Best,
Panos
--

On Tue, Dec 5, 2017 at 11:06 AM, Richmond Mathewson via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Happy, Happy 5th of December: by sheer chance I stumbled on how to do this
> . . .
>
> In fact the whole thing is dead easy (not, admittedly clear from the
> Dictionary).
>
> http://forums.livecode.com/viewtopic.php?f=7&t=30258&p=161069#p161069
>
> Best, Richmond.
>
> On 5/12/17 12:47 am, Graham Samuel via use-livecode wrote:
>
>> Hi - perhaps due to not picking the right search terms in the
>> documentation, I am confused about playing audio files in LC 8. What I want
>> seems quite simple to me: I want the user to click a button which will
>> cause a single MP3 file to play. While it plays I may or may not want to
>> switch cards or use visual effects. When it stops, I want to take back
>> control and move the program onto something else.
>>
>> It appears that I have to use a player object to play MP3s, since the
>> “play” comment will only play aiffs. OK, so I can create a player object,
>> but I want to embed my MP3 file into it (since I have no need to play more
>> than one file), I want to start it, and I want the option to do stuff while
>> it’s playing, and I certainly want to do stuff when it stops.
>>
>> The documentation is not good on this - there is no indication as to
>> whether you can embed files (if you can’t, what would the path to a file
>> included in the program look like - I can only see paths referring to files
>> in my development environment)? There is one reference in Beginner’s Guide
>> to a “play stopped” message, but there isn’t one in the User Guide. My old
>> friend “wait until the sound is done” seems to have died of old age. How do
>> I know when the sound is finished, or alternatively how can I know if it’s
>> still playing?
>>
>> Can anyone explain what I’m supposed to do, or (just as good) point me to
>> the right bit of LC documentation?
>>
>> TIA
>>
>> 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

Re: Naive Player Questions

2017-12-05 Thread Richmond Mathewson via use-livecode
Happy, Happy 5th of December: by sheer chance I stumbled on how to do 
this . . .


In fact the whole thing is dead easy (not, admittedly clear from the 
Dictionary).


http://forums.livecode.com/viewtopic.php?f=7&t=30258&p=161069#p161069

Best, Richmond.

On 5/12/17 12:47 am, Graham Samuel via use-livecode wrote:

Hi - perhaps due to not picking the right search terms in the documentation, I 
am confused about playing audio files in LC 8. What I want seems quite simple 
to me: I want the user to click a button which will cause a single MP3 file to 
play. While it plays I may or may not want to switch cards or use visual 
effects. When it stops, I want to take back control and move the program onto 
something else.

It appears that I have to use a player object to play MP3s, since the “play” 
comment will only play aiffs. OK, so I can create a player object, but I want 
to embed my MP3 file into it (since I have no need to play more than one file), 
I want to start it, and I want the option to do stuff while it’s playing, and I 
certainly want to do stuff when it stops.

The documentation is not good on this - there is no indication as to whether 
you can embed files (if you can’t, what would the path to a file included in 
the program look like - I can only see paths referring to files in my 
development environment)? There is one reference in Beginner’s Guide to a “play 
stopped” message, but there isn’t one in the User Guide. My old friend “wait 
until the sound is done” seems to have died of old age. How do I know when the 
sound is finished, or alternatively how can I know if it’s still playing?

Can anyone explain what I’m supposed to do, or (just as good) point me to the 
right bit of LC documentation?

TIA

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: Naive Player Questions

2017-12-05 Thread Richmond Mathewson via use-livecode

https://www.dropbox.com/s/phplc4g1noardab/Carrot.livecode.zip?dl=0

No player object: on Macintosh the mp3 file comes out as "squishy noise".

Richmond.

On 5/12/17 12:47 am, Graham Samuel via use-livecode wrote:

Hi - perhaps due to not picking the right search terms in the documentation, I 
am confused about playing audio files in LC 8. What I want seems quite simple 
to me: I want the user to click a button which will cause a single MP3 file to 
play. While it plays I may or may not want to switch cards or use visual 
effects. When it stops, I want to take back control and move the program onto 
something else.

It appears that I have to use a player object to play MP3s, since the “play” 
comment will only play aiffs. OK, so I can create a player object, but I want 
to embed my MP3 file into it (since I have no need to play more than one file), 
I want to start it, and I want the option to do stuff while it’s playing, and I 
certainly want to do stuff when it stops.

The documentation is not good on this - there is no indication as to whether 
you can embed files (if you can’t, what would the path to a file included in 
the program look like - I can only see paths referring to files in my 
development environment)? There is one reference in Beginner’s Guide to a “play 
stopped” message, but there isn’t one in the User Guide. My old friend “wait 
until the sound is done” seems to have died of old age. How do I know when the 
sound is finished, or alternatively how can I know if it’s still playing?

Can anyone explain what I’m supposed to do, or (just as good) point me to the 
right bit of LC documentation?

TIA

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