Regex help needed...

2016-01-30 Thread Paul Dupuis
I need some regex help.

I have a list that is of the form:

i.e.
1Testing1,7471,1,1,747
2Testing752,18001,752,1,1800
3Testing5398,58462,320,2,768
4Testing3,111.951,683.915,302.268,385.751  
 3,111.951,683.915,302.268,385.751

 can have a list of number in 1 of 2 formats:
A comma separated list of 4 integers, i.e.
,,,
OR
A comma separated list of 1 integer, followed by 4 decimal numbers, i.e.


I need filter the lines of this list with a REGEX pattern to get lines
WHERE a value pPage matches certain places in , specifically:
where pPage is equal to either  or  in the first
format(i.e. item 1 or item 3)
OR
where pPage is equal to  in the second format(i.e. item 1)

So my code is:
put
"((.+\t"&",\d+,\d+,\d+)|(.+\t\d+,\d+,"&",\d+)|(.+\t"&",?[0-9]*\.?[0-9]+,?[0-9]*\.?[0-9]+,?[0-9]*\.?[0-9]+,?[0-9]*\.?[0-9]+))"
into tMatchPattern
filter lines of tList with regex pattern tMatchPattern
 
If pPage is 1 then I should get:
1Testing1,7471,1,1,747
2Testing752,18001,752,1,1800
and I do. If pPage is 2 then I should get:
3Testing5398,58462,320,2,768
and I do. If pPage is 3 then I should get:
4Testing3,111.951,683.915,302.268,385.751  
 3,111.951,683.915,302.268,385.751
and I do. if pPage is 4 then I should get and empty list, and I do, but
when pPage is 5, I am expecting an empty list and I get
3Testing5398,58462,320,2,768

So something is wrong with my Regex, but I can not figure out what? It
looks like it is matching against  in the last case
(pPage=5) but it should not since there are only 2 items in the list
rather than 4 or 5.

I am using LiveCode 6.7.6


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


AW: Re: Regex help needed...

2016-01-30 Thread Paul Dupuis
Never mind. Solved it.

It was the pattern for the 2nd format. Fixed with
"(.+\t"&",\d+,\d+,\d+)|(.+\t\d+,\d+,"&",\d+)|(.+\t"&",\d*\.?\d*,\d*\.?\d*,\d*\.?\d*,\d*\.?\d*)"

On 1/30/2016 3:17 PM, Paul Dupuis wrote:
> I need some regex help.
>
> I have a list that is of the form:
> 
> i.e.
> 1Testing1,7471,1,1,747
> 2Testing752,18001,752,1,1800
> 3Testing5398,58462,320,2,768
> 4Testing3,111.951,683.915,302.268,385.751  
>  3,111.951,683.915,302.268,385.751
>
>  can have a list of number in 1 of 2 formats:
> A comma separated list of 4 integers, i.e.
> ,,,
> OR
> A comma separated list of 1 integer, followed by 4 decimal numbers, i.e.
> 
>
> I need filter the lines of this list with a REGEX pattern to get lines
> WHERE a value pPage matches certain places in , specifically:
> where pPage is equal to either  or  in the first
> format(i.e. item 1 or item 3)
> OR
> where pPage is equal to  in the second format(i.e. item 1)
>
> So my code is:
> put
> "((.+\t"&",\d+,\d+,\d+)|(.+\t\d+,\d+,"&",\d+)|(.+\t"&",?[0-9]*\.?[0-9]+,?[0-9]*\.?[0-9]+,?[0-9]*\.?[0-9]+,?[0-9]*\.?[0-9]+))"
> into tMatchPattern
> filter lines of tList with regex pattern tMatchPattern
>  
> If pPage is 1 then I should get:
> 1Testing1,7471,1,1,747
> 2Testing752,18001,752,1,1800
> and I do. If pPage is 2 then I should get:
> 3Testing5398,58462,320,2,768
> and I do. If pPage is 3 then I should get:
> 4Testing3,111.951,683.915,302.268,385.751  
>  3,111.951,683.915,302.268,385.751
> and I do. if pPage is 4 then I should get and empty list, and I do, but
> when pPage is 5, I am expecting an empty list and I get
> 3Testing5398,58462,320,2,768
>
> So something is wrong with my Regex, but I can not figure out what? It
> looks like it is matching against  in the last case
> (pPage=5) but it should not since there are only 2 items in the list
> rather than 4 or 5.
>
> I am using LiveCode 6.7.6
>
>
> ___
> use-livecode mailing list
> use-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: inserting Data into CustomProp array

