Livecode University on Mac OS 10.8 ?

2015-02-14 Thread Richmond

Does not work.

Could anyone please advise me?

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: Keyboardactivated but mobilecontroltarget is empty

2015-02-14 Thread Ludovic THEBAULT

I put the moving script in the inputBeginEditing and inputEndEditing of the 
object. It’s work now.
___
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


Keyboardactivated but mobilecontroltarget is empty

2015-02-14 Thread Ludovic Thébault
Hello,

I’ve 2 native input on a card. One is covered by the keyboard so i need to move 
it when the keyboard is displayed. It’s ok, it’s work.
But i need to block this script for the other input.
How to know the input that displayed the keyboard ?

The mobilecontrotarget() return empty into the « keyboardactivated » script and 
in the « inputBeginEditing » it’s too late the script of « keyboardactivated » 
is already done.
I’ve also try the « touchstart » script without success.


Thanks.
___
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


Valentina Day 2015: Save 50% on VDN / OEM Distribution of Valentina Server

2015-02-14 Thread Lynn Fredricks
Valentina Server incorporates a powerful Reports Server that works with most
popular database servers (MySQL, MariaDB, PostgreSQL, MS SQL Server 
Valentina DB) to generate reports in HTML, images and as XML enriched PDFs
with your web or network applications. It also incorprates the ultra fast
Valentina Object Relational Database Server.

VDN lets you deploy Valentina Server (OEM version) to your customers,
royalty free! You can build web apps around it with popular languages like
PHP and also Ruby on Rails, but you can also integrate it with most popular
development enviroments - including yours! 

We are celebrating our name day Valentine's Day by having a 50% off sale
on VDN. This sale will last through 2/16/2015.

See our announcement on our blog: http://www.valentina-db.com/blog/

See the description of the product:
http://www.valentina-db.com/en/valentina-developer-network-overview

Buy on our store: http://bit.ly/1FLp0P4

Best regards,

Lynn Fredricks
Paradigma Software
http://www.paradigmasoft.com

Valentina SQL Server: The Ultra-fast, Royalty Free Database Server 


___
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: Reverse a list

2015-02-14 Thread Mike Kerner
Pete, is that a typo, or did you mean to have a semicolon instead of a
colon in front of memory?  Does ;memory: work, too, or just :memory:?

AND HOLY CRAP, yes, Pete, you're right, you were doing 100k records, where
the other example was only doing 10k.  So doing 100k records with REPEAT
WITH took
wait for it
wait for it
Believe me, I was waiting, and waiting, and wating for it
FIFTY EIGHT MINUTES AND THIRTEEN SECONDS.

REPEAT FOR is .129 seconds, and REPEAT WITH is TWENTY SEVEN THOUSAND TIMES
SLOWER (for this operation)??!?!?!?!?!???

Hey, Pete, That's a common technique...WHAT?  If it's so common, and all
of this is common knowledge, then how come it isn't documented, anywhere,
and how come this is the first time I remember EVER hearing about this
difference?  What else don't I know about???  Grr.  You would
think that Edinburgh would think about tweaking an algorithm, since REPEAT
WITH seems to be a special case of REPEAT FOR, and you can generate the
REPEAT WITH behavior by wrapping the REPEAT FOR...

On Fri, Feb 13, 2015 at 6:56 PM, Bob Sneidar bobsnei...@iotecdigital.com
wrote:

 Oh thanks. That would have screwed me up if I had tried to use “memory”.

 Bob S


 On Feb 13, 2015, at 15:34 , Peter Haworth p...@lcsql.commailto:
 p...@lcsql.com wrote:

 We both used in memory databases.  The filename is ;memory:

 ___
 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: Reverse a list

2015-02-14 Thread Peter Haworth
Typo, should be :memory:.

