Retroactive background behavior

2017-03-27 Thread Jim Hurley via use-livecode
As I recall there is a method of retroactively creating a button with 
background behavior, this is appears on all existing cards.

How is my recollection?

Jim Hurley
___
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: Yertle the Turtle

2017-02-02 Thread Jim Hurley via use-livecode
I had been promoting Turtle Graphics in RR/LC for many years.

Here are 4 implementation of Turtle Graphics in LC: 
http://jamesphurley.com/Revolution.html 


Jim


> 
> Message: 19
> Date: Mon, 30 Jan 2017 22:20:10 +0200
> From: Richmond Mathewson 
> To: "u >> How to use LiveCode" 
> Subject: Yertle the Turtle
> Message-ID: 
> Content-Type: text/plain; charset=utf-8; format=flowed
> 
> Having imported an SVG image of a tortoise into a stack . . .
> 
> Being a fan of Seymour Papert . . .
> 
> I thought I'd try and implement turtle graphics in Livecode.
> 
> But came up against something awkward . . .
> 
> [As a caveat, I should like to point out I don't know how the following 
> is implemented
> in any other languages either]
> 
> 1. Rotating my turtle widget is easy.
> 
> 2. But telling the turtle to move forwards or backwards is not easy at all:
> 
> In LOGO one can tell the turtle to turn left by, say, 30 degrees, and 
> then move forward 20 units.
> 
> But in LiveCode, as far as I know, one can either move an object by 
> setting 2 coordinates,
> or by 'set the loc'.
> 
> 2.1. Now if I want my turtle, rotated at 30 degrees to move forward by 
> 20 units I will have to mess
> around with SINE and COSINE and probably not end up with the turtle 
> moving exactly 20 units at 30
> degrees from the vertical.
> 
> 2.2. I wonder how my turtle will be seen to draw a pen line from the two 
> ends of the "line".
> 
> Richmond.
> 

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


Re: Parsing a PDF file

2016-07-11 Thread Jim Hurley
Kay Lan wrote:

In this particular case I found it much easier to open the PDF file in Adobe 
Acrobat and doing a “Save as — Text (Accessible)”

Jim 
> 
> On Mon, Jul 11, 2016 at 9:36 AM, Roger Eller
> > wrote:
>> Since this seems to be Mac only, why not "do as Applescript" the select
>> all, and Copy?
>> 
> Because Preview isn't properly scriptable and you can't "Select All"
> or "Copy". As Richard said, the answer is with Automator.
> 
> If you open Automator, select a new 'application', then in the left
> hand column you'll see "PDF's", as an option. If you click on that and
> browse down the middle column you'll see 'Extract PDF Text', and if
> you click on that, in it's description you'll see that it can extract
> Plain or Rich text.
> 
> So how can we get this to work with LC?
> 
> 1) In Automator, drag the 'Extract PDF Text' action into the right
> hand workspace window.
> a) Choose the output type - most likely Plain Text
> b) Select a folder to save to - for convenience we'll use "Desktop"
> c) For the Output File Name you probably want to use a Custom Name -
> pdf2text or whatever. You do not need to specify the suffix.
> d) tick the Replace Existing files box.
> 
> 2) Back in the left hand column where you clicked on the PDFs icon,
> now click on the 'Files & Folders' icon (looks like the Finder icon).
>> From the middle column drag 'Ask for Finder Items' into the right hand
> column, place it above 'Extract PDF Text'.
> a) Set the 'Start at: to a logical location, like Downloads, if that
> is where your PDFs are likely to be located.
> b) Type: should be left at files and do NOT tick the Allow Multiple
> Selection box as these instruction are for a single file only.
> 
> 
> 3) From the middle column drag 'Open Finder Items' and place it
> 'between' the last two actions - so the order will be Ask for Finder
> Items, Open Finder Items, Extract PDF Text.
> a) Set Open with: to Preview.
> 
> 4) Optionally, if you don't always have Preview open and you don't
> want to be left with the PDF file open, in the left hand column click
> Utility, and from the middle column drag 'Quit Application' to the end
> of your workflow.
> a) set it to "Preview.app"
> 
> You can now test this by clicking the Run button in the top right
> corner. What should happen is you should get a standard Open File
> dialog box to point to a file, you then select a file and shortly
> thereafter the Automator log window at the bottom should have all
> green ticks.
> 
> You should then be able to navigate to the Desktop folder and the file
> 'pdf2text.txt' should be there.
> 
> So to complete the LC integration process. Save your Automator
> workflow, and call it something like pdf2text. For this example we'll
> also save it to Desktop.
> 
> Then in you LC script:
> 
> on mouseUp
>   set the defaultFolder to specialFolderPath("desktop")
>   launch pdf2text.app
>   --if file is large, consider a wait 1 or more here.
>   put textDecode(URL
> "file:/Users/yourname/Desktop/pdf2text.txt","utf8") into tNotPDF
>   --do what you have to after this
> 
>   --your Automator app will auto Quit once it's done it's thing so
> there is no need to balance the 'launch' command with a 'kill' command
> end mouseUp
> 
> It should be noted that Automators Extract PDF Text typically does a
> better job of text extraction than manually Select All + Copy + Paste.
> 
> Unfortunately I consider both these options about 30% or less accurate
> than using my old PPC G5 running Leopard and Devon Technologies old
> PDF2RTFService. I had not previously offered a solution to the OP
> because, get a PPC Mac, install Leopard and PDF2TEXTService is only
> really an option if you are handling many large, complex formatted
> pdfs day in, day out, as I am. Jim's problem sounds like a one off.
> 
> 
> e-livec...@lists.runrev.com 
> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> --
> 
> End of use-livecode Digest, Vol 154, Issue 21
> *

___
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: Parsing a PDF file

2016-07-10 Thread Jim Hurley
hh wrote:

> 
> [Description for MacOS, works on Win/Linux similar.]
> 
> The best results for extracting tables from PDF I had with the free "RAW"
> method:
> 
> = Open the file with Preview.
> = Select All (menu Edit). Copy.
> = Go to a LC stack with a field "INCOMING"
> = Use by a button or the message box the line
>put clipboardData["Text"] into fld "INCOMING"
> 
> If you use simply "paste" you get (probably unwanted) styles with your text.
> (If you have a lot of files: Preview is scriptable.)
> 

Thanks, that works well. 

I thought I would try to program your method  within LC:

on mouseUp
   get url 
"https://www.mynevadacounty.com/nc/elections/docs/2016%20Elections/June%207%2c%202016%2c%20Presidential%20Primary/Election%20Results/cumulativereport.pdf;
   set the clipboarddata["text"] to it
   put the clipboarddata["text"] into field 1
end mouseUp

But, no dice. I'm guessing there is something about "Copy" in Preview that is 
missing in LC.

Same applies to opening the file in Adobe and doing a "save as" and choosing 
"text (accessible)"

Be nice if LC could beef-up "get url" to do whatever it is that  Preview and 
Adobe do.

Thanks again,

Jim




___
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: Parsing a PDF file

2016-07-10 Thread Jim Hurley
Mark Wieder wrote:
> 
> On 07/09/2016 08:54 AM, Richard Gaskin wrote:
> 
>> Across the US we're beginning to see a revolution in government data
>> sharing.
> 
> 
> Except, of course, when it comes to actual data.

Hi Mark. See my reply to Richard. The actual data I wanted was how the election 
turned out. 
The essential reply was: Sorry, we have limited access to our data.

It is interesting that the County’s IT department is working overtime providing 
county parcel data, even though there has been no pressure to do so.
I think it is because there are programmers there, and they love to program. A 
trait not uncommon among us LC folks.

Jim Hurley


> 
> Many of the laws we as citizens of the US are required to follow are not 
> available for us to read without paying a fee. Cal Malamud, Public 
> Resource, et al, are working to place the legal system in the public 
> domain, but the legal establishment fights back. If you want access to 
> the proceedings of U.S. federal courts, PACER is behind a paywall.
> <https://public.resource.org/>
> 
> The state of Georgia (in the US, not the more reasonable country) makes 
> the claim of copyright in its lawsuit against publishing its laws: "Each 
> of these annotations is an original and creative work of authorship that 
> is protected by copyrights owned by the State of Georgia."
> 
> <https://boingboing.net/2015/07/24/georgia-suing-carl-malamud-ca.html>
> <https://www.techdirt.com/articles/20160702/07240834879/standards-body-whines-that-people-who-want-free-access-to-law-probably-also-want-free-sex.shtml>
> 
> 
> -- 
>  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: Parsing a PDF file

2016-07-10 Thread Jim Hurley
Richard Gaskin wrote:
> 
> Jim Hurley wrote:
> 
>> Thanks Richard.
>> 
>> You are so right about releasing data in complex formats.
>> I spoke to the election's off about posting election results in PDF
>> format.
>> I knew there was not use fighting them when they told me that it was
>> now County "policy" to post everything in PDF--not unlike those 10
>> policies of renown that were carved in stone--and a metaphor was born.
> 
> Unfortunate, as it renders the data nearly useless.  I agree you need to 
> pick your battles, but it's dismaying in an ostensible democracy when 
> the process of open data for civic-minded citizens is implemented in 
> ways that ultimately deliver the opposite of the intended goal.

Part of the problem in rural areas, such as the county I retired to, is budget.
The Board Of Supervisors is ruled by budget considerations. They see it as the 
central issue in their reelection.
They have cut back the budget for the elections office. That is not a good 
place to economize.
There have been numerous screw ups recently. I get the feeling that the staff 
lives in constant terror of messing up.
I served as the database manager for the current head of the department in his 
last election (it is an elected office—don’t ask) and I’m confident he had no 
idea what I did in that capacity. 
> 
> Across the US we're beginning to see a revolution in government data 
> sharing.  At the municipal level one of the shining examples has been 
> Raleigh, NC, in no small part due to the work of Jason Hibbets.  He 
> works as the Community Manager for Red Hat, and has devoted significant 
> volunteer time working with city officials to make data available so 
> local devs can deliver apps for the community.
> 
> Notes on his work and a link to his excellent book, "The Foundation for 
> an Open Source City" (I got a signed copy when I met him at the SoCal 
> Linux Expo a couple years ago) is here:
> http://theopensourcecity.com/
> 
> The slides from the SCaLE talk where I met him are linked to from this 
> page outlining his presentation:
> http://www.socallinuxexpo.org/scale12x/presentations/open-source-all-cities.html
> 
> 
>> In the County's old system, each of the 50 election precincts were
>> stored in 50 web pages as HTML documents.
>> That was perfect for LiveCode's "get url". It was a matter of second
>> to  visit all 50 pages, parse the text, and store the data.
> 
> So much for progress. ;)
> 
> Too often we see Cargo Cult thinking in data management, where folks 
> start using a tool or a format only because they hear about it others, 
> but since they don't actually use the system they're delivering they 
> never come to understand what's useful and what's an impedance.
> 
> 
>> (The other two text options in Adobe are "Rich Text Format" and "Text
>> (Plain)", neither of which works--only "Text (Accessible)"
> 
> What is "Text (Accessible)”?

I don’t know. It apparently is neither RTF nor “Text—plain” .

I tried to save the PDF file as “Text—plain”  and got this response:

Acrobat was unable to make this document accessible because of the 
following error:
Bad PDF; could not read page structure.  [7]
Please note that some pages of this document may have been changed. Because 
of this failure, you are advised to not save these changes.

In the “Text (Accessible)” format there seems to be an implied criticism of the 
 “Text—plain” format. Text (Accessible) really is accessible, the others, not 
so much.
Apparently you can save it as plain text, its just not accessible. I love tech 
jargon. 

> 
>> I was unaware of Apple's Automator. I'll look into it--but it is
>> unnecessary for this project.
> 
> Warning:  Automator is a lot of fun, and may be addictive.  Be careful 
> playing with it, since you may find yourself experimenting with all 
> sorts of things and before you know it your Saturday is completely gone. :)

Fair warning. Thanks.
Jim Hurley


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


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

Re: Parsing a PDF file

2016-07-09 Thread Jim Hurley
Thanks Richard. 

You are so right about releasing data in complex formats.
I spoke to the election's off about posting election results in PDF format.
I knew there was not use fighting them when they told me that it was now County 
"policy" to post everything in PDF--not unlike those 10 policies of renown that 
were carved in stone--and a metaphor was born.

In the County's old system, each of the 50 election precincts were stored in 50 
web pages as HTML documents.
That was perfect for LiveCode's "get url". It was a matter of second to  visit 
all 50 pages, parse the text, and store the data.

Thankfully this new PDF web page has all the data for all 50 precincts on the 
one page.
If I save the page to a pdf file, open than file in Adobe Acrobat, and save it 
as "Text (Accessible)" , as you suggested, I get a readable text file for LC to 
work its magic on.

(The other two text options in Adobe are "Rich Text Format" and "Text (Plain)", 
neither of which works--only "Text (Accessible)"

I was unaware of Apple's Automator. I'll look into it--but it is unnecessary 
for this project.

Thanks again,

Jim Hurley


> Message: 9
> Date: Fri, 8 Jul 2016 08:44:50 -0700
> From: Richard Gaskin <ambassa...@fourthworld.com>
> To: use-livecode@lists.runrev.com
> Subject: Re: Parsing a PDF file
> Message-ID: <577fca72.2040...@fourthworld.com>
> Content-Type: text/plain; charset=utf-8; format=flowed
> 
> Jim Hurley wrote:
> 
>> My County is now publishing the election results to the web as a PDF
>> file:
>> 
>> 
> https://www.mynevadacounty.com/nc/elections/docs/2016%20Elections/June%207%2c%202016%2c%20Presidential%20Primary/Election%20Results/precinctreport.pdf
>> 
>> Is there a way to parse these PDF  files?
> 
> It's unfortunate that so many orgs release data useful to analysis in 
> complex formats that inhibit such use.  PDF is great when the goal is to 
> preserve page layout, but a uniquely poor choice for sharing data to be 
> used for analytics.  Alas, that hasn't slowed its unfortunate use in 
> such contexts.
> 
> If this is to be done within an application for others to use, perhaps 
> the smoothest user experience would be via the XPDF external, currently 
> available only in LiveCode Business Edition at $1999/yr.  While that may 
> seem high, for commercial products of such scope it may be a good bargain.
> 
> However, if this is only for use in tools you'll be using yourself, 
> where an extra step or two is less important, there are many options.
> 
> If it's just one file, perhaps the simplest is to use Save As Text from 
> Adobe's PDF Viewer.
> 
> If you'll need to automate this for reuse, here's a way to use Apple's 
> Automator for that:
> <https://www.engadget.com/2013/02/11/mac-101-use-automater-to-extract-text-from-pdfs/>
> 
> I believe there may also be a command line option available on macOS, 
> which could be called from within LC using the shell function.  I don't 
> know the name of the command line tool for that on macOS, but in Linux I 
> use pdftotext, where the syntax is pretty simple:
> 
>   pdftotext  
> 
> e.g.:
> 
>   put "/Users/me/folder/SomeFile.pdf" into tSrc
>   put "/Users/me/folder/SomeFile.txt" into tDest
>   get shell("pdftotext "& tSrc && tDest)
> 
> -- 
>  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


Parsing a PDF file

2016-07-08 Thread Jim Hurley
My County is now publishing the election results to the web as a PDF file: 


https://www.mynevadacounty.com/nc/elections/docs/2016%20Elections/June%207%2c%202016%2c%20Presidential%20Primary/Election%20Results/precinctreport.pdf

Is there a way to parse these PDF  files? 

Thanks, Jim
___
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: Get url "file:///..."

2016-06-21 Thread Jim Hurley
Hi Klaus,

Yes, that works well. Thank you.
But it gives me the html source code.
I can live with that, but lots of parsing to get the text
You seem to suggest I can get the "text" or (?) or html "source" 
hh's script (below) does that but it is very unstable, crashing frequently

Jim


Klaus wrote:
> Hi Jim,
> 
> not sure I understand the problem, but this should give you the TEXT/source 
> of that file:
> ...
> put url "file:/Users/jimhurley/Library/Mail 
> Downloads/elec_web/precincts/241.htm" into tSource
> ...



put url "file:/Users/jimhurley/Library/Mail 
Downloads/elec_web/precincts/241.htm" into msg box
On Jun 21, 2016, at  3:00 AM, use-livecode-requ...@lists.runrev.com wrote:

> Send use-livecode mailing list submissions to
>   use-livecode@lists.runrev.com
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>   http://lists.runrev.com/mailman/listinfo/use-livecode
> or, via email, send a message with subject or body 'help' to
>   use-livecode-requ...@lists.runrev.com
> 
> You can reach the person managing the list at
>   use-livecode-ow...@lists.runrev.com
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of use-livecode digest..."
> 
> 
> you can find the archives for this list at:
> 
> http://lists.runrev.com/pipermail/use-livecode/
> 
> and search them using this link:
> 
> http://www.google.com/advanced_search?q=site:lists.runrev.com
> 
> 
> Message: 1
> Date: Mon, 20 Jun 2016 22:06:41 -0700 (PDT)
> From: "[-hh]" 
> To: use-revolut...@lists.runrev.com
> Subject: Re: Get url "file:///..."
> Message-ID: <1466485601879-4706007.p...@n4.nabble.com>
> Content-Type: text/plain; charset=us-ascii
> 
> Assuming you are on a Mac: 
> The following should work from 10.4 to 10.12 with LC 5/6/7/8.
> 
> on mouseUp
>  put "/Users/jimhurley/Library/Mail%20Downloads/elec_web/precincts/241.htm"
> into f
>  put "source" into sOrT --> one of "source", "text", "URL"
>  do iScript(f, sOrT) as applescript
>  put the result into fld 1
> end mouseUp
> 
> Using above "text" instead of "source" may save you some work.
> (The LC interpretation as htmltext does the same but somehow 'uncomplete').
> 
> function iScript f,x
>  put numToChar(34) into q
>  return "tell application " &  q&"Safari"  & \
>"  open POSIX file " &  q(f)  & \
>"  set rslt to " & x & " of document 1" & \
>"end tell"
> end iScript
> 
> 
> 
> 
> --
> View this message in context: 
> http://runtime-revolution.278305.n4.nabble.com/Get-url-file-tp4705988p4706007.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


Re: Get url "file:///..."

2016-06-21 Thread Jim Hurley
Thank you so much. So useful!

Understatement of the year: "Using above "text" instead of "source" may save 
you some work."

It saves a mountain of parsing.

Shouldn't this be a part of LiveCode?

Jim Hurley

> Message: 1
> Date: Mon, 20 Jun 2016 22:06:41 -0700 (PDT)
> From: "[-hh]" <h...@hh.on-rev.com>
> To: use-revolut...@lists.runrev.com
> Subject: Re: Get url "file:///..."
> Message-ID: <1466485601879-4706007.p...@n4.nabble.com>
> Content-Type: text/plain; charset=us-ascii
> 
> Assuming you are on a Mac: 
> The following should work from 10.4 to 10.12 with LC 5/6/7/8.
> 
> on mouseUp
>  put "/Users/jimhurley/Library/Mail%20Downloads/elec_web/precincts/241.htm" 
> into f
>  put "source" into sOrT --> one of "source", "text", "URL"
>  do iScript(f, sOrT) as applescript
>  put the result into fld 1
> end mouseUp
> 
> Using above "text" instead of "source" may save you some work.
> (The LC interpretation as htmltext does the same but somehow 'uncomplete').
> 
> function iScript f,x
>  put numToChar(34) into q
>  return "tell application " &  q&"Safari"  & \
>"  open POSIX file " &  q(f)  & \
>"  set rslt to " & x & " of document 1" & \
>"end tell"
> end iScript
> 
> 
> 
> 
> --
> View this message in context: 
> http://runtime-revolution.278305.n4.nabble.com/Get-url-file-tp4705988p4706007.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


Re: Get url "file:///..."

2016-06-20 Thread Jim Hurley
Thanks for all the suggestions. So far no luck with any.

No combination of back slashes work, and urlDecode() simply returns the file 
name.

Sarfari opens the file with no difficulty.

Apparently Sarfari does something that LiveCode's  "get Url" doesn't.

Jim

> Dar Scott wrote:
> 
> Yeah, checking 'the result' sounds like a good idea.  
> 
> I don't have a problem with ///, though, on my macOS (as we say instead of OS 
> X these days).  Maybe that part depends on the OS.  
> 
> I have a feeling that we might be missing the core of the problem.  
> 