2016-01-30 Thread Mark Wieder

On 01/30/2016 06:13 AM, Sannyasin Brahmanathaswami wrote:

Property sets appear easer to get and set across “sessions” (different times 
during dev) than putting an array into a property. I don’t see you could set 
just one element of tArray  if it was contained in a property without taking it 
out and putting it back in.

Am I wrong?


I forget what the original problem was/is, but...

if you just want to store an array as a custom property of an object and 
set and retrieve the elements, then the array itself becomes a 
custompropertyset:


put the rect of the last image into tRect
set the uEffects["startsize"] of the last image to tRect
set the uEffects["name"] of the last image to "ganesha"

You now have a custompropertyset named "uEffects", and you can treat it 
as a serialized array property of the image, or you can retrieve it as 
an array and use it that way.


-- use individual elements
put the uEffects["startsize"] of image 1 into tNewRect
set the uEffects["towel"] of the last image to 42

-- get the entire array at once
put the uEffects of image 1 into tArray

--
 Mark Wieder
 ahsoftw...@gmail.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: snapshot and animation capture

2016-01-30 Thread Mark Schonewille

I posted this link in my follow-up:
http://snapper.economy-x-talk.com/

Kind regards,

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

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

Op 1/28/2016 om 21:12 schreef Matt Maier:

Mark, what does "the app" refer to?
On Jan 27, 2016 16:21, "Mark Schonewille" 
wrote:


Matt,

Somehow, the website isn't much anymore, but the app can still be
downloaded. The trial version is almost fully functional. Perhaps this
approach would be useful for you.

Kind regards,

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

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

Op 1/27/2016 om 20:38 schreef Matt Maier:


I need to be able to easily capture stuff the user is seeing on their
screen so that they can import it into my application without having to
navigate the file manager multiple times. There's some good screen capture
stuff already in Livecode, but what I'm picturing is an actual window with
a hole in it the user can position and leave there so they know what's
going to be captured multiple times. Like gifcam
http://blog.bahraniapps.com/gifcam/

There doesn't seem to be a way to set the background of a window to
transparent. There is a way to mask the window using a transparent .png,
but that won't allow the user to resize the window. At the moment the only
mechanism I can come up with is to screencap what's behind the window
every
time the user moves or resizes it and display that in the window so that
it
looks like it's transparent. Is there a better way?

Also, in addition to capturing still images, I'd like the user to be able
to capture animated images (as an alternative to video). So, that part
would be exactly like gifcam. The only mechanism I've found for that is to
export each frame and then use something external like imagemagik to
stitch
them together into an animation.

- Matt
___
use-livecode mailing list
use-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: inserting Data into CustomProp array

2016-01-30 Thread Sannyasin Brahmanathaswami
Property sets appear easer to get and set across “sessions” (different times 
during dev) than putting an array into a property. I don’t see you could set 
just one element of tArray  if it was contained in a property without taking it 
out and putting it back in.

Am I wrong?


On January 29, 2016 at 9:17:26 PM, J. Landman Gay 
(jac...@hyperactivesw.com) wrote:

If you want the array in a single custom property rather than in its own
property set, first create the array and then store it:

put the rect of the last image into tArray["startsize"]
set the uEffects of the last image to tArray

To get things back out:

put the uEffects of this cd into tArray
put tArray["startsize"]

Property sets work too, so it's mostly a matter of personal preference.
___
use-livecode mailing list
use-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: AW: Re: Regex help needed...