On Sat Feb 14 2015 at 2:01:45 PM Mike Kerner mikeker...@roadrunner.com
wrote:

 Pete, is that a typo, or did you mean to have a semicolon instead of a
 colon in front of memory?  Does ;memory: work, too, or just :memory:?

 AND HOLY CRAP, yes, Pete, you're right, you were doing 100k records, where
 the other example was only doing 10k.  So doing 100k records with REPEAT
 WITH took
 wait for it
 wait for it
 Believe me, I was waiting, and waiting, and wating for it
 FIFTY EIGHT MINUTES AND THIRTEEN SECONDS.

 REPEAT FOR is .129 seconds, and REPEAT WITH is TWENTY SEVEN THOUSAND TIMES
 SLOWER (for this operation)??!?!?!?!?!???

 Hey, Pete, That's a common technique...WHAT?  If it's so common, and all
 of this is common knowledge, then how come it isn't documented, anywhere,
 and how come this is the first time I remember EVER hearing about this
 difference?  What else don't I know about???  Grr.  You would
 think that Edinburgh would think about tweaking an algorithm, since REPEAT
 WITH seems to be a special case of REPEAT FOR, and you can generate the
 REPEAT WITH behavior by wrapping the REPEAT FOR...

 On Fri, Feb 13, 2015 at 6:56 PM, Bob Sneidar bobsnei...@iotecdigital.com
 wrote:

  Oh thanks. That would have screwed me up if I had tried to use “memory”.
 
  Bob S
 
 
  On Feb 13, 2015, at 15:34 , Peter Haworth p...@lcsql.commailto:
  p...@lcsql.com wrote:
 
  We both used in memory databases.  The filename is ;memory:
 
  ___
  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: Reverse a list

2015-02-14 Thread Richard Gaskin

Mike Kerner wrote:
...
 REPEAT FOR is .129 seconds, and REPEAT WITH is TWENTY SEVEN THOUSAND
 TIMES SLOWER (for this operation)??!?!?!?!?!???

 Hey, Pete, That's a common technique...WHAT?  If it's so common,
 and all of this is common knowledge, then how come it isn't
 documented, anywhere

The Dictionary entry for repeat notes that the for each form is much 
faster than with.



 and how come this is the first time I remember EVER hearing about this
 difference?

Good question.  This comes up in the forums and/or this list almost 
every month or so.


The speed difference will vary according to the size of each line and 
the size of the lines, but order of magnitude is usually a pretty fair 
minimal expectation for the speed boost with this.


It's one of those things we don't think about until we see it in action, 
and then it seems almost self-evident:


Chunk expressions are handy, but expensive.  We usually don't think 
about the expense because the engine's pretty fast, but with large-scale 
operations like traversing a long list it adds up enough to be significant.


Many chunk expressions require the engine to examine the data character 
by character, keeping track of delimiters as it goes.


With this:

  repeat with i = 1 to the number of lines of tData
 DoSomethingWith line i of tData
  end repeat

...the engine first needs to examine every character in tData to count 
the number of CRs, then each time through the loop it needs to do it 
again to the next line.  First time through it reads from the beginning 
until the first CR, second time through it goes from the beginning until 
the second CR, and so forth, so by the time you get several thousand 
lines into it it's doing the same long character-by-character comparison 
each time through, getting successively slower and slower.


But here:

  repeat for each line tLine in tData
  DoSomethingWith tLine
   end repeat

...the engine only counts to the next CR, puts it into tLine, and 
remembers where it left off so each time through the loop it's only 
reading a single line.


While the former takes logarithmically longer to complete, the latter 
scales flatly.



 What else don't I know about???

Mode 14.  :)


 You would think that Edinburgh would think about tweaking an
 algorithm, since REPEAT WITH seems to be a special case of
 REPEAT FOR, and you can generate the REPEAT WITH behavior
 by wrapping the REPEAT FOR...

But there's one key difference which makes each form worth keeping in 
case you need it:


With repeat with i =... the data in the variable being traversed can 
change.  Sometimes you may need that.


