Re: LC Server - MySQL - update about 2000 rows/records of a table

2017-12-30 Thread Sannyasin Brahmanathaswami via use-livecode
Ditto what Mike said: 

" On mysql..  can't you prebuild your multi-command transaction in a variable"

I periodically do this kind of thing. assuming the transaction is exactly the 
same… one way is to build a single SQL query from your data.

Assume you need something like this, getting and SQL query into a string, from 
raw data with LC's text processing tools is easy:

INSERT INTO `mytable` (item,quantity,amount)
VALUES
('Oranges',3,5.00)
('Apples',10,6.00)
#etc..
#(no problem doing 2000 of these)
;

and then do the insert as a single query/transaction and let the dBase handle 
it.
BR




On 12/29/17, 3:05 PM, "use-livecode on behalf of Mike Bonner via use-livecode" 
 wrote:


(with a beginning and ending to the transaction) and then use revexecutesql
with a single call for the one big transaction?

___
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: Optimizing for small Android devices

2017-12-30 Thread J. Landman Gay via use-livecode

On 12/30/17 2:44 PM, Sannyasin Brahmanathaswami via use-livecode wrote:

I think we need to wait until HQ weighs in on my bug report. Regardless of the fact that it works 
on iOS and Oreo, one has to wonder how on earth we can close a stack which is set to destroy on 
close, turn acceleratedRendering to false (assume previously cached controls are  cleared); open a 
new stack and*still*  see the old stack behind the new, one, as if they two are still fighting for 
the pixel map…. even if the old one "loses" on iOS and Oreo…and the new stack 
"wins" the display.. .the old one could still be in the heap.


This could be a redraw issue rather than an open stack, but see what HQ 
says. I know that pixels outside the card area aren't redrawn on mobile, 
this could be related.


--
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: Dissolve/Transitions Very Costly

2017-12-30 Thread J. Landman Gay via use-livecode

On 12/30/17 4:06 PM, Sannyasin Brahmanathaswami via use-livecode wrote:

# theoretically 1/5 of 2000 = 400 milliseconds

why is the script profiler saying this line takes 4765 milliseconds top execute?


If it's like the MC profiler, these are relative times. They aren't 
meant to tell you exactly how long an operation takes, just how it 
compares to others. The profiler itself slows down execution.


--
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: Dissolve/Transitions Very Costly

2017-12-30 Thread Tore Nilsen via use-livecode
It may also help to lock the screen for visual effect within a given rectangle, 
thereby reducing the number of pixels that need to be updated. If the images 
are of equal dimensions and with the same loc, you can refer to the rect of one 
of them, otherwise you can have an invisible graphic as reference or just the 
local screen coordinates where you would like the effect to take place, like 
this:

lock screen for visual effect in rect(rect of image “test1”) — or the direct 
coordinates as param (200,200,500,400)
hide image “test1”
show image “test2”
unlock screen with visual effect dissolve very fast


Regards
Tore Nilsen

> 30. des. 2017 kl. 23:06 skrev Sannyasin Brahmanathaswami via use-livecode 
> :
> 
> So: if the effectRate defaults to 2000 (which is what I'm seeing here on 
> desktop) and you have
> --
> Show image "grand-canyon" with visual effect dissolve very fast
> ---
> # theoretically 1/5 of 2000 = 400 milliseconds
> 
> why is the script profiler saying this line takes 4765 milliseconds top 
> execute?
> 
> The dictionary has two methods: if you look up "show" it appears you should 
> be able to perform this "directly"
> 
> But, under the visual effect command the suggested method is to lock screen, 
> make the change then unlock the screen with visual effect.  And we get 
> different results, various conditions where the effect just does not happen 
> anyway…no fadein as expected… there is a delay… screen is "stuck" and 
> suddenly the image changes.
> 
> hopefully this all improves very soon as CSS Animation which is fast and 
> smooth… now dominates UI everywhere, even for small inconsequential UX ops… 
> designers are expect all kinds of "oozing" warp,slide,fade away etc.
> 
> Frankly I'm sure users care that much, and if you have a very strong content 
> component, it's a lot more compelling than having your address book "zip up" 
> when you close it.  And what I'm here is that the most important thing is 
> stability and performance. So, I may just remove all these dissolves.
> 
> 
> Richard wrote:
> 
>Effect durations can be normalized and fine-tuned using the effectRate 
>global property.
> 
> 
> 
> ___
> 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: Optimizing for small Android devices

2017-12-30 Thread Sannyasin Brahmanathaswami via use-livecode
Reading this in depth. yes, reallocation of bit map space is beyond the 
developer's realm… 

I spotted this too… RGB 565… 

Anyone using this and getting smaller files sizes ver current jpgs? I'm not 
seeing this as an option in Photoshop on Mac.



 How we reduced our Android app’s memory footprint by 50%



___
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: Dissolve/Transitions Very Costly

2017-12-30 Thread Sannyasin Brahmanathaswami via use-livecode
So: if the effectRate defaults to 2000 (which is what I'm seeing here on 
desktop) and you have
--
Show image "grand-canyon" with visual effect dissolve very fast
---
# theoretically 1/5 of 2000 = 400 milliseconds

why is the script profiler saying this line takes 4765 milliseconds top execute?

The dictionary has two methods: if you look up "show" it appears you should be 
able to perform this "directly"

But, under the visual effect command the suggested method is to lock screen, 
make the change then unlock the screen with visual effect.  And we get 
different results, various conditions where the effect just does not happen 
anyway…no fadein as expected… there is a delay… screen is "stuck" and suddenly 
the image changes.