> On Jun 20, 2016, at 6:39 PM, Mike Bonner  wrote:
> 
> Ah. A combination of both.  get url urldecode(" file:/Users/jimhurley/
> Library/Mail%20Downloads/elec_web/precincts/241.htm")  Still need to get
> rid of the extra //.  If you check the result on fail it'll probably say
> "can't open file". You'll need to urldecode to set the folder too if you
> decide to go that way.
> 
> On Mon, Jun 20, 2016 at 6:23 PM, Dar Scott  wrote:
> 
>> urlDecode() ?
>> 
>>> On Jun 20, 2016, at 5:54 PM, Jim Hurley 
>> wrote:
>>> 
>>> I got this web page address from the county election's office:
>>> 
>>> 
>> file:///Users/jimhurley/Library/Mail%20Downloads/elec_web/precincts/241.htm
>>> 
>>> It opens when I paste  it into the address field in Safari.
>>> 
>>> But
>>> 
>>>  get url
>> "file:///Users/jimhurley/Library/Mail%20Downloads/elec_web/precincts/241.htm"
>>> 
>>> in Live Code leaves "it" empty.
>>> 
>>> I need to get the source code (programmatically) so that I may parse
>> "it" for voter results.
>>> 
>>> Is there something I can do to the address that would make it acceptable
>> to LiveCode's: get url
>>> 
>>> Jim
>>> 
>>> 
>>> 
>>> ___
>>> use-livecode mailing list
>>> use-livecode at 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


Get url "file:///..."

2016-06-20 Thread Jim Hurley
I got this web page address from the county election's office:

   file:///Users/jimhurley/Library/Mail%20Downloads/elec_web/precincts/241.htm

It opens when I paste  it into the address field in Safari.

But 

   get url 
"file:///Users/jimhurley/Library/Mail%20Downloads/elec_web/precincts/241.htm"

in Live Code leaves "it" empty.

I need to get the source code (programmatically) so that I may parse "it" for 
voter results.

Is there something I can do to the address that would make it acceptable to 
LiveCode's: get url 

Jim 



___
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 Future of LiveCode in Education

2016-02-29 Thread Jim Hurley
As programmers, most of us on this list think mainly of programming as a tool 
for solving problems. 
Of course, that’s how it was born. The original use of the computer was to 
solve hard science problems.  It was assumed that a couple dozen around the 
world would be sufficient.

But, besides learning how to become programmers there is another important use, 
particularly in education, and that is computer programming as a tooI for 
exploring.   

If you’re talking about early education, consideration should be given to 
Turtle Graphics. Yes, that again.
Seymour Papert, a protege of Piaget, founded the  MIT Media Lab. The lab was 
responsible for implementing  LOGO (based on Lisp) and Tuttle Graphics designed 
for young children. As many of you know, I have long been an advocate of 
implementing TG in LC. It is a powerful tool for learning and exploring.

Here, for example, is a book written by two MIT Math professors: Turtle 
Geometry, The Computer as  Medium for Exploring Mathematics. MIT press, 1979. 
(The last chapter  is titled: Curved Space and General Relativity.)

Here are the chapter titles of a book I wrote some years back designed to allow 
students to explore the world of physics: Logo Physics, Holt, Rinehart and 
Winston, 1985

Chapter 1   Vectors
Chapter 2   Equilibrium of forces
Chapter 3   Free fall
Chapter 4   Projectile motion and the CRT
Chapter 5   Projectile motion II
Chapter 6   The monkey, the hunter, and Einstein’s principle of equivalence
Chapter 7   Escape velocity
Chapter 8   Planetary Motion
Chapter 9   The music of the spheres
Chapter 10  Voyager II and lunar orbits
Chapter 11  Jets, rockets, and conservation of momentum
Chapter 12  The harmonic oscillator, clocks, rabbits, and foxes 
(predator-prey simulation)
Chapter 13  The big bang
Chapter 14  Radioactive decay
Chapter 15  Bridges, catenaries, and the perfect arch
Chapter 16  Fishes and optics
Cheater 17  Rainbows

If If we're talking about the “The Future of LiveCode in Education” we 
ought to consider programming as a tool for exploration. 
Jim

___
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: Area of Irregular Polygon

2015-11-15 Thread Jim Hurley
Hi Roger,

Actually, the answer to that question I raised follows in the next paragraph. 
All those terms cancel in pairs.

As someone pointed out, that paragraph is a proof of the validity of the method 
for calculating the area of a polygon.

You’re probably right about the minus sign.

Jim

> 
> Message: 23
> Date: Sat, 14 Nov 2015 18:37:13 -0800
> From: Roger Guay <i...@mac.com>
> To: How to use LiveCode <use-livecode@lists.runrev.com>
> Subject: Re: Area of Irregular Polygon
> Message-ID: <868cedf8-5e56-46dc-b88c-bb6a68cd4...@mac.com>
> Content-Type: text/plain; charset=utf-8
> 
> Jim,
> 
> I'm just now trying to catch up on this discussion and I see that no one has 
> answered your question. I can?t answer either and wonder what?s going on???
> 
> BTW, I believe you should have a negative sign in front of the square bracket 
> . . .  not that that helps at all!
> 
> Cheers,
> 
> Roger
> 
> 
> 
> 
>> On Nov 11, 2015, at 2:35 PM, Jim Hurley <jhurley0...@sbcglobal.net> wrote:
>> 
>> Very interesting discussion. 
>> 
>> However, I was puzzled by the following term in the sum used to calculate 
>> the area of a polygon--labeled the centroid method.
>> 
>> x(i)*y(i+1) - x(i+1)y(i)   
>> 
>> Where does this come from? If one were using the traditional method of 
>> calculating the area under a curve (perhaps a polygon) the i'th  term in the 
>> sum would be:
>> 
>> [x(i+1) - x(i)] * [y(i+1) + y(i)] / 2
>> 
>> That is, the base times the average height. This was the original method 
>> employed by many--the non-centroid method
>> 
>> Multiplying this out you get:
>> 
>> x(i)*y(i+1) - x(i+1)y(i) +  [x(i+1)* y(i+1) - x(i)* y(i)]
>> 
>> So THE SAME EXPRESSION as in the centroid method EXCEPT for the added term 
>> in square brackets. So, WHY THE  DIFFERENCE?
>> 
>> In calculating this sum all of the intermediate terms in the sum cancel out, 
>> leaving just the end terms:  x(n)y(n) - x(1)* y(1)
>> But if the figure is closed, they too cancel each other. 
>> For example:  (x3 * y3 - x2*y2) + (x4*y4 - x3*y3)... Notice that the x3 * y3 
>> terms cancel.
>> 
>> Curiously, if one were attempting to calculate the area under a curve 
>> (non-polygon) using this method, the principle contribution could come from 
>> just these end point terms. As an extreme example, if the curve began at the 
>> origin (x(0) = y(0) = 0),. there would be a substantial contribution from 
>> the end point x(n) * y(n), where n is the last point. If it were a straight 
>> line, ALL the contribution would come from the end point: x(n) y(n) . 
>> Divided  by 2 of course.
>> 
>> Jim
>> 
>> P.S. the centroid of a closed curve might be liken eo the center of gravity 
>> in physics.
>> Two closed curves could have the same centroid but very different areas 
>> (masses) 
>> The center of mass bears no relation to the mass, and the centroid of a 
>> closed curved bears no relation to the area.
>> ___
>> 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: Area of Irregular Polygon

2015-11-11 Thread Jim Hurley
Very interesting discussion. 

However, I was puzzled by the following term in the sum used to calculate the 
area of a polygon--labeled the centroid method.

x(i)*y(i+1) - x(i+1)y(i)   

Where does this come from? If one were using the traditional method of 
calculating the area under a curve (perhaps a polygon) the i'th  term in the 
sum would be:

[x(i+1) - x(i)] * [y(i+1) + y(i)] / 2

That is, the base times the average height. This was the original method 
employed by many--the non-centroid method

Multiplying this out you get:

x(i)*y(i+1) - x(i+1)y(i) +  [x(i+1)* y(i+1) - x(i)* y(i)]

So THE SAME EXPRESSION as in the centroid method EXCEPT for the added term in 
square brackets. So, WHY THE  DIFFERENCE?

In calculating this sum all of the intermediate terms in the sum cancel out, 
leaving just the end terms:  x(n)y(n) - x(1)* y(1)
But if the figure is closed, they too cancel each other. 
For example:  (x3 * y3 - x2*y2) + (x4*y4 - x3*y3)... Notice that the x3 * y3 
terms cancel.

Curiously, if one were attempting to calculate the area under a curve 
(non-polygon) using this method, the principle contribution could come from 
just these end point terms. As an extreme example, if the curve began at the 
origin (x(0) = y(0) = 0),. there would be a substantial contribution from the 
end point x(n) * y(n), where n is the last point. If it were a straight line, 
ALL the contribution would come from the end point: x(n) y(n) . Divided  by 2 
of course.

Jim

P.S. the centroid of a closed curve might be liken eo the center of gravity in 
physics.
Two closed curves could have the same centroid but very different areas 
(masses) 
The center of mass bears no relation to the mass, and the centroid of a closed 
curved bears no relation to the area.
___
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


Primitive menu

2015-06-01 Thread Jim Hurley
I have a no frills Livecode stack I wish to save as a Stand Alone, but without 
a Livecode menu bar.

When I do this (on my Mac) I get an Apple Menu headed by the stack name, 
followed by items: About..., Services, Hide [stack name], Hide others, Show 
All, Quit [stack name]

Which is perfect, except I would like to put something into Apple’s  “About…”  
menu item.

Is that possible?

Thanks,

Jim
___
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: use-livecode Digest, Vol 141, Issue 2

2015-06-01 Thread Jim Hurley
I’m trying to sent a LC stand alone app to a friend.
But I when I send it to myself as a test, I get a message: Can’t be opened 
because it is from an unidentified developer.”

Is there a work-around?

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

Mailing stand alone apps.

2015-06-01 Thread Jim Hurley
Oops, on the Subject of the previous message.

I’m trying to email a LC stand alone app to a friend.
But I when I send it to myself as a test, I get a message: Can’t be opened 
because it is from an unidentified developer.”

Is there a work-around? 

Jim
___
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: Automated Drawing

2015-05-09 Thread Jim Hurley
 
 Message: 8
 Date: Sat, 09 May 2015 19:59:15 +0300
 From: Richmond richmondmathew...@gmail.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: Automated Drawing
 Message-ID: 554e3ce3.2030...@gmail.com
 Content-Type: text/plain; charset=utf-8; format=flowed
 
 On 09/05/15 16:52, Richmond wrote:
 On 21/03/15 18:17, Jim Hurley wrote:
 Richmond,
 
 I wrote this Turtle Graphics library in the dark ages of RR, before 
 ?sum? became a reserved word.
 
 So, comment out the ?sum? handler in the stack script.
 
 Jim
 
 
 Having copied your stack script across into my stack I am stuck with 2 
 problems:
 
 1. How to make the line to show as 'pd' [penDown] doesn't seem to work.
 
 2. How to exchange your graphic turtleGraphic for an img.
 
 In all other respects the thing is super!
 
 Richmond.
 
 Actually my big problem at the moment is, with this script:
 
 on right dangl
   rt dangl
 end right
 
 on rt dangl
   subtract dangl from angl
   drawTurtle
 end rt
 
 on drawTurtle
   myWait waitTime
   if noDraw then exit drawturtle
   put 5 into distance
   put round(x0 +x)comma round(-y+y0)  return into gPoints
   put distance * cos(radPerDeg * angl) into dx
   put dx into fld dx
   put distance * sin(radPerDeg * angl) into dy
   put dy into fld dy
   put round(x+x0+dx)commaround(-y+y0-dy) after gPoints
   set points of graphic turtleGraphic to gPoints
   set the angle of img turt to ((the angle of img turt) - angl)
 end drawTurtle
 
 with the graphic turtleGraphic and the img turt initially pointing 
 in the same direction,
 why they don't go on pointing in the same direction everytime I send 
 right 45 via the message box?
 
 Richmond.
 *


Hi Richmond,
  
I suspect the problem your are having is that the turtle has to initiated 
before he will respond.

Try this script in a button as see if it draw a line, shows the arrow pointing 
in the direction of the next move and then repeats.
The result  should be a square 100 units on a side.

on mouseUp
   startTurtle
   showturtle
   repeat 4 times
  fd 100
  lt 90
  wait 50  ticks
   end repeat
   choose the browse tool
end mouseUp

Jim


___
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: Automated Drawing

2015-05-09 Thread Jim Hurley
P.S.

I should have said that startTurtle (or simply st) is the command that 
initiates the turtle.

Jim


 Message: 8
 Date: Sat, 09 May 2015 19:59:15 +0300
 From: Richmond richmondmathew...@gmail.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: Automated Drawing
 Message-ID: 554e3ce3.2030...@gmail.com
 Content-Type: text/plain; charset=utf-8; format=flowed
 
 On 09/05/15 16:52, Richmond wrote:
 On 21/03/15 18:17, Jim Hurley wrote:
 Richmond,
 
 I wrote this Turtle Graphics library in the dark ages of RR, before 
 ?sum? became a reserved word.
 
 So, comment out the ?sum? handler in the stack script.
 
 Jim
 
 
 Having copied your stack script across into my stack I am stuck with 2 
 problems:
 
 1. How to make the line to show as 'pd' [penDown] doesn't seem to work.
 
 2. How to exchange your graphic turtleGraphic for an img.
 
 In all other respects the thing is super!
 
 Richmond.
 
 Actually my big problem at the moment is, with this script:
 
 on right dangl
  rt dangl
 end right
 
 on rt dangl
  subtract dangl from angl
  drawTurtle
 end rt
 
 on drawTurtle
  myWait waitTime
  if noDraw then exit drawturtle
  put 5 into distance
  put round(x0 +x)comma round(-y+y0)  return into gPoints
  put distance * cos(radPerDeg * angl) into dx
  put dx into fld dx
  put distance * sin(radPerDeg * angl) into dy
  put dy into fld dy
  put round(x+x0+dx)commaround(-y+y0-dy) after gPoints
  set points of graphic turtleGraphic to gPoints
  set the angle of img turt to ((the angle of img turt) - angl)
 end drawTurtle
 
 with the graphic turtleGraphic and the img turt initially pointing 
 in the same direction,
 why they don't go on pointing in the same direction everytime I send 
 right 45 via the message box?
 
 Richmond.
 *


Hi Richmond,

I suspect the problem your are having is that the turtle has to initiated 
before he will respond.

Try this script in a button as see if it draw a line, shows the arrow pointing 
in the direction of the next move and then repeats.
The result  should be a square 100 units on a side.

on mouseUp
  startTurtle
  showturtle
  repeat 4 times
 fd 100
 lt 90
 wait 50  ticks
  end repeat
  choose the browse tool
end mouseUp

Jim


___
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: Automated Drawing

2015-03-21 Thread Jim Hurley
Richmond,

I wrote this Turtle Graphics library in the dark ages of RR, before “sum” 
became a reserved word.

So, comment out the “sum” handler in the stack script.

Jim
 Automated Drawing
 
 Richmond richmondmathewson at gmail.com  
 mailto:use-livecode%40lists.runrev.com?Subject=Re%3A%20Automated%20DrawingIn-Reply-To=%3C550D8A50.20300%40gmail.com%3E
 Sat Mar 21 16:12:16 CET 2015
 
 Previous message: Automated Drawing 
 http://lists.runrev.com/pipermail/use-livecode/2015-March/212900.html
 Next message: Automated Drawing 
 http://lists.runrev.com/pipermail/use-livecode/2015-March/212902.html
 Messages sorted by: [ date ] 
 http://lists.runrev.com/pipermail/use-livecode/2015-March/date.html#212901 
 [ thread ] 
 http://lists.runrev.com/pipermail/use-livecode/2015-March/thread.html#212901
  [ subject ] 
 http://lists.runrev.com/pipermail/use-livecode/2015-March/subject.html#212901
  [ author ] 
 http://lists.runrev.com/pipermail/use-livecode/2015-March/author.html#212901
 On 21/03/15 17:09, Richmond wrote:
  On 21/03/15 13:57, Jim Hurley wrote:
  Message: 21
  Date: Sat, 21 Mar 2015 09:02:23 +0200
  From: Richmond richmondmathewson at gmail.com 
  http://lists.runrev.com/mailman/listinfo/use-livecode 
  mailto:richmondmathewson at gmail.com 
  http://lists.runrev.com/mailman/listinfo/use-livecode
  To: How to use LiveCode use-livecode at lists.runrev.com 
  http://lists.runrev.com/mailman/listinfo/use-livecode 
  mailto:use-livecode at lists.runrev.com 
  http://lists.runrev.com/mailman/listinfo/use-livecode
  Subject: Automated Drawing
  Message-ID: 550D177F.10609 at gmail.com 
  http://lists.runrev.com/mailman/listinfo/use-livecode 
  mailto:550D177F.10609 at gmail.com 
  http://lists.runrev.com/mailman/listinfo/use-livecode
  Content-Type: text/plain; charset=utf-8; format=flowed
 
  I set up a little stack with THIS in a button:
 
  on mouseUp
 choose pencil tool
 drag from 100,100 to 200,200
  end mouseUp
 
  and it drew me a jolly diagonal line . . . super!
 
  HOWEVER
 
  I wonder if it is possible to do something like THIS:
 
  drag for 100 pixels at 60 degrees
 
  probably not, BUT ??
 
  Richmond.
 
 
  Of course:
 
  on mouseUp
  startTurtle
  setHeading 60
  forward 100
  end mouseUp
 
 
 
  You have in a matter of seconds made me feel totally stupid as my 
  whole question is geared
  towards an interface I am designing to control a USB-tethered turtle.
 
  Thank you for the great help.
 
  Richmond.
 
 Possibly NOT as stupid as all that:
 
 button Button: execution error at line 2 (Handler: can't find 
 handler) near startTurtle, char 1
 
 Richmond.

You need the Turtle Graphics library: http://jamesphurley.com/Revolution.html 
http://jamesphurley.com/Revolution.html

Jim

Previous message: Automated Drawing 
http://lists.runrev.com/pipermail/use-livecode/2015-March/212900.html
Next message: Automated Drawing 
http://lists.runrev.com/pipermail/use-livecode/2015-March/212902.html
Messages sorted by: [ date ] 
http://lists.runrev.com/pipermail/use-livecode/2015-March/date.html#212901 [ 
thread ] 
http://lists.runrev.com/pipermail/use-livecode/2015-March/thread.html#212901 
[ subject ] 
http://lists.runrev.com/pipermail/use-livecode/2015-March/subject.html#212901 
[ author ] 
http://lists.runrev.com/pipermail/use-livecode/2015-March/author.html#212901
More information about the use-livecode mailing list 
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: Automated Drawing

2015-03-21 Thread Jim Hurley

 Automated Drawing
 
 Richmond richmondmathewson at gmail.com  
 mailto:use-livecode%40lists.runrev.com?Subject=Re%3A%20Automated%20DrawingIn-Reply-To=%3C550D8A50.20300%40gmail.com%3E
 Sat Mar 21 16:12:16 CET 2015
 
 Previous message: Automated Drawing 
 http://lists.runrev.com/pipermail/use-livecode/2015-March/212900.html
 Next message: Automated Drawing 
 http://lists.runrev.com/pipermail/use-livecode/2015-March/212902.html
 Messages sorted by: [ date ] 
 http://lists.runrev.com/pipermail/use-livecode/2015-March/date.html#212901 
 [ thread ] 
 http://lists.runrev.com/pipermail/use-livecode/2015-March/thread.html#212901
  [ subject ] 
 http://lists.runrev.com/pipermail/use-livecode/2015-March/subject.html#212901
  [ author ] 
 http://lists.runrev.com/pipermail/use-livecode/2015-March/author.html#212901
 On 21/03/15 17:09, Richmond wrote:
  On 21/03/15 13:57, Jim Hurley wrote:
  Message: 21
  Date: Sat, 21 Mar 2015 09:02:23 +0200
  From: Richmond richmondmathewson at gmail.com 
  http://lists.runrev.com/mailman/listinfo/use-livecode 
  mailto:richmondmathewson at gmail.com 
  http://lists.runrev.com/mailman/listinfo/use-livecode
  To: How to use LiveCode use-livecode at lists.runrev.com 
  http://lists.runrev.com/mailman/listinfo/use-livecode 
  mailto:use-livecode at lists.runrev.com 
  http://lists.runrev.com/mailman/listinfo/use-livecode
  Subject: Automated Drawing
  Message-ID: 550D177F.10609 at gmail.com 
  http://lists.runrev.com/mailman/listinfo/use-livecode 
  mailto:550D177F.10609 at gmail.com 
  http://lists.runrev.com/mailman/listinfo/use-livecode
  Content-Type: text/plain; charset=utf-8; format=flowed
 
  I set up a little stack with THIS in a button:
 
  on mouseUp
 choose pencil tool
 drag from 100,100 to 200,200
  end mouseUp
 
  and it drew me a jolly diagonal line . . . super!
 
  HOWEVER
 
  I wonder if it is possible to do something like THIS:
 
  drag for 100 pixels at 60 degrees
 
  probably not, BUT ??
 
  Richmond.
 
 
  Of course:
 
  on mouseUp
  startTurtle
  setHeading 60
  forward 100
  end mouseUp
 
 
 
  You have in a matter of seconds made me feel totally stupid as my 
  whole question is geared
  towards an interface I am designing to control a USB-tethered turtle.
 
  Thank you for the great help.
 
  Richmond.
 
 Possibly NOT as stupid as all that:
 
 button Button: execution error at line 2 (Handler: can't find 
 handler) near startTurtle, char 1
 
 Richmond.

You need the Turtle Graphics library: http://jamesphurley.com/Revolution.html

Jim