2016-01-30 Thread Richard Gaskin
Regex is wonderfully compact to write relative to equivalent routines 
using chunk expressions, but sometimes paid for in execution time.


When I come across a good regex example like the one you provided, if I 
have a moment I like to test things out to see where regex is faster and 
where it isn't.  It's really great for many things, but carries quite a 
bit of overhead.


Of course for this test to be relevant it assumes that most of the 
specifiers in the regex expression are merely to identify the elements 
you're looking for, and that the data is expected to fit the definition 
you provided.


Given that, it's possible to make the regex a bit simpler (see foo2 
below), but only with a modest boost to performance.  It can probably be 
simplified more, but the chunk-based alternative performed so well I 
didn't bother exploring the regex side any further.


Writing a lengthier handler that uses chunk expressions seems to yield 
the same results you reported, running between 12 and 60 times faster 
(depending on the percentage of lines tested that match the criteria 
being looked for).


For one-offs like validating email addresses regex can be an excellent 
fit, and even some larger tasks depending on the specifics.


But for iterating across lists I've often been delightfully surprised by 
LiveCode's gracefully efficient chunk handling.


Testing your original data replicated to become 250 lines long, and 
looking for page 1 among them, the script below yields:


Regex: 9261 ms
RegexLite: 7958 ms
Chunks: 197 ms
Chunks faster than orig regex by: 47.01 times
Chunks faster than lite regex by: 40.4 times
Same result? true


on mouseUp
  put fld 1 into tList
  put 1 into tPage --< change this for different tests
  put 1000 into n
  --
  -- Test 1: original regex
  put the millisecs into t
  repeat n
put foo1(tPage, tList) into r1
  end repeat
  put the millisecs - t into t1
  --
  -- Test 2: lighter regex
  put the millisecs into t
  repeat n
put foo2(tPage, tList) into r2
  end repeat
  put the millisecs - t into t2
  --
  -- Test 3: chunks
  put the millisecs into t
  repeat n
put foo3(tPage, tList) into r3
  end repeat
  put the millisecs - t into t3
  --
  -- Display results:
  set the numberformat to "0.##"
  put "Regex: " &" ms" \
&"RegexLite: " &" ms" \
&"Chunks: "& t3 &" ms" \
&"Chunks faster than orig regex by: "&(t1 / t3)&" times"  \
&"Chunks faster than lite regex by: "&(t2 / t3)&" times"  \
&"Same result? "& (r1=r3) & r1 & r3
end mouseUp


function foo1 pPage, tList
  put 
"(.+\t"&",\d+,\d+,\d+)|(.+\t\d+,\d+,"&",\d+)|(.+\t"&",\d*\.?\d*,\d*\.?\d*,\d*\.?\d*,\d*\.?\d*)" 
into tMatchPattern

  filter lines of tList with regex pattern tMatchPattern
  return tList
end foo1


function foo2 pPage, tList
  put "(.+\t"&",*)|(.+\t\d+,\d+,"&",*)|(.+\t"&",*)" 
into tMatchPattern

  filter lines of tList with regex pattern tMatchPattern
  return tList
end foo2



function foo3 pPage, tList
  repeat for each line tLine in tList
set the itemdel to tab
put item 3 of tLine into t1
put pPage &"," into tPageMarker
if "." is in t1 then
  if (t1 begins with tPageMarker) then
put tLine  after tNuList
  end if
else
  if ( t1 begins with tPageMarker) OR (item 4 of tLine begins with 
tPageMarker) then

put tLine  after tNuList
  end if
end if
  end repeat
  delete last char of tNuList
  return tNuList
end foo3










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


Paul Dupuis wrote:

Never mind. Solved it.

It was the pattern for the 2nd format. Fixed with
"(.+\t"&",\d+,\d+,\d+)|(.+\t\d+,\d+,"&",\d+)|(.+\t"&",\d*\.?\d*,\d*\.?\d*,\d*\.?\d*,\d*\.?\d*)"

On 1/30/2016 3:17 PM, Paul Dupuis wrote:

I need some regex help.

I have a list that is of the form:

i.e.
1Testing1,7471,1,1,747
2Testing752,18001,752,1,1800
3Testing5398,58462,320,2,768
4Testing3,111.951,683.915,302.268,385.751
 3,111.951,683.915,302.268,385.751

 can have a list of number in 1 of 2 formats:
A comma separated list of 4 integers, i.e.
,,,
OR
A comma separated list of 1 integer, followed by 4 decimal numbers, i.e.


I need filter the lines of this list with a REGEX pattern to get lines
WHERE a value pPage matches certain places in , specifically:
where pPage is equal to either  or  in the first
format(i.e. item 1 or item 3)
OR
where pPage is equal to  in the second format(i.e. item 1)

So my code is:
put
"((.+\t"&",\d+,\d+,\d+)|(.+\t\d+,\d+,"&",\d+)|(.+\t"&",?[0-9]*\.?[0-9]+,?[0-9]*\.?[0-9]+,?[0-9]*\.?[0-9]+,?[0-9]*\.?[0-9]+))"
into tMatchPattern
filter lines of tList with regex pattern tMatchPattern

If pPage is 1 then I should get:
1Testing1,7471,1,1,747
2Testing752,1800

Re: snapshot and animation capture

2016-01-30 Thread Matt Maier
I got a reasonable facsimile of my original vision by just using an entire
substack to define the capture area.

on mouseUp
   set the blendlevel of stack "untitled 3" to 50
   set the loc of stack "untitled 3" to the screenloc
   go stack "untitled 3"
end mouseUp

Untitled 3 is a stack with button "exit" and button "snap". The first
button just closes the stack. The second button executes the following
script.

on mouseUp
   set the cCaptureRect of stack "untitled 3" to the rect of stack
"untitled 3"
   set the loc of stack "untitled 3" to -1000,-1000
   close stack "untitled 3"
   --   wait 200 milliseconds
   put the cCaptureRect of stack "untitled 3" into tBlerg
   export snapshot from rect tBlerg to image "captureHolder" of stack
"untitled 1"
end mouseUp

Apparently it takes around 200 milliseconds for the stack window to
actually close. At least, sometimes it was still in the way, or only
partially faded out when the snapshot was captured. Moving it out of the
way, however, seems to happen instantly.

The snapshot comes from the inside of the stack window, not including the
decorations.

On Fri, Jan 29, 2016 at 11:35 AM, Richmond 
wrote:

> So, I thought I'd have a bash at rolling my own, but got stuck:
>
> on mouseUp
>put topleft of img "border.png" & "," & the bottomright of img
> "border.png" into 
>put quote &  & quote into fld "guff"
>put fld "guff" into 
>export snapshot from rect  of stack "Super Snap" to file ".png"
> as PNG
> end mouseUp
>
> the thing gets stuck on the "export snapshot" line . . . cannot think why
> . . .
>
> image "snapBTN.png": execution error at line 5 (import: error in
> expression), char 1
>
> that stuff about "char 1" makes NO sense at all.
>
>
> 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
>
___
use-livecode mailing list
use-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: AW: Re: Regex help needed...

2016-01-30 Thread Paul Dupuis
Wow. I would not have expected such a significant difference. Regex has
been around a long time and lots of smart computer science types has
spent time coming up with ways to optimize its performance for pattern
matching. I assumed (falsely) that regex based filters in LC would be on
par or even superior than a custom function using chunks. This leads me to:

1) wondering if LC's hooks to whatever regex tool they are using under
the hood is a good as it should be
AND
2) planning on rewriting my code to use chunks.

Thanks for the post.