hopefully this all improves very soon as CSS Animation which is fast and 
smooth… now dominates UI everywhere, even for small inconsequential UX ops… 
designers are expect all kinds of "oozing" warp,slide,fade away etc.

Frankly I'm sure users care that much, and if you have a very strong content 
component, it's a lot more compelling than having your address book "zip up" 
when you close it.  And what I'm here is that the most important thing is 
stability and performance. So, I may just remove all these dissolves.


Richard wrote:

Effect durations can be normalized and fine-tuned using the effectRate 
global property.



___
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: Optimizing for small Android devices

2017-12-30 Thread Sannyasin Brahmanathaswami via use-livecode
This looks very useful . 

I think we need to wait until HQ weighs in on my bug report. Regardless of the 
fact that it works on iOS and Oreo, one has to wonder how on earth we can close 
a stack which is set to destroy on close, turn acceleratedRendering to false 
(assume previously cached controls are  cleared); open a new stack and *still* 
see the old stack behind the new, one, as if they two are still fighting for 
the pixel map…. even if the old one "loses" on iOS and Oreo…and the new stack 
"wins" the display.. .the old one could still be in the heap.

So if this indicates a failure at garbage collection (my very un-informed 
guess) the app will run out of RAM very fast. So however hard we work to 
optimize any script…it will get us nothing, 5 minutes into using the app, 
moving from stack to stack, crash is imminent.

That said the new script profiler in 9 is awesome (when it runs…often I start 
it, stop it and it is empty…)

e.g. I found a repeat loop that keeps setting the left of a large parent group  
being build up from copying child groups run time…everytime a child group is 
added (100 times) and this one task of setting the left of group "item-list" to 
0 on every loop, even with lockscreen on, was taking 80% of the time needed to 
do the job. it was this developer's (not me) attempt to overcome the challenge 
issue of the coords/ ect of the group constantly being lost despite use of 

on layoutGroup pNum
   -- general list group stuff
   set the lockupdates of group "item list" to true
   set the lockupdates of me to true

the coords still keep getting lost…and require resetting the parent group so 
that 0,0, us actually "known" to the subgroup being appended as a "row" at the 
bottom.  

Me thinks we are working too hard at this one… and I'm noodling a refactor… it 
will be interesting if DataGrid2 represents a "leap" forward for this kind of 
graphically complex list group.  I have stayed away from it as more complex 
than needed… OTOH if DataGrid2 will be more performant, then we should use it.

Meanwhile, other operations, like fetch data from the database, setting props 
on the next-copied subgroup  etc. which I thought (wrongly) would be costly 
were all profiling in at 1 millisecond.. So this new tool is going to be really 
helpful … I just have to figure out why it so often appear blank after running 
scripts.






 Richard Gaskin wrote:

While looking for one of the URLs I included in my last post, I came 
across this:

How we reduced our Android app’s memory footprint by 50%



I have no idea if those strategies would make sense in LC's internals, 
or whether LC is already doing some of that sort of bitmap reuse.  But 
an interesting read just the same.



___
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

reset waitdepth when idle

2017-12-30 Thread Mike Kerner via use-livecode
Is there a way to reset the waitDepth when nothing is happening?  I am
running a CRON-type setup.  I fire events on a schedule, provided that the
waitDepth <=1.  Even when LC is idle and nothing is actually waiting,
SOMETIMES the waitDepth can be >1, and seeing that, my CRON event never
fires the next job.

This seems to happen because of some the mergEXT externals are designed to
be asynchronous, allowing you to issue multiple commands, then handle the
events that fire when the server responds.  Sometimes that process does not
go according to plan, but for some reason the waitDepth stays at 2 (for
instance), even though we are idle.

-- 
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: Optimizing for small Android devices

2017-12-30 Thread J. Landman Gay via use-livecode

Worth reading just to find out about the 57 MB app memory limit.
--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com



On December 29, 2017 9:54:34 PM Richard Gaskin via use-livecode 
 wrote:



While looking for one of the URLs I included in my last post, I came
across this:

How we reduced our Android app’s memory footprint by 50%


I have no idea if those strategies would make sense in LC's internals,
or whether LC is already doing some of that sort of bitmap reuse.  But
an interesting read just the same.

--
  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: LC Server - MySQL - update about 2000 rows/records of a table

2017-12-30 Thread Mark Schonewille via use-livecode
The shell function can do this. I don't know if there could be a limit 
to the length of the shell command though.


Working example:

on mouseUp
   put shortfilepath("C:\Program Files\MySQL\MySQL Server 
5.6\bin\mysql.exe") into myFilePath

   -- the following line contains 2 insert commands
   put "insert into testtable (name) values ('Anne'); insert into 
testtable (name) values ('Belinda')" into mySql
   put myFilePath && "-uUSERNAME -pPASSWORD test -e" && quote & mySql & 
quote into myQuery

   get shell(myQuery)
end mouseUp

Kind regards,

Mark Schonewille
http://economy-x-talk.com
https://www.facebook.com/marksch

Buy the most extensive book on the
LiveCode language:
http://livecodebeginner.economy-x-talk.com

Op 29-Dec-17 om 21:53 schreef Matthias Rebbe via use-livecode:

Hi,

i need to update regularly about 2000 rows/records of a MySQL table with 
Livecode Server.

What is better?
Executing the 2000 update commands in one take using revexecuteSQL
or should i execute one update command after each other within a repeat loop?

What do you think?

Regards,

Matthias




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