Previous message: Automated Drawing 
http://lists.runrev.com/pipermail/use-livecode/2015-March/212900.html
Next message: Automated Drawing 
http://lists.runrev.com/pipermail/use-livecode/2015-March/212902.html
Messages sorted by: [ date ] 
http://lists.runrev.com/pipermail/use-livecode/2015-March/date.html#212901 [ 
thread ] 
http://lists.runrev.com/pipermail/use-livecode/2015-March/thread.html#212901 
[ subject ] 
http://lists.runrev.com/pipermail/use-livecode/2015-March/subject.html#212901 
[ author ] 
http://lists.runrev.com/pipermail/use-livecode/2015-March/author.html#212901
More information about the use-livecode mailing list 
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: Automated Drawing

2015-03-21 Thread Jim Hurley
 
 Message: 21
 Date: Sat, 21 Mar 2015 09:02:23 +0200
 From: Richmond richmondmathew...@gmail.com 
 mailto:richmondmathew...@gmail.com
 To: How to use LiveCode use-livecode@lists.runrev.com 
 mailto:use-livecode@lists.runrev.com
 Subject: Automated Drawing
 Message-ID: 550d177f.10...@gmail.com mailto:550d177f.10...@gmail.com
 Content-Type: text/plain; charset=utf-8; format=flowed
 
 I set up a little stack with THIS in a button:
 
 on mouseUp
   choose pencil tool
   drag from 100,100 to 200,200
 end mouseUp
 
 and it drew me a jolly diagonal line . . . super!
 
 HOWEVER
 
 I wonder if it is possible to do something like THIS:
 
 drag for 100 pixels at 60 degrees
 
 probably not, BUT ??
 
 Richmond.
 


Of course:

on mouseUp
   startTurtle
   setHeading 60
   forward 100
end mouseUp



___
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: Automated Drawing

2015-03-21 Thread Jim Hurley
 
 Message: 14
 Date: Sat, 21 Mar 2015 20:13:37 +0200
 From: Richmond richmondmathew...@gmail.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: Automated Drawing
 Message-ID: 550db4d1.4050...@gmail.com
 Content-Type: text/plain; charset=utf-8; format=flowed
 
 On 21/03/15 17:35, Jim Hurley wrote:
 Automated Drawing
 
 Richmond richmondmathewson at gmail.com  
 mailto:use-livecode%40lists.runrev.com?Subject=Re%3A%20Automated%20DrawingIn-Reply-To=%3C550D8A50.20300%40gmail.com%3E
 Sat Mar 21 16:12:16 CET 2015
 
 Previous message: Automated Drawing 
 http://lists.runrev.com/pipermail/use-livecode/2015-March/212900.html
 Next message: Automated Drawing 
 http://lists.runrev.com/pipermail/use-livecode/2015-March/212902.html
 Messages sorted by: [ date ] 
 http://lists.runrev.com/pipermail/use-livecode/2015-March/date.html#212901
  [ thread ] 
 http://lists.runrev.com/pipermail/use-livecode/2015-March/thread.html#212901
  [ subject ] 
 http://lists.runrev.com/pipermail/use-livecode/2015-March/subject.html#212901
  [ author ] 
 http://lists.runrev.com/pipermail/use-livecode/2015-March/author.html#212901
 On 21/03/15 17:09, Richmond wrote:
 On 21/03/15 13:57, Jim Hurley wrote:
 Message: 21
 Date: Sat, 21 Mar 2015 09:02:23 +0200
 From: Richmond richmondmathewson at gmail.com 
 http://lists.runrev.com/mailman/listinfo/use-livecode
 mailto:richmondmathewson at gmail.com 
 http://lists.runrev.com/mailman/listinfo/use-livecode
 To: How to use LiveCode use-livecode at lists.runrev.com 
 http://lists.runrev.com/mailman/listinfo/use-livecode
 mailto:use-livecode at lists.runrev.com 
 http://lists.runrev.com/mailman/listinfo/use-livecode
 Subject: Automated Drawing
 Message-ID: 550D177F.10609 at gmail.com 
 http://lists.runrev.com/mailman/listinfo/use-livecode
 mailto:550D177F.10609 at gmail.com 
 http://lists.runrev.com/mailman/listinfo/use-livecode
 Content-Type: text/plain; charset=utf-8; format=flowed
 
 I set up a little stack with THIS in a button:
 
 on mouseUp
choose pencil tool
drag from 100,100 to 200,200
 end mouseUp
 
 and it drew me a jolly diagonal line . . . super!
 
 HOWEVER
 
 I wonder if it is possible to do something like THIS:
 
 drag for 100 pixels at 60 degrees
 
 probably not, BUT ??
 
 Richmond.
 
 Of course:
 
 on mouseUp
 startTurtle
 setHeading 60
 forward 100
 end mouseUp
 
 
 You have in a matter of seconds made me feel totally stupid as my
 whole question is geared
 towards an interface I am designing to control a USB-tethered turtle.
 
 Thank you for the great help.
 
 Richmond.
 Possibly NOT as stupid as all that:
 
 button Button: execution error at line 2 (Handler: can't find
 handler) near startTurtle, char 1
 
 Richmond.
 You need the Turtle Graphics library: http://jamesphurley.com/Revolution.html
 
 Jim
 
 
 
 
 Ah, Thank you very much.
 
 AND, should I decided to roll your library into a standalone what do I 
 have to do re attribution,
 licensing, and so on?
 
 Richmond.
 


No need. Enjoy.

Jim
___
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: Can I produce a Google map showing SEVERAL address?

2014-11-11 Thread Jim Hurley
Thanks Rick.

Do you find one that you could launch from within LiveCode? 
I would like to incorporate the search in a LiveCode app.

Jim

 From: Rick Harrison harri...@all-auctions.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: Can I produce a Google map showing SEVERAL address?
 Message-ID: 48fe7ced-95bc-49dd-bb72-8ca1859cf...@all-auctions.com
 Content-Type: text/plain; charset=utf-8
 
 Hi Jim,
 
 If it doesn?t have to be google, there are several other websites
 which will do this for you.
 
 I had to do a map of all the members of an organization
 a few years ago.  I just fed the addresses of all of the members
 to the website, and I was able to visually see where they were
 from mostly.  It helped us to choose a new meeting location which
 was still close for most of them.
 
 A quick internet search should provide you with lots of possibilities.
 
 Good luck!
 
 Rick
 
 
 On Nov 10, 2014, at 9:00 PM, Jim Hurley jhurley0...@sbcglobal.net wrote:
 
 The following gets me a Google map of a single address:
 
 on mouseUP
  put http://maps.google.com/maps?client=safarirls=enq=; into tPrefix 
 --Mac only ?
  put 15281 Kimberly Ct, Nevada City, ca, 95959 into tAddress
  replace space with + in tAddress
  replace comma with + in tAddress
  put tPrefix  tAddress into temp
  launch url temp
 end mouseUP
 
 The site is marked on the map with an inverted teardrop.
 
 Is it possible to get a map showing the location of more than one address at 
 a time?
 
 Thanks,
 
 Jim Hurley
 ___
 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


Can I produce a Google map showing SEVERAL address?

2014-11-10 Thread Jim Hurley
The following gets me a Google map of a single address:

on mouseUP
   put http://maps.google.com/maps?client=safarirls=enq=; into tPrefix --Mac 
only ?
   put 15281 Kimberly Ct, Nevada City, ca, 95959 into tAddress
   replace space with + in tAddress
   replace comma with + in tAddress
   put tPrefix  tAddress into temp
   launch url temp
end mouseUP

The site is marked on the map with an inverted teardrop.

Is it possible to get a map showing the location of more than one address at a 
time?

Thanks,

Jim Hurley
___
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: Opening a stack stored in dropbox's public fold

2014-11-05 Thread Jim Hurley
This is all very strange. Pity. So nice to have this community resource as a 
ready means of exchanging stacks directly, without the intermediary of 
revOnline Browser.

Do we have any idea where the source of the problems lies?
Is it with Dropbox or LiveCode or Apple? 

Why would it work for some and not others? Does this suggest an Apple problem; 
problem with Windows or Mac, or with OS in either?
Why would it work in a button, but not in the msg box? Does this suggest a 
LiveCode issue, and not an OS issue?

Thanks to all who helped.

Jim




 
 Message: 25
 Date: Tue, 4 Nov 2014 23:16:52 +
 From: Bob Sneidar bobsnei...@iotecdigital.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: Opening a stack stored in dropbox's public fold
 Message-ID: 070ca27f-b944-4065-90cd-11975b1fb...@iotecdigital.com
 Content-Type: text/plain; charset=utf-8
 
 Ya works for me in a button. Just not in the message box. Dunno why. 
 
 Bob S
 
 
 On Nov 4, 2014, at 08:19 , Thierry Douez th.do...@gmail.com wrote:
 
 Hi,
 
 Copy/paste in script editor doesn't work,
 but retyping the url make this works in a button script:
 
 on mouseUp
  get URL 
 https://dl.dropboxusercontent.com/u/47044230/CryptDivisionNew.livecode;
  -- https://dl.dropboxusercontent.com/u/47044230/CryptDivisionNew.livecode?
  go IT
 end mouseUp
 
 
 Thierry
 
 2014-11-04 16:46 GMT+01:00 Jim Hurley jhurley0...@sbcglobal.net:
 Hi Gerry,
 
 You say your link doesn?t work on your Mac.
 
 My link works on my Mac.
 
 But does my link work on your Mac?
 Does this open a stack when run in your msg box?
 
 go url 
 https://dl.dropboxusercontent.com/u/47044230/CryptDivisionNew.livecode?
 
 Jim
 
 
 
 Thierry Douez - http://sunny-tdz.com
 Maker of sunnYperl - sunnYmidi - sunnYmage
 
 ___
 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: Opening a stack stored in dropbox's public fold

2014-11-04 Thread Jim Hurley
Hi Gerry,

You say your link doesn’t work on your Mac.

My link works on my Mac.

But does my link work on your Mac?
Does this open a stack when run in your msg box?

  go url 
https://dl.dropboxusercontent.com/u/47044230/CryptDivisionNew.livecode”

Jim

 Message: 21
 Date: Tue, 04 Nov 2014 09:56:03 +
 From: Gerry gerry.or...@gmail.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: Opening a stack stored in dropbox's public fold
 Message-ID:
   caaxhhfef6ebswu-sk7z6kp1vnojtley+feqi9mxjrfz50d3...@mail.gmail.com
 Content-Type: text/plain; charset=ISO-8859-1
 
 My link is new, my Mac is running Yosemite. Still doesn't work.
 
 g
 
 
 On Tue Nov 04 2014 at 1:40:34 AM Jim Hurley jhurley0...@sbcglobal.net
 wrote:
 
 Thanks Jacque. No it is a fresh link.
 
 But new information. It (go url Dropbox link) works on my MacBookAir,
 running 10.9.5 and all versions of RR, but not on my desktop running 10.6.8
 (I need Rosetta) or any version of RR.
 
 Is Dropbox Mac-version dependent?
 
 
 


___
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: Opening a stack stored in dropbox's public fold

2014-11-03 Thread Jim Hurley
Thanks Jacque. No it is a fresh link.

But new information. It (go url Dropbox link) works on my MacBookAir, running 
10.9.5 and all versions of RR, but not on my desktop running 10.6.8 (I need 
Rosetta) or any version of RR.

Is Dropbox Mac-version dependent?

Jim

 
 Message: 5
 Date: Mon, 03 Nov 2014 00:11:59 -0600
 From: J. Landman Gay jac...@hyperactivesw.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: Opening a stack stored in dropbox's public folder
 Message-ID: dad9cdc1-8338-4824-9397-f05fe4978...@hyperactivesw.com
 Content-Type: text/plain; charset=UTF-8
 
 Are you using an old link? I had a similar failure recently and found out 
 that Dropbox had changed the link.  I coded in the new one and it worked 
 again.  It was a little disconcerting that they'd do that.  
 
 On November 2, 2014 5:01:42 PM CST, Jim Hurley jhurley0...@sbcglobal.net 
 wrote:
 There was a time when this worked, but not now.
 
 I put 
 
  go url  https://dl.dropboxusercontent.com/ etc. 
 
 And I get no such card
 
 If I put the Dropbox's public link into the address line of Safari I
 get a list of the scripts, so I know the link is OK, 
 Doesn't this work any more in RR?
 
 Jim


___
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: (Arbitrarily) Long-Division Script

2014-11-03 Thread Jim Hurley
Hi Igor,

Some years ago, 2002 to be exact, I built a stack that emulated a puzzle I 
enjoyed.
The puzzle was to decipher a long division problem where all the numbers had 
been replace by coded letters.
My algorithm is cumbersome--I needed dividends and divisors that yielded all 10 
digits in the long division display. And getting all letter to line up properly 
was tricky.)

But it suggests that it is possible to emulate the long division algorithm in 
LC. 

Here is that stack. Just run this in the msg box. (This works on my MacBookAir 
but not on my desktop running an older version of OS X. See my reply to Jacque.)

   go url 
https://dl.dropboxusercontent.com/u/47044230/CryptDivisionNew.livecode;

That stack displays the long division solution to the problem of dividing a 
random 7 digit dividend by a random 4 digit divisor--provide the display 
includes all 10 digits. (Some of these problems are stinkers.) 

Good luck,

Jim

 
 Message: 15
 Date: Fri, 31 Oct 2014 11:51:13 +1100
 From: Igor de Oliveira Couto i...@semperuna.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: (Arbitrarily) Long-Division Script
 Message-ID: 3f774ea0-2add-48b1-a5af-6d3d57bbb...@semperuna.com
 Content-Type: text/plain; charset=utf-8
 
 Hi all,
 
 I wanted to develop a library to allow me to perform basic maths (add, 
 subtract, multiply, divide) with arbitrarily long numbers in LiveCode. My 
 requirements are simple: 
 
 - integers and floating-point numbers must be supported as all operands in 
 all operations, to an arbitrarily large number of decimal cases
 
 - speed is NOT an issue: performances can safely be relatively slow, as it is 
 unlikely that it?ll need to perform hundreds of thousands of operations per 
 second
 
 - accuracy IS an issue: needless to say, all operations must provide 
 *accurate* and *reliable* results, regardless of how many decimal cases are 
 used
 
 It proved relatively easy to do the addition, multiplication and subtraction 
 operations in LiveCode. I followed the ?pen-and-paper? algorithm, and it all 
 seems to be working really well - I?m happy to provide anybody with a copy of 
 the scripts off-list, if you wish (just send me an email directly). I?m 
 stuck, however, trying to implement DIVISION. There does not seem to be an 
 ?easy? pen-and-paper algorithm that would support arbitrarily large numbers 
 with unknown number of decimal cases. 
 
 Most long-division algorithm seems to expect that the number being divided 
 can be of an arbitrarily length, but they expect that the divisor (the number 
 we are dividing BY) is going to be low enough, so that the person making the 
 division will ?know? instinctively how many times it would ?fit? into the 
 number being divided. These algorithms are not recommended once we start 
 dealing with divisor of 3 digits or more. There does not seem to be an 
 algorithm that would allow us to procede ?digit-by-digit? with the division, 
 as can be done with addition/subtraction/multiplication? Or is there?
 
 Searching Google and Wikipedia has yielded articles about using bitwise 
 operations, or complex mathematical theory, both of which are beyond me. Is 
 there a Math Wiz in this list, who could give us a layman?s explantion of an 
 algorithm that could be used? Any help would be much appreciated!
 
 Kindest regards to all,
 
 --
 Igor Couto
 Sydney, Australia


___
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


Opening a stack stored in dropbox's public folder

2014-11-02 Thread Jim Hurley
There was a time when this worked, but not now.

I put 

   go url  https://dl.dropboxusercontent.com/ etc. 

And I get no such card

If I put the Dropbox's public link into the address line of Safari I get a list 
of the scripts, so I know the link is OK, 
Doesn't this work any more in RR?

Jim




___
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: Getting a list of object properties

2014-10-10 Thread Jim Hurley
Message: 1
 Date: Thu, 9 Oct 2014 13:23:09 -0700
 From: Peter Haworth p...@lcsql.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: Getting a list of object properties
 Message-ID:
   CAGDT7eO+uQWL3+AvOz=N=CMsykF1WMz7=qjocdk6jvsefdu...@mail.gmail.com
 Content-Type: text/plain; charset=UTF-8
 
 On Thu, Oct 9, 2014 at 1:09 PM, William Prothero proth...@earthednet.org
 wrote:
 
 If I do:
 put the properties of scrollbar ?axisEntry
 I don?t get anything in the message box. LC7.0 rC2, Mavericks.
 

And then there is Richard’s Plugin “4Wprops” which is more complete than “the 
properties”
For example it lists the Height and Width 

And Renaldi’s (spelling?) plugin “SmartPropties” that allows one to compare the 
properties of two objects.
This can be very useful.
There’s a bug, but it works anyhow. 

Jacque, 
I’m missing something in your explanation of how to use the dictionary.
___
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: Getting a list of object properties

2014-10-10 Thread Jim Hurley
 
 Message: 10
 Date: Fri, 10 Oct 2014 12:19:01 -0500
 From: J. Landman Gay jac...@hyperactivesw.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: Getting a list of object properties
 Message-ID: 54381505.1020...@hyperactivesw.com
 Content-Type: text/plain; charset=windows-1252; format=flowed
 
 On 10/10/2014, 7:02 AM, Jim Hurley wrote:
 Jacque,
 I?m missing something in your explanation of how to use the dictionary.
 
 I'm not sure what part isn't clear?
 
 -- 
 Jacqueline Landman Gay | jac...@hyperactivesw.com
 HyperActive Software   | http://www.hyperactivesw.com
 
 

Hi Jacque,

I found the problem. I had something left over from a previous search in the 
dictionary--upper right hand corner of the Dictionary window.

That puts all keywords connected with that search into the window below and so 
blocks out the properties list you spoke of.

Jim



___
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


M

2014-08-13 Thread Jim Hurley


___
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: Opening stack from Dropbox--Now Fun with ellipses

2014-07-14 Thread Jim Hurley
Hi Scott,

Wonderful! Thanks. You are a fountain of knowledge.
I wonder why Dropbox differentiates stacks in this way.

But it certainly makes for a convenient way to share Livecode stacks.

I thought of Dropbox when the issue of drawing ellipses arose recently. (Thanks 
for straightening me out on the reason, Jacque.)

I scanned my files looking for ellipses and came across a stack I had forgotten 
about--and I still have no recollection of why I did it. The ravages of age.
At this point  I guess it could be classified as Fun With Ellipses. No a lot of 
fun, just a little. You have to have fun in the math.

Run this in your message box.

   go url https://dl.dropbox.com/s/b6ytkgvdsqs55ec/EllipseInAbox.livecode; 

Jim

 
 Message: 17
 Date: Sun, 13 Jul 2014 13:00:03 -0700
 From: Scott Rossi sc...@tactilemedia.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: OT: Opening stack from Dropbox
 Message-ID: 9ca5f8c5-389b-4c47-9bbb-23493e700...@tactilemedia.com
 Content-Type: text/plain; charset=us-ascii
 
 Try replacing the www of the shared link with dl.
 
 Regards,
 
 Scott Rossi
 Creative Director
 Tactile Media, UX Design
 
 On Jul 13, 2014, at 12:32 PM, Jim Hurley jhurley0...@sbcglobal.net wrote:
 
 Is it possible to do this in the message box:
 
 go url xxx
 
 where xxx is the shared link created in Dropbox using a control click  on 
 the file.
 
 And then have the stack open in Livecode?
 
 I continually get the message: No such card
 
 Thanks,
 
 Jim


___
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


OT: Opening stack from Dropbox

2014-07-13 Thread Jim Hurley
Is it possible to do this in the message box:

  go url xxx

where xxx is the shared link created in Dropbox using a control click  on the 
file.

And then have the stack open in Livecode?

I continually get the message: No such card

Thanks,

Jim



___
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: Conflicting paths

2014-07-12 Thread Jim Hurley
Hi Richard,

I think I'm missing something.

Why construct the circle  (or ellipse) by setting points of a  graphic when the 
graphic oval tool produces a much better result?

No matter how many points I use when I set the points of a graphic, I still get 
jaggies.

P.S.

I tried to include a sample stack from Dropbox but I keep getting No such card

I tried in the msg box:

go  url https://www.dropbox.com/s/pq4lrjftumx4mym/EllipseInAbox.rev;

And I get no such card

I used to be able to do this--like so many other things.

Jim

 
 --
 
 Message: 4
 Date: Fri, 11 Jul 2014 09:07:30 -0700
 From: Richard Gaskin ambassa...@fourthworld.com
 To: use-livecode@lists.runrev.com
 Subject: Re: Conflicting paths
 Message-ID: 53c00bc2.1000...@fourthworld.com
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 
 Mark Wieder wrote:
 
 Jacque-
 
 Thursday, July 10, 2014, 5:10:40 PM, you wrote:
 
 Mark Wieder recently added points to the standard graphic objects. But
 until that gets into the engine, I can't think of an easy way to create
 them.
 
 That should be in the next release of LC 6.7. Ovals aren't included
 yet because I hadn't figured out how to deal with them at that point.
 If my latest pull request can get accepted before the next release
 then you'll be able to use the effective points of ovals as well.
 
 A circle is defined as an infinite number of points a given distance 
 from a given point.
 
 Of course you won't be returning an infinite number of points, but even 
 every pixel might be a bit much for some needs.
 
 How will you determine the level of granularity to use in returning 
 those points?
 
 Could it be adjustable by the user?
 
 --
  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/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-livecode