On 1/30/2016 6:45 PM, Richard Gaskin wrote:
> Regex is wonderfully compact to write relative to equivalent routines
> using chunk expressions, but sometimes paid for in execution time.
>
> When I come across a good regex example like the one you provided, if
> I have a moment I like to test things out to see where regex is faster
> and where it isn't.  It's really great for many things, but carries
> quite a bit of overhead.
>
> Of course for this test to be relevant it assumes that most of the
> specifiers in the regex expression are merely to identify the elements
> you're looking for, and that the data is expected to fit the
> definition you provided.
>
> Given that, it's possible to make the regex a bit simpler (see foo2
> below), but only with a modest boost to performance.  It can probably
> be simplified more, but the chunk-based alternative performed so well
> I didn't bother exploring the regex side any further.
>
> Writing a lengthier handler that uses chunk expressions seems to yield
> the same results you reported, running between 12 and 60 times faster
> (depending on the percentage of lines tested that match the criteria
> being looked for).
>
> For one-offs like validating email addresses regex can be an excellent
> fit, and even some larger tasks depending on the specifics.
>
> But for iterating across lists I've often been delightfully surprised
> by LiveCode's gracefully efficient chunk handling.
>
> Testing your original data replicated to become 250 lines long, and
> looking for page 1 among them, the script below yields:
>
> Regex: 9261 ms
> RegexLite: 7958 ms
> Chunks: 197 ms
> Chunks faster than orig regex by: 47.01 times
> Chunks faster than lite regex by: 40.4 times
> Same result? true
>
>
> on mouseUp
>   put fld 1 into tList
>   put 1 into tPage --< change this for different tests
>   put 1000 into n
>   --
>   -- Test 1: original regex
>   put the millisecs into t
>   repeat n
> put foo1(tPage, tList) into r1
>   end repeat
>   put the millisecs - t into t1
>   --
>   -- Test 2: lighter regex
>   put the millisecs into t
>   repeat n
> put foo2(tPage, tList) into r2
>   end repeat
>   put the millisecs - t into t2
>   --
>   -- Test 3: chunks
>   put the millisecs into t
>   repeat n
> put foo3(tPage, tList) into r3
>   end repeat
>   put the millisecs - t into t3
>   --
>   -- Display results:
>   set the numberformat to "0.##"
>   put "Regex: " &" ms" \
> &"RegexLite: " &" ms" \
> &"Chunks: "& t3 &" ms" \
> &"Chunks faster than orig regex by: "&(t1 / t3)&" times"  \
> &"Chunks faster than lite regex by: "&(t2 / t3)&" times"  \
> &"Same result? "& (r1=r3) & r1 & r3
> end mouseUp
>
>
> function foo1 pPage, tList
>   put
> "(.+\t"&",\d+,\d+,\d+)|(.+\t\d+,\d+,"&",\d+)|(.+\t"&",\d*\.?\d*,\d*\.?\d*,\d*\.?\d*,\d*\.?\d*)"
> into tMatchPattern
>   filter lines of tList with regex pattern tMatchPattern
>   return tList
> end foo1
>
>
> function foo2 pPage, tList
>   put "(.+\t"&",*)|(.+\t\d+,\d+,"&",*)|(.+\t"&",*)"
> into tMatchPattern
>   filter lines of tList with regex pattern tMatchPattern
>   return tList
> end foo2
>
>
>
> function foo3 pPage, tList
>   repeat for each line tLine in tList
> set the itemdel to tab
> put item 3 of tLine into t1
> put pPage &"," into tPageMarker
> if "." is in t1 then
>   if (t1 begins with tPageMarker) then
> put tLine  after tNuList
>   end if
> else
>   if ( t1 begins with tPageMarker) OR (item 4 of tLine begins with
> tPageMarker) then
> put tLine  after tNuList
>   end if
> end if
>   end repeat
>   delete last char of tNuList
>   return tNuList
> end foo3
>
>
>
>
>
>
>
>
>
>


___
use-livecode mailing list
use-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: AW: Re: Regex help needed...

2016-01-30 Thread Mark Wieder

On 01/30/2016 04:28 PM, Paul Dupuis wrote:


1) wondering if LC's hooks to whatever regex tool they are using under
the hood is a good as it should be


LC's regex library is the same PCRE library everyone else uses. And it's 
the latest released version. Regex's power lies in its ability to match 
complex patterns, which doesn't necessarily translate to speed.



AND
2) planning on rewriting my code to use chunks.


