Re: [OSSLC] so far so good...

2013-01-30 Thread Geoff Canyon
Ugh. Went back to slashdot to submit again to get balked again to get the
url, and it submitted without complaint.

http://slashdot.org/submission/2471085/kickstarter-project-a-free-open-version-of-livecode


On Wed, Jan 30, 2013 at 1:09 AM, Mark Wieder mwie...@ahsoftware.net wrote:

 Geoff-

 Tuesday, January 29, 2013, 10:26:27 PM, you wrote:

  I filled the whole thing out, and when I clicked submit it showed it to
 me.

 Weird. Do you have a url?
 I searched and nothing came up.
 I looked at submissions and there's nothing there about it.

 --
 -Mark Wieder
  mwie...@ahsoftware.net


 ___
 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: LiveCode has a new eye on the earth

2013-02-12 Thread Geoff Canyon
Who created it?


On Tue, Feb 12, 2013 at 1:43 PM, stephen barncard 
stephenrevoluti...@barncard.com wrote:

 I'm impressed by the unimpressive-ness of the interface. It was probably
 written before 2002.

 On Tue, Feb 12, 2013 at 11:34 AM, Colin Holgate co...@verizon.net wrote:

  I guess, just don't use the phrase you don't have to be a rocket
  scientist to use LiveCode.
 
 
  On Feb 12, 2013, at 2:25 PM, Monte Goulding mo...@sweattechnologies.com
 
  wrote:
 
   I'm sure it's perfectly usable to those that know how to use it ;-)
 
  ___
 


 --



 Stephen Barncard
 San Francisco Ca. USA

 more about sqb  http://www.google.com/profiles/sbarncar
 ___
 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: LiveCode has a new eye on the earth

2013-02-12 Thread Geoff Canyon
If I had a dollar for every quick hack I've bodged together over the
years...


On Tue, Feb 12, 2013 at 3:23 PM, Monte Goulding mo...@sweattechnologies.com
 wrote:

 Actually LiveCode is perfect for quick single purpose/single user app
 development. I don't see why that should give it a bad name.

 --
 M E R Goulding
 Software development services

 mergExt - There's an external for that!

 On 13/02/2013, at 8:15 AM, Mark Wieder mwie...@ahsoftware.net wrote:

  Looks like a quick hack.
  It's the sort of thing that gives LiveCode a bad name...

 ___
 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: What do you want to contribute?

2013-02-13 Thread Geoff Canyon
I would be working to extend the natural language syntax in every way
possible through the new language capabilities. For twenty years now,
whenever someone says LC is verbose, we've responded with

sort lines of fld demo by item 3 of each
put word 3 of line 2 of x into line 14 of y

or something similar. Chunk syntax is awesome, but it's not the end. The
underlying principle is that whatever you can reasonably interpret from an
intuitive english expression will be more powerful than other syntaxes.
Some examples off the top of my head, english similarity level TBD:

swap the values of x and y
apply function trim to each line of x
apply function demo to x until the result stops changing
scan all the files in directory demoDirectory including subdirectories and
put the paths of the ones that contain the letter z into x

And finally, let's go crazy:

open a window if full screen mode
color it black
place 20 white pixels randomly on the screen, with no pixels closer to each
other than 15 pixels
create a new graphic of type player
use the image player.png for the player graphic
this is where the game starts
if the user tilts the device left or right, accelerate the player graphic
uniformly in the direction of the tilt, proportionate to the amount of
tilt, so that at maximum tilt it takes 120 ticks for the player graphic to
move across the whole window
If the user touches the screen, accelerate the player graphic uniformly
toward the user's touch
if the player graphic reaches the same horizontal location as the user's
finger, decelerate the player graphic uniformly to motionless in 10 ticks
once every 30 to 240 ticks, create a new graphic of type star
place the new star graphic randomly, but always 50 pixels from the top of
the window
use the image star.png for the new star graphic
accelerate the new star graphic uniformly toward the bottom of the screen
so that it takes 120 to 300 ticks to get to the bottom of the screen
if the new star graphic reaches the bottom of the screen, delete it
if the new star graphic collides with the player graphic, delete the new
star graphic and add 50 points to the player's score
sixty seconds after the player graphic is created, stop all motion, delete
all the star graphics
if the user touches the player graphic, set the player's score to 0 and
start the game

I know that's crazy.

gc






On Wed, Feb 13, 2013 at 5:29 PM, Peter M. Brigham pmb...@gmail.com wrote:

 On Feb 13, 2013, at 4:27 PM, Mike Kerner wrote:

  2) Puny but so, so annoying:  built-in method to switch between the run
 and
  edit modes - remember command-tab?  I know that's not an option but...

 Here's my current workaround, use in a frontscript, launched on opening LC:

 on tabkey
if revNewScriptEditor is in line 1 of the openstacks then pass tabkey
if the controlkey is down then
   if browse is in the tool then
  set the tool to pointer
   else
  set the tool to browse
   end if
else
   pass tabkey
end if
 end tabkey

 Control-tab switches tool. Similar enough to the old command-tab that it's
 easy to remember. It would be nice to have this built into the IDE, though.

 -- Peter

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




 ___
 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: What do you want to contribute?

2013-02-14 Thread Geoff Canyon
On Thu, Feb 14, 2013 at 1:18 AM, Monte Goulding mo...@sweattechnologies.com
 wrote:

 Lol... I guess you'd want to be careful not to bloat the engine with
 syntax for edge cases but I get your point. I like:



From a technical standpoint, if I understand how RR is planning to handle
language extensions, this would be more of a library thing than an engine
thing. You'd be able to load grammars selectively.

From a conceptual standpoint, I think the syntax itself is critical to
this. Your example

trim each line of x

That is as clear as day, much clearer than my more generic and less
grammatical

apply function trim to each line of x

...which is part of the point. Let's say that I share my syntax. You like
the functionality but tsk, tsk the way I've phrased it. You rewrite what I
put out (should be easy) and re-release. The market speaks, and a week from
now everyone is using

trim each line of x
bold word 1 of each line of fld display
add 5 to the last item of each element of Z

...and so on. Good syntax wins, and any edge cases or bad syntaxes are lost
in the mist. In other words, the  examples that will survive are the ones
like chunk expressions, which are blindingly clear to any english-speaker,
and where once you use them, you wonder how you ever got along without
them.

Putting it another way, more powerful abstractions are better.
___
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: What do you want to contribute?

2013-02-14 Thread Geoff Canyon
On Thu, Feb 14, 2013 at 2:08 PM, Monte Goulding mo...@sweattechnologies.com
 wrote:

 In my example I used each line OF x rather than each line IN x. I
 often get caught on repeat for each line X IN y when I write OF. Could I
 add OF to the repeat syntax so it didn't matter? It seems natural to me
 either way. If not then perhaps our syntax should be:

 trim each line in X



The impression I got was that the new language ability would make it fairly
simple (or at least possible) to allow for either of or in. I'm right there
with you -- I don't actually code that often anymore, but nearly every time
I do, I mix up of and in. In my perfect world the prepositions would be
interchangeable and likely not significant, so of, in, through, across,
within, and maybe others.

gc
___
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: What do you want to contribute?

2013-02-17 Thread Geoff Canyon
Here's an interesting real(ish) world example:
http://www.leancrew.com/all-this/2011/12/more-shell-less-egg/

The goal is to find the ten most common words in a text file.

Donald Knuth wrote something in literate code form, in Pascal. The result
was ten pages of code. In the article, Doug McIlroy wrote it in shell
script as:

1  tr -cs A-Za-z '\n' |2  tr A-Z a-z |3  sort |4  uniq -c |5  sort -rn
|6  sed ${1}q

and called out Knuth on his supposedly more clear, ten-page solution.

It turns out six lines of transcript accomplishes the same thing:

   repeat for each word w in replacetext(url (file: 
filePath),(?i)[^a-z], )
  add 1 to c[w]
   end repeat
   combine c using cr and comma
   sort lines of c descending numeric by item 2 of each
   put line 1 to 10 of c

If anyone can do it more elegantly, I'm curious to know how. But in a
language where we can write our own syntax, this seems likely to be
possible:

put file filePath with all non-alphabetic characters replaced with space
into fileString
for each unique word w in fileString, put w,the count of w  cr after
countList
put the first 10 lines of countList sorted numeric descending by item 2

Maybe that's not clearer, but it should be possible.


On Thu, Feb 14, 2013 at 4:14 PM, Geoff Canyon gcan...@gmail.com wrote:


 On Thu, Feb 14, 2013 at 2:08 PM, Monte Goulding 
 mo...@sweattechnologies.com wrote:

 In my example I used each line OF x rather than each line IN x. I
 often get caught on repeat for each line X IN y when I write OF. Could I
 add OF to the repeat syntax so it didn't matter? It seems natural to me
 either way. If not then perhaps our syntax should be:

 trim each line in X



 The impression I got was that the new language ability would make it
 fairly simple (or at least possible) to allow for either of or in. I'm
 right there with you -- I don't actually code that often anymore, but
 nearly every time I do, I mix up of and in. In my perfect world the
 prepositions would be interchangeable and likely not significant, so of,
 in, through, across, within, and maybe others.

 gc

___
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: What do you want to contribute?

2013-02-18 Thread Geoff Canyon
yeah, I wasn't happy with that syntax as I was typing it. Part of the
beauty of being able to create/share syntax is that others can improve on
what you come up with, and only the good syntax survives into general
usage. Maybe this would be better:

   put file filePath with all non-alphabetic characters replaced with space
into fileString
   for each unique word w in fileString
  put w,the count of w  cr after countList
   end for
   put the first 10 lines of countList sorted numeric descending by item 2

or maybe this:

   put file filePath with all non-alphabetic characters replaced with space
into fileString
   put ((each unique word w),(the count of w)cr) in fileString into
countList
   put the first 10 lines of countList sorted numeric descending by item 2

or heck, maybe this -- I rather like the use of individual to represent
the non-alphabetic replacement in the earlier examples:

   put the 10 commonest individual words in file filepath along with comma
 the count of each  cr

but again, only actual experimentation with real developers will determine
what makes intuitive sense and what is just useless too-specific jargon.


On Mon, Feb 18, 2013 at 3:20 PM, Monte Goulding mo...@sweattechnologies.com
 wrote:

 Hmm... I think your code using current syntax is actually clearer than the
 proposed syntax. I definitely don't like adding meaningful comma given the
 confusion with items... You could replace that with a semi-colon or new
 line though.

 --
 M E R Goulding
 Software development services

 mergExt - There's an external for that!

 On 18/02/2013, at 5:13 PM, Geoff Canyon gcan...@gmail.com wrote:

  Here's an interesting real(ish) world example:
  http://www.leancrew.com/all-this/2011/12/more-shell-less-egg/
 
  The goal is to find the ten most common words in a text file.
 
  Donald Knuth wrote something in literate code form, in Pascal. The result
  was ten pages of code. In the article, Doug McIlroy wrote it in shell
  script as:
 
  1  tr -cs A-Za-z '\n' |2  tr A-Z a-z |3  sort |4  uniq -c |5  sort -rn
  |6  sed ${1}q
 
  and called out Knuth on his supposedly more clear, ten-page solution.
 
  It turns out six lines of transcript accomplishes the same thing:
 
repeat for each word w in replacetext(url (file: 
  filePath),(?i)[^a-z], )
   add 1 to c[w]
end repeat
combine c using cr and comma
sort lines of c descending numeric by item 2 of each
put line 1 to 10 of c
 
  If anyone can do it more elegantly, I'm curious to know how. But in a
  language where we can write our own syntax, this seems likely to be
  possible:
 
  put file filePath with all non-alphabetic characters replaced with space
  into fileString
  for each unique word w in fileString, put w,the count of w  cr after
  countList
  put the first 10 lines of countList sorted numeric descending by item 2
 
  Maybe that's not clearer, but it should be possible.
 
 
  On Thu, Feb 14, 2013 at 4:14 PM, Geoff Canyon gcan...@gmail.com wrote:
 
 
  On Thu, Feb 14, 2013 at 2:08 PM, Monte Goulding 
  mo...@sweattechnologies.com wrote:
 
  In my example I used each line OF x rather than each line IN x. I
  often get caught on repeat for each line X IN y when I write OF. Could
 I
  add OF to the repeat syntax so it didn't matter? It seems natural to me
  either way. If not then perhaps our syntax should be:
 
  trim each line in X
 
 
  The impression I got was that the new language ability would make it
  fairly simple (or at least possible) to allow for either of or in. I'm
  right there with you -- I don't actually code that often anymore, but
  nearly every time I do, I mix up of and in. In my perfect world the
  prepositions would be interchangeable and likely not significant, so of,
  in, through, across, within, and maybe others.
 
  gc
  ___
  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: What do you want to contribute?

2013-02-18 Thread Geoff Canyon
w is a string, but I'm assuming that in context, syntax like count of
would make sense syntactically, and that the language could make it work.

yeah, commonest sucks, but I didn't want to push it by going with two words
like most common. Also, given how specific the use case is, it would
likely not work as syntax.

for each seems like a reasonable synonym for repeat for each,

Your example seems like a reasonable alternative. My goal wasn't to define
the one true syntax for this example, but just to throw out some
alternatives to suggest what I think should be possible. In practice,
whatever makes sense to enough people will be the syntax that survives.


On Mon, Feb 18, 2013 at 8:58 PM, Monte Goulding mo...@sweattechnologies.com
 wrote:

 Hmm... is w something more than a string... how could it have a count?

 SQL uses distinct... might be good to use that...

 commonest??? ;-)

 Also... why are we dropping repeat?

 Here's something nice: ordered repeats ;-)

 How about:

 put file filePath into fileString
 filter the characters of fileString with (?i)[a-z]
 repeat for each distinct word theWord with count theCount ordered by
 theCount numeric descending
put theWord,theCount cr after theList
if the number of lines of theList = 10 then exit repeat
 end repeat

 --
 M E R Goulding
 Software development services
 Bespoke application development for vertical markets

 mergExt - There's an external for that!

 ___
 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: Card scrolling

2013-02-20 Thread Geoff Canyon
Richmond, is this something you'd be willing to share? I'm curious about
the touch-scrolling aspects.