Re: Dragging an object

2014-07-10 Thread Jim Hurley
 
 Message: 19
 Date: Thu, 10 Jul 2014 17:24:16 -0700
 From: Peter Bogdanoff bogdan...@me.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Dragging an object
 Message-ID: 14789523-9af4-4531-83cf-ff60644d1...@me.com
 Content-Type: text/plain; charset=windows-1252
 
 Hi,
 
 I want to drag an object around (a group), restricting its Y coordinate (set 
 to be a property, ?yLocation). I?m using this script inside the object:
 
 on mouseMove
   if the mouse is down then
  set the loc of me to (item 1 of the mouseLoc,the yLocation of me)
   end if
 end mouseMove
 
 However, after moving it sideways, when I click on it again to move it, every 
 time it jumps back so that its X coordinate is zero relative to the mouseLoc.
 
 This behavior would be fine for a button, but I?m dragging a 3000-pixel-wide 
 group.
 
 How can I drag it by clicking on one side of this group?
 
 I tried using the grab command, but I couldn?t seem to be able to restrict 
 the Y coordinate with that.
 
 Peter
 UCLA

Hi Peter,

Greetings from UCD (retired).

The mouseMove needs to recognize the initial separation between the mouse at 
mouseDown the x loc of the object being moved at mouseDown. I call that 
distance dx. 
The following will move the button along the initial y coordinate of the button 
and the x loc of the mouse plus the initial separation dx  

local y0 ,myName, dx

on mouseDown
  put the short name of me into myName
  put the loc of me into p0
  put item 2 of p0  into y0
  put the mouseloc into p1
  put item 1 of p1 into x1
  put  item 1 of p0 into x0
  put x0 - x1 into  dx --The distance between the button loc and the mouse loc
end mouseDown

on mouseMove x,y
   if myName is not empty then
  set the loc of me to x+ dx,y0
   end if
end mouseMove

on mouseUp
  put empty into myName
end mouseUp

on mouseEnter
   put  into myname
end mouseEnter


___
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


Reading, Writing, Arithmetic, and Lately, Coding

2014-05-12 Thread Jim Hurley
There was an article in this Sunday's NYT that should be of interest to RunRev.

It describes how coding is taking its place beside reading 'riting and 
'ritmatic in early education.
Here is the link to the article:


http://www.nytimes.com/2014/05/11/us/reading-writing-arithmetic-and-lately-coding.html?emc=edit_th_20140511nl=todaysheadlinesnlid=65530924_r=0

There was a move in this direction some years back, around 1984, promoting 
coding in LOGO, a product that originated out of the MIT Media Lab.

LOGO was a stepchild of LISP, (list processing), a language used primarily in 
AI, but adapted to moving sprites around the screen by MIT, and then 
implemented by Apple, IBM, among others.

The language was called Turtle Graphics from the Turtle Sprite that may be 
directed using such commands as FORWARD, BACK, RIGHT 45, LEFT 90, SETHEADING, 
TOWARD etc.  As many of you know, I have been advocating that it be implemented 
in LiveCode for some years. I have four flavors of TG implemented in LC, see: 
   
   http://jamesphurley.on-rev.com/Revolution.html

But it needs to become a formal part of LC.

From the NYT article:

The lessons do not involve traditional computer language. Rather, they use 
simple word commands — like “move forward” or “turn right” — that children can 
click on and move around to, say, direct an Angry Bird to capture a pig.

The use of these word-command blocks to simplify coding logic stems largely 
from the work of the Massachusetts Institute of Technology Media Lab, which 
introduced a visual programming language called Scratch in 2007. It claims a 
following of millions of users, but mostly outside the schools.

MIT has simplified LOGO to eliminate command-line coding to allow students to 
sequence blocks of code (MOVE, TURN RIGHT 90 DEGREES, etc) to accomplish 
some task. This block programming, using essentially TG, is called Scratch. 
See:

http://en.wikipedia.org/wiki/Scratch_(programming_language)

http://scratch.mit.edu/

High school students would be more comfortable with a command line environment.

Implementing some version of a turtle-like programming language in LC would be 
helpful in getting into this burgeoning education market. Programable graphics 
is not only a seductive way to engage k-12 students, it is actually quite 
useful to students of science: plotting trajectory motion, planetary orbits, 
Voyager II, statics (bridges, catenaries, arches) optics, predator prey 
dynamics, etc.,  Text manipulation would follow.


___
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: New chunks

2014-03-16 Thread Jim Hurley
Sorry Peter and Stephen,

That should have been:

open stack  url 
“https://dl.dropboxusercontent.com/u/47044230/FindSentences2.livecode;

Jim

 Message: 6
 Date: Sat, 15 Mar 2014 22:19:20 -0400
 From: Peter M. Brigham pmb...@gmail.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: New chunks
 Message-ID: 5865b76a-362c-44a2-97e6-1bf49181a...@gmail.com
 Content-Type: text/plain; charset=windows-1252
 
 On Mar 15, 2014, at 7:05 PM, Jim Hurley wrote:
 
 The following app allows one to put any text into a field and search for any 
 or all words (whole words of patricidal)  in a sentence or paragraph in 
 whatever order, even MS Word with all their curly quotes and apostrophes 
 etc. It handles decimal numberers and also check for 70 of the most common 
 abbreviations. But still I am looking forward to LC implementation of these 
 new word and sentence chunks. No telling how many special cases I have 
 missed.
 
 In the msg. box:
 
 go url 
 ?https://dl.dropboxusercontent.com/u/47044230/Find%20sentences2.livecode?
 
 I get script compile error: Expression bad factor in the message box, and 
 when I click on the link itself I get a 404 in the browser.
 
 -- Peter
 
 Peter M. Brigham
 pmb...@gmail.com
 http://home.comcast.net/~pmbrig
 
 
 
 
 --
 
 Message: 7
 Date: Sat, 15 Mar 2014 19:47:24 -0700
 From: stephen barncard stephenrevoluti...@barncard.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: New chunks
 Message-ID:
   CAFmQfHKX9jo3=kgysnyymorseeyojfq8hl5khnxvc5j6bhu...@mail.gmail.com
 Content-Type: text/plain; charset=UTF-8
 
 On Sat, Mar 15, 2014 at 7:19 PM, Peter M. Brigham pmb...@gmail.com wrote:
 
 I get script compile error: Expression bad factor in the message box,
 and when I click on the link itself I get a 404 in the browser.
 
 
 yeah something odd about the URL here too.
 
 *--*
 *Stephen Barncard - San Francisco Ca. USA - Deeds Not Words*
 


___
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: New chunks

2014-03-16 Thread Jim Hurley
Hi Pete,

I’ve never gotten into SQL. Will it search for any or all words in any order in 
a sentence?

Jim


 Message: 5
 Date: Sat, 15 Mar 2014 17:02:20 -0700
 From: Peter Haworth p...@lcsql.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: New chunks
 Message-ID:
   cagdt7ep0pdwcchnhoxcfpxdjgpy4yxq9pnmf0brw73je4vc...@mail.gmail.com
 Content-Type: text/plain; charset=ISO-8859-1
 
 Hi Jim,
 Have you ever tried the sqlite fts virtual table?  It's specifically
 designed for text searching and is lightening fast.  Certainly an extra
 step load stuff into a sneak but might be worth a look.
 
 Pete
 lcSQL Software
 On Mar 15, 2014 4:25 PM, Jim Hurley jhurley0...@sbcglobal.net wrote:

___
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: New chunks

2014-03-15 Thread Jim Hurley
 
 Message: 3
 Date: Sat, 15 Mar 2014 11:30:06 -0400
 From: Peter M. Brigham pmb...@gmail.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: New chunks
 Message-ID: d04520e3-36df-4bf6-9ced-72b363e19...@gmail.com
 Content-Type: text/plain; charset=windows-1252
 
 On Mar 13, 2014, at 11:51 AM, Jim Hurley wrote:
 
 I have a poor man?s version that is workable.
 
 However just ran across a sentence in today?s NYT that I will have to 
 include:
 
  (?What they?re offering people is a full stomach and an empty soul.?)
 
 I had dealt with the quote beyond the period and the paren beyond the 
 period, but not both.
 
 Here's a simple function I've been using. The new LC grammar revisions will 
 make it obsolete eventually.
 
 function naturalWord tWord
  -- strips punctuation from HC-style words fore and aft
  -- to return something closer to what is normally understood as a word
  put abcdefghijklmnopqrstuvwxyz1234567890 into tAlphabet
  -- numerals included to cope with numbers and things like HTML5
  repeat while char 1 of tWord is not in tAlphabet
 delete char 1 of tWord
  end repeat
  repeat while char -1 of tWord is not in tAlphabet
 delete char -1 of tWord
  end repeat
  return tWord
 end naturalWord
 
 It's simple, and therefore somewhat simple-minded -- it will miss some cases, 
 but I've found it useful.
 
 Every complicated problem has a simple, easy, obvious, wrong answer.
   -- H. L. Mencken
 
 -- Peter
 
 Peter M. Brigham
 pmb...@gmail.com
 http://home.comcast.net/~pmbrig

Hi Peter,

Always good to hear from you. I like your approach, but as you say, it  sill 
miss some cases, for example: “Don’t’ tell Ms. Fitz-Williams that pi is equal 
to 3.15”

I have built an app I find very useful. I do a lot of writing and I often want 
to go back to search through a manuscripts for sentences or paragraphs contain 
a certain combination of words, in whatever order. 

The following app allows one to put any text into a field and search for any or 
all words (whole words of patricidal)  in a sentence or paragraph in whatever 
order, even MS Word with all their curly quotes and apostrophes etc. It handles 
decimal numberers and also check for 70 of the most common abbreviations. But 
still I am looking forward to LC implementation of these new word and sentence 
chunks. No telling how many special cases I have missed.

In the msg. box:

  go url 
“https://dl.dropboxusercontent.com/u/47044230/Find%20sentences2.livecode”

Warm regards,

Jim



___
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: New chunks

2014-03-15 Thread Jim Hurley
Just thought of a situation I didn’t deal with. The apostrophe is tricky.

In doing a word search, you would want to kept the apostrophe in the word 
“don’t” but probably not in  “Howard’s best friend is his dog.” “Howard’s” 
should appear in the found sentence but not in the word search, i.e. If you 
searched for sentences in which “Howard”  appeared, you would want to find 
“Howard’s best….” 

 
___
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: New chunks

2014-03-13 Thread Jim Hurley
Thanks Fraser. I’m looking forward to it.

I have a poor man’s version that is workable.

However just ran across a sentence in today’s NYT that I will have to include:

(“What they’re offering people is a full stomach and an empty soul.”)

I had dealt with the quote beyond the period and the paren beyond the period, 
but not both.

I find it quite useful in look ups. I can look find all sentences in a book 
length ms. in which any number of words occur, regardless of the order.

The ICU library will be a welcome addition.

Jim

 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: New chunks
 Message-ID: a9cfc885-71fb-4f78-b7df-df5954511...@runrev.com
 Content-Type: text/plain; charset=us-ascii
 
 
 On 13 Mar 2014, at 04:48, Jim Hurley jhurley0...@sbcglobal.net wrote:
 
 So I really can't see the purpose of RR's sentence chunk. I wish they 
 would explain.
 
 
 We'd be using ICU's sentence breaking code. They include a whole bunch of 
 language-related knowledge with the library and can use that to tell the 
 difference between decimal points, full stops, abbreviations, etc. You're 
 right about it not being perfect but it does seem pretty reliable.
 
 Regards,
 Fraser
 
 
 
 
 --
 
 Subject: Digest Footer
 
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 http://lists.runrev.com/mailman/listinfo/use-livecode
 
 --
 
 End of use-livecode Digest, Vol 126, Issue 20
 *


___
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: New chunks

2014-03-12 Thread Jim Hurley
Hi Bob,

I have an app that I use for manuscript analysis and have done some of this 
prep.

For example to deal with decimal points, since the digit following the decimal 
point is always a number (0123456789):

 repeat with i = 0 to 9
  replace .  i with \  i in tText
   end repeat

So that 3.14 becomes 3\14 and 2.3456 becomes 2\3456

But that's only the beginning.  There are a massive number of abbreviations: 
Mr. Smith, etc. Jan. , A.D., Dr.  

I have a list of about 70.

But then there are names: P. G. Wodehouse and on and on.

I find my script useful for my own needs, but I don't see any commercial 
application. Just too many unexpected places where a period will show up.

So I really can't see the purpose of RR's sentence chunk. I wish they would 
explain.

Jim

 
 Message: 25
 Date: Wed, 12 Mar 2014 23:58:46 +
 From: Bob Sneidar bobsnei...@iotecdigital.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: New chunks
 Message-ID: e3ab1833-c8fc-47f0-af8e-358e6ec80...@iotecdigital.com
 Content-Type: text/plain; charset=Windows-1252
 
 Pretty sure Livecode is going to do a simple delimiter on period. You would 
 have to prep the data first by replacing periods in any word that is a number 
 with a placeholder, processing your sentences, then restoring the 
 placeholders (if you need to). 
 
 You could get fancy by setting the lineDelimiter to space, then finding every 
 line that ends in a period and processing everything in-between. It?s 
 doubtful a number would end in a period without it being the end of a 
 sentence. 
 
 Bob
 
 
 On Mar 11, 2014, at 15:34 , Jim Hurley jhurley0...@sbcglobal.net wrote:
 
 Can someone explain how the ?sentence chunk would work?
 How are decimal points, and points in an abbreviation distinguished from the 
 ?period? that deliniates the end of a ?sentence??
 Does it presume that the exitsing text has special embedded ?periods??
 
 I?ve written my own, but it is very cumbersome and not flawless. I use it to 
 do manuscript analysis.
 Like: Find all sentences in which ?time? and ?party? occur anywhere in the 
 same sentence.
 
 My ignorance on unicode is profound.
 Jim
 For some reason data
 in certain rows didn't 'register' correctly and so WHERE clauses based on
 those rows didn't work. A bug report was issued and the problem solved.
 
 Currently the WHERE clauses in SQLite + LC 6.6.1 (6.6 rc1) seem to be
 working for me, but I haven't really stress tested it.
 
 Try creating a brand new db and see if you can get WHERE clauses to work.
 If so, what about dumping your data, build a new db and see if that works?
 
 
 --
 
 Subject: Digest Footer
 
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 http://lists.runrev.com/mailman/listinfo/use-livecode
 
 --
 
 End of use-livecode Digest, Vol 126, Issue 19
 *


___
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: New chunks

2014-03-11 Thread Jim Hurley
Can someone explain how the “sentence chunk would work?
How are decimal points, and points in an abbreviation distinguished from the 
“period” that deliniates the end of a “sentence?”
Does it presume that the exitsing text has special embedded “periods?”

I’ve written my own, but it is very cumbersome and not flawless. I use it to do 
manuscript analysis.
Like: Find all sentences in which “time” and “party” occur anywhere in the same 
sentence.

My ignorance on unicode is profound.
Jim

C
 Message: 15
 Date: Tue, 11 Mar 2014 18:15:18 +
 From: Benjamin Beaumont b...@runrev.com
 To: LiveCode Developer List livecode-...@lists.runrev.com,  How to
   use LiveCode use-livecode@lists.runrev.com
 Subject: New chunks
 Message-ID:
   CADd0_Txbhdem4PbKXifXUsujqPLs9HROME6vKhF=sk1znp2...@mail.gmail.com
 Content-Type: text/plain; charset=ISO-8859-1
 
 Hi All,
 
 We're in the process of adding some new chunk types in LiveCode 7 and we
 would appreciate suggestions for a particular chunk name.
 
 The new chunk types are:
 
 naturalword (breaks on unicode word boundaries)
 sentence (breaks on unicode sentence boundaries)
 paragraph (Same behaviour as current 'line' chunk)
 
 The first chunk is called 'naturalword' because 'word' is already in use.
 Renaming the current 'word' chunk to 'token' to free up 'word' is not an
 option for backward compatibility. We are also limited by the current
 parser which doesn't allow us to use the form:
 
 put natural word 1 of this is a string of words
 
 'naturalword' is the clearest internal suggestion at the moment and we'd
 love to get the input from community members if there is an even clearer
 option.
 
 Warm regards and thank you for your input.
 
 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


Re: Wolfram language

2014-02-27 Thread Jim Hurley
 
 Message: 3
 Date: Wed, 26 Feb 2014 09:35:12 -0800
 From: Richard Gaskin ambassa...@fourthworld.com
 To: use-livecode@lists.runrev.com
 Subject: Re: Wolfram language
 Message-ID: 530e25d0.5030...@fourthworld.com
 Content-Type: text/plain; charset=windows-1252; format=flowed
 
 Jim Hurley wrote:
 
 And, Richard, as a petty aside, that formula and graph in the forum you cite 
 don?t ?compute.?
 
 Not petty at all.  It's just one more reason we love having you in this 
 community:  you help keep our math straight.
 
 
 But there is another significant difference between LC and what one might 
 achieve in the new
 Wolfram-enabled LC.  One cannot plot a truly smooth curve in LC. The curve 
 is always a set
 of line segments joining a set of discrete points. It is similar to the 
 difference between
 bit map and vector graphics.
 
 Hopefully that can change now that LiveCode uses the Skia library for 
 its graphics primitives.  If memory serves Skia supports Beziers - could 
 those be used for what you're looking for?

Richard,

Thank you. I'm afraid I really haven't been keeping up. Could you, or any one, 
provide me with an example that shows how to use the Skia library?

Here is an example that illustrates what I mean when I say that LC cannot plot 
a smooth curve. 
It will *plot* a circle and also place a circle of equal size next it using 
LC's graphic tools.
They are close, but the plot shows the pixillation no matter how many points 
one choose for the plot.

Just put this into a button script.

on mouseUp
   if there is no grc circle then create grc Circle
   set the style of grc circle to polygon
   
   set the points of grc circle to 
   put 200 into R  
   put R+10 into  x0   
   put the height of this card /  2 into y0
   
   answer By what fraction of a degree between steps would you choose? with 
1 or 2  or 3 or 4
   put it into tFraction
   
  --Draw the circle
  repeat with Ang = 0 to 360*tFraction
  put R* cos(ang*PI/180/tFraction) into x
  put R * sin(Ang*PI/180/tFraction) into y
  put Round(x0 + x), Round(y0+y)  cr after tPoints
   end repeat
   set the points of grc Circle to tPoints
   
--Show the oval
   if there is not grc oval then 
  create grc oval
  set the style of grc oval to oval
  set the width of grc oval to 2*R
  set the height of grc oval to 2*R
  set the loc of grc Oval to x0 +2* R + 10, y0
   end if
end mouseUp

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


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


Re: Wolfram language

2014-02-26 Thread Jim Hurley
 
 Message: 29
 Date: Tue, 25 Feb 2014 20:22:48 -0800
 From: Richard Gaskin ambassa...@fourthworld.com
 To: use-livecode@lists.runrev.com
 Subject: Re: Wolfram language
 Message-ID: 530d6c18.3080...@fourthworld.com
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 
 Did you see what [-hh] cooked up in the forums?
 http://forums.runrev.com/viewtopic.php?f=76t=19132

Richard et. al.

Adding Mathematica and/or Wolfram to LC would be a sea chance. 
Mathematica is already causing  profound changes in educating theoretical 
physicists. I remember countless hours  solving differential equation, complex 
integrals, differential geometry and the whole arena of analytical mathematics. 
Trouble is I loved it, and I would have missed it. I loved every bit of 
mathematics, the same way so many of you love programing.

It is difficult to know what to include in the curriculum now. It’s not the 
same as adding hand held calculators to students of arithmetic. Should we teach 
students how to take square roots. I certainly can’t remember how. Should we 
teach them how so solve differential equations?

It is surely true that providing these preprogramed solutions in Mathematica 
makes it possible to expand one’s imagination to whole new areas that were 
previously inaccessible. And that is a profound change. But there is always the 
nagging feeling that without the underlying capability to do the math, you will 
eventually run into a problem that Wolfram hasn’t though of.

And, Richard, as a petty aside, that formula and graph in the forum you cite 
don’t “compute.” 
The formula is  y = 3* sin(x+pi*J) where J runs from 0 to 4 and x from -3 to +3.
But adding 2* pi, or 4*pi is the same as 0*pi. In the same way 1*pi and 3*pi 
give the same results. So there are really only 2 distinct curves, not the 5 
shown.
But I’m sure the author was plotting a different formula than the one shown.

And, by the way, that same problem is easy dealt with in, you guessed it, 
Turtle Graphics:

on mouseUp
  put 40 into scale
  startTurtle
  clean
  repeat with J = 0 to 4
 put -3 into x
 pen up
 setXY x*scale, scale * 3* sin(x+pi*J)
 penDown
 repeat until x 3
setXY x*scale, Scale * 3* sin(x+pi*J)
add .1 to x
 end repeat
  end repeat
  choose the browse tool
end mouseUp

But there is another significant difference between LC and what one might 
achieve in the new Wolfram-enabled LC.  One cannot plot a truly smooth curve in 
LC. The curve is always a set of line segments joining a set of discrete 
points. It is similar to the difference between bit map and vector graphics. (I 
wonder whether Wolfram will provide the ability to show the *evolving* curve as 
one can in LC?)