You may find that regex matching works better than LC's chunk matching 
in some situations. For speed though, it's hard to beat the built=in 
chunking functions in LC, as they're already pretty well optimized.


--
 Mark Wieder
 ahsoftw...@gmail.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


Caveat: Use Any 16x9 Stack That Makes You Happy

2016-01-30 Thread Sannyasin Brahmanathaswami
Maybe not….

@ colin:

Hmmm my strategy to work in a 16:9  1200px x 675px tall stack was working great 
…..

until using animation engine where all values get translated into rects like


 aeChangeRect the long ID of  img "HALogo", 58,32,259,233,1500, “overshoot"


and these numbers are “hard wired” into the current stack dimensions


So when I tested on my iPhone everything was too big.


one *could* I suppose. build in some pixel/ratio converter to translated every 
single rect into a native iPhone six rect…


And to make this even more exciting…. if you do use AE for iPhone 6 Plus and 
all rects are targeting those fixed dimensions (7363X414) I’m pretty sure the 
whole thing will break on an iPad..


So I may end up having to do the rect translation to device ratio function 
anyway….


What fun.

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

Re: inserting Data into CustomProp array

2016-01-30 Thread Phil Davis



On 1/30/16 9:05 AM, Mark Wieder wrote:

-- get the entire array at once
put the uEffects of image 1 into tArray


And of course what you meant to say was:

put the customProperties["uEffects"] of image 1 into tArray

:-)

--
Phil Davis


___
use-livecode mailing list
use-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: AW: Re: Regex help needed...

2016-01-30 Thread Richard Gaskin

Paul Dupuis wrote:
> Wow. I would not have expected such a significant difference. Regex
> has been around a long time and lots of smart computer science types
> has spent time coming up with ways to optimize its performance for
> pattern matching. I assumed (falsely) that regex based filters in LC
> would be on par or even superior than a custom function using chunks.
> This leads me to:
>
> 1) wondering if LC's hooks to whatever regex tool they are using under
> the hood is a good as it should be
> AND
> 2) planning on rewriting my code to use chunks.

One of the reasons for my seemingly-obsessive benchmarking is to learn 
about what goes on under the hood, and to try to anticipate it when 
choosing among different algos.


LC does such a good job of shielding us from what goes on under the hood 
that we often forget that the relationship between the number of lines 
we write and the number of machine instructions our scripts invoke may 
differ broadly depending on the statement.


My favorite example is: set the scroll of field 1 to 100 -- seems simple 
enough, but having written scrollbar management routines in C back in 
the pre-Cocoa days I learned that a *tremendous* number of low-level 
routines come into play with that one simple line of script.  LC makes 
it easy to take this stuff for granted, since it does all the heavy lifting.


Same with regex.

The beauty of regex is that it's a very generalized solution.  The 
downside of regex is that it's a very generalized solution. ;)


Generalized options can provide convenience, but often at the cost of 
performance.


Purpose-built solutions are usually much faster than generalized ones, 
and with LC's chunk expressions they're fun to write too. :)


There are times when regex will outperform chunk expressions, though, so 
I would caution against rewriting everything.  Benchmarking is the key, 
and some day I will have done enough to be able to come up with a small 
set of useful rules as to when to use chunks and when to use regex.  But 
at the moment, it's half hunch and half benchmarking to confirm the hunch.


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


Graphic effects - Feather Edges of Rects

2016-01-30 Thread Sannyasin Brahmanathaswami
Does anyone have any method to “feather” the edges of a fld, rect or grc?

Any inner glow or outer glow leaves a sharp edge on the object no matter what 
we do.

Any options there?

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

Re: Graphic effects - Feather Edges of Rects

2016-01-30 Thread Terry Judd
On 31/01/2016 1:56 pm, "use-livecode on behalf of Sannyasin
Brahmanathaswami"  wrote:

>Does anyone have any method to ³feather² the edges of a fld, rect or grc?
>
>Any inner glow or outer glow leaves a sharp edge on the object no matter
>what we do.
>
>Any options there?

Even if you use both inner and outer glow in combination with no object
boder?

>


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