On Wed, Feb 20, 2013 at 12:49 PM, Richmond richmondmathew...@gmail.comwrote:

 On 02/20/2013 07:38 PM, Robert Sneidar wrote:

 The way I have heard to do this in the past is to create a group of all
 the controls on the card, then set the vScroll of the group to true.

 Bob


 Funnily enough, just this evening, I've put together a stack for my wife
 for her lectures on Anglo-Saxon;

 this includes a socking great map (3000 by 3000 pixels) of the South of
 England pointing out lots of places
 associated with King Aelfred of the West Saxons, in a 1200 x 620 stack;
 so, I grouped the image, set it to have
 both vertical and horizontal controls, and set the size to 1100 x 610
 pixels - and, Lo  Behold, a drop-dead, sexy
 map.

 Richmond.



 On Feb 20, 2013, at 9:29 AM, Nigel Soden wrote:

  Hi All

 I'm currently coding a application to work on the iPad. I need to but
 more controls than can fit on the card. Is there a way to make the card
 scroll up and down allowing controls that are of the card to be seen.  I'm
 developing using the default card size settings for an iPad and unable to
 penetrate lower than what's available on the card.

 I hope this makes sense.

 Regards
 Nigel
 __**_
 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-livecodehttp://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-livecodehttp://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-livecodehttp://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: Congratulations RunRev!

2013-02-26 Thread Geoff Canyon
Kickstarter does this. Click the Backers link near the top of the page.

gc

Sent from my iPad

On Feb 26, 2013, at 3:39 PM, Richmond richmondmathew...@gmail.com wrote:

 Will RunRev publish a list of donors? or is that meant to be confidential?

___
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


I posted on Slant, anyone who wants to improve my response can

2013-02-26 Thread Geoff Canyon
http://slant.co/topics/what-is-the-best-programming-language-to-learn-first/opinions/livecode

I just put up a few notes.
___
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: 100%

2013-02-26 Thread Geoff Canyon
On Tue, Feb 26, 2013 at 8:16 PM, Monte Goulding mo...@sweattechnologies.com
 wrote:

 a high level rest client


I could have used this several times over the last couple years.

  - a proper browser control


Definitely.

I would add to this list a graphics library capable of doing roughly what
Codea http://twolivesleft.com/Codea/ does -- useful in general, and
particularly for kids to learn with. Nothing motivates kids more than
making games.
___
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: tweet that made me laugh

2013-02-26 Thread Geoff Canyon
Mission Accomplished http://daringfireball.net


On Mon, Feb 25, 2013 at 2:58 PM, Mark Wieder mwie...@ahsoftware.net wrote:

 Colin Holgate coiin@... writes:

  Well, in the end she outed John Gruber about not replying to my email!

 Ha! Ilene came to check out a little usergroup meeting we threw together at
 MacWorld a few years ago.

 --
  Mark Wieder
  mwie...@ahsoftware.net




 ___
 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: Policing the Open Source Version?

2013-02-27 Thread Geoff Canyon
Unless this has changed from years back, an enencrypted stack, even when
built into a standalone, can be pried out if someone is naughty.


On Wed, Feb 27, 2013 at 4:31 AM, Monte Goulding mo...@sweattechnologies.com
 wrote:

  1. Who is going to check on this sort of thing?

 Not me... hoever, there's likely to be lots of lc users wanting RunRev to
 stay in business so they will often report breaches.
 
  2. Is a Livecode OS standalone going to be constructed in such a way
 that it
  can be unpeeled without having recourse to a bare stack?

 Actually it's already like that. Once upon a time I wrote a script to
 decouple the engine from the attached stackfile... But basically look at a
 standalone you didn't password protect in a text editor.

 --
 Monte Goulding

 M E R Goulding - software development services
 mergExt - There's an external for that!





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

2013-03-20 Thread Geoff Canyon
I set the visible of a stack to false, and put this in the stack script:

on opencard
   send set the visible of me to true to me in 5 seconds
end opencard

I didn't try it in a standalone, but opening that in the dev environment
resulted in no visible change for 5 seconds, then the stack appeared. So
you could do something like this and run your code after the stack has
fully loaded (but is still not visible).


On Wed, Mar 20, 2013 at 1:43 PM, Mike Bonner bonnm...@gmail.com wrote:

 Oh duh. So even if its a send in time, and the control DOES exist by the
 time the send kicks in, the underlying stuff doesn't get set right when the
 send is queued so it doesn't work?  That actually makes sense.

 Think I'm going to start changing how I structure things from now on.


 On Wed, Mar 20, 2013 at 12:21 PM, Mark Wieder mwie...@ahsoftware.net
 wrote:

  Peter Haworth pete@... writes:
 
   I guess I'm just very suspicious of anything other than really
   straightforward commands in preOpenCard now.
 
  Well, here's the thing. It's *pre*OpenCard because the card and its
  controls
  haven't been instantiated yet. So sending a message to a control that
  doesn't
  officially exist shouldn't work. The script is there in memory, so you
 can
  call
  handlers in it, but it's not yet associated with an on-screen object. The
  pre
  handlers exist so that you can set things up before the objects take
 form.
 
  --
   Mark Wieder
   mwie...@ahsoftware.net
 
 
  ___
  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: Ungroup a nested group

2013-03-25 Thread Geoff Canyon
What are you trying to accomplish? I've always used layers to move things
into and out of groups.

gc


On Sun, Mar 24, 2013 at 5:47 PM, Peter Haworth p...@lcsql.com wrote:

 What seems to work in a script is to start editing each owning group until
 you reach the one containing the group to be ungrouped, ungroup it, then
 stop editing its owning group.

 I'm nervous though.  I've found that the world of editbackground mode is a
 weird and wonderful place.  No matter how many cards are in the stack being
 edited, the cardIDs returns only the card that is being edited.  And the
 number of controls on the card is the number in the group being edited not
 the number on the card.  And the long id of any control in the group before
 you entered this strange place isn't valid because it's not a member of the
 group at that point.

 Pete
 lcSQL Software http://www.lcsql.com


 On Sun, Mar 24, 2013 at 1:26 PM, Peter Haworth p...@lcsql.com wrote:

  Unless I'm missing something, it looks like the ungroup command doesn't
  work on nested group, i.e. one that is owned by another group.  The
 ungroup
  command doesn't return an error either.
 
  It feels like the only way to do this is to ungroup all the owning groups
  first but that seems fraught with dangers of losing the group structures.
   Is there a better way to do it.  By Script I mean.
 
  Thanks,
 
  Pete
  lcSQL Software http://www.lcsql.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: Ungroup a nested group

2013-03-25 Thread Geoff Canyon
yep, that's what I did in navigator way back when: set
relayergroupedcontrols to true, make the changes by assigning layers (which
can be tricky) and you're set. If you're deleting, I'm not sure you even
need to do that. Delete group whatever should work regardless of how
many groups whatever is nested in.

gc


On Mon, Mar 25, 2013 at 11:21 AM, Peter Haworth p...@lcsql.com wrote:

 Hi Geoff,
 In my lcSTackBrowser utility  I want to provide the ability to delete a
 nested group.  Someone just sent me a solution using relayergroupedcontrols
 which feels much safer than the method I mentioned.
 Pete
 lcSQL Software http://www.lcsql.com


 On Mon, Mar 25, 2013 at 7:53 AM, Geoff Canyon gcan...@gmail.com wrote:

  What are you trying to accomplish? I've always used layers to move things
  into and out of groups.
 
  gc
 
 
  On Sun, Mar 24, 2013 at 5:47 PM, Peter Haworth p...@lcsql.com wrote:
 
   What seems to work in a script is to start editing each owning group
  until
   you reach the one containing the group to be ungrouped, ungroup it,
 then
   stop editing its owning group.
  
   I'm nervous though.  I've found that the world of editbackground mode
 is
  a
   weird and wonderful place.  No matter how many cards are in the stack
  being
   edited, the cardIDs returns only the card that is being edited.  And
 the
   number of controls on the card is the number in the group being edited
  not
   the number on the card.  And the long id of any control in the group
  before
   you entered this strange place isn't valid because it's not a member of
  the
   group at that point.
  
   Pete
   lcSQL Software http://www.lcsql.com
  
  
   On Sun, Mar 24, 2013 at 1:26 PM, Peter Haworth p...@lcsql.com wrote:
  
Unless I'm missing something, it looks like the ungroup command
 doesn't
work on nested group, i.e. one that is owned by another group.  The
   ungroup
command doesn't return an error either.
   
It feels like the only way to do this is to ungroup all the owning
  groups
first but that seems fraught with dangers of losing the group
  structures.
 Is there a better way to do it.  By Script I mean.
   
Thanks,
   
Pete
lcSQL Software http://www.lcsql.com
   
   ___
   use-livecode mailing list
   use-livecode@lists.runrev.com
   Please visit this url to subscribe, unsubscribe and manage your
   subscription preferences:
   http://lists.runrev.com/mailman/listinfo/use-livecode
  
  ___
  use-livecode mailing list
  use-livecode@lists.runrev.com
  Please visit this url to subscribe, unsubscribe and manage your
  subscription preferences:
  http://lists.runrev.com/mailman/listinfo/use-livecode
 
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode

___
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: Ungroup a nested group

2013-03-25 Thread Geoff Canyon
yep, that should do it.


On Mon, Mar 25, 2013 at 1:31 PM, Peter Haworth p...@lcsql.com wrote:

 Thanks Geoff.  I inadvertently confused things in my last email by using
 delete instead of ungroup.  Ungroup  of a nested group is what I need
 to do and using the relayerGroupedControls approach seems to work fine.

 Pete
 lcSQL Software http://www.lcsql.com


 On Mon, Mar 25, 2013 at 10:38 AM, Geoff Canyon gcan...@gmail.com wrote:

  yep, that's what I did in navigator way back when: set
  relayergroupedcontrols to true, make the changes by assigning layers
 (which
  can be tricky) and you're set. If you're deleting, I'm not sure you even
  need to do that. Delete group whatever should work regardless of how
  many groups whatever is nested in.
 
  gc
 
 
  On Mon, Mar 25, 2013 at 11:21 AM, Peter Haworth p...@lcsql.com wrote:
 
   Hi Geoff,
   In my lcSTackBrowser utility  I want to provide the ability to delete a
   nested group.  Someone just sent me a solution using
  relayergroupedcontrols
   which feels much safer than the method I mentioned.
   Pete
   lcSQL Software http://www.lcsql.com
  
  
   On Mon, Mar 25, 2013 at 7:53 AM, Geoff Canyon gcan...@gmail.com
 wrote:
  
What are you trying to accomplish? I've always used layers to move
  things
into and out of groups.
   
gc
   
   
On Sun, Mar 24, 2013 at 5:47 PM, Peter Haworth p...@lcsql.com
 wrote:
   
 What seems to work in a script is to start editing each owning
 group
until
 you reach the one containing the group to be ungrouped, ungroup it,
   then
 stop editing its owning group.

 I'm nervous though.  I've found that the world of editbackground
 mode
   is
a
 weird and wonderful place.  No matter how many cards are in the
 stack
being
 edited, the cardIDs returns only the card that is being edited.
  And
   the
 number of controls on the card is the number in the group being
  edited
not
 the number on the card.  And the long id of any control in the
 group
before
 you entered this strange place isn't valid because it's not a
 member
  of
the
 group at that point.

 Pete
 lcSQL Software http://www.lcsql.com


 On Sun, Mar 24, 2013 at 1:26 PM, Peter Haworth p...@lcsql.com
  wrote:

  Unless I'm missing something, it looks like the ungroup command
   doesn't
  work on nested group, i.e. one that is owned by another group.
  The
 ungroup
  command doesn't return an error either.
 
  It feels like the only way to do this is to ungroup all the
 owning
groups
  first but that seems fraught with dangers of losing the group
structures.
   Is there a better way to do it.  By Script I mean.
 
  Thanks,
 
  Pete
  lcSQL Software http://www.lcsql.com
 
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
   
   ___
   use-livecode mailing list
   use-livecode@lists.runrev.com
   Please visit this url to subscribe, unsubscribe and manage your
   subscription preferences:
   http://lists.runrev.com/mailman/listinfo/use-livecode
  
  ___
  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: positioning graphics in relation to a line in a text field

2013-04-01 Thread Geoff Canyon
On Mon, Apr 1, 2013 at 5:31 PM, Mark Wieder mwie...@ahsoftware.net wrote:

 Don't forget to adjust for scrolling as well.
 And it gets slightly more complicated if you select multiple lines.



To simplify this I'd use a non-scrolling text field in a scrolling group
with the field (sized to fit all the content) and rects in it. As long as
the user is using the scrollbar(s) this is easy. If the user will
drag-select text then this becomes more difficult.
___
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: The little object that wasn't there

2013-04-05 Thread Geoff Canyon
if you aren't repositioning the buttons or changing their position, would
it be possible to simply include them all in a single group, include that
group on all the cards, and then hide/show them as appropriate in the
preopencard handler?
___
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


What's the best way to store data that one iOS app sends to another?

2013-04-06 Thread Geoff Canyon
Each instance of my iOS app needs to maintain a list of other users of the app 
and be able to send them information, and retrieve information they have sent. 
Think email, but without the image, attachment, etc. overhead -- more like 
sending tweets as emails. What sort of host/infrastructure would work for this? 
It might be a hosted database, in which case is there one that is easier to use 
with LC? Or it might just be a hosted file system, in which case how might I 
handle security?

___
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: What's the best way to store data that one iOS app sends to another?

2013-04-06 Thread Geoff Canyon
With on-rev, how do you handle authentication/a secure connection?

___
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: What's the best way to store data that one iOS app sends to another?

2013-04-08 Thread Geoff Canyon
I didn't know encryption was an issue for the App Store. I'm working on pretty 
non-sensitive stuff, so some variant of what you're doing should work.

Thanks!

Sent from my iPad

On Apr 7, 2013, at 8:10 AM, John Craig j...@splash21.com wrote:

 I don't rely on SSL - to avoid any potential hassles with Apple's app store - 
 Does your application use encryption?.

___
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: What's the best way to store data that one iOS app sends to another?

2013-04-08 Thread Geoff Canyon
I've been thinking about this. I'm assuming (all with salt):

1. At some point the user set a password. At that point the iOS app applies 
MD-5, sends that to the server, and stores the hash locally.

2. When the app wants to access something from the server, it makes a request 
for an authentication string. The server takes the user name and the current 
time and sends that back,and stores that hash itself. 

The iOS app hashes the authentication string combined with the password hash, 
and includes that with its requests. Since both the server and the iOS app know 
the authentication string from (1), they do not have to exchange it now.

Richard, is this something like what you're doing?

Sent from my iPad

On Apr 7, 2013, at 8:10 AM, John Craig j...@splash21.com wrote:

 As an example, my requests to the server contain;
 1/ a uuid
 2/ current time
 3/ md5 hash of user credentials + uuid + time
 4/ any other data

On Apr 7, 2013, at 4:54 PM, Richard Gaskin ambassa...@fourthworld.com wrote:

 One method Dave Cragg, me, and others have used is a home-grown 
 quasi-HTTPS-like scheme in which the client first handshakes with the server 
 to obtain a token, which is a hash of the IP address, time stamp, and some 
 salt, and that token is used as a key to send the authentication data, after 
 which all other data uses a less derivable method.