But with repeat for each... the data being traversed is not allowed to 
change, because if it did then the line endings might have been altered 
and its attempt to keep track of where it is would fail.


So each form has its own special benefits.  I tend to use repeat for 
each most of the time, but I'm glad repeat with is available for the 
rare cases where it's useful.


--
 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: Cover the complete dual screen desktop with a stack?

2015-02-14 Thread Walt Brown
Look at the screenRects. It gives you the dimensions of all screens in
use, one per line. The top left corner of your main screen is 0,0. Moving
to the right and down the numbers increase, while moving above and to the
left the numbers decrease as negative numbers. With that you can calculate
the rectangle encompassing both screens and it's center location and set
your stack to that.
Walt

On Fri, Feb 13, 2015 at 7:37 PM, Matthias Rebbe | M-R-D 
matthias_livecode_150...@m-r-d.de wrote:

 Hi.

 please excuse, if this post should arrive twice in your inbox But i sent
 this message already about 6 hrs ago to this list and it did not arrive
 here or in the online list archive.

 So i am trying again.


 I am looking for a way to cover the whole dual screen desktop with a
 stack. Setting the fullscreen mode only works on the „active“ screen. The
 screen where the stack is placed after opening.

 Is there a way to do this in livecode?

 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
___
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: Cover the complete dual screen desktop with a stack?

2015-02-14 Thread Walt Brown
Sorry, my new email client only showed me the first post...

On Fri, Feb 13, 2015 at 11:56 PM, Trevor DeVore li...@mangomultimedia.com
wrote:

 On Fri, Feb 13, 2015 at 7:51 PM, Paul Dupuis p...@researchware.com
 wrote:

  On 2/13/2015 7:37 PM, Matthias Rebbe | M-R-D wrote:
  
   I am looking for a way to cover the whole dual screen desktop with a
  stack. Setting the fullscreen mode only works on the „active“ screen. The
  screen where the stack is placed after opening.
  
   Is there a way to do this in livecode?
  
 
  See the screenrects in the dictionary. Get the screenRects for the 2
  displays, figure the contiguous coordinates of the combined area and
  then set the rect of your stack to that.


 You'll want to consider creating a stack for each line (screen) in the
 screenrects. On newer versions of OS X, each monitor can be a unique space
 and a window can't span multiple monitors.

 --
 Trevor DeVore
 ScreenSteps
 www.screensteps.com-www.clarify-it.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

Answer File DIalog

2015-02-14 Thread Peter Haworth
When I select Open from the Textedit File menu, I see a dropdown menu of
encodings to be used when I select a file.

Is there a way to have that menu appear with the LC answer file dialog?
___
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


Filename of an image

2015-02-14 Thread Peter Haworth
If I set the filename of an image, it correctly loads that file into the
image.

Say I then change the contents of the file - if I set the filename of the
image again, the original file contents remain in the image, presumably
because of some caching effect.

Is there a way to force the image to be reloaded from the file?  I tried
setting the filename to empty but that gave me an error (in the message
box).
___
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: Filename of an image

2015-02-14 Thread maring.richard
Peter,

It is indeed the cache. I spent an entire day trying to figure this one out.  I 
finally found that if there is any reference to that filename in any image 
container anywhere in your code the cache will not release it. 

Also changing the image file and reloading it will not clear it from cache 
either as the file was never deleted. 

What worked for me was to delete the original image file. The I put the word 
junk into the filename of every occurrence of that image container. Did a 
wait of 5 milliseconds then loaded any modified copy of the original and it 
worked. 

I had a scratch stack that I occasionally placed substances in for various 
reasons. I found that one of them had an image container that had my image 
filename in it and it was the reason the cache wasn't releasing the file. Had 
forgotten it was even there. It is never called or opened but the cache new it 
was there. 

Hope this helps point you in a direction that helps. 

Rich Maring 




Sent via the Samsung Galaxy Note® 4, an ATT 4G LTE smartphone


 Original message 