I will have to leave that  brave and bold new world to all you young Turks now. 
 Have fun.  I’m  82,  retired, and my mind doesn’t work as well as it used to.

But I”m still having lots of fun in the old world.

Jim

 
 --
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for Desktop, Mobile, and Web
 
 ambassa...@fourthworld.com http://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


Extracting emails from mac mail

2014-02-04 Thread Jim Hurley
I seem to recall that it was possible to extract the text from MAC Mail Mail 
boxes.

Am I dreaming?

Jim Hurley




___
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 points of graphic

2014-01-19 Thread Jim Hurley
Hi Roger,

Praying on my ego are you?

I don't really think I am up to this challenge. I'm not quite sure what is 
needed.

But here's a thought. It sounds like joining all these disparate parts together 
to form a whole might be helpful. After all, all graphics drawn with the 
pencil, line, curve... tools are just a bunch of joined line segments. If you 
have a bunch of such independent such groups, i'm guessing that putting them 
together might help form the single new polygon you speak of would be useful.

This stack below show how to join any two graphic segments without changing 
their individual shapes. It uses the handler:

JoinLines line1, line2

It preserves the length and angle of each.

Repeated used of this command will put all your elements together. As in:

   repeat with i = 1 to N-1
  joinLines line  i , line  i+1
   end repeat

Of course you will have to define the order in which they are to be joined.

  go url 
https://dl.dropboxusercontent.com/u/47044230/Set%20angle%20and%20join%20lines.livecode;

I think I posted a stack that makes uses of these Line Tools, some time ago. 
RIght now all you  can do is set the points and the location. But it would be 
useful on occasions to set the length and angle, and possibly join them 
together without changing the shape of the bits and pieces. So here it is again:

  go url 
https://dl.dropboxusercontent.com/u/47044230/Line%20properties%20final.livecode;

Some of the applications in  that stack are a bit frivolous, frivolous but fun, 
like shattering a circle and reforming the bits and pieces into a rectangle.

Jim



 Message: 10
 Date: Sat, 18 Jan 2014 11:20:02 -0500
 From: Roger Eller roger.e.el...@sealedair.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: the points of graphic
 Message-ID:
   caat6exmzwkpke3w0ah4au0dpqtkfhdc4+fqer3egjdkhrsf...@mail.gmail.com
 Content-Type: text/plain; charset=ISO-8859-1
 
 Jim (aka Mr. graphics wizard),
 
 Here's a challenge for you:
 
 Create the outline of an odd geometric shape using several of the existing
 tools (an L shape, but with round ends, by using circles).
 
 Then, with math wizard code, trace the outer overall shape into the points
 of a single new polygon.
 
 THAT would be uber-useful!
 
 ~Roger
 On Jan 18, 2014 11:04 AM, Jim Hurley jhurley0...@sbcglobal.net wrote:
 
 
 Message: 2
 Date: Fri, 17 Jan 2014 16:00:43 +0200
 From: j...@souslelogo.com
 To: use-revolut...@lists.runrev.com
 Subject: the points of graphic
 Message-ID: b058292c0d6ba33b59b2906da17e9271.squirrel@185.8.104.234
 Content-Type: text/plain;charset=iso-8859-1
 
 Hi list,
 
 Is there a way to get the points of a Regular Polygon
 graphic, or do I have to compute it myself using the
 loc, width, height and number of sides of the graphic ?
 
 Thanks,
 jbv
 
 
 
 This script will provide the individual points.
 
 on mouseUp
   put the width of this card/2 into x0
   put the height of this card/2  into y0
   put 6 into n
   put 50 into L
   put 360/n into tAngle
   put x0,y0  cr after tPoints
   set the points of grc polygon to tPoints
   repeat with i = 1 to n+1 -- plus 1 to close
  --Calculate each line segment individually
  --dx and dy and the x and y projections of the line segment
  repeat with j = 1 to i
 add  L * cosine(j*tAngle) to dx
 subtractL * sine(j*tAngle) from dy
  end repeat
  put x0 + dx , y0 + dy into theCoord[i] --if you want the coordinates
 of each vertex
  put (x0 + dx), ( y0 + dy)  cr after tPoints
  set the points of grc polygon to tPoints--if you want to see the
 polygon evolve
  put 0 into dx
  put 0 into dy
   end repeat
 end mouseUp
 
 Given the individual points (theCoord[i]), it would be possible to do
 things line draw all diagonals, connect each vertex with all the others.
 When n is large, it is a pretty picture.
 
 But, of course, there is always the much simpler Turtle Graphics.
 
 To poly n, L
 repeat n
  forward L
  left 360/n
  put xycor() into theVertex[i]
 end repeat
 end poly
 
 
 
 ___
 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: the points of graphic

2014-01-19 Thread Jim Hurley
Thanks, Klaus, and sorry Michael.

I forgot. I have sine and cosine functions in the stack script:

function sine tAngle
  return sin(tAngle /180*pi)
end sine

Similarly for the cosine.

Jim

 Hi Michael,
 
 Am 19.01.2014 um 16:41 schrieb Michael Kristensen 
 michael-kristensen at dsa-net.dk
 :
 
 
  hi Jim
 
 
  
 
 
  ...
 
 
  I put it in a button in alejandros stack and get errors.
 
 
 Replace cosine with COS and sine with SIN in the handler:
 ...
 
 add L * cos(j*tAngle) to dx
 
 
 subtract L * sin(j*tAngle) from dy
 
 ...
 That does the trick :-)
 And of course you need a polygon graphic named polygon!
 
 
  ...
 
 
  
 
 
  Michael
 
 
 Best
 
 Klaus
 
 --
 Klaus Major
 
 http://www.major-k.de
 klaus at major-k.de
 
 

___
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 points of graphic

2014-01-18 Thread Jim Hurley
 
 Message: 2
 Date: Fri, 17 Jan 2014 16:00:43 +0200
 From: j...@souslelogo.com
 To: use-revolut...@lists.runrev.com
 Subject: the points of graphic
 Message-ID: b058292c0d6ba33b59b2906da17e9271.squirrel@185.8.104.234
 Content-Type: text/plain;charset=iso-8859-1
 
 Hi list,
 
 Is there a way to get the points of a Regular Polygon
 graphic, or do I have to compute it myself using the
 loc, width, height and number of sides of the graphic ?
 
 Thanks,
 jbv
 
 

This script will provide the individual points.

on mouseUp
   put the width of this card/2 into x0
   put the height of this card/2  into y0
   put 6 into n
   put 50 into L
   put 360/n into tAngle
   put x0,y0  cr after tPoints
   set the points of grc polygon to tPoints
   repeat with i = 1 to n+1 -- plus 1 to close
  --Calculate each line segment individually
  --dx and dy and the x and y projections of the line segment
  repeat with j = 1 to i
 add  L * cosine(j*tAngle) to dx
 subtractL * sine(j*tAngle) from dy
  end repeat
  put x0 + dx , y0 + dy into theCoord[i] --if you want the coordinates of 
each vertex
  put (x0 + dx), ( y0 + dy)  cr after tPoints
  set the points of grc polygon to tPoints--if you want to see the 
polygon evolve
  put 0 into dx
  put 0 into dy
   end repeat
end mouseUp 

Given the individual points (theCoord[i]), it would be possible to do things 
line draw all diagonals, connect each vertex with all the others. When n is 
large, it is a pretty picture.

But, of course, there is always the much simpler Turtle Graphics.

To poly n, L
repeat n 
  forward L 
  left 360/n
  put xycor() into theVertex[i]
end repeat
end poly



___
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: With Apple script no longer supported, how do I....

2013-08-07 Thread Jim Hurley
 
 Message: 22
 Date: Wed, 7 Aug 2013 00:20:59 -0500
 From: Geoff Canyon gcan...@gmail.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: With Apple script no longer supported, how do I
 Message-ID:
   cakclktprwvm-lb4awzhkpnrzbha7oxcrhttfshaxzmudszf...@mail.gmail.com
 Content-Type: text/plain; charset=ISO-8859-1
 
 Would it work to export from within FileMaker, and then import that file
 into LC? That would mean writing a (very simple) script in FileMaker, or
 just manually exporting using the specified layout as a template, and then
 writing a simple importer in LC.

Yes Geoff, that is what I did for some time before I became away of the Apple 
Script solution.

You, of all people, understand the value of the nice, neat solution. 

It was so easy to put the relevant data into a FM layout, move over to LC, and 
then just click a button and the data appeared just where I wanted it, and 
formatted for maximum massaging in LC. No file create and export.  No resulting 
file I need to remember to trash. Sooo nice and neat. I will miss it.

Here is my dream, my dream DB management application: FM but with LC as the 
scripting language. Seems to me like a killer application.  FM, in attempting 
to make it easy (?) for the novice, made it traumatic for experienced 
programers. 

Jim


 
 
 On Tue, Aug 6, 2013 at 5:55 PM, Jim Hurley jhurley0...@sbcglobal.netwrote:
 
 Election season is fact approaching in my county. I do a lot of election
 DB work.
 
 One thing I have long relied on was the ability to extract data stored
 Filemaker and put it into a LC stack, (where the scripting language is not
 idiotic.)
 
 I have done  this with something like this (below) executed as Apple
 Script:
 
 set theDatabase to choose file with prompt Please locate a FileMaker Pro
 database file to open:
 tell application FileMaker Pro
   with transaction
   try
   open theDatabase
   go to layout list
   get every record of layout list
   end try
   end transaction
 end tell
 
 It was slow but it worked.
 
 With Apple script gone, will there remain a way to script in LC a way to
 extract  info from FM?
 
 Please tell me this is a naive question, and the answer is easy.
 
 Jim Hurley
 ___
 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
 
 
 --
 
 Message: 23
 Date: Wed, 07 Aug 2013 08:34:04 +0100
 From: Neil Roger n...@runrev.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: unable to start simulation on iOS
 Message-ID: 5201f86c.20...@runrev.com
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 
 Dear Malte,
 
 You could also try resetting the iOS simulator to its default state via 
 the reset content an Settings option from the iOS Simulators 
 application bar.
 
 iOS simulatorReset Content and Settings
 
 Please note that this will clear currently installed iOS applications 
 from the simulator.
 
 Kind Regards,
 
 Neil Roger,
 --
 RunRev Support Team ~ http://www.runrev.com
 --
 
 
 On 07/08/2013 00:05, Malte Brill wrote:
 I wanted to work I created a while back. It fails to open in the simulator 
 with the following error:
 
 unable to start Simulation: Could not install the app (in german, so the 
 english wording might be a little different). A vanilla new stack launches 
 just fine in the Simulator. I already deleted the standalone settings custom 
 property, but to no avail. Anybody got an idea what is happening here?
 ___
 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
 
 
 
 
 --
 
 Message: 24
 Date: Wed, 7 Aug 2013 10:01:31 +0200
 From: Malte Brill revolut...@derbrill.de
 To: use-livecode@lists.runrev.com
 Subject: Re: unable to start simulation on iOS  
 Message-ID: 70f55ab2-2cf2-4964-95c2-acfbe9eab...@derbrill.de
 Content-Type: text/plain; charset=us-ascii
 
 Thanks Monte and Neil,
 
 changing the identifizier fixed this. Can't see the tree from the forrest 
 sometimes.
 
 :-)
 
 
 Best,
 
 Malte
 
 
 --
 
 Message: 25
 Date: Wed, 7 Aug 2013 10:05:38 +0200
 From: paolo mazza mazzapaoloit...@gmail.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: MobGui and Resolution Indipendence
 Message-ID:
   CA+NEnO8ju-rjyN=maatsbdwvjwwzlrny4arjdvf8hkb7okq...@mail.gmail.com
 Content-Type: text/plain; charset=ISO-8859-1
 
 Thank you all  for your messages.
 
 I had a look at the mApp framework. I do not understand exactly how it
 works and AFAIK there is not  any

With Apple script no longer supported, how do I....

2013-08-06 Thread Jim Hurley
Election season is fact approaching in my county. I do a lot of election DB 
work.

One thing I have long relied on was the ability to extract data stored 
Filemaker and put it into a LC stack, (where the scripting language is not 
idiotic.)

I have done  this with something like this (below) executed as Apple Script:

set theDatabase to choose file with prompt Please locate a FileMaker Pro 
database file to open:
tell application FileMaker Pro
with transaction
try
open theDatabase
go to layout list
get every record of layout list
end try
end transaction
end tell

It was slow but it worked.

With Apple script gone, will there remain a way to script in LC a way to 
extract  info from FM?

Please tell me this is a naive question, and the answer is easy.

Jim Hurley
___
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] Google Math Fun

2013-07-10 Thread Jim Hurley
Hi Scott,

Google math is great. It will even evaluate factorials up to about 170.  170! = 
7.257416e+306

Most calculators show an overflow beyond 60!

But Wolfram alpha will evaluate 300! = 
3.0605751221644063603537046129726862938858880417 × 10^614

And God knows how much further.

Live code doesn't have a factorial function.

I wrote one that works up to 170!  It uses the traditional iterative method 
below 60! and the Sterling approx beyond that.  Beyond 170! LC shows an  
overflow:


function fact n
   if n  60 then
 return factorial (n)
   else
  put exp(1) into e
  return   ((n/e)^n) * (sqrt(2*pi*n)) --This is the Sterling approx.
   end if
end fact

function Factorial n
if n = 1 then
 return 1
  else
   return n * factorial(n-1)
end if 
end factorial



 
 Message: 21
 Date: Tue, 09 Jul 2013 23:47:19 -0700
 From: Scott Rossi sc...@tactilemedia.com
 To: LiveCode Mail List use-livecode@lists.runrev.com
 Subject: [OT] Google Math Fun
 Message-ID: ce025187.222ba%sc...@tactilemedia.com
 Content-Type: text/plain; charset=US-ASCII
 
 When working in LiveCode, I often use the message box to do quick
 operations and avoid switching out to another application, say a math
 problem for example.  Tonight I needed to do some quick operations while
 searching the Web and I had just a feeling in my gut that Google had taken
 care of this.  This might be old news to some, but sure enough, I typed
 1136 divided by 2 into the browser search field, and Google returned a
 javascript calculator pre-filled with the answer.
 
 Nice one, Google.
 
 (I now expect the day will come when Google will return a page containing
 a picture of a large camera lens and will speak to me in a synthesized
 voice:  I'm sorry, Scott. I'm afraid I can't do that.)
 
 Regards,
 
 Scott Rossi
 Creative Director
 Tactile Media, UX/UI Design
 


___
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] Google Math Fun

2013-07-10 Thread Jim Hurley
Curses! And recurses!

I meant recursive not iterative.

Jim

 Hi Scott,
 
 Google math is great. It will even evaluate factorials up to about 170.  170! 
 = 7.257416e+306
 
 Most calculators show an overflow beyond 60!
 
 But Wolfram alpha will evaluate 300! = 
 3.0605751221644063603537046129726862938858880417 × 10^614
 
 And God knows how much further.
 
 Live code doesn't have a factorial function.
 
 I wrote one that works up to 170!  It uses the traditional iterative method 
 below 60! and the Sterling approx beyond that.  Beyond 170! LC shows an  
 overflow:
 
 
 function fact n
   if n  60 then
 return factorial (n)
   else
  put exp(1) into e
  return   ((n/e)^n) * (sqrt(2*pi*n)) --This is the Sterling approx.
   end if
 end fact
 
 function Factorial n
if n = 1 then
 return 1
  else
   return n * factorial(n-1)
end if 
 end factorial
 
 
 
 
 Message: 21
 Date: Tue, 09 Jul 2013 23:47:19 -0700
 From: Scott Rossi sc...@tactilemedia.com
 To: LiveCode Mail List use-livecode@lists.runrev.com
 Subject: [OT] Google Math Fun
 Message-ID: ce025187.222ba%sc...@tactilemedia.com
 Content-Type: text/plain;charset=US-ASCII
 
 When working in LiveCode, I often use the message box to do quick
 operations and avoid switching out to another application, say a math
 problem for example.  Tonight I needed to do some quick operations while
 searching the Web and I had just a feeling in my gut that Google had taken
 care of this.  This might be old news to some, but sure enough, I typed
 1136 divided by 2 into the browser search field, and Google returned a
 javascript calculator pre-filled with the answer.
 
 Nice one, Google.
 
 (I now expect the day will come when Google will return a page containing
 a picture of a large camera lens and will speak to me in a synthesized
 voice:  I'm sorry, Scott. I'm afraid I can't do that.)
 
 Regards,
 
 Scott Rossi
 Creative Director
 Tactile Media, UX/UI Design
 
 

___
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: Polygon's share of its rectangle inconsistent?

2013-06-09 Thread Jim Hurley
 
 
 Message: 1
 Date: Sat, 8 Jun 2013 11:06:05 -0600
 From: Dar Scott d...@swcp.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: Polygon's share of its rectangle inconsistent?
 Message-ID: eb5d4974-e672-4afd-9b5f-c353e4aa5...@swcp.com
 Content-Type: text/plain; charset=windows-1252
 
 (Snip)
 
 I'm not sure what singly connected means.  Does this mean a graphic can 
 work like several graphics? 
 
 Dar
 

Hi Dar,

The code I offered for obtaining  the area within a closed, singly connected 
polygon relied on the sum of the areas underneath a connected series of line 
segments equates to the area within those segments. The area under a single 
line segment defined by it's end points x1,y1 and x2,y2 is given by  (x2 - x1) 
* (y1 + y2)/2

The area under the top of the polygon (where x2 - x1) is positive) minus the 
area under the  bottom (where x1 - x2 is negative) is equal to the area 
within. 

This presumes one moves clockwise around the polygon. Going counter-clockwise 
the area calculated is negative. For a symmetric, doubly connected figure, such 
 as a figure 8, there is a clockwise segment and an equal and opposite 
counter-clockwise segment, resulting in zero net area.

A figure is singly connected if it is possible to move to every point within, 
without crossing a line. The figure 0 is singly connected; the figure 8 is 
doubly connected.

Jim
___
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: Polygon's share of its rectangle inconsistent?

2013-06-07 Thread Jim Hurley
Hi David,

Would it help if you could calculate the area of the polygons?

The following determines the area of any singly connected (the area of a figure 
8 is zero) closed polygon:

on mouseUp
   put the points of grc polygon into tPoints
   put line 1 of tPoints into tStart
   put the number of lines in tPoints into n
   put 0 into tArea
   repeat with i = 1 to n-1
  put line i+1 of tPoints into tEnd
  put item 1 of tStart - item 1 of tEnd into tWidth
  put (item 2 of tStart + item 2 of tEnd)/2 into tHeight --The average 
height of this line.
  add tWidth * tHeight to tArea
  put tEnd into tStart
   end repeat
   put  tArea into msg box
end mouseUp

Jim

 
 Message: 7
 Date: Thu, 6 Jun 2013 19:39:25 -0400
 From: David Epstein dfepst...@comcast.net
 To: use-livecode@lists.runrev.com
 Subject: Polygon's share of its rectangle inconsistent?
 Message-ID: 5e916091-0fde-4c67-9d52-04601757a...@comcast.net
 Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
 
 In order to properly adjust the relative area of two dissimilar  
 polygons, I thought I would use a function to determine the fraction  
 of each polygon's rectangle that is covered by the polygon.
 
 function coverage obLID
set the filled of obLID to true
put the rect of obLID into r
repeat with x = (item 1 of r) to (item 3 of r)
   repeat with y = (item 2 of r) to (item 4 of r)
  put x,y into pt
  if within(obLID,pt) then add 1 to isIn
  add 1 to all
   end repeat
end repeat
return isIn/all
 end coverage
 
 This seems to work as expected, but I am perplexed by the fact that  
 when I resize an object keeping its proportions constant (drag a  
 corner with the shift key down; or script this) I get a surprising  
 variation in the result.  E.g., a fairly simple shape I tried went  
 from 0.48 coverage up to 0.59 coverage when I shrank its dimensions  
 by about two-thirds.  With tens or hundreds of thousands of pixels  
 being sampled in the calculation, I would not expect this variation.
 
 Many thanks for any insights or suggestions.
 
 David Epstein
 *


___
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: Alternative To A Specific Switch Statement

2013-03-15 Thread Jim Hurley
Hi Ender,

I don't know how this trig function arose in you application, but you may want 
to take a look at the atan2 function in Live Code.

It handles all the funny things that happen at the branch cuts in the trig 
functions beautifully. It dispenses with the need for a switch function.

Jim


 
 Message: 1
 Date: Thu, 14 Mar 2013 19:42:05 +0200
 From: Ender Nafi Elek?io?lu endern...@gmail.com
 To: List LiveCode use-livecode@lists.runrev.com
 Subject: Alternative To A Specific Switch Statement
 Message-ID: 66721958ea974a8480a750047083d...@gmail.com
 Content-Type: text/plain; charset=utf-8
 
 Hello Dear LiveCode Gurus,  
 
 
 
 Here is a little code snippet:
 
 __switch
 case sin(pAngleInRadians)  0
 __put 1 into tX
 __break
 case sin(pAngleInRadians) = 0
 __put 0 into tX
 __break
 case sin(pAngleInRadians)  0
 __put -1 into tX
 __break
 __end switch
 
 It's for a complex rotation command.
 Is there a more elegant way to achieve the same result with built-in 
 functions?
 I mean, something like a combination of abs(), max() and/or round()?
 Just an intellectual curiosity :)
 
 Thanks for any insights...
 
 
 Best,
 
 ~ Ender Nafi
 