___
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: Galactic Gauntlet crash

2013-04-11 Thread Geoff Canyon
The reviews on it call out Run Rev and say that the thing is broken. If it
can't be fixed, for the love of pete, how has this not been pulled from the
app store?


On Thu, Apr 11, 2013 at 9:46 AM, William Waldman wwald...@klht.org wrote:

 Thanks Jackie!
 Does anyone know if it's possible to recreate the full final app with the
 Game Academy parts?
 I'd be happy to just blow it out to my own phone and iPad just to show it
 off.
 It's just too important a tool to demo LiveCode with to not have on my
 person at all times...

 Thanks

 Bill Waldman
 Director of Technology
 King
 1450 Newfield Avenue
 Stamford, CT 06905
 Voice: 203 322 3496 ext 377
 www.klht.org



 br
 a href=http://www.facebook.com/kingStamford; target=_newimg
 src=http://forum.klht.org/Social_Media_Images/fb.png; border=0/a

 a href=https://twitter.com/#%21/kingstamford; target=_newimg
 src=http://forum.klht.org/Social_Media_Images/twit.png; border=0/a

 a href=http://www.youtube.com/kingstamford; target=_newimg
 src=http://forum.klht.org/Social_Media_Images/yt.jpg; border=0/a


 br
 br



 This e-mail and any attachments may contain confidential and privileged
 information. If you are not the intended recipient, please notify the
 sender immediately by return e-mail, delete this e-mail and any
 attachments and destroy any copies. Any dissemination or use of this
 information by a person other than the intended recipient is unauthorized.

 ___
 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: What's the best way to store data that one iOS app sends to another?

2013-04-16 Thread Geoff Canyon
On Thu, Apr 11, 2013 at 2:16 PM, Mark Wilcox m_p_wil...@yahoo.co.uk wrote:

 There's this really great but fairly recent trend for Backend-as-a-Service
 providers



Any thoughts on https://www.firebase.com/

I haven't written any code yet for either possibility, but the language on
firebase's web site makes sense to me -- with one (or two) question(s).

1. Am I correct that hitting a REST API from LC involves setting parameters
for the http headers and then using https?
2. Would (1) work on an iOS/Android device?
___
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: What's the best way to store data that one iOS app sends to another?

2013-04-16 Thread Geoff Canyon
On Tue, Apr 16, 2013 at 5:41 AM, Mark Wilcox m_p_wil...@yahoo.co.uk wrote:

 Firebase but it's primarily about sending small chunks of realtime data.
 Is that what you want for your app



No, but the early, non-optimized stage the app is likely to send many small
messages, so firebase's bandwidth-based billing sounds better than parse's
message-based billing.
___
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: What's the best way to store data that one iOS app sends to another?

2013-04-16 Thread Geoff Canyon
On Tue, Apr 16, 2013 at 12:00 PM, Mark Wilcox m_p_wil...@yahoo.co.ukwrote:

 StackMob



Checking it out 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


Re: What's the best way to store data that one iOS app sends to another?

2013-04-16 Thread Geoff Canyon
On Tue, Apr 16, 2013 at 4:23 PM, Monte Goulding mo...@sweattechnologies.com
 wrote:

 is this for an app in the same room/wifi



No, it could be anywhere. For 1.0 I think all I need is slow, peer-to-peer
messaging, for small (usually  a few hundred bytes, but occasionally
larger) messages, but in fairly large quantities -- it could easily be 100s
messages/user/day, which is why Parse's free 1,000,000 API calls/mo likely
wouldn't work.
___
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: What's the best way to store data that one iOS app sends to another?

2013-04-18 Thread Geoff Canyon
I've successfully signed up for stackmob and connected with it.
Interestingly, it ended up being simpler than I expected. I spent several
hours trying to find the right url encoding etc., but it turned out this
worked:

on mouseUp
   set the HTTPHeaders to fld headers
   post fld data to url (fld url)
   put it into fld result
end mouseUp

Where fld headers looks like this:

//version sets your REST API Version. 0 for Development. 1 and up for
Production
Accept: application/vnd.stackmob+json; version=0
X-StackMob-API-Key: my-key-here
Content-Type: application/json

and fld url looks like this:

http://api.stackmob.com/chatmessage

and fld data looks like this:

{user:t...@mailinator.com,forecast:7,t:vlIj,zip:63108}

{user:o...@mailinator.com,
forecast:7,t:vlIj,zip:63108}

no special encoding, no https.

I'm going to try user authentication tonight.


On Wed, Apr 17, 2013 at 4:08 AM, Mark Wilcox m_p_wil...@yahoo.co.uk wrote:

 Ah yes! Sorry. Local peer-to-peer without Game Center was the only bit of
 GameKit you're allowed to use in non-game apps and the Apple SDK docs
 explicitly say you can.  I get the impression they're also hinting you can
 use in-game voice chat on non-game apps now as long as you don't use Game
 Center for setting up the connection in the first place.  I bought a couple
 of collaboration apps that got removed from the store for using voice chat
 feature before.

 http://developer.apple.com/library/ios/#documentation/GameKit/Reference/GameKit_Collection/Introduction/Introduction.html


 Mark


 
  From: Monte Goulding mo...@sweattechnologies.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Sent: Wednesday, 17 April 2013, 8:27
 Subject: Re: What's the best way to store data that one iOS app sends to
 another?


 On 17/04/2013, at 5:22 PM, Mark Wilcox m_p_wil...@yahoo.co.uk wrote:

  Monte, not sure if you're aware but Apple's not at all keen on non-game
 apps using GameKit. Shame because there's loads of really useful generic
 stuff in GameKit. Non games that show up in Game Center get rejected, or
 occasionally approved and then removed later.

 You can use GameKit peer to peer without your app being on Game Center.

 --
 Monte Goulding

 M E R Goulding - software development services
 mergExt - There's an external for that!





 ___
 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: Shifting the Controls out of the Card

2013-04-22 Thread Geoff Canyon
Have you tried setting the loc of the templatebutton before creating the
buttons? That way you don't need to do anything after creating them.

Second, why are you setting the loc to a random location? Since they're off
screen it doesn't matter, but you might want to be able to easily work with
the buttons yourself at another time?


On Mon, Apr 22, 2013 at 10:07 AM, Thierry Douez th.do...@gmail.com wrote:

 Hi,

 2013/4/22 Ender Nafi Elekçioğlu endern...@gmail.com

 
  On Monday, April 22, 2013 at 4:51 PM, Thierry Douez wrote:
 
   ( I'm crashing LC with my tests on my latest work! )
 
  Constant crashes, huh?
  Coding is hard, ain't it;
  fun but hard :)
 

 I'm cutting weeds and planting seeds in my garden;
 that makes me feel really good and gives me some height
 about these *^%$* :)


 Well, about my problem...
  the debugging didn't result anything useful.
  BUT, when I've tested it in the iOS Simulator, it worked like a charm.
  Just to test, I've built even a windows standalone and it works on
  desktop, too.
 
  So it seems, there's something about the development environment.
 

 Weird :(


  Thanks Thierry, for all your efforts and time.
 

 I'm happy when I'm having some help, so ..  :)

 Regards,

 Thierry
 ___
 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: [OT] Cross-platform tools shootout

2013-04-23 Thread Geoff Canyon
On Tue, Apr 23, 2013 at 10:36 AM, Mark Wilcox m_p_wil...@yahoo.co.ukwrote:

 developers using it had much lower expectations



There's a huge 
blubhttp://en.wikipedia.org/wiki/Paul_Graham_(computer_programmer)#Blubissue
here. Of course most people think their language is pretty good. Most
don't know any better, and those who do likely moved on.

The only people who are (somewhat) suited to judge a language are those who
can judge it relative to another language, and then only the relative
difference between the two languages.

I can say, for example, that LC's IDE kicks ass compared to PHP, but only
for the PHP IDEs I've seen.

I can say that LC's math libraries *really* need bignum and arbitrary
precision integer math compared to J.

I can say that J's ability to handle arbitrary arrays kicks ass over LC,
RB, PHP, Ruby, Python... everything I've ever used. Same thing with their
power functions, and inverse functions (*that* will bake your noodle).

I can say that FileMaker's label abstraction destroys every other tool I've
used.

LISP macros (in my limited understanding) kick major ass, and I am *s*
looking forward to having something similar with open language.

But it's much harder to say how LC rates on a scale of 1-10.
___
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


Tail recursion, and limits

2013-04-26 Thread Geoff Canyon
So I was curious whether LC optimizes tail calls. It appears not. But even
stranger, this code busts the recursion limits. It should only call itself
900 times, right? And am I correct that if LC optimized tail calls, then
this would work regardless of the recursionLimit.


on mouseUp
   answer the recursionlimit -- this answers 400,000
   put incrementer(1,900)
end mouseUp

function incrementer x,steps
   if steps  1 then return x else return incrementer(x+1,steps-1)
end incrementer
___
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


How is this in the app store

2013-05-01 Thread Geoff Canyon
http://apparchitect.com/
I would have bet on Apple rejecting this since it's obviously taking in and
executing code. Has the policy changed, or did these guys get clever
somehow?

gc
___
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: How is this in the app store

2013-05-01 Thread Geoff Canyon
This is an iOS tool. It makes it *totally* simple. I literally went to
their web site, initiated an app, created a few screens with minor
interaction, installed their runtime iOS app, and was reviewing my app on
my iPhone two minutes later (had to sign up by email etc.) But I think I
answered my question at the same time: there is no code.

None. At. All.

I don't know how this is in any way useful, slick as it is. Maybe they're
planning to add code. But for now, just to give one example, you can have a
scrolling list, but the data in that list comes from the configuration you
give it when you design it. You can't even specify a data source, you
literally need to configure it in the dev environment.

If they don't change that, I don't know how this is useful. If they do, I
don't know how Apple won't kill this.



On Wed, May 1, 2013 at 11:39 AM, J. Landman Gay jac...@hyperactivesw.comwrote:

 On 5/1/13 5:27 AM, Geoff Canyon wrote:

 http://apparchitect.com/
 I would have bet on Apple rejecting this since it's obviously taking in
 and
 executing code. Has the policy changed, or did these guys get clever
 somehow?


 I thought the no executable code rule was only for iOS?

 --
 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-livecodehttp://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: How is this in the app store

2013-05-01 Thread Geoff Canyon
setting aside the question of code, it's not quite what you're saying, and
it doesn't work the way rev does.

1. I installed their player app on my iPhone and hooked it up with my
account on their site.
2. On my mac, in a web browser on their site, I created a new project.
3. Specified that it was for iPhone.
4. Configured everything. No code, but many interesting features. I chose a
template this time, and I was absolutely able to create a credible
restaurant application: pictures of food, a menu with links to individual
descriptions and prices, a map, phone and email links, social media links,
etc.
5. Every few seconds the IDE said that it had saved the app.
6. On my iPhone, open their app. It lists the apps I've created in the
IDE on my Mac.
7. Open the app I just created.
8. I'm browsing through my restaurant's application on my iPhone.
9-??? submit to the app store.

No signing, no keys, no hassle, five minutes, tops, from I want to make an
app to Look, there's my app running on my iPhone.

No code is a dealbreaker, obviously, but still, this is pretty magical tech.

gc


On Wed, May 1, 2013 at 4:29 PM, J. Landman Gay jac...@hyperactivesw.comwrote:

 On 5/1/13 3:34 PM, Geoff Canyon wrote:

 This is an iOS tool. It makes it *totally* simple. I literally went to
 their web site, initiated an app, created a few screens with minor
 interaction, installed their runtime iOS app, and was reviewing my app on
 my iPhone two minutes later (had to sign up by email etc.) But I think I
 answered my question at the same time: there is no code.

 None. At. All.

 I don't know how this is in any way useful, slick as it is. Maybe they're
 planning to add code. But for now, just to give one example, you can have
 a
 scrolling list, but the data in that list comes from the configuration you
 give it when you design it. You can't even specify a data source, you
 literally need to configure it in the dev environment.

 If they don't change that, I don't know how this is useful. If they do, I
 don't know how Apple won't kill this.


 I didn't get very far because you can't go past their front page without
 signing up, and that page doesn't give any info. But the picture looks like
 it's a tool for the Mac that creates iOS apps. So what I meant was, it
 isn't creating code on an iPhone, it's creating code on a Mac and then
 installing it on an iPhone just like we do.

 Only...there's no code apparently so it's all moot. How odd.


 --
 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-livecodehttp://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: How is this in the app store

2013-05-02 Thread Geoff Canyon
Sections 2.7 and 2.8:


   -

   Apps that download code in any way or form will be rejected
   -

   Apps that install or launch other executable code will be rejected

Apps like Codea (and presumably this Basic!, but I'm installing it out of
curiosity) cannot load code, only export it.



On Wed, May 1, 2013 at 11:53 PM, J. Landman Gay jac...@hyperactivesw.comwrote:

 On 5/1/13 9:19 PM, Peter W A Wood wrote:

 On 2 May 2013, at 00:39, J. Landman Gay wrote:

  I thought the no executable code rule was only for iOS?


 I don't think that there is a no executable code rule on iOS but
 there are restrictions on what the code can do. You can buy a basic
 interpreter for iOS through iTunes -
 https://itunes.apple.com/us/**app/basic!/id362411238?mt=8https://itunes.apple.com/us/app/basic!/id362411238?mt=8

 I think that there may be other languages too.


 I was confused when I first heard about that. I thought anything that
 downloaded and ran code was forbidden. Maybe the basic interpreter doesn't
 work that way.

 I get lost in Apple's provisions.


 --
 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-livecodehttp://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: How is this in the app store

2013-05-03 Thread Geoff Canyon
Stacks that don't come with the app? I wonder if Apple is okay with that,
or if the reviewer just didn't understand what you were doing?


On Thu, May 2, 2013 at 1:50 AM, Gerry Orkin gerry.or...@gmail.com wrote:

 That seems to disallow stacks that go to other stacks in the same app? My
 app does that :)

 Gerry

 On 02/05/2013, at 4:10 PM, Geoff Canyon gcan...@gmail.com wrote:

Apps that install or launch other executable code will be rejected

 ___
 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: Comment about do (was clickLine/clickcharchunk)

2013-05-08 Thread Geoff Canyon
On Wed, May 8, 2013 at 8:31 AM, dunb...@aol.com wrote:

 Good stuff Geoff.



Good stuff Richard.
___
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: [OFF] The Competition

2013-05-08 Thread Geoff Canyon
what are they changing their name to?


