Re: HTML entity escaping?

2019-01-09 Thread Richard Gaskin via use-livecode

David Bovill wrote:

> yes that would work for an app - but this is for Livecode server

You can use a stack with a field in it for converting to htmlText, or 
run the html through the templateField.


--
 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: HTML entity escaping?

2019-01-09 Thread David Bovill via use-livecode
Hi Devin, yes that would work for an app - but this is for Livecode server
- I'm not sure but is there a way to do that with revIgniter - ie create a
field by script and use the functionality that way - this is the old hack
I'm using / found - if anyone finds it useful / can improve on it ( i
should probably use arrays):

*command* text_HtmlEntityEscape @someText, pNotQuotes
> *local* sNum, eNum
> *put* 0 into countNum
> *put* "(&[^;]+;)" into someReg
> *put* html_EntityList (pNotQuotes) into htmlEntities
> *put* html_EntityCharNums (pNotQuotes) into entityCharNums
> *set* the wholematches to true
>
> *repeat**get* matchchunk (someText, someReg, sNum, eNum)
> *if* sNum is not a number *then* *return* empty
> *-- breakpoint -- bug**if* it is false *then* *return* countNum
> *put* char sNum to eNum of someText into foundEntity
> *if* char 1 to 2 of foundEntity = 

Re: Get RGB color of a specific screen location

2019-01-09 Thread hh via use-livecode
Looking again at your problem my experiences with both statistics
and images say that the *median* would be a better average than
the *arithmeticMean*. So you could try and compare both averages
(more exactly: location parameters of your WxH-color-distribution).

local t="temp"

-- hL,vL is the topleft of the pixel-rect on your screen
-- the width  of the pixel-rect is w. W is an integer >= 1.
-- the height of the pixel-rect is h. H is an integer >= 1.
-- tp is the average method "median" or (default:) "arithmeticMean"
-- average is taken from the pixel-colors of rect (hL,vL,hL+w,vL+h)
--
function averageColor w,h,hL,vL,tp
   export snapshot from rect (hL,vL,hL+w,vL+h) to img t as PNG
   put the imagedata of img t into iData
   put the alphadata of img t into aData
   repeat with i=1 to w*h
  put byteToNum(byte 4*i-2 of iData) into redA[i]
  put byteToNum(byte 4*i-1 of iData) into greenA[i]
  put byteToNum(byte 4*i   of iData) into blueA[i]
  put byteToNum(byte i of aData) into alphaA[i]
   end repeat
   if tp is "median" then
  return trunc(median(redA)),trunc(median(greenA)), \
 trunc(median(blueA)),trunc(median(alphaA))
   else
  return trunc(avg(redA)),trunc(avg(greenA)), \
 trunc(avg(blueA)),trunc(avg(alphaA))
   end if
end averageColor

-- usage example:
on mouseUp
   lock screen; lock messages
   put 5 into w0; put 5 into h0
   put -w0+the left of this stack into sL 
   put -h0+the top of this stack into sT -- = without window bar
   
   if there is no img "temp" then create invisible img t
   if there is no field t then
  create fld t
  set rect of fld t to (0,0,128,23)
  set botleft of fld t to the botright of me
   end if
   if there is no grc t then
  create grc t
  set opaque of grc t to true
  set rect of grc t to (0,0,23,23)
  set botright of grc t to the botleft of me
   end if
   
   put averageColor(w0,h0,sL,sT,"median") into x --> returns r,g,b,alpha
    use x, for example:
   set backColor of grc t to item 1 to 3 of x
   --set blendlevel of grc t to round(100*(1-(item 4 of x)/255)) -- if wanted
   put x into fld t
   unlock screen; unlock messages
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: Get RGB color of a specific screen location

2019-01-09 Thread Beat Cornaz via use-livecode
I have used the export snapshot and then the averaging. Works great. I had
forgotten about the export function (have been away from coding for 3
years).
I also had to implement Phil Davis' "set the screenMouseLoc to
globalLoc(tLocWithinMyStack)".
The average I got first (with only the mouseLoc) was offsetted to where I
clicked. Now it purs :-)

Thanks again, Beat
___
use-livecode mailing list
use-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: TestInStandalone v_100

2019-01-09 Thread hh via use-livecode
> Bernd N. wrote:
> At times it is hard to believe that it is "just" a HTML5 stack, it
> seems like a little IDE in its own.

It is in fact an interesting question how much of the IDE can be "ported"
to a HTML5 standalone. Currently we are at the level of a non-debugging
message box. If somebody is willing to dive deeper into this -- I have
currently too many other projects...

> And also has code folding...

That's done by the codeMirror editor. All I had to do for that editor was
to write the setup, implement the communication with the standalone and
roughly define a language file "livecodescript".

And code folding is not at the high level of *bn's code folding* in the
IDE's script editor ;-)


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

2019-01-09 Thread Niggemann, Bernd via use-livecode
Hello Hermann,

this is a super HTML5 stack. It lets one easily test what works and does not 
work in HTML5 stacks.
Anyone interested in HTML5 stacks should at least have a look at it.

At times it is hard to believe that it is "just" a HTML5 stack, it seems like a 
little IDE in its own.

And also has code folding...

Thank you

Bernd