___
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: Editing polygon points

2013-03-07 Thread Jim Hurley
Hi John,

There is a much overlooked feature in RR that allows you to manually reshape 
points.

Under the Object menu select Reshape graphic. 

And you can delete points using the Inspector. Just delete the offending line 
among the Points.

Adding points is tricky. But you can just add a new line to the Points and then 
reposition the points.

And then, as you know, there are Bezier curves.  

Jim Hurley

 
 Message: 27
 Date: Thu, 07 Mar 2013 13:28:18 +
 From: John Craig j...@splash21.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Editing polygon points
 Message-ID: 513895f2.50...@splash21.com
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 
 Is it possible to visually edit the points of a polygon and can I add 
 and delete individual points?
 
 http://stackoverflow.com/questions/15272215/editing-polygon-points-with-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: Physics Engine support

2013-02-27 Thread Jim Hurley
And then, there is physics in the Physics Engine support.

Jim Hurley

___
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


The love formula

2013-02-15 Thread Jim Hurley
This is a little late for Valentine's day, but I was being smothered in 
affection yesterday ;)

Here is a link to show the formula for a heart: 

http://www.google.com/imgres?q=the+love+formulahl=enclient=safaritbo=drls=enbiw=1335bih=943tbm=ischtbnid=S0s-aYE5EW3kdM:imgrefurl=http://9gag.com/gag/125927docid=ZUOxCpj_QyMOlMimgurl=http://d24w6bsrhbeh9d.cloudfront.net/photo/125927_700b.jpgw=700h=768ei=dLkeUaj-Oci9igLty4CYCwzoom=1ved=1t:3588,r:5,s:0,i:96iact=rcdur=1220sig=100340526412447560004page=1tbnh=172tbnw=157start=0ndsp=20tx=107ty=88

And here is a script to draw one in LC.



local x0, y0, x, signum

on mouseUp
  --The equation of a heart is x^2 + (y - x^(2/3))^2  = 1
  --So that y = x^(2/3) + or - sqrt(1-x^2) 
  -- The plus give the top of the heart and the minus produces the bottom

  if there is no grc heart then create grc heart
  set the style of grc heart to line
  set the points of grc heart to empty
  put the width of this card/2 into x0
  Put round( the height of this card /2) into y0
  put  0 into x
  --Signum is used to change the sign of the square root
  put 1 into  signum
  put drawHeart() into tTopPoints
  put 0 into x
  --Now the bottom
  put -1 into signum
  put drawHeart() into tBottomPoints
  if last line of tBottpPoints is empty then delete the last line of 
tBottomPoints
  --The botton get drawn bottom up--so reverse the points.
  put reverse(tBottomPoints) into tBottomPoints
  --Combine top and bottom.
  put tTopPoints  cr  tBottomPoints into tFinal
  if the last line of tFinal is empty then delete last char of tFinal
--Now put those points into the center of the screen--at x0,y0
  repeat for each line tLine in tFinal
 if tLine is empty then next repeat
 put x0 + 100*item 1 of tLine into xTemp
 put x0 - 100*item 1 of tLine into xTempLeftSide
 put y0 - 100*item 2 of tLine into yTemp
 put  round(xTemp) , round(yTemp) into temp
 if temp is not empty then put temp  cr after results
 put  round(xTempLeftSide) , round(yTemp)  into temp2
 if temp2 is not empty then put temp2  cr after resultsLeftSide
  end repeat
  set the points of grc heart to empty 
  set the points of grc heart to resultsLeftSide
  put cr  resultsLeftSide after results
  set the points of grc heart to results
end mouseUP

function y x
  return  x^(2/3) + signum* sqrt (1 - x^2) 
end y

function DrawHeart
  repeat 
 if x= 1 then exit repeat
 put x , y(x) into tPoint
 put tPoint  cr after tPoints
 add .002to x
  end repeat
  return tPoints
end DrawHeart

function reverse tPoints
  repeat for each line tLine in tPoints
 put tLine  cr before results
  end repeat
  return results 
end reverse


___
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: Super duper scripts in MS Word

2013-01-20 Thread Jim Hurley
Paul and Bob,

Thanks. I see now. 

And apparently I saw this some time ago.
Using the character dialog box you suggested, I see that in my existing sample, 
the superscript of my superscript is elevated by 3 points.
I have absolutely no recollection of having set that elevation.

I wish I could believe that the memory is finite and learning new bits 
necessarilty crowds out old bits.

But I'm afraid there comes a time in life when bits are not just crowded out, 
they just begin fall away at a frightening rate.

Thanks again,

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


OT: Super duper scripts in MS Word

2013-01-18 Thread Jim Hurley
This is WAY off topic, but I don't know where else to turn. Google has failed 
me  entirely.

I need TWO levels of superscript in MS Word. X to the Y power to the Z power. 
Three levels of text: base level, superscript level, and super-duper script 
level.

Now I know that it is possible. I have a manuscript with such a beast. Each 
level is editable and so I can use is as a template for all such instance of 
two levels of superscript.

But, and here is the annoying part: I have no idea how I first achieved this 
results. I have tried all combination of MS Word superscript formatting, 
without success. 

I have tried the obvioius: FIrst create Y to the Z power, and then apply this 
as a superscript for X. But the power of X become YZ. Z is no longer a 
superscript of Y.

Is there even a way to look at the underlying Word code to see how I achieves 
this? 

Jim Hurley

I am thinking of publishing a MS Word document of but one word: X to the Y to 
the Z. Super-duper scripting as a utility.
___
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: Capture the Trig Function from an Option Menu Button

2012-12-10 Thread Jim Hurley
It turns out that Do is fast enough. Here is the Do script:
(The script might read a litle better by using x in the repeat loop instead 
of i.)

on mouseUp
   put the label of btn myOptionMenu into tTrigFunction
   --It might be necessary  to take care in using the following replacements 
   replace sine with sin in tTrigFunction
   replace cosine with cos in tTrigFunction
   replace tangent with tan in tTrigFunction
   put round(the width of this card/2) into x0
   put  round(the height of this card/2) into y0
   put 50 into Amp--Amplitude of the trig curve
   set the points of grc myCurve to empty
   wait 0 millisec -- Force a screen refresh on the Mac
   repeat with i = 1 to 360--maybe with a step of 2 or 4
  put i*pi/180 into tAngle
   get   put the   tTrigFunctionof   tAngleinto y  
  do it
  put round(Amp*y) into y
  put i into x
  put x+ x0, y+y0 into tPoint
  put tPoint  cr after tPoints
  --Uncomment the following to see the curve evolve
  --set the points of grc myCurve to tPoints
  --wait 0 millisec
   end repeat
   set the points of grc myCurve to tPoints
end mouseUp
___
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: Capture the Trig Function from an Option Menu Button

2012-12-10 Thread Jim Hurley
Roger, 

One caveat. This is a good exampe the caution one must exercise in using the Do.

Instead of: 

  replace sine with sin in tTrigFunction
  replace cosine with cos in tTrigFunction
  replace tangent with tan in tTrigFunction

Use:

 replace cosine with cos in tTrigFunction

  replace sine with sin in tTrigFunction
  replace tangent with tan in tTrigFunction

If you replace sine with sin you also change cosine to cosin (There is 
a sine in cosine) 
So reverse the order of these first two.

Jim



 --
 
 Message: 3
 Date: Mon, 10 Dec 2012 09:42:55 -0800
 From: Roger Guay i...@mac.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: Capture the Trig Function from an Option Menu Button
 Message-ID: 2f8eaa01-f970-48e0-af7a-7733af7e4...@mac.com
 Content-Type: text/plain; CHARSET=US-ASCII
 
 This script is amazingly fast! And so are you, having apparently produced it 
 in less than an hour!! My script appears to be slightly slower using a 
 switch/case structure. I'll test it out when I get a moment.
 
 Thanks very much,
 Roger
 
 
 On Dec 10, 2012, at 8:59 AM, Jim Hurley jhurley0...@sbcglobal.net wrote:
 
 It turns out that Do is fast enough. Here is the Do script:
 (The script might read a litle better by using x in the repeat loop 
 instead of i.)
 
 on mouseUp
  put the label of btn myOptionMenu into tTrigFunction
  --It might be necessary  to take care in using the following replacements 
  replace sine with sin in tTrigFunction
  replace cosine with cos in tTrigFunction
  replace tangent with tan in tTrigFunction
  put round(the width of this card/2) into x0
  put  round(the height of this card/2) into y0
  put 50 into Amp--Amplitude of the trig curve
  set the points of grc myCurve to empty
  wait 0 millisec -- Force a screen refresh on the Mac
  repeat with i = 1 to 360--maybe with a step of 2 or 4
 put i*pi/180 into tAngle
  get   put the   tTrigFunctionof   tAngleinto y  
 do it
 put round(Amp*y) into y
 put i into x
 put x+ x0, y+y0 into tPoint
 put tPoint  cr after tPoints
 --Uncomment the following to see the curve evolve
 --set the points of grc myCurve to tPoints
 --wait 0 millisec
  end repeat
  set the points of grc myCurve to tPoints
 end mouseUp
 ___
 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: Capture the Trig Function from an Option Menu Button

2012-12-10 Thread Jim Hurley

Thanks Dick. I hadn't thought about using the  Value function. Interesting.
Do you have any thoughts on the relative merits of Do vs. Value?

I could also have used 

 do put tTrigFunction  (  tAngle  ) into y  

And Roger, in my code the positive y axis is the usual screen y axis--positive 
down. 

If you want to use the traditional cartesian y-axis--positive up-- change y0 + 
y to y0 - y

Otherwise you trig curves will all look upside down.

Jim



 On Dec 10, 2012, at 8:59 AM, Jim Hurley wrote:
get   put the   tTrigFunctionof   tAngleinto y  
   do it
   
 
 
 Hi, Jim and Roger.
 
 If you like more concise code, you can code the above like this:
 put value( tTrigFunction  (  tAngle  ) ) into y
 
 -- Dick
 
 
 Roger, 
 
 One caveat. This is a good exampe the caution one must exercise in using the 
 Do.
 
 Instead of: 
 
 replace sine with sin in tTrigFunction
 replace cosine with cos in tTrigFunction
 replace tangent with tan in tTrigFunction
 
 Use:
 
 replace cosine with cos in tTrigFunction
 
 replace sine with sin in tTrigFunction
 replace tangent with tan in tTrigFunction
 
 If you replace sine with sin you also change cosine to cosin (There 
 is a sine in cosine) 
 So reverse the order of these first two.
 
 Jim
 
 
 
 --
 
 Message: 3
 Date: Mon, 10 Dec 2012 09:42:55 -0800
 From: Roger Guay i...@mac.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: Capture the Trig Function from an Option Menu Button
 Message-ID: 2f8eaa01-f970-48e0-af7a-7733af7e4...@mac.com
 Content-Type: text/plain; CHARSET=US-ASCII
 
 This script is amazingly fast! And so are you, having apparently produced it 
 in less than an hour!! My script appears to be slightly slower using a 
 switch/case structure. I'll test it out when I get a moment.
 
 Thanks very much,
 Roger
 
 
 On Dec 10, 2012, at 8:59 AM, Jim Hurley jhurley0...@sbcglobal.net wrote:
 
 It turns out that Do is fast enough. Here is the Do script:
 (The script might read a litle better by using x in the repeat loop 
 instead of i.)
 
 on mouseUp
 put the label of btn myOptionMenu into tTrigFunction
 --It might be necessary  to take care in using the following replacements 
 replace sine with sin in tTrigFunction
 replace cosine with cos in tTrigFunction
 replace tangent with tan in tTrigFunction
 put round(the width of this card/2) into x0
 put  round(the height of this card/2) into y0
 put 50 into Amp--Amplitude of the trig curve
 set the points of grc myCurve to empty
 wait 0 millisec -- Force a screen refresh on the Mac
 repeat with i = 1 to 360--maybe with a step of 2 or 4
put i*pi/180 into tAngle
 get   put the   tTrigFunctionof   tAngleinto y  
do it
put round(Amp*y) into y
put i into x
put x+ x0, y+y0 into tPoint
put tPoint  cr after tPoints
--Uncomment the following to see the curve evolve
--set the points of grc myCurve to tPoints
--wait 0 millisec
 end repeat
 set the points of grc myCurve to tPoints
 end mouseUp
 ___
 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: Capture the Trig Function from an Option Menu Button

2012-12-09 Thread Jim Hurley
Well, Mark, maybe not so flexible. For example, to use Do with the arctan() 
function in LC, as you suggest, would require  you to replace the arctan text 
with atan text,  or more likely the atan2 text, as that is how LC expresses 
that trig funciton. 

That might not be easy if arctan text exists in more than one place. A bit of 
parsing may be required. 

And Do can be a bit slow. From the dictionary: Using the do command is slower 
than directly executing the commands, because each statement must be compiled 
every time the do command is executed. 

As to simplifying, it appeared that a good bit of the thread revolved around a 
certain level of opacity in the Do statement. 

But there is certainly a nice generic quality to Do. Never mind what, just Do 
it.

In many cases it will boil down to taste, and I will grant you that that is no 
small issue. It is a good part of what makes coding satisfying.

Jim



 
 Jim-
 
 Saturday, December 8, 2012, 10:11:31 AM, you wrote:
 
 But could you tell me how this mouseUP handle fails to do the job?
 
 Well, it's not nearly as hard to read, for one thing. But seriously,
 the use of lambda functions (google it) can provide a degree of
 flexibility in code and help prevent coding errors. For instance, to
 add the arctan() to your example you'd have to add a new line to the
 option control, then add a new case statement to the switch construct
 in the mouseUp handler. Possibly you could make a mistake when cutting
 and pasting, forgetting to insert a break statement, etc. Using the
 redirected form all you'd need to do is add the new line to the option
 control.
 
 -- 
 -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


Re: Capture the Trig Function from an Option Menu Button

2012-12-09 Thread Jim Hurley
Hi Mark

I can recall one case where Do was the perfect solution for me.
It was a tutorial to help students understand the physics of the rainbow.
It provided them with a mini-programing language, that allowed them to control 
how a ray of light might interact with a drop of water.
They would write a script for the ray they wanted to consider. For example;

startRayAt d
refractionAirToWater
crossDrop
reflection
crossDrop
refractionWaterToAir
exitRay

This ray is refracted into the drop at the initial face, crosses the drop then 
to be reflected off of the back surface, and is eventually reflected and 
refracted back into the air.
This would be typical path for rays responsible for the primary rainbow.

This student script is written into a field called program and is handled by: 

repeat with k = 1 to number of lines in field program
  do line k of field program
end repeat

Nothing could be simpler or less error prone. Speed was not an issue. 
The alternative would have been to write a conditional for each of the commands 
in the 6 word vocabulary. 
What a nuisance. Do is obviously the solution in this case.

In Roger Guay's problem it is a two step process, (1) get the value for the 
trig function and then (2) a statement, and them combine them into a printed 
statement.
This process  might be easier to read, and simpler to execute as a Switch/Case 
solution.


Jim
--
Jim-

 Sunday, December 9, 2012, 12:36:07 PM, you wrote:
  In many cases it will boil down to taste, and I will grant you
  that that is no small issue. It is a good part of what makes coding
  satisfying.

Good points all. I usually try to avoid do whenever I can due to its
inherent slowness and the need to overthink the syntax... I'm never
really sure whether I can use a variable or whether I have to quote it
or even embed quote chars to get it to evaluate properly.

Luckily there's no one size fits all formula in xtalk and there are
many ways to get to any desired goal.

-- 
-Mark Wieder
 
mwieder at 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


Re:Capture the Trig Function from an Option Menu Button

2012-12-08 Thread Jim Hurley
Hi Roger

I'm sure I missed the point of this thread. I'll go through it more carefully.

But could you tell me how this mouseUP handle fails to do the job?

Thanks,

Jim


on mouseUp
   put field 1 into tAngle
   put tAngle*pi/180 into tAngle
   --put the label of btn myOptiionMenu into sOption
   put the label of button myOptionMenu into tTrigFunct
   switch tTrigFunct
  case sine
 put sin(tAngle) into tValue
 put The sine of   tAngle*180/pi   degrees  is   tValue into 
tResult
 break
  case cosine 
put cos(tAngle) into tValue
 put The cosine of   tAngle*180/pi   istValue into tResult
 break
  case tangent
 put tan(tAngle) into tValue
 put The Tangent of   tAngle*180/pi   istValue into tResult
   end switch
put tResult into field 2
end mouseUp



 
 Message: 5
 Date: Fri, 07 Dec 2012 12:10:28 -0800
 From: Roger Guay i...@mac.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Capture the Trig Function from an Option Menu Button
 Message-ID: 720db527-9ff1-4754-89c1-ce08d44b0...@mac.com
 Content-Type: text/plain; CHARSET=US-ASCII
 
 I know this is probably a stupid question, but I can't seem to make it work:
 
 I have an Option Menu button with sin, cos, tan as menu Items. I want my card 
 script to take the label of that button, and then perform the trig function 
 with that label. I've tried every thing I can think of to get, do or in 
 general  assemble the script, but to no avail. Any suggestion?
 
 TIA,
 Roger
 
 


___
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


Reversing the end point arrow

2012-12-08 Thread Jim Hurley
In RR the start arrow and the end arrow point away from each other.

I needed a line with the more traditional arrows, both pointing in the same 
direction along the line.
The following handler  will reverse the direction of the start arrow.
It does so by introducing a third point ON THE LINE between the two original 
point. It is locate  just a SHORT distance (ds) up from the original start 
point.
The end arrow will now point from this new intermediate point, to the original 
start point, thus, effectively, revering the direction.

on mouseUp
   put myLine into tName --Name of the line
   set the endArrow of grc tName to true
   set the startArrow of grc tName to True
   set the arrowsize of grc tName to 6
   put the points of grc tName into tPoints
   put line 1 of tPoints into tStart
   put line 2 of tPoints into tEnd
   put item 1 of tEnd - item 1 of tStart into dx
   put  item 2 of tEnd - item 2 of tStart into dy
   --Now create a new end point.
   --It will be just a short distance (ds) up from the original end point.
   put 2 into ds
put atan2(dy,dx) into tAngle
   put ds * cos(tAngle) into dx
   put ds * sin(tAngle) into dy
   add round(dx) to item 1 of tStart
   add Round(dy) to item 2 of tStart
   --Insert this new end point into the line's points
   put tStart  cr  tPoints into tNewPoints
   set the points of grc tName to tNewPoints
end mouseUp


___
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: Badge in answer modal?

2012-11-22 Thread Jim Hurley
Hi Jan.

Thanks. Perfect. I can't imagine what all goes on between on  preOpenStack 
and end PreOpenStack

But your suggestion to insert the reset at the end of that handler work just 
fine.

Here is a button script to test the strategy:

CAUTION; This meddles with answer dialog script. But restores it at the end.

on mouseUp --Change the location of the answer dialog box
   answer This is the default position of the answer box.

   put the script of card 1 of stack answer dialog into tScript
   put lineoffset(end preOpenStack, tScript)  into tLineNo

   --Define the new script line.
   put Set the loc of this stack to  200,400 into tNewScriptLine

   --Alter the script
   put tNewScriptLine  cr  end preOpenStack into line tLineNo of tScript
   set the script of card 1 of stack answer dialog  to tScript

   --Test of new loc.
   answer Have I moved?

   --Now restore the deafulat script if you like
   put end preOpenStack into line tLineNo of tScript
   set the script of card 1 of stack answer dialog to tScript
-- Or you might just change the new script line to set the loc of this stack 
to the screenLoc 
end mouseUp

Jim Hurley


On Nov 22, 2012, at  10:00 AM, use-livecode-requ...@lists.runrev.com wrote:

 Message: 2
 Date: Wed, 21 Nov 2012 21:58:30 -0800 (PST)
 From: Jan Schenkel janschen...@yahoo.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: Badge in answer modal?
 Message-ID:
   1353563910.50013.yahoomail...@web141105.mail.bf1.yahoo.com
 Content-Type: text/plain; charset=iso-8859-1
 
 Hi Jim,
 
 Try and add your logic to the very end of the 'preOpenStack' handler.
 That handler fiddles with the width and top of the stack so many times that 
 you might as well let it do its thing and then move it yourself at the very 
 end.
 I tried putting the following line in and it seemed to work on my Mac:
 ##
 set the left of this stack to 100
 ##
 
 Jan Schenkel.


___
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: Badge in answer modal?

2012-11-21 Thread Jim Hurley
Jan,

I thought I would take you up on your challenge to be adventurous and try to 
alter the loc of the answer dialog box by changing the script of the box.

By script, I got the script of card 1 of stack dialog box, found the line in 
the PreopenStack handler where the loc is set, i.e.:

set the loc of this stack to the screenloc

I then added 200 to the second item of the screenloc, altered that line in the 
script, and reset the script of the box.

As a check, I then got the script of the box and I could see that the new loc 
had been applied,

I then called answer again but it continued to show in at the original 
screenLoc. The new script didn't seem to take.

Is there a way to change the loc of the answer dialog box? There are times when 
it is just very inconvenient.

