Re: Japanese (unicode?) text problem

2016-09-20 Thread Tore Nilsen
Internally LiveCode uses UTF-16. You can try to decode your text from UTF-8 
like this:


put url tUrl into tTextToDecode
put textDecode(tTextToDecode,”UTF-8") into field “indices"


regards
Tore




> 21. sep. 2016 kl. 06.30 skrev Nicolas Cueto :
> 
> ​With Notepad++​, created a new file, pasted English and Japanese text, set
> encoding to UTF-8,  then saved as .txt. (Confirmed the file by opening with
> Windows' "Notepad".)
> 
> Next, in LC8.1 ran this button script:
> 
> on mouseUp
>   put empty into field "indices"
>   set the itemdel to quote
>   put item 2 of the long name of this stack into tDataPath
>   set the itemdel to "/"
>   delete the last item of tDataPath
>   put "/Data/bilingual.txt" after tDataPath
>   put "file:" & tDataPath  into tURL
>   put url tURL into field "indices"
> end mouseUp
> 
> The text appears in the field, but with Japanese text garbled.
> 
> What am I doing wrong?
> 
> Thanks.
> 
> --
> Nicolas Cueto
> ___
> use-livecode mailing list
> use-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: Japanese (unicode?) text problem

2016-09-20 Thread Tim Selander

Hi Nicolas,

Finally something I can answer!

I have found that you need to use 'open file' because that let's you 
specify the file's encoding.


Assume the path to your file is in tFile, these lines should work:

  open file tFile for utf8  read
  read from file tFile until end
  put it into fld "indices"
  close file tFile

If there is a more elegant way, I'm sure the pros will chime in!

Tim Selander
Tokyo, Japan


On 2016/09/21 13:30, Nicolas Cueto wrote:

​With Notepad++​, created a new file, pasted English and Japanese text, set
encoding to UTF-8,  then saved as .txt. (Confirmed the file by opening with
Windows' "Notepad".)

Next, in LC8.1 ran this button script:

on mouseUp
put empty into field "indices"
set the itemdel to quote
put item 2 of the long name of this stack into tDataPath
set the itemdel to "/"
delete the last item of tDataPath
put "/Data/bilingual.txt" after tDataPath
put "file:" & tDataPath  into tURL
put url tURL into field "indices"
end mouseUp

The text appears in the field, but with Japanese text garbled.

What am I doing wrong?

Thanks.

--
Nicolas Cueto
___
use-livecode mailing list
use-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

Malte Brill stack

2016-09-20 Thread Alejandro Tejada
Hi All,

Many years ago, Malte Brill posted
a stack (or script) that shows how
to use images within text fields to
simulate a game display board.

In his sample text field, you could
type a word and automatically, each
letter was converted to a bitmap image
of the letter typed.

Probably, Malte created this stack
for one of his games, but I have lose
the reference of the message date and
stack's name.

Does anyone keeps a copy of this stack
or could find the date of publishing,
among your backups?

Many Thanks in advance!

Alejandro

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


Japanese (unicode?) text problem

2016-09-20 Thread Nicolas Cueto
​With Notepad++​, created a new file, pasted English and Japanese text, set
encoding to UTF-8,  then saved as .txt. (Confirmed the file by opening with
Windows' "Notepad".)

Next, in LC8.1 ran this button script:

on mouseUp
   put empty into field "indices"
   set the itemdel to quote
   put item 2 of the long name of this stack into tDataPath
   set the itemdel to "/"
   delete the last item of tDataPath
   put "/Data/bilingual.txt" after tDataPath
   put "file:" & tDataPath  into tURL
   put url tURL into field "indices"
end mouseUp

The text appears in the field, but with Japanese text garbled.

What am I doing wrong?

Thanks.

--
Nicolas Cueto
___
use-livecode mailing list
use-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: Tool palette and Inspector disappearing in LC8.1?

2016-09-20 Thread Devin Asay

> On Sep 20, 2016, at 7:04 PM, Richard Burkett  
> wrote:
> 
> I probably have a number of bugs to file when I get some time to search the 
> bugs database and do it, but has anyone else noticed that the tool palette 
> disappears from time to time? I have an app I’m working on with a lot of 
> substacks with their own menus, and I often work with a script open and the 
> message box visible, and sometimes with the Inspector open, too. I’ve found 
> that after enough time working, sometimes I can no longer open the Inspector, 
> but more frequently the Tool Palette disappears and I have to click on the 
> Message Box to return from the Browse mode to the LC editing cursor and then 
> try to show the Tool Palette (which doesn’t always work when choosing the 
> menu). It’s really annoyingly frequent. There are a lot of great things in LC 
> 8.1, but the editing interface isn’t exactly one of them.

Richard,

Does this bug report match what you’re seeing?

http://quality.livecode.com/show_bug.cgi?id=18292

It’s been confirmed, but I think if you could add your comments to the bug 
report it could help the engineering team pin it down and fix it.

Regards,

Devin


Devin Asay
Learn to code with LiveCode University
https://livecode.com/store/education/

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

Re: Random topic: What script font do you like/use?

2016-09-20 Thread me
I use Typewalk Mono 1915 Medium for the most part. They have a thin as well. I 
use thin and medium in my own editors and medium in the native one.

I am a former Verdana user for the exact reasons you stated, Jeanne. Good luck 
on your quest!

Best, Jerry

On Sep 20, 2016, 8:32 PM -0500, Jeanne A. E. DeVoto , 
wrote:
> I've used Andale Mono by preference, but I don't have the bold, and
> so on versions of LC after 5.x, bolding for comments and keywords
> doesn't show up in the script editor. (Bah.)
>
> I liked it because it was:
> 1) clean-looking with a good x-height
> 2) has easily distinguishable lowercase l, capital I, and number 1,
> and zero and O
>
> I thought about just buying the bold, but I've been experimenting
> with other fonts. I tried Verdana for a while-it's not monospaced,
> but fairly wide and very clean-looking-but it turns out that I prefer
> monospaced fonts better for reading code. Maybe just because I'm so
> used to them that non-monospaced fonts look weird in that context.
> Source Code Pro is appealing.
>
> -
>
> So...
>
> What fonts do you like best for code?
> Or does everybody just fall back on Courier? ;-)
>
> ___
> use-livecode mailing list
> use-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: Fast way to retrieve a range of data

2016-09-20 Thread Mike Bonner
This should be pretty fast if I understand your criteria well enough..

put field "yourfield" into tData
filter lines of tData with ("2" & tab & 54 & tab & "*")

On Tue, Sep 20, 2016 at 8:08 PM, Nicolas Cueto  wrote:

> Given a text field ("Vocabulary Indices") of tab-delimited data whose cr
> lines are organized ascending-numeric first by Column 1 ("Textbook Level" =
> 1, 2, or 3) then next by Column 2 ("Page Number" = 1 to 200), what are fast
> ways of retrieving, say, all the cr lines for Textbook Level = 2, Page
> Number = 54?
>
> Thank you.
>
> --
> Nicolas Cueto
> ___
> use-livecode mailing list
> use-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


Fast way to retrieve a range of data

2016-09-20 Thread Nicolas Cueto
Given a text field ("Vocabulary Indices") of tab-delimited data whose cr
lines are organized ascending-numeric first by Column 1 ("Textbook Level" =
1, 2, or 3) then next by Column 2 ("Page Number" = 1 to 200), what are fast
ways of retrieving, say, all the cr lines for Textbook Level = 2, Page
Number = 54?

Thank you.

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


Re: Random topic: What script font do you like/use?

2016-09-20 Thread Mark Wieder

On 09/20/2016 06:36 PM, Monte Goulding wrote:



On 21 Sep 2016, at 11:31 AM, Jeanne A. E. DeVoto  
wrote:

Source Code Pro is appealing.


Source Code Pro has been my coding font of choice on all platforms and 
programming languages since it was first announced.


--
 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: Fast Algorithm to Determine Average Brightness of an Image

2016-09-20 Thread Sannyasin Brahmanathaswami
@ HH

OK I will "bite" on your idea.  but I have never examined or processed the 
imagedata. Please scrutinize my code below.  But there is a major caveat with 
your original code (see below)

I think I got it correct. 

but there is a huge difference on the result between the 1 X 1 and the 12 X 9

I have a late afternoon shot of the sun setting over the ocean. your original 
function returns

148.981481 # which seems too low…

But if I did this correctly (I may not have)

I get 

192.33  # which seems a lot more correct visually because this is bright 
image.

average across 12x 9 = 108 px = 432 bytes of image data.

did I do something wrong here. (disclaimer… this could probably be 
optimized…but still very fast)


function avgBrightness theImage
   --lock screen; lock messages
   
   if there is no img ii then create img ii
   set resizeQuality of img ii to "best"
   
   put the width of img 1 into tOrigWidth
   put the height of img 1 into tOrigHeight
   
   set width of img ii to tOrigWidth
   set height of img ii to tOrigHeight
   
   set imagedata of img ii to the imagedata of img theImage
   
   put 12 into tNewWidth
   
   # Scale down proportinally
   set the width of img ii to tNewWidth
   put  round ( (tOrigHeight*tNewWidth)/tOrigWidth) into tNewHeight
   set height of img ii to tNewHeight
   
   --set width of img ii to 1
   --set height of img ii to 1
   
   put the imagedata of img ii into iData
   
   put tNewWidth * tNewHeight * 4 into tNoPixelBytes
   
   delete img ii
   
   # get beyond first byte otherwise mod 4 returns bogus value

   put (byteToNum(byte 2 of iData) & "," &\
   byteToNum(byte 3 of iData) & "," &\
   byteToNum(byte 4 of iData) & ",")   into tAllPixelColorValues
   
   repeat with x = 5 to tNoPixelBytes
  if x mod 4 = 1 then next repeat # skip this one, all zeros here.
  put byteToNum(byte x of iData) &"," after tAllPixelColorValues
   end repeat

   put empty into item -1 of tAllPixelColorValues # remove last empty itm
   
  return avg (tAllPixelColorValues)
  unlock screen; unlock messages
   end avgBrightness
BR


But if you use your original code  and do not delete img ii, a different value 
is returned than if you uncomment that line.. if you delete img ii you get a 
different value.



function avgBrightness1 theImage
   --lock screen; lock messages
   
  if there is no img ii then create img ii
  set resizeQuality of img ii to "best"
  
  put the width of img 1 into tOrigWidth
  put the height of img 1 into tOrigHeight
  
  set imagedata of img ii to the imagedata of img theImage
  set width of img ii to 1
  set height of img ii to 1
 put the imagedata of img ii into iData
 --delete img ii
  return avg (byteToNum(byte 2 of iData), \
byteToNum(byte 3 of iData), \
byteToNum(byte 4 of iData))
  --unlock screen; unlock messages
end avgBrightness1
 

On 9/20/16, 1:31 PM, "use-livecode on behalf of hh" 
 wrote:

There is still one option that uses a weighted grayLevel-mean
(I use these weights in imageJIT). This would reflect more
than simple averaging that one wants a dark/light decision.

return (0.1*byteToNum(byte 2 of iData) \
  + 0.6*byteToNum(byte 3 of iData) \
  + 0.3*byteToNum(byte 4 of iData))

Also, what will be still fast enough, you could think about 
scaling down _proportional_ to 3x2 pixels (or 12x8 pixels)
and then applying the above weighted mean on these few pixels.

p.s. I checked: The one-pixel color is by LC built from the
arithmetic mean of the color channels, nearly as fast as an external!



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

Re: Random topic: What script font do you like/use?

2016-09-20 Thread Monte Goulding

> On 21 Sep 2016, at 11:31 AM, Jeanne A. E. DeVoto  
> wrote:
> 
> Source Code Pro is appealing.

We are contemplating bundling this with LiveCode as the default it seems to be 
suitably licensed. Hack is also a pretty nice open source font 
http://sourcefoundry.org/hack/ 

Cheers

Monte


___
use-livecode mailing list
use-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: "lightening" a color

2016-09-20 Thread Roger Eller
There's no reason that Windows can not render a graphic or color equal to
that of a Mac.  Video card capabilities do have relevance however.

On Sep 20, 2016 6:44 PM, "Bob Sneidar"  wrote:

> Lots of graphic affects on Macs, but Win seems to lack some of that
> functionality. I will put something in front of the background, like a
> grapic object, then change the opacity of the graphic object. Makes
> selecting things with a mouse lasso impossible tho'
>
> Bob S
>
>
> > On Sep 10, 2016, at 15:00 , Dr. Hawkins  wrote:
> >
> > I am adding the ability to have multiple clients open, and want to use
> > colors as a cue.
> >
> > Is there a way to "lighten" a color.  That is (I suppose), to grab the
> > numeric representation, and convert that to a much paler shade of the
> color?
> >
> > --
> > Dr. Richard E. Hawkins, Esq.
> > (702) 508-8462
> > ___
> > use-livecode mailing list
> > use-livecode@lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: How to extract specific columns/line items from a CSV file?

2016-09-20 Thread Mike Bonner
Thanks Richard, that does answer my question.  Repeating for each line in
an external url does load the whole thing at once.  Someone remind me.. I
think I read that the "for each" no longer creates a second copy of the
data, is this correct?  Or did it ever make a duplicate?

On Tue, Sep 20, 2016 at 3:42 PM, Richard Gaskin 
wrote:

> Keith Clarke wrote:
>
> > It’s interesting that the url container can be addressed directly,
> > instead of loading the file
>
>   get url ("file:"& tFile)
>
> ...does the same as:
>
>   open file tFile for read
>   read from file until EOF
>   close file tFile
>
> It's just more convenient than using the three-line method (which can be
> very useful if you need for fine-grained control over the read, such as
> reading in chunks or from a particular offset).
>
> Unless your files are much bigger than 100 MBs you should find loading
> them into memory well worth the effort for the time saved parsing them thee.
>
> --
>  Richard Gaskin
>  Fourth World Systems
>  Software Design and Development for the Desktop, Mobile, and the Web
>  
>  ambassa...@fourthworld.comhttp://www.FourthWorld.com
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Silly Text Field Question