> hh via use-livecode Sun, 06 Jan 2019 20:00:25 -0800 wrote:
> 
> There is nearly no documentation in the dictionary what works (or works not)
> in HTML5 standalones. That's why I made this tool:
> 
> Here is "hhTestInStandalone", a HTML5 standalone that is ready for testing
> code snippets up to local libraries (script-only stacks).
> I use it to isolate critical script parts that run in the IDE but not in the
> HTML5 engine.
> 
> It has a LC-ScriptEditor (made in the browser) with a lot of features,
> especially it can access the system clipboard for copy and paste and it has
> code folding, colorising and indenting built-in.
> 
> • You can set the script of several buttons (or use these as text containers).
> • You can output to two fields and import images in order to work with them.
> 
> See
> (US) 
> http://hh.on-rev.com/html5/hhTestInStandalone-9.0.2hhX.html
> 
> (EU) 
> http://hyperhh.de/html5/hhTestInStandalone-9.0.2hhX.html
> 
> 
> Enjoy!
> 

___
use-livecode mailing list
use-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: Checking xml string

2019-01-09 Thread Malte Pfaff-Brill via use-livecode
Sorry,

Was thinking  

Going into submarine mode again… Nothing to see 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

Re: Checking xml string

2019-01-09 Thread Malte Pfaff-Brill via use-livecode
Hi JBV,

 actually is valid in XML and is the short form of 

Do you get parsing errors?

Cheers,

Malte

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


Checking xml string

2019-01-09 Thread jbv via use-livecode
Hi list,
Does anyone has a function that would remove "ghost tags" from
an xml string, for instance a  tag when there's no 
tag before ? More generally, a script that checks the consistency
of an xml string and points errors would do perhaps ?
Thanks in advance.
jbv


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


Re: LC-apps for HC

2019-01-09 Thread Ingar Roggen via use-livecode
Richmond,
«If I were a rich man…»
But I am not, I am just an old (soon 85) lover of HC living here up North  — 
but this is love eternal…
What I  c o u l d   try to do is to get some rich and generous Norwegian 
idealist (RICH + GENEROUS + IDEALIST = an unbelievable value-combination in 
Scotland, not?) to pay for such a  job. How much would you charge for this app?
Regards
Ingar

3. des. 2018 kl. 10.15 skrev Richmond via use-livecode 
mailto:use-livecode@lists.runrev.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: windows defender issues? & other AV issues?

2019-01-09 Thread Matthias Rebbe via use-livecode
I meant 

I have just tested it here with LC9.0.2

Matthias Rebbe

free tools for Livecoders:
https://instamaker.dermattes.de 
https://winsignhelper.dermattes.de 

> Am 09.01.2019 um 10:33 schrieb Matthias Rebbe via use-livecode 
> mailto:use-livecode@lists.runrev.com>>:
> 
> The whole discussion made me remembering that on my Mac i noticed a really 
> significant performance loss in SE when outputting large data in message box.
> When this is happening i can hear my fans boosting and the cpu temperature is 
> increasing.
> 
> As soon as i close the message box or empty it the SE is responsive again,the 
> temperature is lowering and the fans go into normal mode.
> 
> This script for example
> repeat 2
> put "12asdfadsfasdfasdfasfasdf3453"  after tOut
> end repeat
> put tout
> 
> is able to force this behaviour on an iMac 4Ghz i7 with 32GB ram.
> 
> Just test with LC9.0.2
> 
> Matthias Rebbe
> 
> free tools for Livecoders:
> https://instamaker.dermattes.de 
> https://winsignhelper.dermattes.de
> 
>> Am 09.01.2019 um 07:17 schrieb Richard Gaskin via use-livecode 
>> :
>> 
>> AndyP wrote:
>> 
>>> This 'thrashing about' of messages may also explain why the situation
>>> (speed) is impacted when the project browser and message  box are
>>> open?
>> 
>> Components that need frequent updates to reflect current state can indeed be 
>> tricky. You may find this report interesting, esp. Comment #3:
>> https://quality.livecode.com/show_bug.cgi?id=13585
>> 
>> -- 
>> 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

___
use-livecode mailing list
use-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: windows defender issues? & other AV issues?

2019-01-09 Thread Matthias Rebbe via use-livecode
The whole discussion made me remembering that on my Mac i noticed a really 
significant performance loss in SE when outputting large data in message box.
When this is happening i can hear my fans boosting and the cpu temperature is 
increasing.

As soon as i close the message box or empty it the SE is responsive again,the 
temperature is lowering and the fans go into normal mode.

This script for example
repeat 2
put "12asdfadsfasdfasdfasfasdf3453"  after tOut
end repeat
put tout

is able to force this behaviour on an iMac 4Ghz i7 with 32GB ram.

Just test with LC9.0.2

Matthias Rebbe

free tools for Livecoders:
https://instamaker.dermattes.de
https://winsignhelper.dermattes.de

> Am 09.01.2019 um 07:17 schrieb Richard Gaskin via use-livecode 
> :
> 
> AndyP wrote:
> 
> > This 'thrashing about' of messages may also explain why the situation
> > (speed) is impacted when the project browser and message  box are
> > open?
> 
> Components that need frequent updates to reflect current state can indeed be 
> tricky. You may find this report interesting, esp. Comment #3:
> https://quality.livecode.com/show_bug.cgi?id=13585
> 
> -- 
> 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: Get RGB color of a specific screen location

2019-01-09 Thread Beat Cornaz via use-livecode
Thanks everyone for the many suggestions. I will try them out and see which
one will work best.
Appreciate the multitude of ideas.

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