I seem to recall a discussion of this topic some time ago.

Jim Hurley


On Nov 21, 2012, at  10:00 AM, use-livecode-requ...@lists.runrev.com wrote:

 
 Message: 3
 Date: Wed, 21 Nov 2012 19:55:18 +0200
 From: Richmond richmondmathew...@gmail.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: Badge in answer modal?
 Message-ID: 50ad1586.7010...@gmail.com
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 
 On 11/21/2012 05:56 PM, Jan Schenkel wrote:
 The badging is implemented specifically to help Mac developers comply with 
 the OS X Human Interface Guidelines.
 See: 
 http://developer.apple.com/library/mac/#documentation/UserExperience/Conceptual/AppleHIGuidelines/Intro/Intro.html
 
 There's no precedent for this badging on Windows or Linux, and while you may 
 personally find this a desirable feature accross all platforms, the RunRev 
 team wants to help us create a native user experience and tries to stop us 
 from creating user interfaces which look and feel alien to native users.
 
 That said, if you feel adventurous, you can edit the script of card 1 of 
 stack Answer dialog and remove the platform check for the code pertaining 
 to gRevSmallAppIcon ;-)
 
 Cheers,
 
 Jan Schenkel.
 


___
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


Livecode's appetite

2012-11-13 Thread Jim Hurley
I just happened to notice Livecode's CPU appetite,--as reported in the Activity 
Monitor. It is takes up 6.7% of the CPU available usage, even while I am using 
MS Word.

On the other hand, Excel is using only .2% 

There is probably a good reason for LC's appetite.

Jim
___
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's appetite

2012-11-13 Thread Jim Hurley
Hi Mark,

Thanks for your thoughtful reply. Very interesting.

Quick first response:

It appears there is a problem similar to that of the Uncertainty  Principle in 
quantum mechanics, where one cannot observe the system without changing it.

I went to my existing app that was open in Livecode to look at the 
pendingmessage, and it appeared to mje that my observation will change the 
observed.

Jim  



 Hi Jim,
 
 Check pendingmessages, send in time commands, repeat loops with messages, 
 blinking cursor and, last but not least, default buttons.
 
 If I create a standalone without any of this, it usually gets below 3% most 
 of the time. Still, much more than most other apps and problematic if you 
 decide to run 10 standalones at the same time (something which isn't a 
 problem at all if you use apps created with XCode).
 
 While I'm writing this, Color Converter (made with LiveCode) shows a CPU 
 usage of 0.0%, which proves that it is possible to make apps that don't eat 
 up CPU time while running in the background.
 
 --
 Best regards,
 
 Mark Schonewille
 
 


___
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


The inverse of Interset

2012-11-10 Thread Jim Hurley
The intersect command (intersect arrayOne with arrayTwo) removes the elements 
from arrayOne that not in arrayTwo.

What I need is an array of the elements removed. Intersect leaves everything 
but.

Is there an array operation that accomplishes this? 
The dimensions of my arrays are very large and so using is among on the keys 
is not an option.

Jim Hurley 
___
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 inverse of Interset

2012-11-10 Thread Jim Hurley
Hi Phil,

Thanks very much. You solved my problem. I was unaware of delete variable 
myArray[tKey]
That is very fast.

It appears that this works as well:

repeat for each key tKey in the keys of arrayOne
  delete variable arrayTwo[tKey]
end repeat

This provided a very simple way to subtract elements of one array from the 
other.

Thanks again,

Jim


 Hi Jim,
 
 I suppose you could do a union (yielding a 3rd array) and an intersect 
 (yielding a 4th array) and then remove the intersect elements from the 
 union array. It's not what you wanted but it would work. Like so:
 
 put arrayOne into intersectA
 intersect intersectA with arrayTwo
 
 put arrayOne into unionA
 union unionA with arrayTwo
 
 repeat for each key tKey in intersectA
  delete variable unionA[tKey]
 end repeat
 
 -- now unionA contains the anti-intersection (?) of the two original arrays
 
 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: [OT] Looking For OS X Troubleshooting Suggestions 22

2012-09-15 Thread Jim Hurley
Thanks Kay. The complete external kit sounds like a particularly good idea. 
It allows me to test the next step in the process before proceeding.

Jim


 
 Message: 9
 Date: Fri, 14 Sep 2012 10:28:07 +0800
 From: Kay C Lan lan.kc.macm...@gmail.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: [OT] Looking For OS X Troubleshooting Suggestions 22
 Message-ID:
   CA+uh5kjsfnJQpD3F2hNQJiBfnnO8KdSXVEZNo---=x27ltj...@mail.gmail.com
 Content-Type: text/plain; charset=ISO-8859-1
 
 On Fri, Sep 14, 2012 at 3:07 AM, Jim Hurley jhurley0...@sbcglobal.netwrote:
 
 
 But I have one more very sophisticated diagnostic test I perform. I
 listen. Every so often, the HD on my Mac Mini squeaks for a few minutes.
 That can't be good.
 
 
 Are you sure it's the HD, that would be very very unusual. What about the
 fan or DVD drive (if it isn't the latest Mac Mini?
 
 The fan might squeak at certain rpm which would equate to certain
 tempertures. I think smcFanControl will work in an Intel Mac Mini and show
 you internal temps and fan rpm.
 
 http://www.eidac.de/
 
 If you are convinced it's the HD then I completely agree with Bob; it's
 time to make a clone and buy a new bigger and faster replacement, before
 you lose the drive.
 
 Highly recommend:
 
 http://www.macsales.com/
 
 Buy a complete external kit. Use it to clone your old internal onto the new
 external. The move the new HD into your Mac Mini.
 
 Then you can put the old HD into the external case and run programs like
 DriveGenius to see if there are bad blocks or something else that might be
 causing the squeaks. Don't do this before you've cloned your drive, the
 last thing you want is the drive to fail during testing but before you've
 cloned.
 
 At worst, if it can't be cured, you can always use it as an emergency boot
 drive. I have an old 40GB drive I pulled out of a G3 PB that has a pristine
 copy of SnoLeo on it + DriveGenius. Every now and then I start off it and
 run software update to make sure everything is up-to-date. Very rarely I
 actually start off it so I can do some serious Disc maintenance on the
 internal drive of my MBP.
 
 Note, this drive is NOT used for backups, it doesn't have anything
 essential on it, so when it does bite the dust it's no great lose. In the
 mean time it's got something on it that can be a huge time saver.
 
 As for performance hit, see my previous post; from fastest to slowest:
 
 1) Internal HD
 
 External
 2) eSata
 3) FW800
 4) FW400
 5) USB 2.0 HD
 6) USB 2.0 thumb drive
 
 7) DVD install disc
 
 I don't have USB 3.0 or Thunderbolt cases but I would expect both of those
 to sit somewhere around eSATA, but still below an Internal HD.
 
 HTH
 


___
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] Looking For OS X Troubleshooting Suggestions 22

2012-09-13 Thread Jim Hurley
 
 --
 
 Message: 6
 Date: Thu, 13 Sep 2012 08:53:37 -0700
 From: Bob Sneidar b...@twft.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: [OT] Looking For OS X Troubleshooting Suggestions
 Message-ID: e6ae58af-e925-49d7-853e-1420d6524...@twft.com
 Content-Type: text/plain; charset=us-ascii
 
 If spotlight is failing it is because it has encountered bad blocks in the 
 indexing process, and the attempt to relocate the data has failed. Read my 
 prior post. I'm really good at this stuff. It's what I do for a living. 
 
 Bob
 

Bob,

First, let me say, I enjoy people who are good at what they do, and are not 
afraid to say so. (I just wish you were doing what you do in my neighborhood.)

Second, I have many of the symptoms discussed earlier on this topic. 

But I have one more very sophisticated diagnostic test I perform. I listen. 
Every so often, the HD on my Mac Mini squeaks for a few minutes. That can't be 
good.

Generally things are fine. So I assume the contents of my existing internal 
drive are ok.  So, what would you recommend? 

If I were to create a Carbon Copy Clone on an external drive and, in the 
future,  always boot from that external copy, would there be a performance hit?

Jim
___
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: Word chunk includes punctuation

2012-08-15 Thread Jim Hurley
 
 Message: 27
 Date: Tue, 14 Aug 2012 14:41:48 -0500
 From: J. Landman Gay jac...@hyperactivesw.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: Word chunk includes punctuation
 Message-ID: 502aa9fc.3000...@hyperactivesw.com
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 
 On 8/14/12 12:47 AM, Scott Morrow wrote:
 Mark,
 not even a token effort?
 
 --
 Scott Morrow
 
 On Aug 13, 2012, at 9:41 PM, Mark Wieder wrote:
 
 Jim-
 
 Monday, August 13, 2012, 5:31:07 PM, you wrote:
 
 So, how many words could a word chunk chunk, if a word chunk could chunk 
 words?
 
 groan.
 all right... I'm annoyed that I didn't think of it first...
 
 All right. Jim, Scott, go sit in the corner with Colin. Mark can just 
 think about sitting in the corner.
 
 -- 
 Jacqueline Landman Gay | jac...@hyperactivesw.com
 HyperActive Software   | http://www.hyperactivesw.com
 


Augh mom! We were just have'n fun.

Jim
___
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: Word chunk includes punctuation

2012-08-15 Thread Jim Hurley
I haven't really followed this issue, but that has never stopped me in the past.

Just diving in I tried:put the number of words in tText into msg box

No matter what I put into tText by way of quotes or tabs or punctuation, I 
always seem to get what I expect.

It would be nice if someone would post a line or two of text, the 
quintessential challenge, to demonstrate where the problems lie.

Jim Hurley
___
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: making a graphic the shape of a bitmap

2012-07-29 Thread Jim Hurley
 
 Message: 14
 Date: Sat, 28 Jul 2012 17:31:12 -0400
 From: Colin Holgate co...@verizon.net
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: making a graphic the shape of a bitmap
 Message-ID: 2c60fc45-5cd4-4ac1-b12b-c802eb95e...@verizon.net
 Content-Type: text/plain; charset=us-ascii
 
 How can you make a graphic be the exact shape of an irregular shaped image? 
 For example, say you had an alpha transparent background image of a snake, 
 and you wanted a graphic control that was the same shape as the outline of 
 the snake, how could that be done?
 
 You could oh-so-carefully draw the graphic with the freehand tool, but it's 
 extremely unlikely [likely] you would make a mistake. There doesn't seem to 
 be a way to edit a graphic's shape, and there isn't any import vector as 
 control, or a way to launch an editor for graphics.
 

Colin,

When you say, there doesn't seem to be a way to edit a graphic's shape how do 
you mean? There is Reshape graphic under the Object menu for manual editing. 
Or did you mean something more sophisticated? 

Jim Hurley





___
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: Any suggestions?

2012-07-24 Thread Jim Hurley
 
 Message: 7
 Date: Mon, 23 Jul 2012 20:54:14 -0500
 From: J. Landman Gay jac...@hyperactivesw.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: Any suggestions?
 Message-ID: 500e0046.2010...@hyperactivesw.com
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 
 On 7/23/12 8:44 PM, Peter M. Brigham wrote:
 I've always thought that practicing was
 an odd word for what I do, though it does capture the open-ended
 nature of the medical field
 
 One doctor I know says he's practicing until he gets it right. :)
 
 -- 
 Jacqueline Landman Gay | jac...@hyperactivesw.com
 HyperActive Software   | http://www.hyperactivesw.com
 
 

While he is PRACTICING, the PATIENT is out in the WAITING room.

Jim

___
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 future of LiveCode

2012-07-20 Thread Jim Hurley
Professor Goldberg,

A bit daunting because of its size, but I learned HyperTalk from the truly 
wonderful book:  HyperTalk The Book. By Winkler and Kamins, and later, our 
own, Jean DeVoto, who did the original RunRev dictionary.

I am a strong believer in learning from examples--after the basic theory.

Jim Hurley
Emeritus Professor of Physics, Univ. of California

 
 Message: 22
 Date: Fri, 20 Jul 2012 09:02:17 -0400 (EDT)
 From: stgoldb...@aol.com stgoldb...@aol.com
 To: use-livecode@lists.runrev.com
 Subject: The future of LiveCode
 Message-ID: 8cf348f062ed786-11ec-...@webmail-m025.sysops.aol.com
 Content-Type: text/plain; charset=us-ascii
 
 
 
 I have used LiveCode extensively to develop my company's  educational 
 software.  It's a great program.  I think one of the reasons why LiveCode is 
 not more widely adopted is the lack of an adequate user manual that would 
 attract beginners.   I ask, would you recommend the present LiveCode user 
 manual to a student who has no background in programming and is just 
 starting?  I wouldn't; it's too advanced and incomplete at the same time, 
 mixes complex with simple, has no Index, says virtually nothing about the 
 all-important property inspectors, and focuses only spottily on the key 
 scripting words.  An adequate manual should clearly present 150 or so of the 
 basic scripting words, which was the extent of HyperCard's vocabulary and 
 made HyperCard easier to learn.  The beginner in LiveCode is expected to rely 
 on the LiveCode dictionary, which, while truly excellent, contains some 2000 
 scripting words, far too many for the beginner to deal with.  The problem has 
 become more pronounced with new advances in LiveCode's features.   This is 
 why I wrote my own manual (190 pgs. plus figures) for my son. 
 
 
 All other major programming languages have a variety of manuals in the 
 bookstores.  Where are they for LiveCode?  It is insufficient to just direct 
 the user to scattered tutorials on the Internet or to seminars; there needs 
 to be a book that the user can easily use while learning the programming from 
 scratch.   Many people on this forum (including myself) have a background in 
 HyperCard or MetaCard that has made it relatively easy to migrate to 
 Revolution/LiveCode.  What happens when the old guard dies out?  Will 
 beginners who have no such background replace them?  Or will beginners 
 navigate to other programming languages for lack of an adequate LiveCode 
 manual?
 
 
 I have spent 25 years teaching medical students and programming in HyperCard 
 and its successors. I'd love to develop for mobile apps, but I have not yet 
 subscribed to LiveCode for this, because these features are not in the 
 present user manual, and I am unaware of adequate, organized, step-by-step, 
 printed documentation that puts it all together and I can keep in front of me 
 on my desk as I work. (Perhaps Colin Holgate's forthcoming book, LiveCode 
 Mobile Development Beginner's Guide, will make a difference.)My 
 publishing company, Medmaster, is based on educational principles designed to 
 teach medical students learning complex subjects for the first time.  My 
 sense is that sales of LiveCode in the schools and elsewhere would rise 
 significantly with better documentation.
 
 
 Stephen Goldberg, President 
 Medmaster Publishing Co., Inc.
 Professor Emeritus, Univ. of Miami Miller School of Medicine
 www.medmaster.net
 stgoldb...@aol.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: Hanoi Tower programming challenge...

2012-07-19 Thread Jim Hurley
 
 Message: 17
 Date: Wed, 18 Jul 2012 22:22:59 -0400
 From: Colin Holgate co...@verizon.net
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Hanoi Tower programming challenge...
 Message-ID: 65c1b2bf-d4a1-460f-a362-afdedccec...@verizon.net
 Content-Type: text/plain; charset=us-ascii
 
 In another tool's email list there is a thread going on about how it was 
 possible to solve the Hanoi Tower puzzle in under 20 lines. Without getting 
 too crazy it was possible to solve the problem in 16 lines of code. With a 
 little craziness it could be done in 13 lines.
 
 Assuming you have any idea what I'm talking about, how many lines of LiveCode 
 would you need to print out all the steps of solving a Hanoi Tower game?
 

Colin, 

How about this? I think this is the classic recursive solution.

Jim Hurley


on mouseUp
   ask How many disks are there? 
   tower it , A, B , C
end mouseUp

on tower N, start, destination, spare
  if N = 0 then exit tower 
  tower N - 1, start, spare, destination
  put Move   N   from  start   to  destination  cr after field 1
  tower N - 1, spare, destination, start
end tower
___
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: Hanoi Tower programming challenge...

2012-07-19 Thread Jim Hurley
Bob, 

Everybody finds these recursive algorithms hard, really hard, especially the 
Tower of Hanoi. Trouble is you can't start at the top.

Start recursion with the factorial function. The factorial of 9 is 9 * 
factorial(8) and so on. Therefore:

function Factorial n
 if n = 1 then
  return 1
   else
return n * factorial(n-1)
 end if 
end factorial

And everybody finds fitting algorithms to physics problems hard. Again, you 
can't start at the top.  Trust me, I spent my  life teach students how to put 
the math into physics.

Part of the problem of programming for physics problems is the computer 
language. 

For example, the algorithm to draw the path of a baseball is as simple as: 

  put 4 into  vx --x component of the velocity of the turtle
  put 5 into vy
  put .1 into gravity
  repeat until ycor()  0
incXY vx,vy --increase the x coordinate by vx and the y coordinate by vy
subtract gravity from vy -- add the acceleration (the rate of change in the 
velocity) to vy
  end repeat

This in Turtle Graphics. This is why I have been promoting TG for science 
students. It is geometrically oriented. The turtle is easier to talk to, and he 
is really good at solving differential equations--as in the problem of the 
baseball above..

More of this in:

go url http://jamesphurley.com/RunRev/TurtleGraphics.livecode;

Me? I find programming for the internet hard, really hard. I started in the 
middle. Big mistake.

Jim

 
 Message: 25
 Date: Thu, 19 Jul 2012 16:37:03 -0700
 From: Bob Sneidar b...@twft.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: Hanoi Tower programming challenge...
 Message-ID: ee614a6a-5abf-4af7-ae22-ce88ccd9b...@twft.com
 Content-Type: text/plain; charset=us-ascii
 
 I just read up on this. Honestly, if someone had asked me to come up with a 
 programmatical solution to this physical problem, I could not do it to save 
 my life. I don't know why. I consider myself to be fairly intelligent, but I 
 cannot turn physical problems like this into a formula. 
 
 I stumbled at this on a lot of tests in school. Whenever it got to these 
 kinds of problems I would stop dead in my tracks, even when the teacher said 
 to skip over the problems we could not solve. I tried to work out the 
 relationships of the physical problem to the mathemetical expression of it 
 and I could not go on until I saw in my head how it all worked and why. 
 
 I could probably get through the physical puzzle fine and see why it had to 
 work that way, but to convert it to a formula is quite beyond me. sigh Very 
 frustrating. This is probably why I could never be a very good developer, at 
 least when it comes to this sort of thing. 
 
 Bob
 
 


___
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: Stars

2012-06-23 Thread Jim Hurley
Hi Alejandro,

I never taught such a course. I did write a book some time back: Turtle 
Physics, Holt, Reinhard, and Winston, 1985. Also in Spanish: Fisica con Logo.

That implementation of TG was in LOGO, not LiveCode.

LOGO was a product of the MIT multimedia lab and was an outgrowth of an MIT 
project based on Seymor Paper's work.

LOGO was based on LISP, the language of choice at MIT computer science dept. It 
works well for work for AI.

It was all about list processing. So much so that the only repeat structure was 
tail recursion. Recursion drove most teachers nuts.

The link on my web site to Programing for science students was an early 
effort to translate Turtle Physics into LiveCode, nee Transcript.

Jim


On Jun 23, 2012, at  4:46 AM, use-livecode-requ...@lists.runrev.com wrote:

 Message: 5
 Date: Fri, 22 Jun 2012 11:08:32 -0700 (PDT)
 From: Alejandro Tejada capellan2...@gmail.com
 To: use-revolut...@lists.runrev.com
 Subject: Re: ANN: Stars
 Message-ID: 1340388512249-4651134.p...@n4.nabble.com
 Content-Type: text/plain; charset=us-ascii
 
 Hi Jim,
 
 Recently, I posted about my experience teaching a spanish
 version of the course MetaTalk Programmer:
 http://lists.runrev.com/pipermail/use-livecode/2012-June/173891.html
 
 Could you tell us about your experience teaching
 Turtle Graphics in the classroom?
 
 How old were your students?


___
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: Stars

2012-06-23 Thread Jim Hurley
Alejandro,

I can't imagine where that (infostations) web address came from--times long 
gone by.

My current RunRev web address is: http://jamesphurley.com/Revolution.html

There are lots of books that teach TG, but they all use LOGO or LISP.

Jim


On Jun 23, 2012, at  4:46 AM, use-livecode-requ...@lists.runrev.com wrote:

 Message: 18
 Date: Fri, 22 Jun 2012 15:06:54 -0700 (PDT)
 From: Alejandro Tejada capellan2...@gmail.com
 To: use-revolut...@lists.runrev.com
 Subject: Re: ANN: Stars
 Message-ID: 1340402814868-4651147.p...@n4.nabble.com
 Content-Type: text/plain; charset=us-ascii
 
 Hi Ken,
 
 Look at this website published by Jim Hurley:
 http://home.infostations.net/jhurley/
 
 
 Ken Corey wrote
 
 [snip]
 Why should Mr. Miller and crew implement turtle graphics when it's quite 
 possible for an enterprising teacher such as yourself to provide a 
 library that does the same thing? (At least for the people you teach.)
 [snip]
 
 
 I found really interesting that Jim wrote that learning Turtle Graphics
 could be useful for anybody, not just children...
 
 Where I could take an online Turtle Graphics course?
 
 Al


___
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: Stars

2012-06-23 Thread Jim Hurley
Hi Ken,

I agree with you about RevOnline being a priority.

Surly, if they haven't the time for that, they haven't the time to promote LC 
in education.

If that should ever happen, I believe TG would have to  be integral to LC, if 
it is to be taken seriously. Libraries do not provide the visibility needed.

Jim


On Jun 23, 2012, at  4:46 AM, use-livecode-requ...@lists.runrev.com wrote:

 Message: 6
 Date: Fri, 22 Jun 2012 19:10:57 +0100
 From: Ken Corey k...@kencorey.com
 To: use-livecode@lists.runrev.com
 Subject: Re: ANN: Stars
 Message-ID: 4fe4b531.8000...@kencorey.com
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 
 Lovely analysis, and most accessible...
 
 ...but...you've provided great examples of turtle graphics in your stack.
 
 Why should Mr. Miller and crew implement turtle graphics when it's quite 
 possible for an enterprising teacher such as yourself to provide a 
 library that does the same thing? (At least for the people you teach.)
 
 Now, there'd be extra points for the RunRev team if they pushed a little 
 harder on instructions for how to make a library to put into RevOnline, 
 so future students could learn from it.
 
 And I understand that there's trouble with RevOnline and uploading for 
 them to work on too.
 
 I'd rather they spent the time it would take to make native turtle 
 graphics and spent it fixing RevOnline, and making sure we can all share.
 
 -Ken


___
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


ANN: Stars

2012-06-22 Thread Jim Hurley
As LiveCode announcements go, this one is pretty low key. All Stars does is 
provide the code for drawing a star.

But there is a lesson for LiveCode to learn from the lowly five-pointed star, 
the one on the US flag.

A star may be viewed in two ways:

1)  Analytical Cartesian Geometry: A collection of 10 connected points (5 
outside points, and 5 inside) in a  Cartesian coordinate system.