On Wed, May 8, 2013 at 1:14 PM, Mike Kerner mikeker...@roadrunner.comwrote:

 If any of you have been keeping track of the competition, RealBasic is
 about to change names, licensing schemes, and will have their version of
 iOS app building available in December.

 There is no word on Android.

 They are also changing their name.


 So by my math, they are about 3 years behind as of today.  Of course, if
 they have all-native controls then they are ahead on that front, as they
 are on Cocoa support.

 --
 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: [Topic][Dumbfounded] Is there a way to resize and move a group without touching the inside objects

2013-05-10 Thread Geoff Canyon
Hi Scott,

I tried to simplify this and make it so that each control is adjusted in
one step. This also optionally take different scaling factors for
horizontal and vertical. Let me know if I missed anything. I'm not sure
what everyone was seeing with resizing the group affecting the objects in
it -- I'm not seeing that as far as I can tell.

All the implementations shown so far are losing fidelity due to rounding.
If anyone is going to repeatedly resize groups/objects like this, it would
make sense to store the original rects as a separate property, and always
start from there. If the resizing needs to be cumulative, then I'd store
the cumulative resizing factor as a property of the group, then when
resizing multiply that by the new/additional factor before applying that to
the stored rects to set the sizes.

Once we have open language, I'm so looking forward to being able to say
something like:

set the rect of every control of G to
integerRect(shiftRect(scaleRect(shiftRect((the rect of it),-L,-T),H,V),L,T))

gc


command scaleGroup G,H,V
   if V is empty then put H into V
   put the left of G into L
   put the top of G into T
   put shiftRect(scaleRect(shiftRect((the rect of G),-L,-T),H,V),L,T) into R
   repeat with N = 1 to number of controls of G
  set the rect of control N of G to
integerRect(shiftRect(scaleRect(shiftRect((the rect of control N of
G),-L,-T),H,V),L,T))
   end repeat
   set the margins of G to scaleRect((the margins of G),H,V)
   set the rect of G to R
end scaleGroup

function scaleRect R,H,V
   if V is empty then put H into V
   return (H * item 1 of R),(V * item 2 of R),(H * item 3 of R),(V * item 4
of R)
end scaleRect

function shiftRect R,H,V
   if V is empty then put H into V
   return (H + item 1 of R),(V + item 2 of R),(H + item 3 of R),(V + item 4
of R)
end shiftRect

function integerRect R
   return round(item 1 of R),round(item 2 of R),round(item 3 of
R),round(item 4 of R)
end integerRect


On Fri, May 10, 2013 at 7:00 AM, Thomas McGrath III mcgra...@mac.comwrote:

 Monte,

 I won't be attending this year but I will be on the simulcast so I'll sort
 of be there in spirit at the conference…..

 Tom

 -- Tom McGrath III
 http://lazyriver.on-rev.com
 mcgra...@mac.com

 On May 10, 2013, at 1:15 AM, Monte Goulding mo...@sweattechnologies.com
 wrote:

  I asked this exact question on StackOverflow a couple of weeks ago and
 before I was attacked by Mark for not asking the question he answered we
 were getting somewhere... I did create solution that works by retaining an
 offset for the child objects to use in their resizing.
 
 
 http://stackoverflow.com/questions/16168091/how-do-you-change-the-rect-of-a-group-without-changing-the-location-of-the-objec/16178454#16178454
 
  Anyway... all will be revealed at the conference on Tuesday
 
  On 10/05/2013, at 5:23 AM, Thomas McGrath III mcgra...@mac.com wrote:
 
  Is there a way to resize and move a scrolling group without touching
 the inside contents of that group??? This is on mobile and I need to resize
 a scrolling group based on the position of the UI (navbar and toolbar when
 in portrait and landscape) when the UI changes and then after the scrolling
 group is right I then need to separately resize the contents for retina if
 needed -- to double their height, width and topleft -- or regular.
 
  If I resize the group first then it moves the content and then doubling
 the content makes it the right size but positioned wrong.
  If I resize the content and then move the group then it again correctly
 sizes the contents but positions them wrong.
 
  If the group moves then everything is in a different position from when
 I laid them out in the desktop so they are off.
 
  I want the scrolling group code to be separate from the resizing code
 if possible.
 
 
  Thanks,
 
  Tom
 
  -- Tom McGrath III
  http://lazyriver.on-rev.com
  mcgra...@mac.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
 
  --
  Monte Goulding
 
  M E R Goulding - software development services
  mergExt - There's an external for that!
 
 
 
 
 
  ___
  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 

Re: skip lists

2013-05-11 Thread Geoff Canyon
I'm curious why you'd want to do this? As far as I can see, the advantages of 
linked lists, and the negatives of the alternatives, are both negated by 
aspects inherent in the LC scripting system.


On May 11, 2013, at 12:22 AM, Richard Gaskin ambassa...@fourthworld.com wrote:

 Anyone here had occasion to implement a skip list in an xTalk?
 http://en.wikipedia.org/wiki/Skip_list

___
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: skip lists

2013-05-12 Thread Geoff Canyon
On Sat, May 11, 2013 at 5:20 PM, Richard Gaskin
ambassa...@fourthworld.comwrote:

 Geoff Canyon wrote:

  I'm curious why you'd want to do this?

 Because I'm a madman. :)


A perfectly fine reason, I've done many things for the same reason. In this
instance, just to make sure there's nothing I'm overlooking, as far as I
can see:

In non-high-level languages:
Linked lists, are compact and easy to write to. They don't have to allocate
all storage space up front the way arrays do. They're slow to find elements
in, which skip lists help to address.

In LC:
Arrays allocate memory below the level we look at, as do all other storage
forms. Any implementation of a linked list that I can think of would
probably be slower than simply writing to an array. The only thing that
comes to mind that *might* be faster to write to would be some sort of
two-variable solution where one variable contained the data, and new
additions involved simply appending to the end of the (increasingly long)
string, along with a second variable that, in some efficient way, keeps
track of what is where in the first variable, which sounds horrible.

Am I overlooking anything?

gc
___
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: Speed of Building Applications with LiveCode

2013-05-15 Thread Geoff Canyon
If you're building 8 fully featured database applications one after the
next, how much are you having to do for app #2, 3, etc.?

Editing a row is editing a row -- you should be growing better and better
libraries with each iteration?


On Wed, May 15, 2013 at 9:07 AM, Andrew Kluthe and...@ctech.me wrote:

 This is an odd kind of post for the list,

 Sometimes with LiveCode I am able to put things together so quickly that it
 is hard for me to compare development times in livecode to development
 times in other environments. It makes me tend to expect things much more
 quickly after a while.

 So, all bragging aside, how many fully featured database applications do
 you think you would be able to develop in a year?

 I have worked on about 8 since last july. Lately, I have felt a little
 overwhelmed with the workload I place on myself and am having a hard time
 deciding if I need to lighten it or just learn to work faster/more
 efficiently.

 Can some of you share similar experiences or give me some advice?

 --
 Regards,

 Andrew Kluthe
 and...@ctech.me
 ___
 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: Multiple Images on Card

2013-05-21 Thread Geoff Canyon
On Tue, May 21, 2013 at 8:39 AM, Graham Pearson gspear...@gmail.com wrote:

 when a user hovers over a section of the
 picture, it would change colors and upon clicking a section of the
 picture it would display a new card with detailed information of the
 section of the image selected.



I think you don't need to slice your image to accomplish this. Instead:

1. import the whole image and position as you want
2. create a graphic control. make it a rect, the size you want, with a
color and blendlevel that get you the effect you want when it is positioned
over the image. For example, set it to 255,0,0 and 50 to have it colorize
the image pretty strongly red when the graphic is over it.
3. set the script of the image to something like this:

on mouseMove x,y
   set the topleft of grc 1 to (100 * (x div 100)),(100 * (y div 100))
end mouseMove

The above assumes that the highlight graphic is 100x100 pixels.

Then do whatever math you have to when the user clicks to identify what
section to show info on -- you could store the current section in the
section above, or do it on the fly.
___
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: scrolling stack I made

2013-05-22 Thread Geoff Canyon
Hi Colin,

Nice work!

I added timing code to get the framerate. On my macbook pro when nothing is
actually moving, it achieves about 40 fps. When the images are moving it
drops to about 24 fps. I'd be curious how using the move command might
compare. I don't think  it would be faster since with each frame it's
likely that all the commands would have to be canceled and re-issued to
change the speed.

I also simplified the movement routine to a single line to update the
position of each object, which eliminated the need to store the position in
the array. Feel free to use anything or nothing from this:


global places,worldx,difx
local frameratecounter,secondmarker

on opencard
   resetobjects
   put 0 into difx
   if the environment is mobile then mobileEnableAccelerometer 100
   moveworld
end opencard

on accelerationChanged pXAccel, pYAccel, pZAccel
   put min(100,max(-100,pYAccel*10)) into difx
end accelerationChanged

on moveworld
   if the environment is not mobile then
  put (512-the mouseh)/100 into difx
   end if
   movethings difx
   add 1 to frameratecounter
   if seconds() is not secondmarker then
  put frameratecounter
  put 0 into frameratecounter
  put seconds() into secondmarker
   end if
   if the optionkey is not down then send moveworld to me in 16 milliseconds
end moveworld

on resetobjects
   lock screen
   put 0 into oldvalue
   put 0 into worldx
   put  into places
   split places by return
   addimage lc1,the left of img lc1,8
   repeat with a = 1 to 100
  put lc_a into imagename
  if there is not an image imagename then
 clone image lc1
 set the name of image the number of images to imagename
  end if
  set the width of image imagename to min(256,1024/min(101-a,100))
  set the height of image imagename to min(256,1024/min(101-a,100))
  set the top of image imagename to random(500)
  set the left of image imagename to random(2048)
  addimage imagename,the left of image imagename,min(10+(101-a) / 3,100)
   end repeat
   addimage sky1,0,60
   addimage sky2,1024,60
   addimage hills1,0,40
   addimage hills2,1024,40
   addimage tracks1,0,20
   addimage tracks2,1024,20
   addimage farhedges1,0,10
   addimage farhedges2,1024,10
   addimage nearhedges1,0,5
   addimage nearhedges2,1024,5
   movethings worldx
   repeat with a = 1 to the number of images
  set the layerMode of img a to dynamic
   end repeat
   unlock screen
end resetobjects

on addimage imagename, imageplace, imagespeed
   put imagename into places[imagename][imagename]
   set the left of image imagename to imageplace
   put imagespeed into places[imagename][imagespeed]
end addimage

on movethings howmuch
   lock screen
   repeat for each element a in places
  set the left of image a[imagename] to trunc(3072 + the left of
image a[imagename] + howmuch*100/a[imagespeed]) mod 2048 - 1024
   end repeat
   unlock screen
end movethings
___
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: scrolling stack I made

2013-05-22 Thread Geoff Canyon
Funny, I thought I was getting away with it because I was scrolling to the
left, where the use of trunc instead of round meant that even at the
slowest setting, everything was moving, in some cases too fast.

Here it is adapted to use the array again. It's too bad (for this) that the
loc can't use a fractional value and just work.

on addimage imagename, imageplace, imagespeed
   put imagename into places[imagename][imagename]
   put imageplace into places[imagename][imageplace]
   put imagespeed into places[imagename][imagespeed]
end addimage

on movethings howmuch
   lock screen
   repeat for each key K in places
  put (3072 + places[K][imageplace] +
howmuch*100/places[K][imagespeed]) mod 2048 - 1024 into
places[K][imageplace]
  set the left of image places[K][imagename] to
trunc(places[K][imageplace])
   end repeat
   unlock screen
end movethings



On Wed, May 22, 2013 at 10:00 AM, Colin Holgate co...@verizon.net wrote:

 The use of an array value was intentional. Try your version and my version
 while moving very slowly, you'll see that lots of the images will stall in
 your one. That's because the value keeps rounding down to the nearest
 pixel. The array approach makes the location be floating point, and so over
 time the image will reach the next integer value.


 On May 22, 2013, at 10:28 AM, Geoff Canyon gcan...@gmail.com wrote:

  I also simplified the movement routine to a single line to update the
  position of each object, which eliminated the need to store the position
 in
  the array.

 ___
 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: Random sort demonstration

2013-05-23 Thread Geoff Canyon
On Thu, May 23, 2013 at 1:08 AM, Dar Scott d...@swcp.com wrote:

 The problem is equality in the sort.  It keeps the same order in
 comparison of pairs of items.  For example, the items sorted in the last
 case above as though they were 2,2,3.  The first item is still first.

 So...

 Use large values for the argument to random() in random sorts.



Came here to say this -- in case it's not clear, sorts in LC are stable,
meaning that they don't change the order of the input unless they have to.
This can be useful when you have several different things to sort by.
Suppose you want to sort a list of people by age, and then by name. If the
data looks like

first name,last name,age,other stuff

then you could use:

sort lines of theData by item 1 of each
sort lines of theData by item 2 of each
sort lines of theData numeric by item 3 of each

To Dar's point, here the stable sort means that you should never use this
to get a random sort:

sort lines of someContainer by random(the number of lines of someContainer)

You are almost guaranteed to get less than random results. Instead always
use something like

sort lines of someContainer by random(9)

gc
___
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: randomly order a list

2013-05-23 Thread Geoff Canyon
There is, indeed much confusion here. I, of course, am correct ;-)

I simplified the problem to a list of two items:

1,2

That way the sort command has exactly two outcomes. It either reverses the
list, or it doesn't. The two outcomes should happen roughly 50% of the
time. This script demonstrates that sorting by a large random number works,
and sorting by a random number up to the number of items (2) does not.

on mouseUp
   put 1,2 into originalList
   repeat 1
  put originalList into newList
  sort items of newList by random(2)
  if newList is originalList then add 1 to sameCount1
   end repeat
   repeat 1
  put originalList into newList
  sort items of newList by random(9)
  if newList is originalList then add 1 to sameCount2
   end repeat
   put Sorting by random(2) kept the same order  sameCount1  out of
1 times.  cr  \
 Sorting by random(9) kept the same order  sameCount2
 out of 1 times.
end mouseUp

For anyone interested in the math, as you would expect, the random numbers
for the sort come out 2,1 roughly 1/4 of the time, so the result is that
the list is in the same order roughly 75% of the time when using random(2).
Here's one result I got:

Sorting by random(2) kept the same order 7514 out of 1 times.
Sorting by random(9) kept the same order 5014 out of 1 times.

If anyone disagrees, come at me, bro. ;-)
___
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: randomly order a list

2013-05-24 Thread Geoff Canyon
Dar -- I hardly think you need my blessing, but I agree with your
definition of p(k). I ran some numbers through Wolfram Alpha, and it looks
like even for 100 item lists the probability of the first item being sorted
to the first spot is about 0.015, or 1.5 times what it should be if sorted
by random(the number of items).

Of course, that's not the overall probability that the list is mal-sorted.
That probability is much higher, and I'm not sure how to calculate it
(hanging my head in shame), but roughly:

Say you have a set of 100 items where each gets a unique random number to
sort by except for the first two, which both get 1. They *should* be able
to come out either A,B or B,A, but they can only come out A,B. Note that
this does not depend on what common number they get -- even if they both
got 100, then although both of them would be moved to a different spot in
the output, there should be two possible outcomes, but there is only one.
Hence the probability under this circumstance of having an improper shuffle
is 0.5.

Likewise, if three items had the same random number, there would be only
one possible outcome when there should be 3*2*1 = 6 possible outcomes, so
there is a 5/6 or roughly 0.83 probability of a bad shuffle. This goes up,
obviously, as the number of dupes increases. Further, there can be more
than one duplicated number. If two items have 99, and three others have 23,
then the probability of an improper shuffle is 1 - 1/2 * 1/6 = 1 - 1/12 =
about 0.92.

My failure comes in aggregating all the various possible sets of
duplicates. Of course, the goal is achieving success, not calculating
failure. I did the math (okay, Wolfram Alpha did the math) and using:

sort lines of myList by random(9)  random(9)

For a list 1 million lines long has a probability less than 1 in a million
of having even a *slightly* non-random order (within the bounds of the
random number generator). That seems good enough for me. For shorter lists
the concatenation would be unnecessary.

I commented on the feature request. I think this would be an excellent
application of the new language features once they are available.

gc
___
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: Best screencast demo ever!

2013-05-28 Thread Geoff Canyon
Nice! It bugs me that in some cases they use forks to present different
variations, while in others they just change the text in the box (sometimes
more than once).


On Mon, May 27, 2013 at 8:49 PM, Bill Vlahos bvla...@mac.com wrote:

 This doesn't have anything to do with LiveCode or me but it is so clever I
 just had to share it.

 https://www.lucidchart.com/pages/examples/flowchart_software

 Bill Vlahos
 _
 InfoWallet (http://www.infowallet.com) is about keeping your important
 life information with you, accessible, and secure.
 lcTaskList: (http://www.infowallet.com/lctasklist/index.htm)
 RunRev lcTaskList Forum: (http://forums.runrev.com/viewforum.php?f=61)


 ___
 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: text sortType

2013-05-28 Thread Geoff Canyon
tested  seems to work:

   sort lines of x numeric by word -1 of item 1 of each
   sort lines of x by word 1 to -2 of item 1 of each



On Tue, May 28, 2013 at 2:26 PM, J. Landman Gay jac...@hyperactivesw.comwrote:

 On 5/28/13 2:09 PM, Andrew Kluthe wrote:

 That would handle it for the most part, jaque, but some of the data has
 multiple words in the first item.

 Here is a real sample of the most intricate of the data I would be sorting
 in that first item.

 MA West Creek 14

 This would be a string to designate a field code we use. the first two are
 an abbreviated version of the county the farm is located in, the second is
 the common name of the farm and the last is a code for the specific chunk
 of land we are talking about.

 Sorting by words would work if the second piece of data in that string
 wasn't multiple words sometimes and I had some way to know how many words
 were in that item.

 I am thinking the string is just too variable to sort it down in that way
 without replacing spaces with another character momentarily.


 Maybe:

 sort lines of fld 1 numeric by last word of item 1 of each

 sort lines of fld 1

 --
 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-livecodehttp://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: text sortType

2013-05-28 Thread Geoff Canyon
Interesting -- this works in one line:

   sort lines of x by word 1 to -2 of item 1 of each  char -10 to -1 of
(00  word -1 of item 1 of each)

I'm a little put off by not using the native numeric -- I'd be worried
that something I'm not thinking of right now would break it. But
nevertheless, it works.

I timed three options and found that (on the sample I tried --  1 million
lines)

   sort lines of x numeric by word -1 of item 1 of each
   sort lines of x by word 1 to -2 of item 1 of each

is fastest, barely.

   sort lines of x by word 1 to -2 of item 1 of each  char -10 to -1 of
(00  word -1 of item 1 of each)

is just slightly slower.

   sort lines of x by sortKey(item 1 of each)

with

function sortKey X
   return ((word 1 to -2 of X)  (char -10 to -1 of (00  word -1
of X)))
end sortKey

was slower, but only by about 1.4 times.

gc


On Tue, May 28, 2013 at 3:04 PM, Dar Scott d...@swcp.com wrote:

 Whoops, I didn't read Peter's solution all the way.

 I guessed at what he was doing instead of giving it the attention it
 deserved.

 I guess my thumbs up was for using the sorting value function and for
 putting in zero digits.

 I would (off the top of my head) simplify (and change) that to this:

 function reformatLine pL
   get item 1 of it
   return (word 1 to -2 of it)  char -6 to -1 of (00  word -1 of
 it)
 end reformatLine

 By adding leading zeros for a fixed length, a text sort is the same as a
 number sort.

 A 3rd solution is to put fixed length numerals in the last word of the
 original data.

 (I could try using the *s as an excuse, but it is not a good excuse, sorry
 for commenting after only a glance.)

 Dar


 On May 28, 2013, at 1:51 PM, Dar Scott wrote:

  I think this and Geoff's are good!  This one is more general if you can
 come up with some sort of metric or sortvalue for each item/list.  Geoff's
 is simpler for this case.  The speed difference will depend on the length
 of the list.
 
  Shouldn't the zero be put 'before' instead of 'after' to force a
 numerical sort?
 
  Also, there is a shortcut.
 
  put char -6 to -1 of (00  tKey) into tKey
 
  Dar
 
 
  On May 28, 2013, at 1:41 PM, Peter Haworth wrote:
 
  The following worked for me (with apologies ofr any asterisks that may
 be
  inserted into the script by my email client)
 
  It assumes there won;t be any numbers  6 digits.
 
  *on* mouseUp
 
   *sort* lines of field Field by reformatLine(each)
 
  *end* mouseUp
 
 
  *function* reformatLine l
 
   *local* tKey
 
   *put* word 1 to -2 of item 1 of l into tKey
 
   *repeat* 6-the length of word -1 of item 1 of l
 
  *put* zero after tKey
 
   *end* *repeat*
 
   *put* word -1 of item 1 of l after tKey
 
   *return* tKey
 
  *end* reformatLine
 
  Pete
  lcSQL Software http://www.lcsql.com
  ___
  use-livecode mailing list
  use-livecode@lists.runrev.com
  Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
  http://lists.runrev.com/mailman/listinfo/use-livecode
 
 
  ___
  use-livecode mailing list
  use-livecode@lists.runrev.com
  Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
  http://lists.runrev.com/mailman/listinfo/use-livecode


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

___
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: Point in Poly

2013-05-29 Thread Geoff Canyon
On Wed, May 29, 2013 at 9:44 AM, Devin Asay devin_a...@byu.edu wrote:

 Have you tried the within() function? It works the way you describe for
 images, but I'm not sure about graphics objects.



This works for graphics objects as well, as long as their opaque is true.

within(grc 1,the loc of btn 1) -- true if the point is within the actual
graphic, not just the rect.
___
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: Point in Poly

2013-05-29 Thread Geoff Canyon
On Wed, May 29, 2013 at 10:44 AM, Dar Scott d...@swcp.com wrote:

 Consider a horizontal line through the point.  Find the points where it
 crosses the line segments of the sides.  (Take care of the special case of
 a line segment being on your horizontal line.)  Count the points to the
 left of your point.  If it is odd, then the point is inside.



Ah, the CS 202 solution -- I was wondering if anyone would bring this up.
You're giving me flashbacks, Dar ;-)
___
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


Pretty impressive demo video

2013-06-04 Thread Geoff Canyon
Would be nice to have views like this in LC

http://revealapp.com/

Sent from my iPad
___
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: Pretty impressive demo video

2013-06-04 Thread Geoff Canyon
On Tue, Jun 4, 2013 at 4:16 AM, René Micout rene.mic...@numericable.comwrote:

 Le 4 juin 2013 à 10:50, Geoff Canyon gcan...@gmail.com a écrit :

  Would be nice to have views like this in LC
 
  http://revealapp.com/



Not sure I understand -- the link was in the text you quoted:
http://revealapp.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: randomly order a list

2013-06-04 Thread Geoff Canyon
At the risk of beating the decaying equus -- the previously suggested
random() solutions should be fine for all purposes --I found an alternative
that:

1. Is faster than sorting by random(9)  random(9)
2. Is about as fast as sorting by random(9)
3. Is (I think) less likely to have duplicate sort keys

The drawback is that it is determinative (albeit random) for any given set
of data, unless you are willing to accept performance equivalent to sorting
by random(9)  random(9), while providing near-certainty of
a true sort (I think).

The one-time, as fast as any solution so far, sort is:

  sort lines of myVar by md5digest(each)

Collisions are highly unlikely in 128 bits. Even random(9) 
random(9) only provides about 60 bits, which, to be clear, is
*more* than enough, but md5 is (I think) even more certain, and faster.
However, it will always produce the same results.

  sort lines of myVar by sha1digest(each)

Works roughly the same: 160 bits of guaranteed-no-collision-ness, but it's
a little slower, although still much faster than random(9) 
random(9). Like MD5, it will always sort the same data the same
(random) way.

The same-ness for either solution can (I think) be fixed by this:

  put ticks() into T
  sort lines of myVar by md5digest(T  each)

or

  put ticks() into T
  sort lines of myVar by sha1digest(T  each)

That should result in random results each time, and is a little faster
(MD5) or about 1/3 slower (SHA1) than random(9)  random(9)

If anyone has thoughts on the collision-or-not-ness of MD5 or SHA1, feel
free to comment. Otherwise, I hope I'm done 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


Re: randomly order a list

2013-06-05 Thread Geoff Canyon
What code were you using Alex? I thought the first step(s) of the MD5
process reduce (or grow) whatever input string is given to 128 bits, and
then everything from there operates on the 128 bit data. Likewise for SHA1,
in 160 bits.

In other words, the size of the individual strings should have a limited
impact on the MD5 algorithm. For example, the two times returned by this
are nearly identical:

on mouseUp
   repeat 5
  put random(9) after S[1]
   end repeat
   repeat 5000
  put random(9) after S[2]
   end repeat
   repeat with i = 1 to 2
  put ticks() into T
  repeat 100
 get MD5digest(S[1])
  end repeat
  put i  ticks() - T  cr after R
   end repeat
   put R
end mouseUp



On Tue, Jun 4, 2013 at 6:26 PM, Alex Tweedly a...@tweedly.net wrote:

 No comments on the collision-or-not-ness, but some concerns about
 performance.

 The performance of random()  random() is conveniently data-independent,
 but that for md5digest() is not. With nice short lines, it is indeed faster
 than the randomrandom version, but as the line size increases, so does the
 time taken by all of the digest methods. I didn't test it thoroughly, but
 the swap-over point is fairly low - somewhere around 500 chars per line.

 -- Alex.


 On 04/06/2013 18:51, Geoff Canyon wrote:

 At the risk of beating the decaying equus -- the previously suggested
 random() solutions should be fine for all purposes --I found an
 alternative
 that:

 1. Is faster than sorting by random(9)  random(9)
 2. Is about as fast as sorting by random(9)
 3. Is (I think) less likely to have duplicate sort keys

 The drawback is that it is determinative (albeit random) for any given set
 of data, unless you are willing to accept performance equivalent to
 sorting
 by random(9)  random(9), while providing near-certainty
 of
 a true sort (I think).

 The one-time, as fast as any solution so far, sort is:

sort lines of myVar by md5digest(each)

 Collisions are highly unlikely in 128 bits. Even random(9) 
 random(9) only provides about 60 bits, which, to be clear, is
 *more* than enough, but md5 is (I think) even more certain, and faster.
 However, it will always produce the same results.

sort lines of myVar by sha1digest(each)

 Works roughly the same: 160 bits of guaranteed-no-collision-ness, but it's
 a little slower, although still much faster than random(9) 
 random(9). Like MD5, it will always sort the same data the same
 (random) way.

 The same-ness for either solution can (I think) be fixed by this:

put ticks() into T
sort lines of myVar by md5digest(T  each)

 or

put ticks() into T
sort lines of myVar by sha1digest(T  each)

 That should result in random results each time, and is a little faster
 (MD5) or about 1/3 slower (SHA1) than random(9) 
 random(9)

 If anyone has thoughts on the collision-or-not-ness of MD5 or SHA1, feel
 free to comment. Otherwise, I hope I'm done 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-livecodehttp://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-livecodehttp://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: randomly order a list

2013-06-07 Thread Geoff Canyon
On Wed, Jun 5, 2013 at 5:14 PM, Alex Tweedly a...@tweedly.net wrote:

 Your code has a minor bug :-)

 You get MD5Digest(S[1]) 
 instead of using   S[i]



Agh!!! ;-)

Interestingly, md5 appears to scale roughly linearly on the length of the
strings. 100x as long string means about 15x as long to md5, while 1000x as
long string means about 120x as long to md5. sha1 is longer but scales
similarly.
___
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: randomly order a list

2013-06-07 Thread Geoff Canyon
I did some reading and it sounds like md5 and sha1 should both be
deprecated in favor of sha256.


On Fri, Jun 7, 2013 at 10:57 AM, Dar Scott d...@swcp.com wrote:

 Right.  There is a little bit of overhead for padding for both md5 and
 sha1 (they use the same padding method), as a string a multiple of 64-bytes
 is created.  Then each resulting 64-byte block is processed; this is
 linear.  The methods are very similar, an important difference being the
 number of 32-bit chaining variables; md5 has four and sha1 has five.  (The
 final values are the hash.)  That is a factor in making the sha1 basic
 operation take longer, and thus the whole process take longer.  (We could
 look it up and count all the XOR, SHIFT, OR and AND operations, but you can
 imagine there would be more in scrambling five things instead of
 four--well, scrambled along with a portion of the block.)

 I empathize your arrrgh.

 Dar



 On Jun 7, 2013, at 9:18 AM, Geoff Canyon wrote:

  On Wed, Jun 5, 2013 at 5:14 PM, Alex Tweedly a...@tweedly.net wrote:
 
  Your code has a minor bug :-)
 
  You get MD5Digest(S[1]) 
  instead of using   S[i]
 
 
 
  Agh!!! ;-)
 
  Interestingly, md5 appears to scale roughly linearly on the length of the
  strings. 100x as long string means about 15x as long to md5, while 1000x
 as
  long string means about 120x as long to md5. sha1 is longer but scales
  similarly.
  ___
  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: LC Community - Script Limits

2013-06-12 Thread Geoff Canyon
I built standalones with both community and commercial. In my limited
experimentation, neither has scriptlimits.