From: Peter Haworth p...@lcsql.com 
Date: 02/14/2015  6:32 PM  (GMT-06:00) 
To: How to use LiveCode use-livecode@lists.runrev.com 
Subject: Filename of an image 

If I set the filename of an image, it correctly loads that file into the
image.

Say I then change the contents of the file - if I set the filename of the
image again, the original file contents remain in the image, presumably
because of some caching effect.

Is there a way to force the image to be reloaded from the file?  I tried
setting the filename to empty but that gave me an error (in the message
box).
___
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: Answer File DIalog

2015-02-14 Thread Paul Hibbert
Yes there is, see answer file with type in the dictionary, but here's example 
I've used…

on mouseUp
  answer file Choose an Image to import... with defaultFolder with \
type All Images|png,jpg,gif|PNG,JPG,GIF or \
type PNG|png|PNG or \
type GIF|gif|GIF or \
type JPEG|jpg|JPG as sheet
  if it is empty then
 exit to top
  else
 set the itemDel to slash
 put the last item of it into fld myImagePath
 set the fileName of img myImage to it
  end if
end mouseUp

HTH

Paul

 On Feb 14, 2015, at 4:29 PM, Peter Haworth p...@lcsql.com wrote:
 
 When I select Open from the Textedit File menu, I see a dropdown menu of
 encodings to be used when I select a file.
 
 Is there a way to have that menu appear with the LC answer file dialog?
 ___
 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: Answer File DIalog

2015-02-14 Thread Peter Haworth
Hi Paul,
Right, that's for filtering by file type.  What I'm looking for is a menu
of encoding types (UTF8, UTF16, etc).  If you're on a Mac, run Textedit and
choose Open from the File menu and you'll see what I mean.

On Sat Feb 14 2015 at 5:10:41 PM Paul Hibbert p...@livecode.org wrote:

 Yes there is, see answer file with type in the dictionary, but here's
 example I've used…

 on mouseUp
   answer file Choose an Image to import... with defaultFolder with \
 type All Images|png,jpg,gif|PNG,JPG,GIF or \
 type PNG|png|PNG or \
 type GIF|gif|GIF or \
 type JPEG|jpg|JPG as sheet
   if it is empty then
  exit to top
   else
  set the itemDel to slash
  put the last item of it into fld myImagePath
  set the fileName of img myImage to it
   end if
 end mouseUp

 HTH

 Paul

  On Feb 14, 2015, at 4:29 PM, Peter Haworth p...@lcsql.com wrote:
 
  When I select Open from the Textedit File menu, I see a dropdown menu of
  encodings to be used when I select a file.
 
  Is there a way to have that menu appear with the LC answer file dialog?
  ___
  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: Filename of an image

2015-02-14 Thread Peter Haworth
Thanks Rich.  I've temporarily been working round the issue by deleting the
image and creating a new one as you mentioned. Fortunately, there's only
one image with the filename in question.

I was hoping there'd be a more elegant solution than deleting and creating
a new image but maybe that's the way it is.  I guess I could create my
image file with a different name every time I create it.

Sounds like there should be a way to switch off image caching.

On Sat Feb 14 2015 at 5:04:56 PM maring.richard maring.rich...@gmail.com
wrote:

 Peter,

 It is indeed the cache. I spent an entire day trying to figure this one
 out.  I finally found that if there is any reference to that filename in
 any image container anywhere in your code the cache will not release it.

 Also changing the image file and reloading it will not clear it from cache
 either as the file was never deleted.

 What worked for me was to delete the original image file. The I put the
 word junk into the filename of every occurrence of that image container.
 Did a wait of 5 milliseconds then loaded any modified copy of the original
 and it worked.

 I had a scratch stack that I occasionally placed substances in for various
 reasons. I found that one of them had an image container that had my image
 filename in it and it was the reason the cache wasn't releasing the file.
 Had forgotten it was even there. It is never called or opened but the cache
 new it was there.

 Hope this helps point you in a direction that helps.

 Rich Maring




 Sent via the Samsung Galaxy Note® 4, an ATT 4G LTE smartphone


  Original message 
 From: Peter Haworth p...@lcsql.com
 Date: 02/14/2015  6:32 PM  (GMT-06:00)
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Filename of an image

 If I set the filename of an image, it correctly loads that file into the
 image.

 Say I then change the contents of the file - if I set the filename of the
 image again, the original file contents remain in the image, presumably
 because of some caching effect.

 Is there a way to force the image to be reloaded from the file?  I tried
 setting the filename to empty but that gave me an error (in the message
 box).
 ___
 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: Filename of an image