2)  Euclidian Geometry: A collection of lines and angles without reference to 
place or orientation.

The first is the Cartesian picture where the computation to draw the star is 
executed using algebra, trigonometry, and/or analytic geometry. 

The other  picture is that of a figure in Euclidean space and the construction 
is carried out geometrically, drawing lines with a given angular relation to 
one another.

LiveCode favors the Cartesian picture employing its analytic tools to generate 
a list of 10 points and presenting the list as a graphic by setting the graphic 
to these points.

Here is how that code might look using those tools to draw a star in a 
Cartesian coordinate system:

   --FIrst, define the angles and lengths in the figure to be drawn
put 36 into gamma
put 18 into alpha
put 200 into L
--Next some trig. Not trivial.
 
--Let r1 be the distance from the center of the star to the inner 
 vertices. 
put L*sine(alpha) /sine(gamma) into  r1
 
--Let r2 be the distance from the center to the outer vertices
put L*cosine(alpha) +  r1 * cosine(gamma) into r2
 
--Start at the top of the star at a polar angle of 90 degrees
put 90 into a
--Circle around the ten verticies of the star
--in increments of 360/10 = 36 degree, the polar angle between vertices.
put 36 into da 
repeat with i = 1 to 10 
   if i mod 2 = 1 then
  put r2* cosine(a) into x
  put r2* sine(a)  into y
  put round(x+ x0) into x
  put round(-y+y0) into y
  put x,y  cr after tPoints--outer points
   else
  put  r1* cosine(a) into x
  put  r1* sine(a)  into y
  put round(x+ x0) into x
  put round(-y+y0) into y
  put x,y  cr after tPoints--inner points
   end if
   add da to a -- next vertex
   --If you want to see the star form line by line.
   set the points of grc Star to tPoints
   end repeat
   --Close the loop
   put results  line 1 of results into tPoints
   set the points of grc Star to tPoints



And here is what the loop might look like if the star were expressed as a 
geometrical figure: 

 put 2*360/5 into tAngle -- Pretty simple geometry here. 
 put 200 into L
 repeat with i = 1 to 5
   forward L
   right tAngle --at an exterior point
   forward L
   left tAngle/2 --at an interior point
end repeat


(After LC has  been taught how to execute forward, right, and left.)

There has been talk for some time of promoting LC in education, even in K-12. 
Great idea.

There has also been talk, more broadly, of rejuvenating the teaching of 
mathematics --See the TED talk by Conrad Wolfram at:


http://www.ted.com/talks/lang/en/conrad_wolfram_teaching_kids_real_math_with_computers.htmlConrad
 Wolfram

(Ken Ray will enjoy the stick figures at the end of the talk.)

From Wolfram's  talk: I believe that correctly using computers is the silver 
bullet for making math education work.  He cites particularly the use of the 
computer in modeling and simulation. He anticipates scientists (geologist, 
biologists, engineers) programing these simulations.

LiveCode has all the necessary analytical tools for such modeling and 
simulation, but  it lacks the geometric tools, specifically Sprite Geometry 
(aka Turtle Graphics.) 

For some years I have been promoting (spoken to Kevin on several occasions) the 
addition of Sprite geometry into LC. I believe it would add significantly to 
LC's penetration into the education market. It would allow kids to tackle 
problems that are much too difficult using Cartesian analytical tools, but 
quite straight forward when presented as problems in geometry--witness the 
Star above.

It would also allow them easy access to game programming. The loop to set a Fox 
graphic (control) chasing a Rabbit graphic (control) would look like this:

  repeat until the mouseClick
   tell hare
   --Move Hare in a circle.
   forward 2
   left 1
   put theLocation() into theHareLocation
   tell fox
   setheading direction(theHareLocation)
   forward 1
end repeat


The Fox and Hare and treated as Sprites and Sprite geometry can talk to any LC 
control, a drawing sprite with penDown or not drawing with penUp.

Many are put off by Turtle Graphics. There is a perception that it is just for 
kids. But it goes well beyond simple ways to draw polygons. (See the book by 
Professor Harold Ableson of MIT titled: Turtle Geometry: The Computer as a 
Medium for Exploring Mathematics (Artificial Intelligence, at 

Re: Sort of a problem

2012-05-12 Thread Jim Hurley
Thanks Peter. But I live in a very conservative county. None of yer fancy 
diagonals here. NW indeed!

Actually it is the County election database, and a search reveals only N, E, S, 
and W.

I think I finally get the phrase by  of each. Live Code does pretty much 
what I did, except I'm sure they don't use a bubble sort. 

Jim



 
 Message: 2
 Date: Sat, 12 May 2012 12:22:38 -0400
 From: Peter M. Brigham, MD pmb...@gmail.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: Sort of a problem
 Message-ID: 50a823d6-005e-47de-9a05-4b7ba094e...@gmail.com
 Content-Type: text/plain; charset=us-ascii
 
 If you have streets like SW 34th St you'll have a problem -- you should 
 probably adjust your pickStreet function:
 
 function pickStreet pName
   if word 1 of pName is among the words of N S E W NE NW SE SW then
  return word 2 to -1 of pName
   end if
   return pName
 end pickStreet
 
 -- 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


Re: Sort of a problem

2012-05-11 Thread Jim Hurley
Thanks Jerry. That is what I was looking for.

There is some magic going on behind the scenes with that by ... of each that 
I never really caught on to.

Jim


 
 Message: 5
 Date: Thu, 10 May 2012 21:23:36 -0700
 From: Jerry Jensen j...@jhj.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: Sort of a problem
 Message-ID: d53bdb2b-11cd-46b1-9f25-ba46e64a8...@jhj.com
 Content-Type: text/plain; charset=us-ascii
 
 This seems to do the job. No polish, but you'll get the idea.
 .Jerry
 
 Aw, crap, forgot about no attachments. Here's the code:
 
 
 
 on mouseUp
   local tList
   put fld Streets into tList
   sort lines of tList by pickStreet(each)
   put tList into fld Streets
 end mouseUp
 
 function pickStreet pName
   if word 1 of pName is in NSEW then
  return word 2 to -1 of pName
   else
  return pName
   end if
 end pickStreet
 
 -
 


___
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


Sort of a problem

2012-05-10 Thread Jim Hurley
I have a list of streets:

Main St
Oak Ave
N Auburn
Kimberly Ct
S Rector Rd
Maple Ave
W Pine St
Fairmont Ave

I want to sort them, but ignoring the compass prefix (N E S W) to give:

N Auburn
Fairmont Ave
Kimberly Ct
Main St
Maple Ave
Oak Ave
W Pine St
S Rector Rd

The best I have come up with is performing a bubble sort where I have control 
of the first word.

That script is below. This works well enough for short lists, but not for 
longer lists.
It might be possible to speed it up with arrays, but that is not what I'm after 
right now.
I have seen some amazing things done with custom sorts in Live Code. I confess, 
I never understood them.

Is there a custom sort available in Live Code to do this kind of sort?

Thanks,
JIm Hurley

Here is the bubble sort:

on mouseUp
   put field 1 into tList
   put N E S W into tWordsToIgnore
   put the number of lines in tList into n
   repeat
  put true into noChange
  repeat with i = 1 to n-1
 put theFirstWord(line i of tList, tWordsToIgnore) into tFirst
 put  theFirstWord(line i + 1 of tList, tWordsToIgnore) into tSecond
   --Reverse sequencial pairs if out of order.
 if tFirst  tSecond then
put line i  of tList into temp
put line i + 1 of tList into line i of tList
put temp into line i + 1 of tList
put false into  noChange
 end if
  end repeat
  if the shiftKey is down then exit to top --Just in case
  if  noChange then exit repeat ---Keep it up until no change.
   end repeat
   put tList into field 2
end mouseUp

function theFirstWord temp, tIgnoreWords
   put word 1 of temp into tFIrstWord
   if tFirstWord is among the words of tIgnoreWords then
  return word 2 of temp
   else 
  return word 1 of temp
   end if
end theFirstWord
___
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: Animation

2012-04-22 Thread Jim Hurley
Hi J,

LC can handle the game of 9 ball pool fairly well, and that is fairly 
computationally intensive--handling the collisions between multiple moving 
balls.

   You can find it at http://jamesphurley.com/Revolution.html

To download a stack from that web site, get the link and run this in the msg box

go url [the link]

There are a number of other simulations, in particular Bouncing ball tools at 
that web site  that deal with the complexities of collisions with walls in a 
convex polygon.

See also Programmable Graphics  in RevOnLine. There are 21 cards there 
demonstrating a variety of  animation problems.

Jim

 
 Message: 18
 Date: Sun, 22 Apr 2012 09:39:21 -0500
 From: J. Downs downs.davi...@gmail.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Animation
 Message-ID: 18535f31-46c1-49b0-b6db-870549d7f...@gmail.com
 Content-Type: text/plain; charset=windows-1252
 
 Hey, all.
 
 I'd like to experiment with LC for some video game development.  Sprite 
 animation with collision detection, vertical and horizontal landscape 
 scrolling, etc.  Can LC keep up the pace when the number of on-screen objects 
 gets to a dozen or more?  Need special add-ons like the Animation Engine, or 
 can it all be done natively?  Any exceptional online tutorials, etc. you 
 would recommend?
 
 All help would be greatly appreciated.
 
 Thanks,
 J.
 
 


___
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 and OT: Calling All SETI Enthusiasts

2012-03-28 Thread Jim Hurley
Roger and RIchard,

Two more distinctions:

1) Theories that supersede vs. theories that overturn

The General theory of relativity superseded Newton's theory of gravity and QM 
superseded Newtonian dynamics.
In each case, the second is the classical limit of the first.

On the other hand, Newtonian theory of gravity  overturned Aristotelian theory  
of gravity.



2) Theories of such weight, of such abundance and breadth of confirmation, vs. 
Theories of the lesser weight

Regarding this distinction, the current rhubarb over experimental evidence 
purporting to find neutrinos that traveled at a speed greater than light, some 
die hard theoretical physicists have recalled Sir Arthur Eddington (renowned 
British astrophysicist) facetiously  saying Experiments should not be believed 
until they have been confirmed by theory. 

The neutrino played a  similar roll many years ago. In a certain collision of 
elementary particle the evidence of the tracks in the cloud chamber were such 
that energy was not conserved in the reaction. Rather than admit a violation of 
such an entrenched  fundamental physical law, it was assumed that there was 
some, as yet unknown, particle that was invisible in the cloud chamber that had 
carried away the missing energy. Later that particle was found; it was the 
neutrino.



Jim



 
 Message: 21
 Date: Wed, 28 Mar 2012 09:51:45 -0600
 From: Roger Guay i...@mac.com
 To: use-livecode@lists.runrev.com
 Subject: Re: use-livecode Digest, Vol 102, Issue 56
 Message-ID: f4abe6cc-d6a3-4258-8956-25b7172fb...@mac.com
 Content-Type: text/plain; CHARSET=US-ASCII
 
 Thanks for your great post, Richard. Just one clarification if I may. 
 
 Hypothesis, Theory and Law have different connotations in science. A good 
 explanation is found at:
 
   
 http://wilstar.com/theories.htm
 
 Cheers,
 Roger 
 
 
 
 
 On Mar 27, 2012, at 5:43 PM, use-livecode-requ...@lists.runrev.com wrote:
 
 Message: 12
 Date: Tue, 27 Mar 2012 12:22:20 -0700
 From: Richard Gaskin ambassa...@fourthworld.com
 To: use-livecode@lists.runrev.com
 Subject: Re: ANN and OT: Calling All SETI Enthusiasts
 Message-ID: 4f72136c.6060...@fourthworld.com
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 
 
 
 Snip . . . . snip
 
 
 And Einstein's Theory is just that, a theory.  It's not yet a law, and 
 for good reason.  Every few years we hear from another quantum physicist 
 suggesting that they may be on the edge of something that disproves it. 
 Wouldn't be the first time a new discovery completed shattered our 
 understanding of how things work.
 
 snip . . . snip
 
 
 -- 
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 
 


___
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: ScaleMatic

2012-03-28 Thread Jim Hurley
Roger,

I was able to post to RevOnLine this morning.

Jim

 
 Message: 7
 Date: Wed, 28 Mar 2012 12:10:41 -0600
 From: Roger Guay i...@mac.com
 To: use-livecode@lists.runrev.com
 Subject: ANN: ScaleMatic
 Message-ID: 1116b76a-8c30-4aff-a1cf-b2601961c...@mac.com
 Content-Type: text/plain; CHARSET=US-ASCII
 
 Hi all,
 
 Here is a small utility for making scales/rulers for your stacks:
 
   
 http://web.me.com/irog/Roger_Guay/Downloads.html
 
 Scroll down to lower left. Sure would be nice to get RevOnLine back!!
 
 Cheers,
 Roger
 


___
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: Collisions

2012-03-26 Thread Jim Hurley
Richard,

That 9 ball stack is a bit wonkish.

I have extracted from that stack the basic elements that illustrate the 
collision process. It can be found in:

   go url http://jamesphurley.com/jhurleyFolder/TwoBallCollisions.livecode;

It illustrates the physics of the ideal collision. The momenta along the line 
of the collision (the line joining  the two centers of the balls) is exchanged 
in the collision, while the momenta (velocities) perpendicular to this line are 
unaffected in the collission. That is the very definition of an ideal elastic 
impact.
  
But you needn't  worry about all that, just  use the newVel function to 
generate the after collision velocities given the before collision velocities.

Jim


 
 Message: 10
 Date: Sun, 25 Mar 2012 15:23:13 -0400
 From: Richard MacLemale rich...@richardmac.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: Collisions
 Message-ID: 6b8c015f-1509-451a-adf0-fb934c89d...@richardmac.com
 Content-Type: text/plain; charset=us-ascii
 
 Jim,
 
 Thanks for taking the time to respond with such great explanations!  Of 
 course, since I spent most of my time in high school math staring at a girl 
 named Lisa, it's a bit challenging for me.  I downloaded the 9 ball example 
 and plan on spending a lot of time learning how it works.  Thanks for sharing 
 your knowledge - I really appreciate it.  
 
 ---
 Richard MacLemale
 Music = http://www.richardmac.com
 Programming = http://www.macandchee.se
 


___
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: Collisions

2012-03-25 Thread Jim Hurley
Richard,

Collision detection is the easier part. Just calculate the distance between 
centers and, if it is greater than the sum of the radii (assuming they are 
circular) you have a collision.

The more difficult part is the physics, what happens after the collission. Are 
they of equal mass and size? You need to conserve momentum and energy.

To get started you may  look at a pool game. See:

 http://jamesphurley.com/runrev.html

and look for Nine ball pool.

You may  want to also checkout Bouncing ball tools at the same site to see 
how to work with collision with different shapes, and how to deal with 
enclosures that are may  be convex.

Jim Hurley




 I'm working on a very simple iPad app where 4 large shapes randomly float 
 around on the screen.  What I'd like to do is have them be able to bounce off 
 each other if they happen to touch.  Are there any tutorial pages or sample 
 stacks out there that anyone knows of that I could use as a starting point?  
 I can do collision detection with intersect, but before I spend countless 
 hours reinventing the wheel, I thought I'd ask.
 
 ---
 Richard MacLemale
 Music = 
 http://www.richardmac.com
 
 Programming = 
 http://www.macandchee.se


___
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: Collisions

2012-03-25 Thread Jim Hurley
P.S.

In the simplest case, equal  masses, just interchange the velocities of the two 
balls after the collision.

Proof:
If one assumes that the solution is unique, and since interchanging the 
velocities conserves momentum and energy (for balls of equal mass), this 
solution is THE solution.

Jim

 Richard,
 
 Collision detection is the easier part. Just calculate the distance between 
 centers and, if it is greater than the sum of the radii (assuming they are 
 circular) you have a collision.
 
 The more difficult part is the physics, what happens after the collission. 
 Are they of equal mass and size? You need to conserve momentum and energy.
 
 To get started you may  look at a pool game. See:
 
 http://jamesphurley.com/runrev.html
 
 and look for Nine ball pool.
 
 You may  want to also checkout Bouncing ball tools at the same site to see 
 how to work with collision with different shapes, and how to deal with 
 enclosures that are may  be convex.
 
 Jim Hurley
 
 
 
 
 I'm working on a very simple iPad app where 4 large shapes randomly float 
 around on the screen.  What I'd like to do is have them be able to bounce 
 off each other if they happen to touch.  Are there any tutorial pages or 
 sample stacks out there that anyone knows of that I could use as a starting 
 point?  I can do collision detection with intersect, but before I spend 
 countless hours reinventing the wheel, I thought I'd ask.
 
 ---
 Richard MacLemale
 Music = 
 http://www.richardmac.com
 
 Programming = 
 http://www.macandchee.se
 

___
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: Collisions

2012-03-25 Thread Jim Hurley
Geoff,

What happens when two ball of equal mass collide ellastically is an exchange in 
velocities. 

The velocity is a VECTOR. I think that is the source of misunderstanding.

Your right there is  trig involved. For example from Nine ball...

function resetVel  xx,yy,xx',yy',vxx,vyy,vxx',vyy'
  put xx,yy into pme
  put xx',yy' into pOther
  put theLineAngle(pme,pOther) into tCentersAngle
  put tCentersAngle into tCa
  put xx,yy,xx+vxx,yy+vyy into tVelVector
  put theLineAngle(tVelVector) into tVa
  put sqrt(vxx'*vxx'+vyy'*vyy') into v'
  put sqrt(vxx*vxx+vyy*vyy) into v

  put xx',yy',xx'+vxx',yy'+vyy' into tVelVector'
  put theLineAngle(tVelVector') into tVa'
  --Angle of the vVector relative to the line joining centers
  put tVa - tCa into tVrA 
  put tVa'- tCa into tVrA'
  
  put v*cos(tVrA) into vR'
  put v*sin(tVrA) into vT
  put v'*cos(tVrA') into vR
  put  v'*sin(tVrA') into vT'
  
  put vR*cos(tCa) - vT*sin(tCa) into vxx
  put vR*sin(tCa) + vT*cos(tCa) into vyy
  
  put vR'*cos(tCa) - vT'*sin(tCa) into vxx'
  put vR'*sin(tCa) + vT'*cos(tCa) into vyy'
  return vxx,vyy,vxx',vyy'
end resetVel

Jim Hurley

 Geoff Canyon wrote:
 This works only if the balls hit head-on. Otherwise you need to do the
 trig. As a simple example, say there are two balls headed toward each
 other. Each has a radius of 2^.5. Ball A is moving at -2 units per second
 on the x axis, i.e. to the left, and its center has a Y coordinate of 2.
 Ball B is moving at 2 units per second on the x axis, i.e. to the right,
 and its center has a Y coordinate of 0. When the balls collide, they will
 be 2 units apart both horizontally and vertically, hence they collide at a
 45 degree angle. Let's say that they're at 0,0 and 2,2 at the time of the
 collision. They won't simply exchange velocities. Their original motion on
 the x axis is translated entirely into motion along the y axis. After the
 collision, ball A will have an X coordinate of 2, and be moving at 2 units
 per second on the Y axis, i.e. up. ball B will have an X coordinate of 0,
 and be moving at -2 units per second on the Y axis, i.e. down. You need to
 calculate the angle between the balls at the moment of collision, and use
 the sine and cosine to figure out what happens from there.
 
 All of the above is from my head so feel free to check me.
 
 On Sun, Mar 25, 2012 at 8:56 AM, Jim Hurley 
 jhurley0305 at sbcglobal.net
 wrote:
 
 

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