2016-09-20 Thread Mike Bonner
Yeah, it is probably wiser to increase the delay as you did to be safe (if
you decided to use the method)  This is another thing that would be nice as
a settable property.  "set the autohilite of field "whatever" to true"

On Tue, Sep 20, 2016 at 4:07 PM, Peter Reid  wrote:

> Thanks Mike & Richmond.
>
> Mike – your solution provides the behaviour I'm after but does seem to
> live on the edge of a runaway loop!  I increased the millisec delay from 1
> to 5 to try to reduce the potential for a runaway situation:
>
> local sHilitedelay
>
> on openField
>if sHilitedelay is empty then put the millisec into sHilitedelay
>if the millisec - sHilitedelay > 5 then send "hiliteText" to the target
> in 0 millisec
> end openField
>
> on hiliteText
>   select the text of the target
>   put the millisec into sHilitedelay
> end hiliteText
>
>
> Richmond – your solution matches the keyboard tabbing behaviour I'm after
> but not the mouse selection behaviour.
>
>
> My own further idea was the following in the card script:
>
> on openField
>-- on tabbing into a field highlight its current content:
>hiliteText
> end openField
>
> on mouseEnter
>-- on mousing into/across a field highlight its current content:
>hiliteText
> end mouseEnter
>
> on hiliteText
>put the id of the target into tID
>if there is a field id tID then
>   -- select the text of field objects only:
>   select the text of the target
>end if
> end hiliteText
>
> The above almost does what I want, but not quite. This method allows the
> user to use either the tab key on the keyboard or the mouse pointer to
> select another field. As the new field is selected, its current content is
> hilited ready to be replaced by any keystrokes.
>
> Note that the user must simply move the mouse pointer into (or across) the
> new field but NOT click into it. When the user does click the mouse, it
> behaves normally and places the insertion point in the current content at
> the position of the mouse pointer at the moment of the click.
>
> As with Mike's approach, the script for this behaviour is in the card
> script to provide the default behaviour for all fields on the card.
>
> Peter
> --
> Peter Reid
> Loughborough, UK
>
> > On 20 Sep 2016, at 10:14pm, use-livecode-requ...@lists.runrev.com wrote:
> >
> > Date: Tue, 20 Sep 2016 07:07:42 -0600
> > From: Mike Bonner 
> > To: How to use LiveCode 
> > Subject: Re: Silly Text Field Question
> > Message-ID:
> >    mail.gmail.com>
> > Content-Type: text/plain; charset=UTF-8
> >
> > Try this..
> >
> > local sHilitedelay
> >
> > on openField
> >
> > -- sHilitedelay is used to avoid a weird side effect when regaining stack
> > focus
> > -- by clicking on a field in the card.  If a field other than the
> > previously selected
> > -- is clicked, it can start a runaway loop. The delay solves this
> problem.
> > -- when experimenting you might put in a "if the shiftkey is down then
> exit
> > to top"
> > -- so you can break out of the loop if necessary, though the delay does
> > appear to solve it fine.
> >   if sHilitedelay is empty then put the millisec into sHilitedelay
> >
> > -- use send in time so that all the housekeeping is completed before you
> > try to hilite
> >   if the millisec - sHilitedelay > 1 then send "hiliteText" to the target
> > in 0 millisec
> >
> > end openField
> >
> > on hiliteText
> >   select the text of the target
> >   put the millisec into sHilitedelay
> > end hiliteText
>
> >
> > On 20 Sep 2016, at 10:14pm, use-livecode-requ...@lists.runrev.com wrote:
> >
> > Date: Tue, 20 Sep 2016 23:29:25 +0300
> > From: Richmond 
> > To: How to use LiveCode 
> > Subject: Re: Silly Text Field Question
> > Message-ID: <3960ebe8-2e97-572a-941f-b96a97345...@gmail.com>
> > Content-Type: text/plain; charset=windows-1252; format=flowed
> >
> > Well, I missed something as well.
> >
> > I just put this script in the cardScript:
> >
> > on openCard
> >set the autoTab of fld "f1" to true
> >set the autoTab of fld "f2" to true
> >set the autoTab of fld "f3" to true
> >set the autoTab of fld "f4" to true
> > end openCard
> >
> > and everything works . . . even if I did lose my temper several times.
> >
> > https://www.dropbox.com/s/rnnj9rxla17ij8j/Text%20Hop.livecode.zip?dl=0
> >
> > Richmond.
> >
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:

Tool palette and Inspector disappearing in LC8.1?