2015-02-14 Thread Scott Rossi
Seems to work fine here using LC 6.7 on OS X 10.9.5.

Setting the fileName of an image by itself shouldn¹t cause an error.

How are you modifying the external image?

Regards,

Scott Rossi
Creative Director
Tactile Media, UX/UI Design




On 2/14/15, 4:32 PM, Peter Haworth p...@lcsql.com wrote:

If I set the filename of an image, it correctly loads that file into the
image.

Say I then change the contents of the file - if I set the filename of the
image again, the original file contents remain in the image, presumably
because of some caching effect.

Is there a way to force the image to be reloaded from the file?  I tried
setting the filename to empty but that gave me an error (in the message
box).
___
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: Filename of an image

2015-02-14 Thread maring.richard
Peter,

No way I've found to turn off or manually do anything with the cache. I'm using 
LC 7.01 rc2 and when I moved to it is when this became a problem for me. 

It should only be a problem when the image name is unchanged. As the system can 
still find that name in the cache even though you deleted the physical file on 
the drive. 

The physical file needs to be removed and by putting a different file name or 
some interim junk in the filename reference allows the cache to release it's 
copy. 

Rich



Sent via the Samsung Galaxy Note® 4, an ATT 4G LTE smartphone


 Original message 
From: Peter Haworth p...@lcsql.com 
Date: 02/14/2015  7:29 PM  (GMT-06:00) 
To: How to use LiveCode use-livecode@lists.runrev.com 
Subject: Re: Filename of an image 

Thanks Rich.  I've temporarily been working round the issue by deleting the
image and creating a new one as you mentioned. Fortunately, there's only
one image with the filename in question.

I was hoping there'd be a more elegant solution than deleting and creating
a new image but maybe that's the way it is.  I guess I could create my
image file with a different name every time I create it.

Sounds like there should be a way to switch off image caching.

On Sat Feb 14 2015 at 5:04:56 PM maring.richard maring.rich...@gmail.com
wrote:

 Peter,

 It is indeed the cache. I spent an entire day trying to figure this one
 out.  I finally found that if there is any reference to that filename in
 any image container anywhere in your code the cache will not release it.

 Also changing the image file and reloading it will not clear it from cache
 either as the file was never deleted.

 What worked for me was to delete the original image file. The I put the
 word junk into the filename of every occurrence of that image container.
 Did a wait of 5 milliseconds then loaded any modified copy of the original
 and it worked.

 I had a scratch stack that I occasionally placed substances in for various
 reasons. I found that one of them had an image container that had my image
 filename in it and it was the reason the cache wasn't releasing the file.
 Had forgotten it was even there. It is never called or opened but the cache
 new it was there.

 Hope this helps point you in a direction that helps.

 Rich Maring




 Sent via the Samsung Galaxy Note® 4, an ATT 4G LTE smartphone


  Original message 
 From: Peter Haworth p...@lcsql.com
 Date: 02/14/2015  6:32 PM  (GMT-06:00)
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Filename of an image

 If I set the filename of an image, it correctly loads that file into the
 image.

 Say I then change the contents of the file - if I set the filename of the
 image again, the original file contents remain in the image, presumably
 because of some caching effect.

 Is there a way to force the image to be reloaded from the file?  I tried
 setting the filename to empty but that gave me an error (in the message
 box).
 ___
 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: Reverse a list