On Tue, Jun 11, 2013 at 11:00 AM, Richard Gaskin ambassa...@fourthworld.com
 wrote:

 Kay C Lan wrote:

  To Richard Gaskin,

 I'm posting in this public domain as there are clearly far more new LC
 users visitng the List and so I felt it appropriate to hilight your
 excellent article on the Message Path:

 http://www.fourthworld.com/**embassy/articles/revolution_**
 message_path.htmlhttp://www.fourthworld.com/embassy/articles/revolution_message_path.html

 Considering Mark Weider's recent revelation that script limits are gone, I
 was wondering if you would be updating the article to reflect the current
 state of affairs.


 Thank you for the kind words.

 If we can get verification, either from RunRev or through testing, that
 the scriptLimits are indeed gone in all versions, I'll be happy to update
 the article to reflect that when I return toward the end of the month from
 a trip I'm about to take.

 --
  Richard Gaskin
  Fourth World
  LiveCode training and consulting: http://www.fourthworld.com
  Webzine for LiveCode developers: http://www.LiveCodeJournal.com
  Follow me on Twitter:  
 http://twitter.com/**FourthWorldSyshttp://twitter.com/FourthWorldSys


 __**_
 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-livecodehttp://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 Community - Script Limits

2013-06-12 Thread Geoff Canyon
6,000 lines of scripts that you set in the development environment? That's
normal. 6,000 lines of scripts that you execute with do or that you set
as scripts within the standalone? That's unusual (in LC).


On Wed, Jun 12, 2013 at 2:05 PM, Richmond richmondmathew...@gmail.comwrote:

 On 06/12/2013 09:59 PM, Geoff Canyon wrote:

 I built standalones with both community and commercial. In my limited
 experimentation, neither has scriptlimits.




 Pardon my naivety, but I have a standalone I market that has about 6,000
 lines in a vast number of objects;
 I really don't know what the fuss is all about.

 http://andregarzia.on-rev.com/**richmond/dwriterpro.htmlhttp://andregarzia.on-rev.com/richmond/dwriterpro.html

 http://www.indiegogo.com/**projects/devawriter#sharehttp://www.indiegogo.com/projects/devawriter#share

 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


Really large groups

2013-06-28 Thread Geoff Canyon
Has anyone created a library to handle groups  32k pixels wide/tall? I'm
thinking of something that stores the coordinates of controls relative to a
larger space and allows scrolling through that larger space -- maybe by
placing/removing them in an actual group so normal scrolling can still be
used? This seems like a hard-ish problem to get right, but possible to
build in a fairly robust way.
___
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: Really large groups

2013-06-28 Thread Geoff Canyon
I agree that it seems challenging, but I think if it's done right it could
be fairly transparent and robust.

I wrote some code to display the number of factors of each number from
1..N. It uses a graphic and draws a single-pixel-width vertical bar for
each number. It creates a new graphic for each hundred numbers (they start
to become unwieldy when you try to set more than a thousand points or so).

All of that works, but if I'm trying to do 1..50,000, or even 1.. a few
million. That makes the group with the set of graphics I'm creating up to
millions of pixels wide. Insane, I know, but the recent progress on the
twin prime conjecture has me excited and curious.


On Fri, Jun 28, 2013 at 1:57 PM, Richard Gaskin
ambassa...@fourthworld.comwrote:

 Geoff Canyon wrote:

 Has anyone created a library to handle groups  32k pixels wide/tall? I'm
 thinking of something that stores the coordinates of controls relative to
 a
 larger space and allows scrolling through that larger space -- maybe by
 placing/removing them in an actual group so normal scrolling can still be
 used? This seems like a hard-ish problem to get right, but possible to
 build in a fairly robust way.


 I believe you'd have to use separate scrollbar controls like the DataGrid
 does to maintain a consistent scroll thumb while hiding/show elements.

 That said, it seems like a painfully tedious task but doable, sort of like
 a DataGrid on acid.

 Just curious:  What are you making that needs that sort of display space?

 --
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for Desktop, Mobile, and 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-livecodehttp://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: Weekend challenge

2013-06-30 Thread Geoff Canyon
Okay, this is a beast, and in no way good or generalized. It doesn't use
the previous function, instead just going through line by line and flagging
all the issues it sees in one pass. It should:

1. Flag any new ID that doesn't have just two items on the line.
2. Following that line, flag if the next line doesn't have just 3 items
3. Flag any line that doesn't have an ID
4. Flag any line that doesn't have a section.
5. Flag any line where the ID is a duplicate of any previous section,
subsection or type.
6. Flag any line where the section is a duplicate of any previous id,
subsection or type.
7. Flag any line where the subsection is a duplicate of any previous id, or
section
8, Flag any line where the subsection is a duplicate of a previous type
that was under a different subsection
9. Flag any line where the subsection is empty, unless it's line 1 or 2 of
a new ID
10. Flag any line where the type is a duplicate of any previous id or
section
11. Flag any line where the type is a duplicate of any previous subsection,
unless that is the current subsection.
12. Flag any line where the type is a duplicate of any previous type.
13. Flag any line where the type is empty, unless it is line 1 or 2 of a
new ID
14. Flag any line where OP1 or OP2 is not one of the allowed values, or
they are the same.

I might be missing some, but I think that's it.

If you choose to use this feel free to check in with me with any questions.
In the words of Gene Wilder, It's alive! But watch for page breaks.




function validateList aList
   put 0 into lineNumber
   put DIV,1 MULT,1 PLUS,1 MINUS,1 COUNT,1 into OP
   split OP using space and comma
   repeat for each line L in aList
  add 1 to lineNumber
  put empty into lineError
  put L into W
  split W using tab

  -- Check to see if this should be the second line of an ID with three
items
  if W[1] is empty then
 put  -- ID missing  cr after lineError
  else
 if W[1] is lastID then
put false into newID
 else
if itemList[1][W[1]] is not empty then put  -- ID out of
order  cr after lineError
if W[3] is not empty or W[4] is not empty then put  -- FIrst
line of ID has wrong item count  cr after lineError
put 1 into itemList[1][W[1]]
if itemList[2][W[1]] + itemList[3][W[1]] + itemList[4][W[1]] 
0 then put  -- ID is a duplicate  cr after lineError
put true into newID
put W[1] into lastID
 end if
  end if
  if W[2] is empty then
 put  -- Section missing  cr after lineError
  else
 if W[2] is not lastSection and itemList[2][W[2]] is not empty then
put  -- Section out of order  cr after lineError
 put 1 into itemList[2][W[2]]
 if itemList[1][W[2]] + itemList[3][W[2]] + itemList[4][W[2]]  0
then put  -- Section is a duplicate  cr after lineError
 put W[2] into lastSection
  end if
  if newID and W[3] is empty and W[4] is empty then
 put true into newSection
 next repeat
  end if
  if W[3] is empty then
 put  -- Subsection missing  cr after lineError
  else
 if W[3] is not lastSubsection and itemList[3][W[3]] is not empty
then put  -- Subsection out of order  cr after lineError
 put 1 into itemList[3][W[3]]
 if itemList[1][W[3]] + itemList[2][W[3]] + itemList[5][W[3]]  0
then put  -- Subsection is a duplicate  cr after lineError
 put W[3] into lastSubsection
  end if
  if newSection then
 put false into newSection
 if W[4] is empty then next repeat
 put  -- Second line of new ID has wrong item count  cr after
lineError
  end if
  split W[4] using |
  if W[4][1] is empty then
 put  -- Type missing  cr after lineError
  else
 if W[4][1] is not lastType and itemList[4][W[4][1]] is not empty
then put  -- Type out of order  cr after lineError
 if (W[4][1] is not W[3] and itemList[3][W[4][1]] is not empty) or
itemList[1][W[4][1]] + itemList[2][W[4][1]] + itemList[4][W[4][1]]  0 then
put  -- Type is a duplicate  cr after lineError
 put 1 into itemList[4][W[4][1]]
 if W[4][1] is not W[3] then put 1 into itemList[5][W[4][1]]
 put W[4][1] into lastType
  end if
  if OP[W[4][2]] is empty then put  -- OP1 is empty  cr after
lineError
  if OP[W[4][3]] is empty then put  -- OP2 is empty  cr after
lineError
  if W[4][2] = W[4][3] then put  -- OP values are the same  cr after
lineError


  if lineError is not empty then put lineNumber  L  cr  lineError 
cr after R
   end repeat
   return R
end validateList
___
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: Weekend challenge

2013-07-02 Thread Geoff Canyon
I'd be very curious to know what the rails code looked like. I've said many 
times, and I hope the new language features enable this soon, that there are 
*many* extensions to the LC language that would be equal parts intuitive and 
useful.

The unique requirement on the  type might be (assuming the data has been 
processed to 6-item comma-delimited lines):

put the indexes of lines of myList where the count of item 4 of each  1 into 
myDupedTypes


For the requirement across the ID, section, and subsection, and type, not 
counting the type when it dupes its parent subsection, maybe:

put the indexes of lines of myList where item 1 of each is among the items of 
item 2 to 4 of any into myDupedIDs

Just a thought. 


As one example of what we're missing, consider this implementation of Conway's 
game of Life in J:

life=: (_3 _3 (+/ e. 3+0,4{)@,;._3 ])@(0,0,~0,.0,.~])

Granted, that looks like greek, but J is incredibly expressive. Consider what 
it does in just one line:

1. Pad the array representing the current state of the grid with zeroes all the 
way around, so 

1,0
1,1

becomes

0,0,0,0
0,1,0,0
0,1,1,0
0,0,0,0

2. Slice that array up into 3x3 sub-arrays, allowing overlaps, so now we have:

0,0,0   0,0,0
0,1,0   1,0,0
0,1,1   1,1,0

0,1,0   1,0,0
0,1,1   1,1,0
0,0,0   0,0,0

3. Sum those arrays to an element in a new array -- 1 if the sum is 3 (dead 
cell with 3 live neighbors, or live cell with 2 live neighbors) or 4 if the 
center cell is 1 (live cell with 3 live neighbors). The result is:

1,1
1,1



On Mon, Jul 1, 2013 at 12:46 PM, J. Landman Gay jac...@hyperactivesw.com 
wrote:
 On 7/1/13 12:53 AM, Geoff Canyon wrote:
 Okay, this is a beast, and in no way good or generalized. It doesn't use
 the previous function, instead just going through line by line and flagging
 all the issues it sees in one pass.
 
 snip
 
 Thanks Geoff, I'll definitely look it over. I actually won't have to use it 
 though because I was excused from the exercise, the server is doing it 
 instead. But it bugged me that I couldn't write a nice, neat handler to do it.
 
 The backstory: The client wanted a data verification check performed on both 
 the server and in the LiveCode stacks. I spent a weekend toiling over this, I 
 probably wrote six or eight different versions using different methods. I 
 never did produce anything neat and compact, so the next Monday I asked the 
 server person how they did it. They replied with a four or five line 
 algorithm which was very close to one of my initial attempts, but they didn't 
 have to do any duplicate checking. Apparently there's a way in Rails to do 
 that easily. They were bouncing arrays around. A couple of my attempts used 
 arrays but looping through all the sub-keys wasn't any easier than just 
 looping through the list.
 
 I was feeling kind of miffed that they were able to produce a workable script 
 in a couple of hours and I'd been messing with it for days. Fortunately the 
 client said never mind, they would just use the one on the server, and that I 
 should move on to other things.
 
 I was not disappointed, but it did leave me feeling kind of stupid (and a 
 little defensive about LiveCode.) I was relieved that no one here jumped in 
 to say oh, just do this. But I still wonder if I was missing some cool 
 trick.
 
 
 -- 
 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

___
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


List links and open them on mobile?

2013-07-03 Thread Geoff Canyon
Has anyone written code they'd be willing to share for mobile to show a list of 
links and then open them in a browser object? Similar to what the Facebook app 
does, in a way.

___
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: Weekend challenge

2013-07-03 Thread Geoff Canyon
On Wed, Jul 3, 2013 at 11:30 AM, J. Landman Gay jac...@hyperactivesw.comwrote:

 Right, that's why yours is better. The nature of the data is usually that
 only a single line would be out of sequence, but of course you can't rely
 on that.



So tell those guys that you don't condone half-assed error checking ;-)
___
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: Regular expressions

2013-07-04 Thread Geoff Canyon
I like general utility functions like this. I've written this one myself
somewhere in the past. When we can tinker with the language this will
definitely be in my lexicon.


On Thu, Jul 4, 2013 at 10:08 AM, Peter M. Brigham pmb...@gmail.com wrote:


 function offsets str,container,includeOverlaps

___
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


RosettaCode

2013-07-05 Thread Geoff Canyon
http://rosettacode.org/wiki/Category:Revolution

Has anyone looked at this site before? There is only one example so far.
Many of them aren't too difficult.

gc
___
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: RosettaCode

2013-07-07 Thread Geoff Canyon
Thanks for contributing!

Hopefully I don't come off quite that harsh... In any case, there doesn't
seem to be a better way to add a new entry than:

1. Go to the page for 99 bottles.
2. Click the entry for the language before LiveCode alphabetically --
Liberty BASIC in this case.
3. Edit that entry.
4. Insert the following at the bottom, after a couple CRs:

=={{header|LiveCode}}==
lang livecodefunction beerMe numberOfBottles
  put XX bottles of beer on the wall into verseA
  put Take one down, pass it around into verseB
  repeat with N = numberOfBottles down to 1
put replaceText(verseA,XX,N)  cr  word 1 to 4 of \
replaceText(verseA,XX,N)  cr  verseB  cr 
replaceText(verseA,XX,N-1) \
 cr  cr after theSong
  end repeat
  return theSong
end beerMe/lang

I generally add a comment that I'm adding LiveCode, and then save. It could
also be done by editing the entry *after* LiveCard alphabetically, and
putting the LiveCode entry before that entry, with a couple CRs between
them. Or by editing the whole page, but that would be harder because you'd
have to search through the markdown to find the right place to put LiveCode.

Note that in this case I just modified your code to take an argument for
the number of bottles just for laughs. If I were optimizing I'd do
something like:

function beerMe3 numberOfBottles
   repeat with N = numberOfBottles down to 0
  put N  bottles of beer on the wall  cr  cr  \
N  bottles of beer on the wall  cr  \
N  bottles of beer  cr  \
Take one down, pass it around  cr after theSong
   end repeat
   return line 3 to -5 of theSong
end beerMe3
___
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: RosettaCode

2013-07-08 Thread Geoff Canyon
I don't have much experience with the site, but what I've seen seems more 
friendly than contentious. The goal seems to be the exchange of information, to 
help people learn about the different languages. 

With the new language features coming in LiveCode, I think it provides a rich 
template for extensions to our syntax. For example, the anagrams problem made 
it abundantly clear that we need a sort characters command, as well as words. 

gc

Sent from my iPad