2016-09-20 Thread Richard Burkett
I probably have a number of bugs to file when I get some time to search the 
bugs database and do it, but has anyone else noticed that the tool palette 
disappears from time to time? I have an app I’m working on with a lot of 
substacks with their own menus, and I often work with a script open and the 
message box visible, and sometimes with the Inspector open, too. I’ve found 
that after enough time working, sometimes I can no longer open the Inspector, 
but more frequently the Tool Palette disappears and I have to click on the 
Message Box to return from the Browse mode to the LC editing cursor and then 
try to show the Tool Palette (which doesn’t always work when choosing the 
menu). It’s really annoyingly frequent. There are a lot of great things in LC 
8.1, but the editing interface isn’t exactly one of them.

Richard

Richard Burkett
richard.burk...@sbcglobal.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: Fast Algorithm to Determine Average Brightness of an Image

2016-09-20 Thread hh
There is still one option that uses a weighted grayLevel-mean
(I use these weights in imageJIT). This would reflect more
than simple averaging that one wants a dark/light decision.

return (0.1*byteToNum(byte 2 of iData) \
  + 0.6*byteToNum(byte 3 of iData) \
  + 0.3*byteToNum(byte 4 of iData))

Also, what will be still fast enough, you could think about 
scaling down _proportional_ to 3x2 pixels (or 12x8 pixels)
and then applying the above weighted mean on these few pixels.

p.s. I checked: The one-pixel color is by LC built from the
arithmetic mean of the color channels, nearly as fast as an external!

___
use-livecode mailing list
use-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: new glx2 script editor now on line

2016-09-20 Thread mwieder
However, there *are* a couple of things that aren't working in release
3.0.19, and I've fixed them up and will post a new build when I get home
this evening. What isn't working currently is that folding scripts don't
update the line numbers.



-
-- 
 Mark Wieder
 ahsoftw...@gmail.com
--
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/ANN-new-glx2-script-editor-now-on-line-tp4708283p4708707.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: ANN: new glx2 script editor now on line

2016-09-20 Thread Bob Sneidar
False alarm. I was misremembering that GLX2 had clairvoyance for variable 
names, but that was a feature of another script editor now long defunct.

Bob S


On Sep 20, 2016, at 15:37 , Bob Sneidar 
> wrote:

Clairvoyance no workie... I can have a look and see if I can tell what is going 
wrong.

Bob S


On Sep 10, 2016, at 19:34 , ahsoftware 
> wrote:

Zombie alert: the dead glx2 script editor has come back to life.

>From the release notes:

2016.09.10 GLX2 3.0.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: "lightening" a color

2016-09-20 Thread Bob Sneidar
Lots of graphic affects on Macs, but Win seems to lack some of that 
functionality. I will put something in front of the background, like a grapic 
object, then change the opacity of the graphic object. Makes selecting things 
with a mouse lasso impossible tho'

Bob S


> On Sep 10, 2016, at 15:00 , Dr. Hawkins  wrote:
> 
> I am adding the ability to have multiple clients open, and want to use
> colors as a cue.
> 
> Is there a way to "lighten" a color.  That is (I suppose), to grab the
> numeric representation, and convert that to a much paler shade of the color?
> 
> -- 
> Dr. Richard E. Hawkins, Esq.
> (702) 508-8462
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


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


Re: Bug or Feature - Tranparent Buttons Non-Responsive

2016-09-20 Thread Bob Sneidar
The way Jacque describes it is how it behaves for me. 10.11/8.1.

Bob S


On Sep 11, 2016, at 20:02 , J. Landman Gay 
> wrote:

Is it just me that thinks the ideal button should be responsive
across it's whole rect regardless of the opacity status? That that
should be the default/in the engine itself?

We discussed this issue before under the heading of "Grabbing Image
with Transparent Mask" where the underlying challenge was the same.

Transparent buttons have always responded to a click in any part of the 
rectangle. If it isn't happening in LC 8 then I'd call it a bug. I just tried 
it here though and it seemed to work okay, at least on desktop. Is it different 
on mobile?

--
Jacqueline Landman Gay | 
jac...@hyperactivesw.com
HyperActive Software   | 
http://www.hyperactivesw.com

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


Re: ANN: new glx2 script editor now on line

2016-09-20 Thread Bob Sneidar
Clairvoyance no workie... I can have a look and see if I can tell what is going 
wrong.

Bob S


On Sep 10, 2016, at 19:34 , ahsoftware 
> wrote:

Zombie alert: the dead glx2 script editor has come back to life.

>From the release notes:

2016.09.10 GLX2 3.0.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: Silly Text Field Question

2016-09-20 Thread Peter Reid
Thanks Mike & Richmond.

Mike – your solution provides the behaviour I'm after but does seem to live on 
the edge of a runaway loop!  I increased the millisec delay from 1 to 5 to try 
to reduce the potential for a runaway situation:

local sHilitedelay

on openField
   if sHilitedelay is empty then put the millisec into sHilitedelay
   if the millisec - sHilitedelay > 5 then send "hiliteText" to the target in 0 
millisec
end openField

on hiliteText
  select the text of the target
  put the millisec into sHilitedelay
end hiliteText


Richmond – your solution matches the keyboard tabbing behaviour I'm after but 
not the mouse selection behaviour.


My own further idea was the following in the card script:

on openField
   -- on tabbing into a field highlight its current content:
   hiliteText
end openField

on mouseEnter
   -- on mousing into/across a field highlight its current content:
   hiliteText
end mouseEnter

on hiliteText
   put the id of the target into tID
   if there is a field id tID then
  -- select the text of field objects only:
  select the text of the target
   end if
end hiliteText

The above almost does what I want, but not quite. This method allows the user 
to use either the tab key on the keyboard or the mouse pointer to select 
another field. As the new field is selected, its current content is hilited 
ready to be replaced by any keystrokes.

Note that the user must simply move the mouse pointer into (or across) the new 
field but NOT click into it. When the user does click the mouse, it behaves 
normally and places the insertion point in the current content at the position 
of the mouse pointer at the moment of the click.

As with Mike's approach, the script for this behaviour is in the card script to 
provide the default behaviour for all fields on the card.

Peter
--
Peter Reid
Loughborough, UK

> On 20 Sep 2016, at 10:14pm, use-livecode-requ...@lists.runrev.com wrote:
> 
> Date: Tue, 20 Sep 2016 07:07:42 -0600
> From: Mike Bonner 
> To: How to use LiveCode 
> Subject: Re: Silly Text Field Question
> Message-ID:
>   
> Content-Type: text/plain; charset=UTF-8
> 
> Try this..
> 
> local sHilitedelay
> 
> on openField
> 
> -- sHilitedelay is used to avoid a weird side effect when regaining stack
> focus
> -- by clicking on a field in the card.  If a field other than the
> previously selected
> -- is clicked, it can start a runaway loop. The delay solves this problem.
> -- when experimenting you might put in a "if the shiftkey is down then exit
> to top"
> -- so you can break out of the loop if necessary, though the delay does
> appear to solve it fine.
>   if sHilitedelay is empty then put the millisec into sHilitedelay
> 
> -- use send in time so that all the housekeeping is completed before you
> try to hilite
>   if the millisec - sHilitedelay > 1 then send "hiliteText" to the target
> in 0 millisec
> 
> end openField
> 
> on hiliteText
>   select the text of the target
>   put the millisec into sHilitedelay
> end hiliteText

> 
> On 20 Sep 2016, at 10:14pm, use-livecode-requ...@lists.runrev.com wrote:
> 
> Date: Tue, 20 Sep 2016 23:29:25 +0300
> From: Richmond 
> To: How to use LiveCode 
> Subject: Re: Silly Text Field Question
> Message-ID: <3960ebe8-2e97-572a-941f-b96a97345...@gmail.com>
> Content-Type: text/plain; charset=windows-1252; format=flowed
> 
> Well, I missed something as well.
> 
> I just put this script in the cardScript:
> 
> on openCard
>set the autoTab of fld "f1" to true
>set the autoTab of fld "f2" to true
>set the autoTab of fld "f3" to true
>set the autoTab of fld "f4" to true
> end openCard
> 
> and everything works . . . even if I did lose my temper several times.
> 
> https://www.dropbox.com/s/rnnj9rxla17ij8j/Text%20Hop.livecode.zip?dl=0
> 
> 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: Fast Algorithm to Determine Average Brightness of an Image

2016-09-20 Thread Sannyasin Brahmanathaswami
@ hh

That works!

fascinating. Though what is bright not bright, is, as you say, "not sharp" 

Images that return a value > 100 still seem bright enough to warrant darker 
type… 

and of course you may have e.g. very dark stone mountains (taking up 1/3 of the 
composition space at the bottom half of the image) with a very bright, blue 
clear sky… 

So "average brightness" has only so much utility in terms of choosing a color 
brightness for an overlay.

But, this is still very useful function.  Thank you!
 

On 9/20/16, 10:14 AM, "use-livecode on behalf of hh" 
 wrote:

You could try the following function. It is "dirty" (the definition
of 'brightness' is also unsharp!), but it is very fast.

local ii="tmp-1.414214"

-- uses the average color intensity of the pixel
-- resulting from scaling down to a 1x1 image
function avgBrightness theImage
  lock screen; lock messages
  if there is no img ii then create img ii
  set resizeQuality of img ii to "best"
  set width of img ii to the width of img 1
  set height of img ii to the height of img 1
  set imagedata of img ii to the imagedata of theImage
  set width of img ii to 1
  set height of img ii to 1
  put the imagedata of img ii into iData
  delete img ii
  return avg (byteToNum(byte 2 of iData), \
byteToNum(byte 3 of iData), \
byteToNum(byte 4 of iData))
  unlock screen; unlock messages
