use-revolution Digest, Vol 69, Issue 42

Bryan McCormick bryan at deepfoo.com
Sat Jun 27 13:16:58 EDT 2009


Completely without running anything, it would seem more efficient to 
divide one char by another. If the result is anything other than 1, it's 
different. I have no idea if these are alphas or numerics, if alpha then 
  convert using chartonum.

Also, try commenting out your status update or reduce it to some every 
nth compare. I think you might be wasting cycles needlessly by doing it 
for every iteration.

Mind you, I am fairly certain there has to be an even faster way to do 
this with array conversion. You ought to be able to convert to two 
arrays and do the differences that way.

use-revolution-request at lists.runrev.com wrote:
> Send use-revolution mailing list submissions to
> 	use-revolution at lists.runrev.com
> 
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://lists.runrev.com/mailman/listinfo/use-revolution
> or, via email, send a message with subject or body 'help' to
> 	use-revolution-request at lists.runrev.com
> 
> You can reach the person managing the list at
> 	use-revolution-owner at lists.runrev.com
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of use-revolution digest..."
> 
> 
> you can find the archives for this list at:
> 
> http://lists.runrev.com/pipermail/use-revolution/
> 
> and search them using this link:
> 
> http://www.google.com/advanced_search?q=site:lists.runrev.com
> 
> Today's Topics:
> 
>    1. Re: Unwanted characters from pasted-in text. (stephen barncard)
>    2. [OT] Shift-Lock (Richmond Mathewson)
>    3. Inefficient code (Bert Shuler)
>    4. Re: Rev 4 Preview Webinar - Video Link (Michael)
>    5. Re: Inefficient code (J. Landman Gay)
>    6. Re: Inefficient code (Mark Wieder)
>    7. Re: Rev 4 Preview Webinar - Video Link (Colin Holgate)
>    8. Re: Rev 4 Preview Webinar - Video Link (Andre Garzia)
>    9. Re: Inefficient code (Richmond Mathewson)
>   10. Re: Rev 4 Preview Webinar - Video Link (Trevor DeVore)
>   11. Re: Rev 4 Preview Webinar - Video Link (Colin Holgate)
>   12. Re: Rev 4 Preview Webinar - Video Link (Colin Holgate)
>   13. Re: Rev 4 Preview Webinar - Video Link (Richmond Mathewson)
>   14. Re: Rev 4 Preview Webinar - Video Link (Colin Holgate)
>   15. Re: Inefficient code (Richard Gaskin)
>   16. Re: Inefficient code (Mark Smith)
>   17. Re: Rev 4 Preview Webinar - Video Link (Bill Marriott)
>   18. Re: Inefficient code (Bill Marriott)
>   19. Re: [OT] Shift-Lock (Kay C Lan)
>   20. Re: [OT] Shift-Lock (Kay C Lan)
>   21. Rev cannot open my jpeg ! (Ludovic Th?bault)
>   22. Re: Rev cannot open my jpeg ! (Colin Holgate)
>   23. Re: Rev cannot open my jpeg ! (Phil Davis)
>   24. Re: Rev cannot open my jpeg ! (Ludovic Th?bault)
>   25. Re: Rev cannot open my jpeg ! (Jerry J)
>   26. Re: Rev cannot open my jpeg ! (Ludovic Th?bault)
>   27. Re: Salivating . . . (Richmond Mathewson)
>   28. Re: Inefficient code (Richmond Mathewson)
>   29. Re: Inefficient code (Richmond Mathewson)
>   30. NumberFormat with SQLite or mySQL (Josep)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Fri, 26 Jun 2009 10:14:06 -0700
> From: stephen barncard <stephenREVOLUTION2 at barncard.com>
> Subject: Re: Unwanted characters from pasted-in text.
> To: How to use Revolution <use-revolution at lists.runrev.com>
> Message-ID:
> 	<e5e009d70906261014ua5e006bl682c7afc2d51b79c at mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
> 
> Thanks Björnke!
> that indeed is the magic incantation....
> thanks again....
> -------------------------
> Stephen Barncard
> San Francisco
> http://barncard.com
> 
> 
> 2009/6/25 Björnke von Gierke <bvg at mac.com>
> 
>> I'm not sure, but those could be utf-8 chars, did you try to convert from
>> utf8?
>>
>> function revText theText
>>   return unidecode(uniencode(theText,"utf8"))
>> end revText
>>
>>
>>
> 
> 
> ------------------------------
> 
> Message: 2
> Date: Fri, 26 Jun 2009 22:35:39 +0300
> From: Richmond Mathewson <richmondmathewson at gmail.com>
> Subject: [OT] Shift-Lock
> To: How to use Revolution <use-revolution at lists.runrev.com>
> Message-ID: <4A45230B.9080005 at gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> 
> I really miss the old SHIFT-LOCK key:
> 
> http://mathewson.110mb.com/kp.html
> 
> does anybody know how to convert the Caps-Lock key
> to a Shift-Lock key?
> 
> 
> ------------------------------
> 
> Message: 3
> Date: Fri, 26 Jun 2009 14:50:50 -0500
> From: Bert Shuler <bertshuler at yahoo.com>
> Subject: Inefficient code
> To: How to use Revolution <use-revolution at lists.runrev.com>
> Message-ID: <C226BC83-61AC-4267-A24C-E32C8C7CE1F8 at yahoo.com>
> Content-Type: text/plain;	charset=US-ASCII;	format=flowed;	delsp=yes
> 
> I have written this code a few different ways. Each seems to be  
> equally inefficient. I am attempting to compare to images, pixel by  
> pixel, and record the differences.
> 
> ON mouseUp pMouseBtnNo
>      put 0 into c
>      set the startvalue of scrollbar Progress to 0
>      set the endvalue of scrollbar Progress to the length of imagedata  
> of image "Alpha"
>      put the imagedata of image "Alpha" into idataalpha
>      put the imagedata of image "Beta" into idatabeta
>      REPEAT FOR each char myChar in idataalpha
>          set the thumbposition of scrollbar Progress to c
>          IF myChar is not  char (c) of idatabeta THEN
>              put c && char (c) of idatabeta & return after hAll
>          END IF
>          put c+1 into c
>      END repeat
>      put hAll into field "diff"
> END mouseUp
> 
> It takes many minutes to process a 200x200 image. I want this code to  
> eventually compare full screen-captures, so if there is any way to  
> speed it up, I am open for advice.
> 
> Thanks
> 
> Bert
> 
> ------------------------------
> 
> Message: 4
> Date: Fri, 26 Jun 2009 13:04:05 -0700
> From: Michael <mpease at lawandpolitics.com>
> Subject: Re: Rev 4 Preview Webinar - Video Link
> To: <use-revolution at lists.runrev.com>
> Message-ID: <C66A77C5.56F4B%mpease at lawandpolitics.com>
> Content-Type: text/plain;	charset="US-ASCII"
> 
> Bill:
> 
>> Be my guest. We've already spent dozens of hours trying to work around this.
> 
> Wow. This took several minutes:
> 
>      <http://imp.on-rev.com/webinars/index.html>
> 
> Plays on iPods too. (And Zunes. And anything else that plays H.264.)
> 
>> The GoToWebinar software we use for our webinars records *only* in WMV -
> 
> So I can suggest you use something without that serious limitation?
> 
>> file size ... loss in quality
> 
> My priority would be compatibility, especially since it's a web-inar. (BTW,
> Web <> Windows.)
> 
>> Note also that you said you prefer mp4, as if this were a universal format.
> 
> It is, for all intents and purposes. It's the new MPG-1. It is not owned by
> Microsoft, and it is not owned by Apple or any other OS vendor. Lots of
> people on the web think that's important.
> 
>> But most Windows users cannot view that format, without having QuickTime or
>> other additional software installed
> 
> Software has to be "installed" to do anything on a computer. The Rev 4
> plug-in will have to be installed, for example.
> 
>> So, if you've got an idea that doesn't have these downsides, let me know.
> 
> Your own "upsides" require Mac users to install technology that has been
> officially discontinued for them by Microsoft, in addition to the problem of
> OS vendor ownership of the video format. And I thought QT, which natively
> supports but does not own mp4, was necessary for Revolution video on Windows
> anyway.
> 
> I admit I'm perhaps overly sensitive to video formats on the web, as well as
> the continuous onslaught of (clumsy and technologically inferior)
> Windows-only lock-ins masquerading as "solutions" on the internet. I do
> understand that there are trade-offs among compatibility, efficiency,
> practicality and commerce, but this particular trade-off didn't seem
> necessary to me.
> 
> Thanks,
> 
> m
> 
> 
> 
> 
> 
> ------------------------------
> 
> Message: 5
> Date: Fri, 26 Jun 2009 15:23:46 -0500
> From: "J. Landman Gay" <jacque at hyperactivesw.com>
> Subject: Re: Inefficient code
> To: How to use Revolution <use-revolution at lists.runrev.com>
> Message-ID: <4A452E52.6060302 at hyperactivesw.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> 
> Bert Shuler wrote:
>> I have written this code a few different ways. Each seems to be equally 
>> inefficient. I am attempting to compare to images, pixel by pixel, and 
>> record the differences.
>>
>> ON mouseUp pMouseBtnNo
>>     put 0 into c
>>     set the startvalue of scrollbar Progress to 0
>>     set the endvalue of scrollbar Progress to the length of imagedata of 
>> image "Alpha"
>>     put the imagedata of image "Alpha" into idataalpha
>>     put the imagedata of image "Beta" into idatabeta
>>     REPEAT FOR each char myChar in idataalpha
>>         set the thumbposition of scrollbar Progress to c
>>         IF myChar is not  char (c) of idatabeta THEN
>>             put c && char (c) of idatabeta & return after hAll
>>         END IF
>>         put c+1 into c
>>     END repeat
>>     put hAll into field "diff"
>> END mouseUp
>>
>> It takes many minutes to process a 200x200 image. I want this code to 
>> eventually compare full screen-captures, so if there is any way to speed 
>> it up, I am open for advice.
> 
> Take out the progress bar and then see how it does. Setting a progress 
> indicator on every repeat often takes longer than running the entire 
> rest of the handler.
> 
> If you do need a progress bar, only update it occasionally; for example, 
> every few hundred iterations:
> 
>    if c mod 500 = 0 then set the thumbpos of sb "progress" to c
> 



More information about the use-livecode mailing list