On Jul 8, 2013, at 1:30 AM, Scott Rossi sc...@tactilemedia.com wrote:

 OK, just so I'm clear, thoughŠ  I thought part of the bragging rights of
 these things was to execute the task in as few lines as possible,
 regardless of readability.  Looking through the various entries (including
 the entry you posted), everything looks fairly well formatted/readable. So
 on this site, brevity, while encouraged, isn't really the goal, correct?
 In fact, it seems convoluted options can be posted alongside concise
 options within the same language.
 
 Regards,
 
 Scott Rossi
 Creative Director
 Tactile Media, UX/UI Design
 
 
 
 
 On 7/7/13 10:20 PM, Geoff Canyon gcan...@gmail.com wrote:
 
 Thanks for contributing!
 
 Hopefully I don't come off quite that harsh... In any case, there doesn't
 seem to be a better way to add a new entry than:
 
 1. Go to the page for 99 bottles.
 2. Click the entry for the language before LiveCode alphabetically --
 Liberty BASIC in this case.
 3. Edit that entry.
 4. Insert the following at the bottom, after a couple CRs:
 
 =={{header|LiveCode}}==
 lang livecodefunction beerMe numberOfBottles
 put XX bottles of beer on the wall into verseA
 put Take one down, pass it around into verseB
 repeat with N = numberOfBottles down to 1
   put replaceText(verseA,XX,N)  cr  word 1 to 4 of \
   replaceText(verseA,XX,N)  cr  verseB  cr 
 replaceText(verseA,XX,N-1) \
cr  cr after theSong
 end repeat
 return theSong
 end beerMe/lang
 
 I generally add a comment that I'm adding LiveCode, and then save. It
 could
 also be done by editing the entry *after* LiveCard alphabetically, and
 putting the LiveCode entry before that entry, with a couple CRs between
 them. Or by editing the whole page, but that would be harder because you'd
 have to search through the markdown to find the right place to put
 LiveCode.
 
 Note that in this case I just modified your code to take an argument for
 the number of bottles just for laughs. If I were optimizing I'd do
 something like:
 
 function beerMe3 numberOfBottles
  repeat with N = numberOfBottles down to 0
 put N  bottles of beer on the wall  cr  cr  \
   N  bottles of beer on the wall  cr  \
   N  bottles of beer  cr  \
   Take one down, pass it around  cr after theSong
  end repeat
  return line 3 to -5 of theSong
 end beerMe3
 ___
 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: Vertically aligning text in a field

2014-12-20 Thread Geoff Canyon
Not sure what's up with the offset that seems constant and inherent, but
this corrects for it. It does nothing about the apparent offset caused by
the difference between the textheight and and textsize of the first line,
because if the size varies, the textsize returns mixed. In any case, this
works for me to a reasonable degree of accuracy:

   set the topmargin of fld 1 to (8 + the height of fld 1 - the
formattedheight of line 1 to -1 of fld 1) div 2

Here's a demo stack that shows what this does. Each time you click the Test
button the text changes, then vertically aligns, then puts in two
equal-height boxes above and below to show the results.

https://dl.dropboxusercontent.com/u/41182876/vertical%20text%20demo.livecode

On Sat, Dec 20, 2014 at 11:24 AM, J. Landman Gay jac...@hyperactivesw.com
wrote:

 On 12/20/2014, 1:18 PM, J. Landman Gay wrote:

  I found that by adding a small number of pixels to the top margin I
 could get it close, which is what Bernd was doing too. I've been trying
 to figure out where the problem is, but like him, I don't see anything
 offhand. I'm pretty sure the engine must either be adding padding to the
 top line, or else not reporting the underhang of the last line, which
 makes the formattedWhatever functions not quite exact.


 On the theory that the problem isn't at the top but rather at the bottom,
 I calculated the amount of space occupied by the (imaginary) line 0 in the
 field. I think in general 2/3 of the text is placed above the baseline and
 1/3 of it is placed below that. So the top line would be offset by 1/3 the
 textheight of the (nonexistent) line 0.

 This seems to come closer to what we want:

 put round(the effective textheight of fld 1 * .66) into tUnderHang
 set the topmargin of fld 1 to (the height of fld 1 - (the
 formattedheight of line 1 to -1 of fld 1) + tUnderHang) div 2


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

___
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: I didn't know this...

2014-12-27 Thread Geoff Canyon
It's too bad this won't work:

   put bob carol ted alice into S
   replace c with x in char 1 of each word of S
   put S -- puts bob xarol ted alice


On Sat, Dec 27, 2014 at 5:42 PM, Kay C Lan lan.kc.macm...@gmail.com wrote:

 Nice :-)

 This isn't limited to variables but for works for fields as well.

 Taken the liberty of entering an Enhancement Request - 14311 - that the
 Dictionary entry be amended to include your example and note that replace
 can also be used on chunks within a container, not just the entire
 container.
 ___
 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: [ANN] Free: Google-style typing filter for LiveCode

2014-12-30 Thread Geoff Canyon
On Tue, Dec 23, 2014 at 7:36 AM, FlexibleLearning.com 
ad...@flexiblelearning.com wrote:


 www.FlexibleLearning.com/typingfilter


Nice work, Hugh! I remember doing something similar about eighteen years
ago and having to write the code to do a thousand lines of the search
material at a time, displaying results as it went, and using send..in to
allow the user to continue typing. Technology is a wonderful thing, eh?

One suggestion: the filter command allows wildcards by default, so the
coloring code will fail if you search for something like E*st it will
find Eads, United States (Colorado) but will only highlight the st. Not
sure the best way to address this since matchchunk doesn't work the same as
filter. You could switch filter to using regex, I suppose.

gc
___
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: changing layer within a group by script/ speed of start editing

2015-01-26 Thread Geoff Canyon
set relayergroupedcontrols to true
set the layer of whatever control to whatever layer

On Sun, Jan 25, 2015 at 7:30 PM, Scott Rossi sc...@tactilemedia.com wrote:

 Try locking the screen before doing any object relayering.

 Regards,

 Scott Rossi
 Creative Director
 Tactile Media, UX/UI Design

 On Jan 25, 2015, at 5:19 PM, Dr. Hawkins doch...@gmail.com wrote:

  I have a group with four overlapping graphics.
 
  Depending upon what happens, different ones want to be brought to the top
  and change the overlap.
 
  I'm currently using start editing/set the layer of zzz to top/stop
  editing.  I think it also changes the size.
 
  I can actually see the order in which this is handled on an iphone 6+.
  Fast, but visible.
 
  Is start editing expensive?  Is there a better way to do this?
 
 
  I suppose I could skip the group and catch their handlers in the card or
  stack instead of the group, but . . .
  --
  Dr. Richard E. Hawkins, Esq.
  (702) 508-8462
  ___
  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: stackfileversion and locking 6.5.2

2015-01-30 Thread Geoff Canyon
So far I've determined that stripping out every line of code from the stack
doesn't fix the problem.

Deleting every control does.

Now I'm going through to figure out which control is poisonous to 6.5.2

On Fri, Jan 30, 2015 at 3:40 AM, Geoff Canyon gcan...@gmail.com wrote:

 I have a stack that I moved to 7.0.2 for a few days without thinking, and
 I want to move it back. I tried this in the message box:


 set the stackfileversion to 5.5;lock messages;save stack
 versionProblem;close stack versionProblem


 and after that if I open it in 6.5.2 or 6.7, they lock up with the
 spinning beach ball of death. I don't think I put anything into the stack
 that requires 7, and LC dies even if I lock messages before opening the
 stack.


 Any ideas?


 gc

___
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


A code style question

2015-01-20 Thread Geoff Canyon
I think these two functions are equivalent. Which would you use? (or would
you use a different function altogether?)

function baseID newID
   if newID is empty then
  if not exists (the baseID of this stack) then
 set the baseID of this stack to this card
  end if
   else
  if exists newID then
 set the baseID of this stack to newID
  else
 set the baseID of this stack to this card
  end if
   end if
   return the baseID of this stack
end baseID

function baseID newID
   if (newID is not empty and not exists newID) or \
 (newID is empty and not exists (the baseID of this stack)) then \
 set the baseID of this stack to this card
   if newID is not empty then set the baseID of this stack to newID
   return the baseID of this stack
end baseID
___
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: A code style question

2015-01-20 Thread Geoff Canyon
It would be good to post code that works:

function baseID newID
   if (newID is not empty and not exists(newID)) or \
 (newID is empty and not exists(the baseID of this stack)) then \
 set the baseID of this stack to this card
   if newID is not empty then set the baseID of this stack to newID
   return the baseID of this stack
end baseID
___
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: A code style question

2015-01-20 Thread Geoff Canyon
okay, I think this is correct for both versions (gah)

function baseID newID
   if newID is empty then
  if not exists (the baseID of this stack) then
 set the baseID of this stack to this card
  end if
   else
  if exists(newID) or \
newID is among the items of this card,card list,background
list,stack list then
 set the baseID of this stack to newID
  else
 set the baseID of this stack to this card
  end if
   end if
   return the baseID of this stack
end baseID


function baseID newID
   if (newID is not empty and not exists(newID)) or \
 (newID is empty and not exists(the baseID of this stack)) then \
 set the baseID of this stack to this card
   if exists(newID) or \
 newID is among the items of this card,card list,background
list,stack list then \
 set the baseID of this stack to newID
   return the baseID of this stack
end baseID
___
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: A code style question

2015-01-21 Thread Geoff Canyon
I was thinking of doing a switch version, so thanks!

On Wed, Jan 21, 2015 at 11:54 AM, Ken Ray k...@sonsothunder.com wrote:

  local baseID
 
  function baseID newID
put iff(validID(newID),newID, \
  iff(validID(baseID), baseID,this card)) into baseID
return baseID
  end baseID3

 Of course you could reduce it one step further:

 function baseID newID
   return iff(validID(newID),newID, \
 iff(validID(baseID), baseID,this card))
 end baseID3

 I use a similar inline switch:

 put stsSwitch(the
 platform,MacOS=Finder,Win32=Explorer,*=Desktop) into tReference

 easier/shorter then:

 switch (the platform)
 case MacOS
 put Finder into tReference
 break
 case Win32
 put Explorer into tReference
 break
 default
 put Desktop into tReference
 break
 end switch


 For anyone interested, here’s the code:

 function stsSwitch
   -- does a quick inline switch/case; separate multiple matches with a
 comma
   -- param 1 is checkValue
   -- params 2+ is in the form matchValue(s)=returnValue; if there is a
 match to one
   -- or more items in matchValue(s), return returnValue
   -- otherwise empty is returned (unless a matchValue is *, in which
 case return the associated value)
   put param(1) into tCheckValue
   set the itemDel to =
   put  into tDefault
   repeat with x = 2 to the paramCount
 put param(x) into tCheck
 put item 1 of tCheck into tMatch
 put item 2 of tCheck into tRetVal
 replace , with = in tMatch
 if tCheckValue is among the items of tMatch then return tRetVal
 if tMatch = * then
   if tRetVal = * then
 put tCheckValue into tDefault
   else
 put tRetVal into tDefault
   end if
 end if
   end repeat
   return tDefault
 end stsSwitch

 :D

 Ken Ray
 Sons of Thunder Software, Inc.
 Email: k...@sonsothunder.com
 applewebdata://52553A11-C1AF-4926-9DEF-C77D655DC26B/k...@sonsothunder.com
 
 Web Site: http://www.sonsothunder.com/   http://www.sonsothunder.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: Inspector Issue

2015-01-21 Thread Geoff Canyon
Sorry I didn't see this before -- if you're seeing that the problem is now
fixed, then maybe -- maybe -- there was something wrong with the stack
before. If you still see the problem, if you have a large number of
cards/controls, maybe there's some inherent limit in the inspector you're
hitting. Navigator has limits as well, they're just very large. I think in
menus it's something like 300 cards/objects, and in lists I think it's
3000, or maybe 10,000. Those were set a long time ago because of
performance limitations. At this point I could probably remove them and the
engine/Navigator would likely hold up for much larger counts.

On Fri, Jan 16, 2015 at 3:14 PM, Peter Bogdanoff bogdan...@me.com wrote:

 Hi,

 I would like some expert advice.

 I have a stack that on some of the cards exhibit an issue: When you show
 the Inspector and there click on Inspect… it doesn’t show all the
 controls. In fact it only shows Inspectbuttons and then a list of the
 first 7-8 buttons on the card. On the card there are dozens of buttons,
 fields, an image, etc., but the Inspector doesn’t list them.

 When I use Geoff Canyon’s Navigator plugin I see all the controls, and
 indeed, all the controls seem to be visible and it all works. I can select
 any control and its properties display in the Inspector. Just that dang
 Inspect triangle doesn’t show all it should.

 This issue occurs on many of the cards of this 3,000 card stack, but not
 all; on many all the controls show properly in the Inspector. This anomaly
 occured recently but doesn’t seem to affect the functionality of the stack.
 I’m using LC 6.3.1, but I also see it when I open that stack in a later
 version of LC.

 My question(s): Has anyone seen this before? and is my stack damaged? and
 should I revert to an earlier version?

 Peter Bogdanoff
 UCLA
 ___
 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: A code style question

2015-01-21 Thread Geoff Canyon
I know iff means in-and-only-if, but I have a habit of taking things that
are not functions and making them into functions by appending an f so I
went with it.

I agree that it would be a very useful thing to have -- the obvious
drawback of the way it is now is that both outcomes have to be evaluated,
where in an if statement, obviously, only one of them is.

On Wed, Jan 21, 2015 at 9:15 AM, Ben Rubinstein benr...@cogapp.com wrote:

 On 21/01/2015 01:58, J. Landman Gay wrote:

 On 1/20/2015 7:33 PM, Geoff Canyon wrote:

 The nested if statements in the first
 one, and the duplicated

  set the baseID of this stack to this card

 offend my eye.


 There's two of us then.


 Me three.

 Also I was glad to see you also have a reflex of defining

  function iff X,T,F
if X then return T else return F
 end iff


 (I usually name my version ifthenelse - I like the conciseness of yours,
 but I studied logic some decades ago, so for me iff is already a word,
 and it means something different - if and only if.)

 I don't we think should be proposing fundamental additions to the language
 very often, but this is such a useful one that I think it should be
 considered.

 What do you think?

 Ben



 ___
 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: Debugging plugins

2015-01-14 Thread Geoff Canyon
On Wed, Jan 14, 2015 at 11:22 AM, J. Landman Gay jac...@hyperactivesw.com
wrote:

 The simplest thing might be to temporarily rename your plugin without the
 rev prefix while you're working on it.


This gives me the opportunity to use my favorite phrase from an Apple
commercial: What, was I in thinking jail?

Apart from how much of a pain it is to rename a stack with behavior buttons
in it, this was straightforward and works perfectly.

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