end avgBrightnes

___
use-livecode mailing list
use-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: new glx2 script editor now on line

2016-09-20 Thread Bob Sneidar
My beloved GLX2! I thought I had lost you!!! ;-)

Bob S


On Sep 10, 2016, at 19:34 , ahsoftware 
> wrote:

Zombie alert: the dead glx2 script editor has come back to life.

>From the release notes:

2016.09.10 GLX2 3.0.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: Strategies to test stacks in different platforms

2016-09-20 Thread Bob Sneidar
+1. I got 2 new technicians whose struggles with Forms Generator made me 
rethink a few things. They also found bugs I had not yet discovered.

Bob S


On Sep 10, 2016, at 14:09 , J. Landman Gay 
> wrote:

Really the only way to test thoroughly is to find someone else to do it, 
someone who has never seen your stack before. As a developer, you know too much 
to test in an unbiased way. Also, watching a new user try to figure out what to 
do will tell you a lot about your interface.

--
Jacqueline Landman Gay | 
jac...@hyperactivesw.com
HyperActive Software   | 
http://www.hyperactivesw.com

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


Re: use-livecode Digest, Vol 156, Issue 20

2016-09-20 Thread Bob Sneidar
Once something is part of a standard, getting it unstandardized is probably 
like brain surgery with a bic pen. Best not attempted.

Bob S


On Sep 10, 2016, at 03:28 , Peter Reid 
> wrote:

1.:


2.:


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


Re: How to extract specific columns/line items from a CSV file?

2016-09-20 Thread Richard Gaskin

Keith Clarke wrote:

> It’s interesting that the url container can be addressed directly,
> instead of loading the file

  get url ("file:"& tFile)

...does the same as:

  open file tFile for read
  read from file until EOF
  close file tFile

It's just more convenient than using the three-line method (which can be 
very useful if you need for fine-grained control over the read, such as 
reading in chunks or from a particular offset).


Unless your files are much bigger than 100 MBs you should find loading 
them into memory well worth the effort for the time saved parsing them thee.


--
 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: What's everyone working on this month? (September 2016)

2016-09-20 Thread Ralph DiMola
I am migrating all my mobile apps from 6.7.x to LC 8.1.0. I am impressed with 
LC 8 so far now that I am into it heavy. No IDE crashes or lockups on Win 10 
and El Capitan so far. IDE load times are as fast if not faster than LC6. iOS 
builds are using Xcode 7.3.1. I have submitted a couple of bug reports and will 
have at least 1 more, but I have been able to work around them for now. The 
first app (with a few minor issues) is running OK on Android, iOS 9 and iOS 10. 
Now on to the next app. Been some long nights and a lot of "answer"s but I live 
for this. Lots of tea with honey...

Question: On the Mac the LC app is read-only now, what is the current procedure 
for modifying the plists?

Were having fun now!

Ralph DiMola
IT Director
Evergreen Information Services
rdim...@evergreeninfo.net


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


Re: How to extract specific columns/line items from a CSV file?

2016-09-20 Thread Keith Clarke
Thanks Mike (& Craig) for confirming that iteration of some sort is the way to 
go. 

It’s interesting that the url container can be addressed directly, instead of 
loading the file - I’d not seen that before. I’m currently pulling each file 
into a regular variable, so will probably stick with that as only a few 
(existing) lines of code would be saved and the net overall effect on timing / 
resources is probably marginal if the file gets loaded behind the scenes anyway.

As the column names/numbers vary by CSV file name - which I have built-out in a 
ColumnsOfInterest field - it looks like I’ll also be safe to iterate through 
these items to build the row extraction line dynamically, too.

Great, thanks again - I have a direction of travel.
Best,
Keith..
   
> On 20 Sep 2016, at 21:32, Mike Bonner  wrote:
> 
> If a file you can do this..
> 
> repeat for each line tline in url "file:yourfilename.csv"
> put item 1 of tLine & comma & item 3 of tline & comma & item 15 of tLine &
> return after tExtracted
> end repeat
> delete the last char of tExtracted -- remove the extraneous return
> 
> Or you can put them into an array or whatever. It should be VERY fast.  If
> the files are very large, you can instead open the file for read, read a
> line, extract the data as above, and repeat till the end of the file. I
> think using repeat for each with a file url loads the whole thing at once
> then goes line to line, but I'm not sure of that.
> 
> On Tue, Sep 20, 2016 at 2:16 PM, Keith Clarke  wrote:
> 
>> Hi folks,
>> I’ve a large number of sizeable CSV files from each of which I need to
>> extract just 2 or 3 specific columns. Creating nested iterations through
>> every item in every line seems somewhat inefficient - as does loading each
>> full file into memory - so I feel I must be missing a trick here.
>> 
>> Does Livecode support any elegant way of directly manipulating or
>> ‘querying’ (like SQL) delimited data, to extract numbered (or named)
>> columns/items - such as 1(Id), 3(Name) & 15(Summary) - from in each line
>> from a CSV container or direct from a file/URL?
>> Best,
>> Keith..
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


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

Re: How to extract specific columns/line items from a CSV file?

2016-09-20 Thread dunbarx
What Mike said. The reason he said it is this:

 I made a 1,000,000 line CSV  dataset. I extracted two random columns from
it. The new 1,000,000 line dataset took 33 ticks.

Craig Newman



--
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/How-to-extract-specific-columns-line-items-from-a-CSV-file-tp4708690p4708694.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: How to extract specific columns/line items from a CSV file?

2016-09-20 Thread Mike Bonner
If a file you can do this..

repeat for each line tline in url "file:yourfilename.csv"
 put item 1 of tLine & comma & item 3 of tline & comma & item 15 of tLine &
return after tExtracted
end repeat
delete the last char of tExtracted -- remove the extraneous return

Or you can put them into an array or whatever. It should be VERY fast.  If
the files are very large, you can instead open the file for read, read a
line, extract the data as above, and repeat till the end of the file. I
think using repeat for each with a file url loads the whole thing at once
then goes line to line, but I'm not sure of that.

On Tue, Sep 20, 2016 at 2:16 PM, Keith Clarke  wrote:

> Hi folks,
> I’ve a large number of sizeable CSV files from each of which I need to
> extract just 2 or 3 specific columns. Creating nested iterations through
> every item in every line seems somewhat inefficient - as does loading each
> full file into memory - so I feel I must be missing a trick here.
>
> Does Livecode support any elegant way of directly manipulating or
> ‘querying’ (like SQL) delimited data, to extract numbered (or named)
> columns/items - such as 1(Id), 3(Name) & 15(Summary) - from in each line
> from a CSV container or direct from a file/URL?
> Best,
> Keith..
> ___
> use-livecode mailing list
> use-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: error building iOS standalone with LiveCode 8.1

2016-09-20 Thread panagiotis merakos
Since the crash occurs before the code signing takes place, I do not think
it is caused by the second workaround. I would suggest you upload another
archive that includes the audio files. The crash log would be helpful, as
well. If I remember correctly, on OSX the crash logs should be stored in
/Users/your_username/Library/Application Support/RunRev/Crash Logs.
One last thing to try: Does the crash occur when using a different stack
and adding the same assets in the Copy Files section?



On Tue, Sep 20, 2016 at 11:09 PM, Chris Sheffield 
wrote:

> The crash is consistent, yes, even after applying the second workaround.
> Like I said, it appears to be happening during the file copy process,
> before the code signing even takes place.
>
> If it would be helpful, I can upload another archive to my dropbox that
> includes those audio files. I didn’t include them before because it makes
> everything so huge. But I’m happy to do that if you’d like. As an
> alternative, is there a crash report somewhere that I can look at and/or
> send you that might be helpful?
>
> Another thought I had, as another possible work around, was to build the
> app without all those audio files, then copy them into the app bundle after
> it’s built, then re-sign the app. But I’m not having much luck doing that
> either… After the re-signing process I get errors when trying to install on
> a device, about entitlements not being valid and/or the app itself cannot
> be verified.
>
> Thanks,
> Chris
>
> > On Sep 20, 2016, at 1:42 PM, panagiotis merakos 
> wrote:
> >
> > Hi Chris,
> >
> > Is the crash consistent when you include the second workaround? I am not
> on
> > a MacOS Sierra to test now.
> >
> > Best,
> > Panos
> > --
> >
> > On Tue, Sep 20, 2016 at 10:32 PM, Chris Sheffield <
> cs_livec...@icloud.com>
> > wrote:
> >
> >> That did the trick on the error, however, now LC is crashing when I try
> to
> >> create a build and include all the files in the app. In addition to my
> >> images folder, which contains quite a few png images, I also have a
> folder
> >> that contains *a lot* of mp3 files (to be exact, 8624 of them).
> Somewhere
> >> during the copy file process LC is crashing. :-( No error message at
> all...
> >>
> >>> On Sep 20, 2016, at 9:34 AM, panagiotis merakos <
> >> panos.mera...@livecode.com> wrote:
> >>>
> >>> Hi Chris,
> >>>
> >>> You can apply the workaround described here until 8.1.1 rc1 is
> released:
> >>>
> >>> https://github.com/livecode/livecode/pull/4530/files <
> >> https://github.com/livecode/livecode/pull/4530/files>
> >>>
> >>> (Make sure you include the line [get shell("xattr -cr" && quote &
> >>> pAppBundle & quote)] as well)
> >>>
> >>> Best,
> >>> Panos
> >>> --
> >>
> >> ___
> >> use-livecode mailing list
> >> use-livecode@lists.runrev.com
> >> Please visit this url to subscribe, unsubscribe and manage your
> >> subscription preferences:
> >> http://lists.runrev.com/mailman/listinfo/use-livecode
> >>
> > ___
> > use-livecode mailing list
> > use-livecode@lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Silly Text Field Question

2016-09-20 Thread Richmond

Well, I missed something as well.

I just put this script in the cardScript:

on openCard
   set the autoTab of fld "f1" to true
   set the autoTab of fld "f2" to true
   set the autoTab of fld "f3" to true
   set the autoTab of fld "f4" to true
end openCard

and everything works . . . even if I did lose my temper several times.

https://www.dropbox.com/s/rnnj9rxla17ij8j/Text%20Hop.livecode.zip?dl=0

Richmond.

On 20.09.2016 10:43, Peter Reid wrote:

I know I'm missing the obvious but I just can't figure out how to get the 
following behaviour with text fields...

1. When the user presses the tab key on the keyboard, the next field is 
selected and the current content of the next field is selected (so any typing 
replaces all the content).

2. If the user uses the mouse to click into a different text field, the current 
content of the next field is selected and behaves just like 1.

What's happening is that I can get 1. to work but every time the user 
mouse-clicks into a different field, that target field gets selected but its 
content is deselected and the I-bar insertion point is placed where the mouse 
click occurred.

So far I've got the following in the card script to provide the same behaviour 
for all the fields on it:

on openField
  hiliteText
end openField

on hiliteText
  put the id of the target into tID
  if there is a field id tID then
select the text of the target
  end if
end hiliteText

Any suggestions please?

Peter
--
Peter Reid
Loughborough, UK


___
use-livecode mailing list
use-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


How to extract specific columns/line items from a CSV file?

2016-09-20 Thread Keith Clarke
Hi folks,
I’ve a large number of sizeable CSV files from each of which I need to extract 
just 2 or 3 specific columns. Creating nested iterations through every item in 
every line seems somewhat inefficient - as does loading each full file into 
memory - so I feel I must be missing a trick here.

Does Livecode support any elegant way of directly manipulating or ‘querying’ 
(like SQL) delimited data, to extract numbered (or named) columns/items - such 
as 1(Id), 3(Name) & 15(Summary) - from in each line from a CSV container or 
direct from a file/URL? 
Best,
Keith..
___
use-livecode mailing list
use-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: Fast Algorithm to Determine Average Brightness of an Image

2016-09-20 Thread hh
> So is there a fast, efficient way to analyze a 1200 X 800 px
> image to get this average brightness value.

You could try the following function. It is "dirty" (the definition
of 'brightness' is also unsharp!), but it is very fast.

local ii="tmp-1.414214"

-- uses the average color intensity of the pixel
-- resulting from scaling down to a 1x1 image
function avgBrightness theImage
  lock screen; lock messages
  if there is no img ii then create img ii
  set resizeQuality of img ii to "best"
  set width of img ii to the width of img 1
  set height of img ii to the height of img 1
  set imagedata of img ii to the imagedata of theImage
  set width of img ii to 1
  set height of img ii to 1
  put the imagedata of img ii into iData
  delete img ii
  return avg (byteToNum(byte 2 of iData), \
byteToNum(byte 3 of iData), \
byteToNum(byte 4 of iData))
  unlock screen; unlock messages
end avgBrightness


___
use-livecode mailing list
use-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: Silly Text Field Question

2016-09-20 Thread Richmond

Maybe I'm being a bit thick, but . . .

I have a stack with four textFields and this script in the cardScript:

on tabkey
   put the id of the selected fld into FLDN
   set the selected fld FLDN to not the selected fld FLDN
end tabkey

Which means that every time I press my TAB key the selection point 
(cursor) hops along

to the next field.

What I seem quite unable to do susequently, is select the text of the 
field the cursor is within.


Richmond.

On 20.09.2016 10:43, Peter Reid wrote:

I know I'm missing the obvious but I just can't figure out how to get the 
following behaviour with text fields...

1. When the user presses the tab key on the keyboard, the next field is 
selected and the current content of the next field is selected (so any typing 
replaces all the content).

2. If the user uses the mouse to click into a different text field, the current 
content of the next field is selected and behaves just like 1.

What's happening is that I can get 1. to work but every time the user 
mouse-clicks into a different field, that target field gets selected but its 
content is deselected and the I-bar insertion point is placed where the mouse 
click occurred.

So far I've got the following in the card script to provide the same behaviour 
for all the fields on it:

on openField
  hiliteText
end openField

on hiliteText
  put the id of the target into tID
  if there is a field id tID then
select the text of the target
  end if
end hiliteText

Any suggestions please?

Peter
--
Peter Reid
Loughborough, UK


___
use-livecode mailing list
use-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: error building iOS standalone with LiveCode 8.1

2016-09-20 Thread Chris Sheffield
The crash is consistent, yes, even after applying the second workaround. Like I 
said, it appears to be happening during the file copy process, before the code 
signing even takes place.

If it would be helpful, I can upload another archive to my dropbox that 
includes those audio files. I didn’t include them before because it makes 
everything so huge. But I’m happy to do that if you’d like. As an alternative, 
is there a crash report somewhere that I can look at and/or send you that might 
be helpful?

Another thought I had, as another possible work around, was to build the app 
without all those audio files, then copy them into the app bundle after it’s 
built, then re-sign the app. But I’m not having much luck doing that either… 
After the re-signing process I get errors when trying to install on a device, 
about entitlements not being valid and/or the app itself cannot be verified.

Thanks,
Chris

> On Sep 20, 2016, at 1:42 PM, panagiotis merakos  wrote:
> 
> Hi Chris,
> 
> Is the crash consistent when you include the second workaround? I am not on
> a MacOS Sierra to test now.
> 
> Best,
> Panos
> --
> 
> On Tue, Sep 20, 2016 at 10:32 PM, Chris Sheffield 
> wrote:
> 
>> That did the trick on the error, however, now LC is crashing when I try to
>> create a build and include all the files in the app. In addition to my
>> images folder, which contains quite a few png images, I also have a folder
>> that contains *a lot* of mp3 files (to be exact, 8624 of them). Somewhere
>> during the copy file process LC is crashing. :-( No error message at all...
>> 
>>> On Sep 20, 2016, at 9:34 AM, panagiotis merakos <
>> panos.mera...@livecode.com> wrote:
>>> 
>>> Hi Chris,
>>> 
>>> You can apply the workaround described here until 8.1.1 rc1 is released:
>>> 
>>> https://github.com/livecode/livecode/pull/4530/files <
>> https://github.com/livecode/livecode/pull/4530/files>
>>> 
>>> (Make sure you include the line [get shell("xattr -cr" && quote &
>>> pAppBundle & quote)] as well)
>>> 
>>> Best,
>>> Panos
>>> --
>> 
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


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

Re: Fast Algorithm to Determine Average Brightness of an Image

2016-09-20 Thread Rick Harrison
Hi Sannyasin,

Based on my previous experiences trying to process
images with LC pixel by pixel, I would have to say no.
LC is too slow for this kind of processing.

You would probably have to use a routine written in
some other language like Objective C, or C++, etc.

If anyone else has had a different experience with this type
of image processing in LC please chime in!

Thanks,

Rick

> On Sep 20, 2016, at 3:15 PM, Sannyasin Brahmanathaswami  
> wrote:
> 
> Use Case:
> 
> I want to place puzzle tiles on top of an image. We take a field, put a grc 
> behind it, take a snapshot, crop each word off at -1000, -1000 and then 
> scramble the tiles to make a puzzle… all this works really well. So I decided 
> to dress it up a bit more: we dynamically choose a color for the foreground 
> of the field in RGB range of 0-135 for all three colors → This gets us dark 
> type… then add 100 to all the colors and this gets us a color for the bkgnd 
> grc which is the same hue, but brighter (well, that depends on your preferred 
> brand HSV, HSL, HSB LAB color theory, it's not that simple… but, close enough 
> for this context)  tiles look great.. color is randomized for each puzzle 
> with the caveat of an occasional "ugly" (in relation to the nature photo in 
> the background)  but still… cool..
> 
> OK I thought hmmm we could also use light type with dark background and I got 
> this working… too much fun..
> 
> Switch sUserColorRange 
> case "darkType"
> set the itemdelimiter to "," # just to be safe
> put randomInRange(0,135) into tRGB
> put comma & randomInRange(0,135) after tRGB
> put comma & randomInRange(0,135) after tRGB
> set the backgroundcolor of grc "startHere" to tRGB
> set the foregroundcolor of fld _Quote to tRGB
> # same hue for background, but light
> repeat for each item tHue in tRGB
> put tHue+ (115) & comma after tTileBkgndRGB
> end repeat
> delete char -1 of tTileBkgndRGB
> set the backgroundColor of grc quoteBkgnd to tTileBkgndRGB
> break
> case "lightType"
> set the itemdelimiter to "," # just to be safe
> put randomInRange(136,255) into tRGB
> put comma & randomInRange(136,255) after tRGB
> put comma & randomInRange(136,255) after tRGB
> set the backgroundcolor of grc "startHere" to tRGB  ## oops need to fix this… 
> too light, disappears
> set the foregroundcolor of fld _Quote to tRGB
> # same hue for background, but light
> repeat for each item tHue in tRGB
> put tHue- (115) & comma after tTileBkgndRGB
> end repeat
> delete char -1 of tTileBkgndRGB
> set the backgroundColor of grc quoteBkgnd to tTileBkgndRGB
> end Switch
> 
> The incoming nature photo that is the backdrop for the puzzle is a random 
> selection. The above is predicated on a user choice/save-as-setting, but a 
> preferred algorithm would be:
> 
> Determine average overall brightness of the image. If below 130 on a scale of 
> 1-255, then use light colored type on dark tile… if >130 then use dark type 
> on light tiles
> 
> So is there a fast, efficient way to analyze a 1200 X 800 px image to get 
> this average brightness value.
> 
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-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: error building iOS standalone with LiveCode 8.1

2016-09-20 Thread panagiotis merakos
Hi Chris,

Is the crash consistent when you include the second workaround? I am not on
a MacOS Sierra to test now.

Best,
Panos
--

On Tue, Sep 20, 2016 at 10:32 PM, Chris Sheffield 
wrote:

> That did the trick on the error, however, now LC is crashing when I try to
> create a build and include all the files in the app. In addition to my
> images folder, which contains quite a few png images, I also have a folder
> that contains *a lot* of mp3 files (to be exact, 8624 of them). Somewhere
> during the copy file process LC is crashing. :-( No error message at all...
>
> > On Sep 20, 2016, at 9:34 AM, panagiotis merakos <
> panos.mera...@livecode.com> wrote:
> >
> > Hi Chris,
> >
> > You can apply the workaround described here until 8.1.1 rc1 is released:
> >
> > https://github.com/livecode/livecode/pull/4530/files <
> https://github.com/livecode/livecode/pull/4530/files>
> >
> > (Make sure you include the line [get shell("xattr -cr" && quote &
> > pAppBundle & quote)] as well)
> >
> > Best,
> > Panos
> > --
>
> ___
> use-livecode mailing list
> use-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: error building iOS standalone with LiveCode 8.1

2016-09-20 Thread Chris Sheffield
That did the trick on the error, however, now LC is crashing when I try to 
create a build and include all the files in the app. In addition to my images 
folder, which contains quite a few png images, I also have a folder that 
contains *a lot* of mp3 files (to be exact, 8624 of them). Somewhere during the 
copy file process LC is crashing. :-( No error message at all...

> On Sep 20, 2016, at 9:34 AM, panagiotis merakos  
> wrote:
> 
> Hi Chris,
> 
> You can apply the workaround described here until 8.1.1 rc1 is released:
> 
> https://github.com/livecode/livecode/pull/4530/files 
> 
> 
> (Make sure you include the line [get shell("xattr -cr" && quote &
> pAppBundle & quote)] as well)
> 
> Best,
> Panos
> --

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


Fast Algorithm to Determine Average Brightness of an Image

2016-09-20 Thread Sannyasin Brahmanathaswami
Use Case:

I want to place puzzle tiles on top of an image. We take a field, put a grc 
behind it, take a snapshot, crop each word off at -1000, -1000 and then 
scramble the tiles to make a puzzle… all this works really well. So I decided 
to dress it up a bit more: we dynamically choose a color for the foreground of 
the field in RGB range of 0-135 for all three colors → This gets us dark type… 
then add 100 to all the colors and this gets us a color for the bkgnd grc which 
is the same hue, but brighter (well, that depends on your preferred brand HSV, 
HSL, HSB LAB color theory, it's not that simple… but, close enough for this 
context)  tiles look great.. color is randomized for each puzzle with the 
caveat of an occasional "ugly" (in relation to the nature photo in the 
background)  but still… cool..

OK I thought hmmm we could also use light type with dark background and I got 
this working… too much fun..

Switch sUserColorRange 
case "darkType"
set the itemdelimiter to "," # just to be safe
put randomInRange(0,135) into tRGB
put comma & randomInRange(0,135) after tRGB
put comma & randomInRange(0,135) after tRGB
set the backgroundcolor of grc "startHere" to tRGB
set the foregroundcolor of fld _Quote to tRGB
# same hue for background, but light
repeat for each item tHue in tRGB
put tHue+ (115) & comma after tTileBkgndRGB
end repeat
delete char -1 of tTileBkgndRGB
set the backgroundColor of grc quoteBkgnd to tTileBkgndRGB
break
case "lightType"
set the itemdelimiter to "," # just to be safe
put randomInRange(136,255) into tRGB
put comma & randomInRange(136,255) after tRGB
put comma & randomInRange(136,255) after tRGB
set the backgroundcolor of grc "startHere" to tRGB  ## oops need to fix this… 
too light, disappears
set the foregroundcolor of fld _Quote to tRGB
# same hue for background, but light
repeat for each item tHue in tRGB
put tHue- (115) & comma after tTileBkgndRGB
end repeat
delete char -1 of tTileBkgndRGB
set the backgroundColor of grc quoteBkgnd to tTileBkgndRGB
end Switch

The incoming nature photo that is the backdrop for the puzzle is a random 
selection. The above is predicated on a user choice/save-as-setting, but a 
preferred algorithm would be:

Determine average overall brightness of the image. If below 130 on a scale of 
1-255, then use light colored type on dark tile… if >130 then use dark type on 
light tiles

So is there a fast, efficient way to analyze a 1200 X 800 px image to get this 
average brightness value.



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

Re: LiveCode interface to SCORM /LIT

2016-09-20 Thread William Prothero
Martin:
It’s actually LTI here is a link:
http://www.imsglobal.org/activity/learning-tools-interoperability 


There is another protocol that is getting support in the US called “Common 
Cartridge”. Link:
https://www.imsglobal.org/cc/ccfaqs.html#37 


Common cartridge seems to have been built in response to the shortcomings of 
SCORM. SCORM is most useful for training, while Common Cartridge and LTI are 
more oriented toward higher ed, with more features necessary for assessment of 
student learning.

If an investment is to be made in developing software to interface with an LMS, 
I hope they can interface with a variety of popular platforms, like Moodle, 
Blackboard, Canvas, and others I haven’t come across.

Best,
Bill

> On Sep 20, 2016, at 9:52 AM, Martin Koob  wrote:
> 
> Oh, One more question.
> 
> What is LIT?  
> 
> Thanks.
> 
> Martin Koob
> 
> 
> 
> --
> View this message in context: 
> http://runtime-revolution.278305.n4.nabble.com/LiveCode-interface-to-SCORM-LIT-tp4708670p4708681.html
> Sent from the Revolution - User mailing list archive at Nabble.com.
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

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

Re: LiveCode interface to SCORM /LIT

2016-09-20 Thread Martin Koob
Oh, One more question.

What is LIT?  

Thanks.

Martin Koob



--
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/LiveCode-interface-to-SCORM-LIT-tp4708670p4708681.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: LiveCode interface to SCORM /LIT

2016-09-20 Thread Martin Koob
I am interested integrating my app with an LMS but felt there were too many
limitations with SCORM.   I then found the Tin Can API.   

http://tincanapi.com/scorm-vs-the-tin-can-api/

Could this be another approach to integrating LiveCode and an LMS?

Martin Koob



--
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/LiveCode-interface-to-SCORM-LIT-tp4708670p4708680.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: error building iOS standalone with LiveCode 8.1

2016-09-20 Thread panagiotis merakos
Hi Chris,

You can apply the workaround described here until 8.1.1 rc1 is released:

https://github.com/livecode/livecode/pull/4530/files

(Make sure you include the line [get shell("xattr -cr" && quote &
pAppBundle & quote)] as well)

Best,
Panos
--

On Tue, Sep 20, 2016 at 9:55 AM, panagiotis merakos <
panos.mera...@livecode.com> wrote:

> Hi Chris,
>
> I just tested with your stack in LC 8.1.1 RC-1 (not public) and I confirm
> I still get the "resource fork, Finder information, or similar detritus
> not allowed” error when building an iOS standalone. After further
> investigation, it seems this is caused *only* if you add the "Internet" or
> "tsNet" inclusion in the "Inclusions" pane. I will change the status of
> http://quality.livecode.com/show_bug.cgi?id=18135 back to IN_PROGRESS.
>
> Best,
> Panos
> --
>
> On Mon, Sep 19, 2016 at 10:54 PM, panagiotis merakos <
> panos.mera...@livecode.com> wrote:
>
>> You are welcome. Just the stack should be enough to replicate this, but I
>> would suggest you send everything, just in case.
>>
>> Best,
>> Panos
>> --
>> On 19 Sep 2016 22:46, "Chris Sheffield"  wrote:
>>
>>> It appears to be just this stack. After creating a new stack, and even
>>> setting it to copy the same files, the build works just fine.
>>>
>>> Yes, I do have png files, quite a lot of them, inside an images folder
>>> that is included in the Copy Files section. Like I said though, I included
>>> that folder even with the new stack, and everything worked fine. This
>>> particular app also makes use of a few mergExt externals. I have updated
>>> those to the latest versions included with LC 8.1. Again, even including
>>> all of those in the new simple stack I created, everything builds fine.
>>>
>>> So I will plan on sending you my stack. Do you need all the included
>>> files, or just the stack itself? I just tried removing all my Copy Files
>>> entries, and the build still fails, so I don’t think it’s related to any of
>>> those, but I’m happy to include them in a zip archive if you’d like.
>>>
>>> Thanks again.
>>>
>>>
>>> > On Sep 19, 2016, at 2:28 PM, panagiotis merakos 
>>> wrote:
>>> >
>>> > Hi Chris,
>>> >
>>> > Hmm, that's weird, it should work. The first part of the error
>>> > (—resource-rules blah blah) is just a warning. The codesign fails
>>> because
>>> > of the "resource fork, Finder information, or similar detritus not
>>> allowed”
>>> > part.
>>> >
>>> > The command [get shell("xattr -cr" && quote & pAppBundle & quote)]
>>> should
>>> > recursively clear those "extended attributes" in the app bundle. I am
>>> not
>>> > on a MacOS Sierra to test now, but what happens if you try to create a
>>> > different ios standalone (after having applied this workaround)?
>>> >
>>> > Moreover, does your app contain any .png files in the "Copy Files"
>>> section?
>>> >
>>> > If you see this error *only* when building an ios standalone *for this
>>> > particular app*, I suggest attaching your sample stack to bug 18135 (or
>>> > send it privately to panos.mera...@livecode.com if it is
>>> confidential), so
>>> > as we ensure that the fix to this bug works with your stack. Today I
>>> tested
>>> > 8.1.1 RC-1 (not public yet) for this bug and I could not reproduce it
>>> using
>>> > a couple of simple stacks.
>>> >
>>> > Best regards,
>>> > Panos
>>> > --
>>> >
>>> > On Mon, Sep 19, 2016 at 10:47 PM, Chris Sheffield <
>>> cs_livec...@icloud.com>
>>> > wrote:
>>> >
>>> >> Panos,
>>> >>
>>> >> I greatly appreciate the quick reply. Unfortunately that fix didn’t
>>> work
>>> >> for me. I even dug in a little deeper and applied Monte’s other
>>> changes as
>>> >> well, and my build still fails. The —resource-rules error is gone,
>>> but I am
>>> >> still left with the second part of the error about the "resource fork,
>>> >> Finder information, or similar detritus not allowed”. That is with
>>> the line:
>>> >>
>>> >> get shell("xattr -cr" && quote & pAppBundle & quote)
>>> >>
>>> >> added just before the code signing occurs.
>>> >>
>>> >> This is running macOS Sierra (GM), LiveCode 8.1, and Xcode 7.3.1.
>>> >>
>>> >> Any other ideas?
>>> >>
>>> >> Thanks,
>>> >> Chris
>>> >>
>>> >>
>>> >>> On Sep 19, 2016, at 12:06 PM, panagiotis merakos >> >
>>> >> wrote:
>>> >>>
>>> >>> Hi Chris,
>>> >>>
>>> >>> Try the workaround described here:
>>> >>> http://quality.livecode.com/show_bug.cgi?id=18135
>>> >>>
>>> >>> It worked for me.
>>> >>>
>>> >>> Best,
>>> >>> Panos
>>> >>> On 19 Sep 2016 19:01, "Chris Sheffield" 
>>> wrote:
>>> >>>
>>>  I’m hoping someone can help with this.
>>> 
>>>  I just fired up LiveCode 8.1 this morning to create a new app build
>>> for
>>> >> a
>>>  landscape app that has the “cropped” issue in iOS 10. I am getting
>>> an
>>> >> error
>>>  at the point that the app gets signed:
>>> 
>>>  codesigning failed with Warning: —resource-rules has been
>>> deprecated in
>>> 

Re: LiveCode interface to SCORM /LIT

2016-09-20 Thread Earthednet-wp
Todd,
There's another LMS interface gaining some use, called "Common Cartridge". It 
addresses shortcomings that SCORM has for assessment of learning and will 
probably displace SCORM in higher Ed.
https://www.imsglobal.org/cc/ccfaqs.html#37

Best,
Bill

William Prothero
http://es.earthednet.org

> On Sep 19, 2016, at 10:47 PM, Earthednet-wp  wrote:
> 
> Todd,
> Fabulous! It will be a great resource for higher Ed developers. I'll see what 
> I can do to test it at UCSB when it is available.
> Best,
> Bill
> 
> William Prothero
> http://es.earthednet.org
> 
>> On Sep 19, 2016, at 10:02 PM, Todd Fabacher  wrote:
>> 
>> Hello Educators,
>> 
>> Will Jamieson, and the DP teem are deep into creating an online and App
>> integrated LMS in LiveCode. We are at the stage of creating  a SCORM and
>> LIT interface to our App. I see that several people have posted on the
>> subject and was wondering if anyone has finished, made any progress or have
>> suggestions that would help us out.
>> 
>> We would appreciate any help in getting in using LiveCode with SCORM /LIT.
>> One potential client is focused on full LIT compatibility. We of course
>> will make the SCORM /LIT code Open Source for all educators.
>> 
>> Thanks,
>> 
>> Todd, Will and DP Education Team
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription 
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


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


Re: Silly Text Field Question

2016-09-20 Thread Mike Bonner
Try this..

local sHilitedelay

on openField

-- sHilitedelay is used to avoid a weird side effect when regaining stack
focus
-- by clicking on a field in the card.  If a field other than the
previously selected
-- is clicked, it can start a runaway loop. The delay solves this problem.
-- when experimenting you might put in a "if the shiftkey is down then exit
to top"
-- so you can break out of the loop if necessary, though the delay does
appear to solve it fine.
   if sHilitedelay is empty then put the millisec into sHilitedelay

-- use send in time so that all the housekeeping is completed before you
try to hilite
   if the millisec - sHilitedelay > 1 then send "hiliteText" to the target
in 0 millisec

end openField

on hiliteText
   select the text of the target
   put the millisec into sHilitedelay
end hiliteText

On Tue, Sep 20, 2016 at 1:43 AM, Peter Reid  wrote:

> I know I'm missing the obvious but I just can't figure out how to get the
> following behaviour with text fields...
>
> 1. When the user presses the tab key on the keyboard, the next field is
> selected and the current content of the next field is selected (so any
> typing replaces all the content).
>
> 2. If the user uses the mouse to click into a different text field, the
> current content of the next field is selected and behaves just like 1.
>
> What's happening is that I can get 1. to work but every time the user
> mouse-clicks into a different field, that target field gets selected but
> its content is deselected and the I-bar insertion point is placed where the
> mouse click occurred.
>
> So far I've got the following in the card script to provide the same
> behaviour for all the fields on it:
>
> on openField
>  hiliteText
> end openField
>
> on hiliteText
>  put the id of the target into tID
>  if there is a field id tID then
>select the text of the target
>  end if
> end hiliteText
>
> Any suggestions please?
>
> Peter
> --
> Peter Reid
> Loughborough, UK
>
>
> ___
> use-livecode mailing list
> use-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: Xcode 8 / iOS 10 support coming in 8.1.1

2016-09-20 Thread Randy Hengst
Panos,

Thank you for the help. I’ve finished rebuilding and submitting the updates to 
Apple.

I received the same error message with multiple apps. But, I cannot reliably 
recreate the problem. I’ll continue to pay attention to this issue as I 
continue to migrate to LC 8.x

be well,
randy

Randy Hengst
www.classroomFocusedSoftware.com



> On Sep 16, 2016, at 9:24 AM, panagiotis merakos  wrote:
> 
> Hi all,
> 
> @Phil
> I have added some comments and a workaround to the bug report
> http://quality.livecode.com/show_bug.cgi?id=18416
> 
> @Randy
> I cannot reproduce those errors, even when setting the minimum iOS version
> to 8.0. Could you please file a bug report and attach a sample stack?
> 
> Best
> Panos
> --
> 
> On Fri, Sep 16, 2016 at 2:30 PM, Phil Jimmieson 
> wrote:
> 
>> Hi Randy,
>> I get so many errors generated and they display in an answer dialog window
>> that truncates the ends off some of the error messages and so it’s
>> difficult for me to figure out what the errors actually are. The stack in
>> question uses revZip and pdfPrinter though (unlike a stack I’ve got that
>> works, that only uses PDFPrinter) and so I was wondering if revZip was to
>> blame…
>> 
>>> On 16 Sep 2016, at 13:45, Randy Hengst  wrote:
>>> 
>>> Hi Panos,
>>> 
>>> Well, your response is consistent with what I thought I knew… but, when
>> I tried to build a standalone with the minimum iOS version set to 8.0, I
>> received the error message build on the build… there is no error message
>> when I build for 9.3. And, when I build for 9.3 I can load the app on an
>> iPad running iOS 10.
>>> 
>>> “linking for arm (arm64) failed with Id: warning: Id: warning: object
>> file
>>> (/private/var/folders/15d3mtyl1r8xj4y3006s6dhb6r
>> gn/T/TemporaryItems/tmp.81721.zat*Cbeal)
>>> was build for new iOS version (9.3) than being linked (8.0)object file
>> (/Applications/LiveCode Indy
>>> 8.1.0.app/Contents/Tools/Runtime/iOS/Device-9_3/Standalone) was build
>> for newer iOS version ) (9.3)
>>> than being linked (8.0)
>>> 
>>> I tried to make sense of the error message and set the build for 8.1 and
>> later…  when I set to build for 8.1 later, things work fine… I assume that
>> has something to to do with the part of message: (/Applications/LiveCode
>> Indy 8.1.0.app/Contents/Tools/Runtime/iOS/Device-9_3/Standalone)
>>> 
>>> 
>>> I see Phil Jimmieson also noted a similar arm64 error… Phil… is your
>> message like mine? What do you see that corresponds to the point in the
>> error message “8.1.0.app”?
>>> 
>>> Thoughts anyone?
>>> 
>>> be well,
>>> randy
>>> 
>>> Randy Hengst
>>> www.classroomFocusedSoftware.com
>>> 
>>> 
>>> 
 On Sep 16, 2016, at 3:50 AM, panagiotis merakos 
>> wrote:
 
 Hi Randy,
 
 The version of Xcode you choose in [Preferences -> Mobile support] only
 decides which version of the iOS SDK will be used to *build* the iOS
 standalone app.
 
 In the Standalone Application Settings, you can choose the minimum iOS
 version you want your app to *run* in.
 
 So you set this option to "8.0 or later"
 
 Best regards,
 Panos
 --
 
 On Thu, Sep 15, 2016 at 11:32 PM, Randy Hengst 
>> wrote:
 
> Thank you Panos, I’ll get that going.
> 
> One related question…. I’ve had a computer “issue” and now only have
>> Xcode
> 7.3.1 on my machine… it only has SDK 9.3.
> 
> I assume that will allow me to build for iOS 10… but will it building
>> for
> the iOS 7 or 8 series?
> 
> If not, is there an easy way to add SDKs to Xcode 7.3.1? I’ve been
> searching without success. If I have to download other Xcode apps, can
> someone point me to which one would allow me to build for at least iOS
>> 8
> and beyond.
> 
> Thanks in advance for the help.
> 
> be well,
> randy
> 
> Randy Hengst
> www.classroomFocusedSoftware.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: error building iOS standalone with LiveCode 8.1

2016-09-20 Thread panagiotis merakos
Hi Chris,

I just tested with your stack in LC 8.1.1 RC-1 (not public) and I confirm I
still get the "resource fork, Finder information, or similar detritus not
allowed” error when building an iOS standalone. After further
investigation, it seems this is caused *only* if you add the "Internet" or
"tsNet" inclusion in the "Inclusions" pane. I will change the status of
http://quality.livecode.com/show_bug.cgi?id=18135 back to IN_PROGRESS.

Best,
Panos
-- 

On Mon, Sep 19, 2016 at 10:54 PM, panagiotis merakos <
panos.mera...@livecode.com> wrote:

> You are welcome. Just the stack should be enough to replicate this, but I
> would suggest you send everything, just in case.
>
> Best,
> Panos
> --
> On 19 Sep 2016 22:46, "Chris Sheffield"  wrote:
>
>> It appears to be just this stack. After creating a new stack, and even
>> setting it to copy the same files, the build works just fine.
>>
>> Yes, I do have png files, quite a lot of them, inside an images folder
>> that is included in the Copy Files section. Like I said though, I included
>> that folder even with the new stack, and everything worked fine. This
>> particular app also makes use of a few mergExt externals. I have updated
>> those to the latest versions included with LC 8.1. Again, even including
>> all of those in the new simple stack I created, everything builds fine.
>>
>> So I will plan on sending you my stack. Do you need all the included
>> files, or just the stack itself? I just tried removing all my Copy Files
>> entries, and the build still fails, so I don’t think it’s related to any of
>> those, but I’m happy to include them in a zip archive if you’d like.
>>
>> Thanks again.
>>
>>
>> > On Sep 19, 2016, at 2:28 PM, panagiotis merakos 
>> wrote:
>> >
>> > Hi Chris,
>> >
>> > Hmm, that's weird, it should work. The first part of the error
>> > (—resource-rules blah blah) is just a warning. The codesign fails
>> because
>> > of the "resource fork, Finder information, or similar detritus not
>> allowed”
>> > part.
>> >
>> > The command [get shell("xattr -cr" && quote & pAppBundle & quote)]
>> should
>> > recursively clear those "extended attributes" in the app bundle. I am
>> not
>> > on a MacOS Sierra to test now, but what happens if you try to create a
>> > different ios standalone (after having applied this workaround)?
>> >
>> > Moreover, does your app contain any .png files in the "Copy Files"
>> section?
>> >
>> > If you see this error *only* when building an ios standalone *for this
>> > particular app*, I suggest attaching your sample stack to bug 18135 (or
>> > send it privately to panos.mera...@livecode.com if it is
>> confidential), so
>> > as we ensure that the fix to this bug works with your stack. Today I
>> tested
>> > 8.1.1 RC-1 (not public yet) for this bug and I could not reproduce it
>> using
>> > a couple of simple stacks.
>> >
>> > Best regards,
>> > Panos
>> > --
>> >
>> > On Mon, Sep 19, 2016 at 10:47 PM, Chris Sheffield <
>> cs_livec...@icloud.com>
>> > wrote:
>> >
>> >> Panos,
>> >>
>> >> I greatly appreciate the quick reply. Unfortunately that fix didn’t
>> work
>> >> for me. I even dug in a little deeper and applied Monte’s other
>> changes as
>> >> well, and my build still fails. The —resource-rules error is gone, but
>> I am
>> >> still left with the second part of the error about the "resource fork,
>> >> Finder information, or similar detritus not allowed”. That is with the
>> line:
>> >>
>> >> get shell("xattr -cr" && quote & pAppBundle & quote)
>> >>
>> >> added just before the code signing occurs.
>> >>
>> >> This is running macOS Sierra (GM), LiveCode 8.1, and Xcode 7.3.1.
>> >>
>> >> Any other ideas?
>> >>
>> >> Thanks,
>> >> Chris
>> >>
>> >>
>> >>> On Sep 19, 2016, at 12:06 PM, panagiotis merakos 
>> >> wrote:
>> >>>
>> >>> Hi Chris,
>> >>>
>> >>> Try the workaround described here:
>> >>> http://quality.livecode.com/show_bug.cgi?id=18135
>> >>>
>> >>> It worked for me.
>> >>>
>> >>> Best,
>> >>> Panos
>> >>> On 19 Sep 2016 19:01, "Chris Sheffield" 
>> wrote:
>> >>>
>>  I’m hoping someone can help with this.
>> 
>>  I just fired up LiveCode 8.1 this morning to create a new app build
>> for
>> >> a
>>  landscape app that has the “cropped” issue in iOS 10. I am getting an
>> >> error
>>  at the point that the app gets signed:
>> 
>>  codesigning failed with Warning: —resource-rules has been deprecated
>> in
>>  Max OS X >= 10.10!
>>  [path to my app]: resource fork, Finder information, or similar
>> detritus
>>  not allowed
>> 
>>  I did a little digging and it sounds like, in an Xcode project at
>> least,
>>  it’s simply a matter of removing the path to the ResourceRules.plist
>> >> file
>>  in the project settings. I went and tried doing what I thought would
>> be
>> >> the
>>  equivalent in LiveCode and I commented out the lines pertaining to
>> this
>>  file 

Re: Dumb question about files on a server

2016-09-20 Thread Graham Samuel
Oh Jacque, you’ve been so kind to me over Zygodact and other things, and I’ve 
been so slow, that I didn’t dare ask! However, you are of course spot on. 
Thanks.

Graham

> On 19 Sep 2016, at 23:43, J. Landman Gay  wrote:
> 
> On 9/19/16 3:15 PM, Graham Samuel wrote:
>> I have a .lc script on the server that invokes Jacque Gay’s Zygodact
>> product to generate license codes, which are then passed on to the
>> payment processor. This works fine. However when a code is generated,
>> it would be prudent to keep it in a file which is on the server. So I
>> want to add a few lines of code to the aforesaid .lc script so that
>> each code goes into a text file.
> 
> That's easy, I do it with all my Zygodact server scripts. The main thing to 
> be aware of is that the text file needs to have read/write permissions. I 
> couldn't generate a file from scratch because of the permission issues (I'm 
> sure there's a way around this, but I didn't know how.) So what I do is 
> create an empty text file on the server and give it read/write permissions 
> (755) manually using Fetch or any other FTP app. I put the file directly in 
> the CGI folder, which is inaccessible to visitors.
> 
> After that, just add this handler to your .lc script:
> 
> on log pData
>  put "myLog.txt" into tFile
>  open file tFile for append
>  write pData  & cr to file tFile
>  close file tFile
> end log
> 
> Then in the main body of the script, collect the data you want to store into 
> a variable and add a "log dataVar" line.
> 
> The reason I use open/write/close instead of "put after URL" is because 
> opening a file for append doesn't need to read the whole thing into memory 
> and then write it all back out again. It seems like a better use of resources.
> 
> -- 
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software   | http://www.hyperactivesw.com
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


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

Silly Text Field Question

2016-09-20 Thread Peter Reid
I know I'm missing the obvious but I just can't figure out how to get the 
following behaviour with text fields...

1. When the user presses the tab key on the keyboard, the next field is 
selected and the current content of the next field is selected (so any typing 
replaces all the content).

2. If the user uses the mouse to click into a different text field, the current 
content of the next field is selected and behaves just like 1.

What's happening is that I can get 1. to work but every time the user 
mouse-clicks into a different field, that target field gets selected but its 
content is deselected and the I-bar insertion point is placed where the mouse 
click occurred.

So far I've got the following in the card script to provide the same behaviour 
for all the fields on it:

on openField
 hiliteText
end openField

on hiliteText
 put the id of the target into tID
 if there is a field id tID then
   select the text of the target
 end if
end hiliteText

Any suggestions please?

Peter
--
Peter Reid
Loughborough, UK


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