2015-02-14 Thread Mike Kerner
Richard,

I just read the dictionary entry (again), and I would say that it is not at
all clear that there would appear to be an ENORMOUS difference.  For
starters, you have to read wy down to find the mention, it isn't
really called out with a NOTE or anything else to draw one's attention to
it, and it is definitely understated.  Even mentioning order of magnitude
would be better (although it would appear to be an understatement).  I
literally had no idea until I ran into this, by accident, and was
exchanging notes with Peter.  The difference is staggering, and it really
should be made much more obvious.

On Sat, Feb 14, 2015 at 6:25 PM, Peter Haworth p...@lcsql.com wrote:

 Typo, should be :memory:.

 On Sat Feb 14 2015 at 2:01:45 PM Mike Kerner mikeker...@roadrunner.com
 wrote:

  Pete, is that a typo, or did you mean to have a semicolon instead of a
  colon in front of memory?  Does ;memory: work, too, or just
 :memory:?
 
  AND HOLY CRAP, yes, Pete, you're right, you were doing 100k records,
 where
  the other example was only doing 10k.  So doing 100k records with REPEAT
  WITH took
  wait for it
  wait for it
  Believe me, I was waiting, and waiting, and wating for it
  FIFTY EIGHT MINUTES AND THIRTEEN SECONDS.
 
  REPEAT FOR is .129 seconds, and REPEAT WITH is TWENTY SEVEN THOUSAND
 TIMES
  SLOWER (for this operation)??!?!?!?!?!???
 
  Hey, Pete, That's a common technique...WHAT?  If it's so common, and
 all
  of this is common knowledge, then how come it isn't documented, anywhere,
  and how come this is the first time I remember EVER hearing about this
  difference?  What else don't I know about???  Grr.  You would
  think that Edinburgh would think about tweaking an algorithm, since
 REPEAT
  WITH seems to be a special case of REPEAT FOR, and you can generate the
  REPEAT WITH behavior by wrapping the REPEAT FOR...
 
  On Fri, Feb 13, 2015 at 6:56 PM, Bob Sneidar 
 bobsnei...@iotecdigital.com
  wrote:
 
   Oh thanks. That would have screwed me up if I had tried to use
 “memory”.
  
   Bob S
  
  
   On Feb 13, 2015, at 15:34 , Peter Haworth p...@lcsql.commailto:
   p...@lcsql.com wrote:
  
   We both used in memory databases.  The filename is ;memory:
  
   ___
   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: Filename of an image

2015-02-14 Thread J. Landman Gay

On 2/14/2015 6:32 PM, Peter Haworth wrote:

If I set the filename of an image, it correctly loads that file into the
image.

Say I then change the contents of the file - if I set the filename of the
image again, the original file contents remain in the image, presumably
because of some caching effect.

Is there a way to force the image to be reloaded from the file?  I tried
setting the filename to empty but that gave me an error (in the message
box).


Apparently not:

http://quality.runrev.com/show_bug.cgi?id=11407

--
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: Answer File DIalog

2015-02-14 Thread J. Landman Gay

On 2/14/2015 7:24 PM, Peter Haworth wrote:

What I'm looking for is a menu
of encoding types (UTF8, UTF16, etc).  If you're on a Mac, run Textedit and
choose Open from the File menu and you'll see what I mean.


I don't think you can from the answer file dialog. BBEdit has the same 
kind of dropdown as Text Ediit, btw, so the OS supports it (or at least, 
OS X does.) Might be a good feature request, since the unicode 
capability has introduced the need for this.


--
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: Reverse a list

2015-02-14 Thread Peter M. Brigham
Harking back to the original discussion on reversing a list -- still the 
subject of this thread, here's the original example as I saved it in my library.