Re: Debugging plugins

2015-01-14 Thread Geoff Canyon
Thanks to those who suggested Script Debug Mode and breakpoint. In plugins,
neither of those allows setting a breakpoint that will work.

global gRevDevelopment;put true into gRevDevelopment enables breakpoints in
plugins, but in 6.7 at least seems to completely break the variable panel
in the debugger.

On Thu, Jan 8, 2015 at 6:51 PM, Mark Talluto use...@canelasoftware.com
wrote:

 On Jan 5, 2015, at 8:16 AM, Geoff Canyon gcan...@gmail.com wrote:

  I have a vague recollection of there being a way to get breakpoints to
 work
  in rev stacks. I thought it was a preference setting, but I don't see
 it.
  Anyone know what the setting/property is for that?

 There is a menu item labeled‘Script Debug Mode’ in the ‘Development’
 drop down of the LiveCode menus.

 Best regards,

 Mark Talluto
 livecloud.io
 canelasoftware.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: A Got-Ya

2015-01-22 Thread Geoff Canyon
On Wed, Jan 21, 2015 at 6:00 PM, Peter Haworth p...@lcsql.com wrote:

 doesn't the presence of the and of objectreference indicate that
 the reference is to a (custom) property not a variable


You can store the name of a custom property in a variable, even one with
the same name as some other custom property. So there's no question that
you're accessing a custom property, because of the the as you say, but
here the issue was over which custom property was being returned.

I'm saying that since it's legitimate and useful to be able to do this,
there's no good way for the compiler to realize when you're doing it by
mistake.
___
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: A code style question

2015-01-22 Thread Geoff Canyon
On Thu, Jan 22, 2015 at 1:42 PM, Ben Rubinstein benr...@cogapp.com wrote:

 Sorry, I've only just realised as I was about to press send that the point
 you were making was that if it was built-in, then it also wouldn't need to
 evaluate both outcomes.  Good point - though I'd personally still tend to
 restrict the use to constants or very simple expressions.


Agreed that there's the potential for complexity abuse for something like
this. The evaluation aspect could come up even in simple situations like:

set the left of some control to iff(exists(some other control),the left
of some other control,default value)
___
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: A Got-Ya

2015-01-20 Thread Geoff Canyon
Two things to consider:

1. It's almost impossible to catch conflicts with custom properties. They
don't have to be mentioned by name in a script because:
2. It's a feature that custom property names can be stored/referenced using
variables. For example:

   repeat for each item P in left,top
  -- not custom properties, but the same principle applies
set the P of button example to 10 * trunc(the P of button
example / 10)
   end repeat

If you have a large number of custom properties to initialize, this allows
you to do something like:

   put cProp1,23 cProp2,18 cProp3,98 into P
   split P using space and comma
   repeat for each key K in P
  set the K of button example to P[K]
   end repeat

In neither of these cases would it be easily detectible to the compiler
what (custom) properties are being referenced, and these cases aren't close
to pathological. On the other hand, simply disallowing the use of a
variable to store/reference a (custom) property would be a significant loss
of functionality.

On Tue, Jan 20, 2015 at 2:17 PM, Mike Kerner mikeker...@roadrunner.com
wrote:

 ugh.  That's an ugly.  I'd file a feature request to have the
 parser/compiler catch those for you.  I am a big proponent of loose syntax,
 but if it's going to be loose enough that you can do THAT, then you either
 should get an error for misusing the token or it should be smart enough to
 not fail.

 On Tue, Jan 20, 2015 at 1:13 PM, Ralph DiMola rdim...@evergreeninfo.net
 wrote:

  I just spent an 1.5 hours of what the heck just happened. My fault but
  just wanted to let others know.
 
  I have a custom stack prop named pRegion. This worked as expected
 except
  in one handler. It always returned empty. From either the handler or from
  the message box while the handler was being debugged or from an answer
  dialog. Click the stop button in the debugger, then from the message box
  the
  custom property is the value the inspector says. Breakpoint on the first
  line of the mouseup handler and it's gone. Deleted all the code in the
  handler and it's back even though I examined it before any code was run
  from
  the debugger both times.
  Problem: I had a local of the same name by mistake. I was not even using
  it.
  I just deleted it and all was OK. This might be obvious to the more
  seasoned
  LiveCoder but to a beginner... not so much
 
  Just an FYI
 
  Ralph DiMola
  IT Director
  Evergreen Information Services
  rdim...@evergreeninfo.net
 
 
 
  ___
  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: A code style question

2015-01-20 Thread Geoff Canyon
I figured the first version would be faster, since it only checks each
thing once, where the second version tests some booleans twice, but this
isn't going to be called repeatedly, so maximum performance isn't an issue.

I was more curious about the readability, because I thought I might be the
odd one out here, and it seems I am. The nested if statements in the first
one, and the duplicated

set the baseID of this stack to this card

offend my eye.

Once I realized I needed to test for exists OR is among more than once
I used a separate function for those. Along with an inline if function I
already had, and switching from a stack property to a local, I came up with:

local baseID

function baseID newID
   put iff(validID(newID),newID, \
 iff(validID(baseID), baseID,this card)) into baseID
   return baseID
end baseID3

function iff X,T,F
   if X then return T else return F
end iff

function validID I
   return ((I is among the items of this card,card list,background
list,stack list) or exists(I))
end validID

Maybe not everyone's cup of tea, but clear to me.



On Tue, Jan 20, 2015 at 1:14 PM, Richard Gaskin ambassa...@fourthworld.com
wrote:

 Thanks for the fix.  Once I took care of the email line wrap it ran well.
 The first version is still slightly faster, and to my eye more readable, so
 I'd go with that.



 on mouseUp
put 1000 into tIterations
--
set the baseID of this stack to empty
put the millisecs into t
repeat tIterations
   put baseID1(1000) into r1
end repeat
put the millisecs - t into t1
--
set the baseID of this stack to empty
put the millisecs into t
repeat tIterations
   put baseID2(1000) into r2
end repeat
put the millisecs - t into t2
--
put t1  t2  (r1=r2) cr r1  r2
 end mouseUp

 function baseID1 newID
if newID is empty then
   if not exists (the baseID of this stack) then
  set the baseID of this stack to this card
   end if
else
   if exists(newID) or \
 newID is among the items of this card,card list,background
 list,stack list then
  set the baseID of this stack to newID
   else
  set the baseID of this stack to this card
   end if
end if
return the baseID of this stack
 end baseID1


 function baseID2 newID
if (newID is not empty and not exists(newID)) or \
  (newID is empty and not exists(the baseID of this stack)) then \
  set the baseID of this stack to this card
if exists(newID) or \
  newID is among the items of this card,card list,background
 list,stack list then \
  set the baseID of this stack to newID
return the baseID of this stack
 end baseID2

 --
  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: Acceleration minus acceleration from rotation

2015-02-11 Thread Geoff Canyon
On Wed, Feb 11, 2015 at 11:59 AM, Richmond richmondmathew...@gmail.com
wrote:

 What my iPad CANNOT do, is detect if it is moved across a surface, for the
 very SIMPLE reason that it doesn't have
 little wheels or other motion sensors on its underside [ err . . .
 backside?].


AccelerationChanged delivers an X, Y, and Z parameters. If your cat slides
the iPad perfectly to the right, you should see that two of the parameters
(Y and Z?) stay at 0, but one of them (X?) changes, first to one sign
(positive?) and then the other (negative?) as the iPad slows to a stop. If
you're clever you can work out how far the iPad moved.

To the larger question, rotationRateChanged also comes in X, Y, and Z
params. Working out the math to isolate one from the other is indeed an
interesting problem.
___
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-10 Thread Geoff Canyon
Yay, that's great news. Does LC 7 now do character references in constant
(albeit a bit slower) time? Or linear? Or...

On Tue, Feb 10, 2015 at 4:50 AM, Ali Lloyd a...@runrev.com wrote:

 Apologies - hit send too early.


 6.7.1

 There are 2931 lines in tstart

 There are now 14655 lines in tstart

 revers(ta) took 427 ms

 qrevers(ta) took 6 ms

 Output OK

 krevers(ta) took 412 ms

 Output OK


 7.0.2 + bugfix

 There are 2931 lines in tstart

 There are now 14655 lines in tstart

 revers(ta) took 142 ms

 qrevers(ta) took 32 ms

 Output OK

 krevers(ta) took 258 ms

 Output OK

 On 10 February 2015 at 04:10, Kay C Lan lan.kc.macm...@gmail.com wrote:

  On Tue, Feb 10, 2015 at 11:58 AM, Geoff Canyon gcan...@gmail.com
 wrote:
 
   It seems that what we've lost with unicode/7 is the speed of character
   references.
  
 
  See Ali Lloyd's earlier response that the LC team have been watching this
  tread and it's clear that 'inefficient code' has been revealed. The LC
 team
  are working on it and believe that for none Unicode chunking LC 7 should
 be
  as fast as LC 6. There will be some slow down when Unicode is involved.
  ___
  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-18 Thread Geoff Canyon
On Tue, Feb 17, 2015 at 4:33 PM, Alex Tweedly a...@tweedly.net wrote:

 Though it would be kinda cool to do a quick LC simulation showing visible
 animation of the variable and index as it goes through the loop.


I did something like this:

https://dl.dropboxusercontent.com/u/41182876/foreach.livecode

It shows a field and parses through the field, highlighting each character
in blue as it considers it, and marking CR in red.

It has two buttons, one which simulates repeat for each line, another which
simulates repeat with i = 1 to the number of lines. It then does something
with each line.

It logs the actual thing it is doing at each step along the way, so you can
see the difference in steps taken, and gives an overall time for each
simulation.
___
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-17 Thread Geoff Canyon
On Tue, Feb 17, 2015 at 11:55 AM, Dr. Hawkins doch...@gmail.com wrote:

 Won't this be orders of magnitude slower?


Yes.

Given that you have access to lines, items, and words, if possible it would
be better to set the outer loop to work on lines, and then do whatever you
like with items within the loop.

Or take the hit and split the list before looping, and then index through
the array.

Or, as you say, be very careful with the item delimiter.
___
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-16 Thread Geoff Canyon
It's important to note that the efficiency is all/mostly in the function
call, not in the execution of the function itself. So for really short
functions that will be called many times, this is significant. For longer
functions, the difference all but vanishes:

on mouseUp
   put 1000 into n
   --
   put the millisecs into t
   repeat n
  put Foo1() into r2
   end repeat
   put the millisecs - t into t1
   --
   put the millisecs into t
   repeat n
  put Foo2() into r2
   end repeat
   put the millisecs - t into t2
   --
   put t1  t2
end mouseUp

function Foo1
   repeat 1
  get Hello
   end repeat
   return it
end Foo1

private function Foo2
   repeat 1
  get Hello
   end repeat
   return it
end Foo2

puts 629 622 for me

On Mon, Feb 16, 2015 at 10:10 PM, Jim Lambert j...@netrin.com wrote:

 RichardG wrote:
 
  I would imagine that a handler in the same
  script as the caller would be faster than having it just about any other
  place, but to limit its scope trims the execution time by a surprising
  amount.
 

 Whoda thunk!

  I think my new habit is to declare everything as private unless I know I
  need it available to other scripts.

 Me too.

  Thanks again.  Excellent discovery.

 Ditto.

 Jim Lambert

 ___
 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: Deleting cards from within themselves.

2015-02-16 Thread Geoff Canyon
On Mon, Feb 16, 2015 at 2:42 PM, Richmond richmondmathew...@gmail.com
wrote:

 Now, for every new term a templet card is cloned and 2 fields on the
 cloned card are filled.


Bernd's solution is correct if you really want to create/delete cards. It
would be better/more scalable to just maintain a list of the information
and use a single card to display it. Then deleting a card would just mean
removing an entry from that list.
___
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: ISO 8601 date to seconds

2015-01-28 Thread Geoff Canyon
On Wed, Jan 28, 2015 at 8:12 PM, Brahmanathaswami bra...@hindu.org wrote:

 2000-02-17T22:13:21-05

 As anyone written a script to convert this to seconds?


If the positioning is fixed (as is implied by the leading 0s) then I think
this will work:

function S D
   put format(%s/%s/%s %s,char 6 to 7 of D,char 9 to 10 of D,char 1 to 4
of D,char 12 to 19 of D) into R
   convert R to seconds
   return R + 3600 * char -3 to -1 of D
end S
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Refactoring

2015-01-29 Thread Geoff Canyon
Small thing, but I just turned this twelve-year-old code:

  put Double-Click: into tProperty
  if the optionKey is down then
 if the commandKey is down then
put Option-Command-Double-Click: into tProperty
 else
put Option-Double-Click: into tProperty
 end if
  else if the commandKey is down then
 put Command-Double-Click: into tProperty
  end if

into this:

  put Double-Click: into tProperty
  if the commandKey is down then put Command- before tProperty
  if the optionKey is down then put Option- before tProperty

I love turning ten lines of code into three lines of code. I hope twelve
years from now I can look back at those three lines with the same degree of
horror I feel now looking at the ten-line implementation.
___
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: stackfileversion and locking 6.5.2

2015-01-30 Thread Geoff Canyon
well that didn't take long :-P

It turns out that there is one field in the stack -- delete the contents of
that field, and the stack opens fine in 6.5.2.

I copied the contents of the field and pasted into Pages, then deleted the
contents of the field, and the file opened fine in 6.5.2. I then pasted the
contents back in, and the stack survived.

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


On Fri, Jan 30, 2015 at 11:00 AM, Mike Bonner bonnm...@gmail.com wrote:

 Even setting the filename to empty might be enough. (this way, any
 references in the stack that use the stackname won't be broken).  When this
 is done, when you save it, rather than just saving it brings up the
 filename dialog as if it were a new stack, and if you try to save it in the
 same place with the same name, you receive the usual warning about
 overwriting the stack.

 On Fri, Jan 30, 2015 at 9:36 AM, tbodine bod...@bodinetraininggames.com
 wrote:

  Is it feasible to make a handler for stacks being opened that would
 detect
  old version stacks and open them copies of them as untitled in the new
  stack format while leaving the legacy stack as is?
  -- Tom Bodine
 
 
 
  --
  View this message in context:
 
 http://runtime-revolution.278305.n4.nabble.com/stackfileversion-and-locking-6-5-2-tp4688290p4688300.html
  Sent from the Revolution - User mailing list archive at Nabble.com.
 
  ___
  use-livecode mailing list
  use-livecode@lists.runrev.com
  Please visit this url to subscribe, unsubscribe and manage your
  subscription preferences:
  http://lists.runrev.com/mailman/listinfo/use-livecode
 
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode

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


<    1   2   3   4   5   6   7   8   9   10   >