function reverseSort pList, pDelim
   -- reverse sorts an arbitrary list
   --ie, item/line -1 - item/line 1, item/line -2 - item/line 2, etc.
   -- pDelim defaults to cr
   -- from an exchange on the use-LC list
   --this was the fastest pure LC method of several proposed
   if pDelim = empty then put cr into pDelim
   split pList by pDelim
   put the keys of pList into indexList
   put the number of lines of indexList into i
   repeat for each line tLine in indexList
  -- tLine is never used, but repeat for each is faster than repeat n 
times
  --and this iterates the correct number of times
  put pList[i]  pDelim after outList
  subtract 1 from i
   end repeat
   delete char -1 of outList
   return outList
end reverseSort

Note that the repeat is a repeat for each line tLine… even though the value 
of tLine is never actually used within the repeat loop. It's incredibly fast to 
do it that way, and it's an easy way to repeat something a foreseeable number 
of times. Using a repeat n times is glacial by comparison. I do agree that 
the dictionary should not just say the repeat for each form is much faster, 
it should say the repeat for each form is MUCH, MUCH faster.

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig

On Feb 14, 2015, at 6:00 PM, Richard Gaskin wrote:

 Mike Kerner wrote:
 ...
  REPEAT FOR is .129 seconds, and REPEAT WITH is TWENTY SEVEN THOUSAND
  TIMES SLOWER (for this operation)??!?!?!?!?!???
 
  Hey, Pete, That's a common technique...WHAT?  If it's so common,
  and all of this is common knowledge, then how come it isn't
  documented, anywhere
 
 The Dictionary entry for repeat notes that the for each form is much 
 faster than with.
 
 
  and how come this is the first time I remember EVER hearing about this
  difference?
 
 Good question.  This comes up in the forums and/or this list almost every 
 month or so.
 
 The speed difference will vary according to the size of each line and the 
 size of the lines, but order of magnitude is usually a pretty fair minimal 
 expectation for the speed boost with this.
 
 It's one of those things we don't think about until we see it in action, and 
 then it seems almost self-evident:
 
 Chunk expressions are handy, but expensive.  We usually don't think about the 
 expense because the engine's pretty fast, but with large-scale operations 
 like traversing a long list it adds up enough to be significant.
 
 Many chunk expressions require the engine to examine the data character by 
 character, keeping track of delimiters as it goes.
 
 With this:
 
  repeat with i = 1 to the number of lines of tData
 DoSomethingWith line i of tData
  end repeat
 
 ...the engine first needs to examine every character in tData to count the 
 number of CRs, then each time through the loop it needs to do it again to the 
 next line.  First time through it reads from the beginning until the first 
 CR, second time through it goes from the beginning until the second CR, and 
 so forth, so by the time you get several thousand lines into it it's doing 
 the same long character-by-character comparison each time through, getting 
 successively slower and slower.
 
 But here:
 
  repeat for each line tLine in tData
  DoSomethingWith tLine
   end repeat
 
 ...the engine only counts to the next CR, puts it into tLine, and remembers 
 where it left off so each time through the loop it's only reading a single 
 line.
 
 While the former takes logarithmically longer to complete, the latter scales 
 flatly.
 
 
  What else don't I know about???
 
 Mode 14.  :)
 
 
  You would think that Edinburgh would think about tweaking an
  algorithm, since REPEAT WITH seems to be a special case of
  REPEAT FOR, and you can generate the REPEAT WITH behavior
  by wrapping the REPEAT FOR...
 
 But there's one key difference which makes each form worth keeping in case 
 you need it:
 
 With repeat with i =... the data in the variable being traversed can 
 change.  Sometimes you may need that.
 
 But with repeat for each... the data being traversed is not allowed to 
 change, because if it did then the line endings might have been altered and 
 its attempt to keep track of where it is would fail.
 
 So each form has its own special benefits.  I tend to use repeat for each 
 most of the time, but I'm glad repeat with is available for the rare cases 
 where it's useful.

___
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