Re: not really OT: The Coming Software Apocalypse

2017-10-16 Thread Peter Alcibiades via use-livecode
Thanks for the link, which was very interesting.  There is a quite deep
insight there about what made Hypercard so inviting, and why LC is so
accessible.  Its not just drag and drop, its working directly with the thing
one is making.  Of course you still end up typing a lot of text, but these
systems are a small part of the way to what the people interviewed are
talking about.

I recall a moment many years ago now when the difference between the
ordinary user's understanding and the coder's suddenly became apparent.  In
the early days of the Web we did a demo for a senior manager of a new
interface.  He had never used a computer - as was quite common back in those
days.  He heard about it with some puzzlement and then asked us to print it
out.  We looked at each other and you could see everyone wondering how on
earth they were going to explain that this just wasn't possible...  That
whatever we handed over on set of A4s was not going to be what we were
talking about.



--
Sent from: 
http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html

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


AW: is a date

2017-10-16 Thread Tiemo Hollmann TB via use-livecode


-Ursprüngliche Nachricht-
Von: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] Im Auftrag
von J. Landman Gay via use-livecode
Gesendet: Sonntag, 15. Oktober 2017 22:38
An: How to use LiveCode 
Cc: J. Landman Gay 
Betreff: Re: is a date

>> To get around that we could just check that there are 3 items delimited
by slashes before testing for "is a date".

As long, as you don't handle international dates ...

Tiemo

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


Re: is a date

2017-10-16 Thread hh via use-livecode
> JLG wrote ...
> The one exception may be that any _integer_ is considered a date.
> To get around that we could just check that there are 3 items
> delimited by slashes before testing for "is a date".

I write "is a /real/ date" into my notes whenever a meeting is a date.
How do you handle such _real_ cases in your functions?  ;-)

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


[ANN] This Week in LiveCode 102

2017-10-16 Thread panagiotis merakos via use-livecode
Hi all,

Read about new developments in LiveCode open source and the open source
community in today's edition of the "This Week in LiveCode" newsletter!

Read issue #102 here: https://goo.gl/RW6UMX

This is a weekly newsletter about LiveCode, focussing on what's been
going on in and around the open source project. New issues will be
released weekly on Mondays. We have a dedicated mailing list that will
deliver each issue directly to you e-mail, so you don't miss any!

If you have anything you'd like mentioned (a project, a discussion
somewhere, an upcoming event) then please get in touch.



-- 
Panagiotis Merakos 
LiveCode Software Developer

Everyone Can Create Apps 
___
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 meet an integer

2017-10-16 Thread hh via use-livecode
> JLG wrote:
> You know, after all the dicussion here, I'm not sure any of the
> options are better than "x is a date". The one exception may be
> that any integer is considered a date.

Being a mathematician I always dreamed about meeting an integer.

How did you manage to meet an integer?
Was it male or female and positive, negative or even zero?

___
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


Comparing 2 Spoken words, FFT function in LiveCode?

2017-10-16 Thread Peter Reid via use-livecode
Does anyone know of an implementation of an FFT function written in LiveCode?  
I've tried joneslib but this doesn't include FFT. I'm hoping to use FFTs as 
part of my attempt to compare 2 short sound clips of people speaking a single 
word.  I'm trying to judge whether a single word spoken by 2 different people 
is the same word or not. Any advice or code that might help with this would be 
most welcome.

Thanks

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


Re: is a date

2017-10-16 Thread Roger Eller via use-livecode
Exactly!  I was elated to find the built-in "is a date" check, because I
really wanted to NOT have to roll my own.  I was THRILLED that our lovely
English-like syntax was working FOR me.  And then an integer was accepted
as a legit date.  I didn't like that at all.  Why can't the engine have "is
a date" or "is a formatted date" as well?

~Roger

On Mon, Oct 16, 2017 at 6:05 AM, hh via use-livecode <
use-livecode@lists.runrev.com> wrote:

> > JLG wrote ...
> > The one exception may be that any _integer_ is considered a date.
> > To get around that we could just check that there are 3 items
> > delimited by slashes before testing for "is a date".
>
> I write "is a /real/ date" into my notes whenever a meeting is a date.
> How do you handle such _real_ cases in your functions?  ;-)
>
>
___
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: Comparing 2 Spoken words, FFT function in LiveCode?

2017-10-16 Thread Bob Sneidar via use-livecode
mySQL has a soundex function. 

Bob S


> On Oct 16, 2017, at 06:18 , Peter Reid via use-livecode 
>  wrote:
> 
> Does anyone know of an implementation of an FFT function written in LiveCode? 
>  I've tried joneslib but this doesn't include FFT. I'm hoping to use FFTs as 
> part of my attempt to compare 2 short sound clips of people speaking a single 
> word.  I'm trying to judge whether a single word spoken by 2 different people 
> is the same word or not. Any advice or code that might help with this would 
> be most welcome.
> 
> Thanks
> 
> 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: is a date

2017-10-16 Thread Bob Sneidar via use-livecode
This of course assumes you know tDate is supposed to be a short date. 

I also have this function which is part of the master library methinks:

function formatDate theDate, theFormat
   /*
   Accepts any valid date for the first parameter. If not a valid date, it 
simply returns
   what was passed. Second parameter can be any of the following:
   sql date: date in the -mm-dd format
   short date, abbreviated date, internet date, long date: LC versions of the 
same
   julian date: Julian number based on (I believe) Jacques formula)
   */
   
   put the itemdelimiter into theOldDelim
   set the itemdelimiter to "-"
   
   if the length of item 1 of theDate = 4 and \
 the number of items of theDate = 3 and \
 item 1 of theDate is a number and \
 item 2 of theDate is a number and \
 item 3 of theDate is a number then
  put item 2 of theDate & "/" & \
item 3 of theDate & "/" & \
item 1 of theDate into theDate
   end if
   
   convert theDate to dateitems
   set the itemdelimiter to theOldDelim
   
   switch theFormat
  case "sql date"
 put item 1 of theDate & "-" & \
   format("%02d",item 2 of theDate) & "-" & \
   format("%02d",item 3 of theDate) into theDate
 break
  case "short date"
 convert theDate from dateitems to short date
 break
  case "abbreviated date"
 convert theDate from dateitems to abbreviated date
 break
  case "abbr date"
 convert theDate from dateitems to abbreviated date
 break
  case "internet date"
 convert theDate from dateitems to internet date
 break
  case "long date"
 convert theDate from dateitems to long date
 break
  case "julian date"
 put the date into theDate
   convert theDate to dateItems
   if  ((item 2 of theDate = 1) or (item 2 of theDate = 2)) then
 put 1 into theDay
   else
 put 0 into theDay
   end if
   put item 1 of theDate + 4800 - theDay into theYear
   put item 2 of theDate + (12 * theDay) - 3 into theMonth
   put item 3 of theDate + \
   ((153 * theMonth + 2) div 5) + \
   (365 * theYear) + \
   (theYear div 4) - \
   (theYear div 100) + \
   (theYear div 400) - \
   32045 into theDate
 break
   end switch
   
   return theDate 
end formatDate

Bob S


> On Oct 16, 2017, at 09:47 , Bob Sneidar  wrote:
> 
> Old trick I learned in Foxpro. Convert something then convert it back and see 
> if it is identical. 
> 
> put 20 into tDate
> put tDate into tOldDate
> convert tDate to dateitems
> convert tDate to short date
> return ((tDate is a date) and (tDate is tOldDate))
> 
> Bob S
> 
> 


___
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 meet an integer

2017-10-16 Thread hh via use-livecode
> JLG wrote:
> Until I met my husband, ALL my dates were zeros.

You won.

___
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: OAuth2 (LC 9) on mobile?

2017-10-16 Thread Ben Rubinstein via use-livecode
OAuth2 does work on mobile - I needed to include the Browser widget in the 
standalone. (The 'search for inclusions' doesn't know to include the Oauth2 
library, let alone the browser widget.)


If anyone else finds themselves sometimes spending a long time going down a 
path where the answer is to do with inclusions, I have two relevant feature 
suggestions in LQCC - I'd be interested in comments:

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

Ben

On 13/10/2017 08:17, Ben Rubinstein via use-livecode wrote:
Now that Greg's Oauth2 issue has been resolved, can I check whether anyone has 
seen the Oauth2 library work on mobile? I don't want to raise an LQCC if it's 
just me doing something wrong!


thanks,

Ben

On 11/10/2017 17:19, Ben Rubinstein via use-livecode wrote:
To clarify, by "everything still works" I mean that the OAuth2 command 
appears to have done "exit to top" without doing anything - but leaving the 
whole screen dimmed out. So other controls on the card, although dim, work. 
But no authorisation has happened.


On 11/10/2017 17:02, Ben Rubinstein via use-livecode wrote:
Does the new OAuth2 library in LC 9 work on mobile? Docs suggest it should, 
but testing on iPad I just get an interesting dimmed out effect on the 
stack - although in fact everything still works - where I would have 
expected a sheet or switching to Safari or some other way of displaying a 
web page.


TIA,

Ben



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


Re: How to meet an integer

2017-10-16 Thread J. Landman Gay via use-livecode




On October 16, 2017 5:16:15 AM hh via use-livecode 
 wrote:



JLG wrote:
You know, after all the dicussion here, I'm not sure any of the
options are better than "x is a date". The one exception may be
that any integer is considered a date.


Being a mathematician I always dreamed about meeting an integer.

How did you manage to meet an integer?
Was it male or female and positive, negative or even zero?


Until I met my husband, ALL my dates were zeros.

:)
--
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: Atkinson dither algorithm

2017-10-16 Thread Bob Sneidar via use-livecode
I didn't post any code I don't think, but I will certainly take some credit for 
having done so! ;-)

Bob S


> On Oct 14, 2017, at 21:57 , Alejandro Tejada via use-livecode 
>  wrote:
> 
> Hi All,
> 
> This forum message contains the final version of this stack.
> It includes a Color version of this algorithm.
> 
> https://forums.livecode.com/viewtopic.php?f=10=159173#p159173
> 
> Thanks again to Malte Brill, Richard Gaskin, Hermann Hoch, Mark Waddingham,
> Peter Reid, Ben Rubinstein, Bob Sneidar and Lagi Pittas for posting scripts
> and
> writing ideas to improve this handler.
> 
> Al


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


Re: Comparing 2 Spoken words, FFT function in LiveCode?

2017-10-16 Thread Bob Sneidar via use-livecode
Oh NVM I thought you were takling about text.

Bob S


> On Oct 16, 2017, at 06:18 , Peter Reid via use-livecode 
>  wrote:
> 
> Does anyone know of an implementation of an FFT function written in LiveCode? 
>  I've tried joneslib but this doesn't include FFT. I'm hoping to use FFTs as 
> part of my attempt to compare 2 short sound clips of people speaking a single 
> word.  I'm trying to judge whether a single word spoken by 2 different people 
> is the same word or not. Any advice or code that might help with this would 
> be most welcome.
> 
> Thanks
> 
> 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: is a date

2017-10-16 Thread Bob Sneidar via use-livecode
Old trick I learned in Foxpro. Convert something then convert it back and see 
if it is identical. 

put 20 into tDate
put tDate into tOldDate
convert tDate to dateitems
convert tDate to short date
return ((tDate is a date) and (tDate is tOldDate))

Bob S



___
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: is a date

2017-10-16 Thread Bob Sneidar via use-livecode
May want to check out the MasterLibrary then. It's got a lot of great commands 
and functinos, one of which will format a date any way you like, including sql 
date. 

Bob S


> On Oct 16, 2017, at 10:14 , Andrew Bell via use-livecode 
>  wrote:
> 
>> From: Bob Sneidar 
>> To: How to use LiveCode 
>> Subject: Re: is a date
>> Message-ID: <6eb529a3-5d21-4186-bd90-641746e96...@iotecdigital.com>
>> Content-Type: text/plain; charset="us-ascii"
>> 
>> This probably matters to no one at all, but SQL does not store dates with 
>> forward slashes. SQL datetime formats look like this:
>> 
>> -dd-mm hh:mm:ss
>> 
>> Bob S
>> 
> 
> It mattered to me recently on a project I was working on so I wrote these two 
> scripts to help me generate a LC version of the mySQL version of "timestamp":
> 
> on timeStamp
>   put the internet date into tTheDate
>   convert tTheDate to dateitems
>   put item 1 of tTheDate into tYear
>   put item 2 of tTheDate into tMonth
>   put item 3 of tTheDate into tDay
>   put item 4 of tTheDate into tHour
>   put item 5 of tTheDate into tMinute
>   put item 6 of tTheDate into tSecond
> 
>   leadingZero tMonth
>   leadingZero tDay
>   leadingZero tHour
>   leadingZero tMinute
>   leadingZero tSecond
> 
>   put tYear & "-" & tMonth & "-" & tDay && tHour & ":" & tMinute & ":" & 
> tSecond into tTimeStamp
>   return tTimeStamp
> end timeStamp
> 
> on leadingZero @pDateItem
>   if the length of pDateItem = 1 then
>  put "0" before pDateItem
>   end if
> end leadingZero
> 
> 
> A new date/time format of "database" would be useful for something like this.
> 
> --Andrew Bell
> 
> 
> ___
> 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


Word recognition

2017-10-16 Thread Frans Schoffelen via use-livecode

> On 16 Oct 2017, at 19:00, use-livecode-requ...@lists.runrev.com wrote:
> 
> 
> Does anyone know of an implementation of an FFT function written in LiveCode? 
>  I've tried joneslib but this doesn't include FFT. I'm hoping to use FFTs as 
> part of my attempt to compare 2 short sound clips of people speaking a single 
> word.  I'm trying to judge whether a single word spoken by 2 different people 
> is the same word or not. Any advice or code that might help with this would 
> be most welcome.
> 
> Thanks
> 
> Peter
> --
> Peter Reid
> Loughborough, UK


Hi,

We tried to do this for a set of professional business english training 
software suites for companies ages ago.
We ended up using Microsoft Speech recognition with an External by Tuviah 
Snyder. On the the mac front we
used the speech recognition ( then in Supercard) to see if any of the words 
reconized was in the restricted
recognition target dictionary. Worked fine. However : If you are looking at 
precise comparisons of two phrases in the realm of :

“ Flying aunts can be dangerous”
“ Flying ants can be dangerous”

then you need word-per-word FFT analysis and the closest I have come were the 
libraries to
plot AIF files by Mark Smith, may he rest in peace. Stephen Barncard was so 
friendly to relay them
to me in 2016. Then funding stopped and I had to pursuit other things. But I 
would be very interested in
solving this as well, because it is a major asset when dealing with languages.( 
I’m an old linguist ;-)

I believe Stephen would not mind the stacks being out there. I just can’t gauge 
if they would be
any help in your endeavour.


Cheers


Frans




Frans Schoffelen
http://knowlegistics.com  // Software & Sound // Berlin



___
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

quicken dates

2017-10-16 Thread Mike Kerner via use-livecode
Way back in the day, Quicken allowed all kinds of shenanigans with dates
It allowed a variety of delimiters
It allowed pseudo-dates:
20 -- 20th of the current month
10/20 -- 10/20/current year
+ -- tomorrow
m -- first of this month
h -- last of this month
etc.

I really like this, because it makes it much easier than trying to look at
a calendar all the time, so I wrote my own version, that expands on the
idea:

function quickenDate what
   /*
   Returns current date if sent an empty string
   Returns empty if can't figure out what "what" is supposed to be

   Delimiter can be ".", "/", ";",  or comma
   Date can be in m/d/y, m/d, or just d format
   Also accepts (upper or lower case)
   T - (T)oday
   M - First day of (M)onth
   H - Last day of mont(H)
   W - First day of (W)eek
   K - Last day of wee(K)
   Y - First day of (Y)ear
   R - Last day of yea(R)
   + - tomorrow
   +x, where x is an integer, x days from today
   - - yesterday
   -x where x is an integer, x days before today
   */

   if what is empty then return the short date # you got a better idea?

   put the short date into currentDateInDateItems
   convert currentDateInDateItems to dateItems #y,m,d,h(24
format),m,s,daynum (0 sun, 6 sat)
   put item 1 of currentDateInDateItems into currentYear
   put item 2 of currentDateInDateItems into currentMonth

   if what="T" then #today
  put the short date into what
   else if what="Y" then #first day of year
  put "01/01/" into what
   else if what="R" then #last day of year
  put "12/31/" into what
   else if what="M" then # first of month
  put currentMonth&"01" into what
   else if what="H" then # last day of month
  if currentMonth is 12 then
 put "12/31/" into what
  else #not 12, # the easiest way to do this math is to get midnight on
the first day of the following month and then move back a second and let LC
do the math on what the date is
 # since otherwise we have to figure out the 30 days
have september, blah, blah, blah, and leap years, blah, blah, blah.
 add 1 to item 2 of currentDateInDateItems #next month
 put "0" into item 3 of currentDateInDateItems #I love dateItems.
How to figure out the last day of this month?  Go to first day of next
month and subtract 1, (making it a 0, e.g. 5/0/17 is 4/30/17)
 put currentDateInDateItems into what
  end if #currentMonth is 12
   else if what is "W" then #first day of week #sunday is first day of week
  put last item of currentDateInDateItems into dayNumber
  subtract (dayNumber-1) from item 3 of currentDateInDateItems
  put currentDateInDateItems into what
   else if what is "K" then #last day of week #saturday is last day of week
  put last item of currentDateInDateItems into dayNumber
  add (7-dayNumber) to item 3 of currentDateInDateItems
  put currentDateInDateItems into what
  convert what to short date
   else if first char of what is "+" then #at least tomorrow, but if
a nuber follows, then x days after today
  delete first char of what # "+"
  if what is empty then put 1 into what #"+" is tomorrow, i.e. +1
  add what to item 3 of currentDateInDateItems
  put currentDateInDateItems into what
   else if first char of what is "-" then # at least yesterday, or if a
number follows, then x days before today
  delete first char of what #"-"
  if what is empty then put 1 into what #"-" is yesterday, i.e. -1
  subtract what from item 3 of currentDateInDateItems
  put currentDateInDateItems into what
   else # a date-ish string could be a date only or a month and a date, or
a month and a date and a year
  #
 if what contains ";" then replace ";" with slash in what
 if what contains space then replace space with slash in what
 if what contains "." then replace "." with slash in what
 if what contains comma then replace comma with slash in what
  # and, if what doesn't contain any of those, comma will be the
delimiter
  #

  set the itemDelimiter to slash

  #
  if the number of items in what is not 3 then put slash
after what   # try adding a year, first
  if the number of items in what is not 3 then put currentMonth
before what # try adding the month, next
  #

  if what is not a date then put empty into what #error
   end if #what="T"

   convert what to short date
   return what
end quickenDate

-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."
___
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: is a date

2017-10-16 Thread Bob Sneidar via use-livecode
This probably matters to no one at all, but SQL does not store dates with 
forward slashes. SQL datetime formats look like this:

-dd-mm hh:mm:ss

Bob S



___
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


Atkinson dither algorithm

2017-10-16 Thread Alejandro Tejada via use-livecode
Hi Bob,

Bob Sneidar wrote:
> I didn't post any code I don't think, but I will certainly
> take some credit for having done so! ;-)

In fact, you are not late! :-D
Please, take a look at the script of
Atkinson Dither 04 (Fastest Version)
and make it faster.

How would you do this?

Making the Functions Private (so they are not
available in the message path)?

Converting some variables to constants?
(like the black and white pixels and many
other variables that do not change at all
inside the handler)

The main difference between V04 and V03
of this handler is a single modification:

An arithmetic operation like ADD:
> add (tDifusionError) to tArray2[tNewKey]
replaced all instances of PUT
variable + variable into array
like in this line:
> put (tDifusionError) + tArray2[tNewKey] into tArray2[tNewKey]

This single change speed the handler (in my own setup)
by a whopping 33%. Just replacing "put" with "add"

Please take a look! :-)
(Download only the stack at the end of this thread)
https://forums.livecode.com/viewtopic.php?f=10=159173#p159173

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


Re: is a date

2017-10-16 Thread Mike Kerner via use-livecode
HEY BOB COPYCAT!

On Mon, Oct 16, 2017 at 1:34 PM, Bob Sneidar via use-livecode <
use-livecode@lists.runrev.com> wrote:

> May want to check out the MasterLibrary then. It's got a lot of great
> commands and functinos, one of which will format a date any way you like,
> including sql date.
>
> Bob S
>
>
> > On Oct 16, 2017, at 10:14 , Andrew Bell via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> >> From: Bob Sneidar 
> >> To: How to use LiveCode 
> >> Subject: Re: is a date
> >> Message-ID: <6eb529a3-5d21-4186-bd90-641746e96...@iotecdigital.com>
> >> Content-Type: text/plain; charset="us-ascii"
> >>
> >> This probably matters to no one at all, but SQL does not store dates
> with forward slashes. SQL datetime formats look like this:
> >>
> >> -dd-mm hh:mm:ss
> >>
> >> Bob S
> >>
> >
> > It mattered to me recently on a project I was working on so I wrote
> these two scripts to help me generate a LC version of the mySQL version of
> "timestamp":
> >
> > on timeStamp
> >   put the internet date into tTheDate
> >   convert tTheDate to dateitems
> >   put item 1 of tTheDate into tYear
> >   put item 2 of tTheDate into tMonth
> >   put item 3 of tTheDate into tDay
> >   put item 4 of tTheDate into tHour
> >   put item 5 of tTheDate into tMinute
> >   put item 6 of tTheDate into tSecond
> >
> >   leadingZero tMonth
> >   leadingZero tDay
> >   leadingZero tHour
> >   leadingZero tMinute
> >   leadingZero tSecond
> >
> >   put tYear & "-" & tMonth & "-" & tDay && tHour & ":" & tMinute & ":" &
> tSecond into tTimeStamp
> >   return tTimeStamp
> > end timeStamp
> >
> > on leadingZero @pDateItem
> >   if the length of pDateItem = 1 then
> >  put "0" before pDateItem
> >   end if
> > end leadingZero
> >
> >
> > A new date/time format of "database" would be useful for something like
> this.
> >
> > --Andrew Bell
> >
> >
> > ___
> > 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
>



-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."
___
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: is a date

2017-10-16 Thread Andrew Bell via use-livecode

From: Bob Sneidar 
To: How to use LiveCode 
Subject: Re: is a date
Message-ID: <6eb529a3-5d21-4186-bd90-641746e96...@iotecdigital.com>
Content-Type: text/plain; charset="us-ascii"

This probably matters to no one at all, but SQL does not store dates  
with forward slashes. SQL datetime formats look like this:


-dd-mm hh:mm:ss

Bob S



It mattered to me recently on a project I was working on so I wrote  
these two scripts to help me generate a LC version of the mySQL  
version of "timestamp":


on timeStamp
   put the internet date into tTheDate
   convert tTheDate to dateitems
   put item 1 of tTheDate into tYear
   put item 2 of tTheDate into tMonth
   put item 3 of tTheDate into tDay
   put item 4 of tTheDate into tHour
   put item 5 of tTheDate into tMinute
   put item 6 of tTheDate into tSecond

   leadingZero tMonth
   leadingZero tDay
   leadingZero tHour
   leadingZero tMinute
   leadingZero tSecond

   put tYear & "-" & tMonth & "-" & tDay && tHour & ":" & tMinute &  
":" & tSecond into tTimeStamp

   return tTimeStamp
end timeStamp

on leadingZero @pDateItem
   if the length of pDateItem = 1 then
  put "0" before pDateItem
   end if
end leadingZero


A new date/time format of "database" would be useful for something like this.

--Andrew Bell


___
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: Send "rawKeyUp"

2017-10-16 Thread Bob Sneidar via use-livecode
I have a great solution, which is simple, elegant and effective. Tell the end 
user, "Don't do that!" :-)

Bob S


> On Oct 15, 2017, at 09:31 , Richmond Mathewson via use-livecode 
>  wrote:
> 
> Normally, when I have personal problems . . .
> 
> This was, oddly enough, someone else's "personal" problem that came my way
> and got me thinking . . .
> 
> Certainly, the ability to make sure chummy doesn't muck things up by keeping 
> his/her finger
> on a button/key is important.
> 
> I suppose an enhancement request for the rather obvious:
> 
> rawKeyStillDown  &   keyStillDown
> 
> might not be a bad idea.
> 
> 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: is a date

2017-10-16 Thread Roger Eller via use-livecode
Again, I would prefer a simple one-liner built-in function.  What if
instead of "is a date" returning true or false, it instead returned some
expected outputs like "short, long, internet, seconds, ect.".  Something
short and sweet.

~Roger

On Mon, Oct 16, 2017 at 12:56 PM, Bob Sneidar via use-livecode <
use-livecode@lists.runrev.com> wrote:

> This probably matters to no one at all, but SQL does not store dates with
> forward slashes. SQL datetime formats look like this:
>
> -dd-mm hh:mm:ss
>
> Bob S
>
___
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: Send "rawKeyUp"

2017-10-16 Thread Richmond Mathewson via use-livecode

That's OK in theory until you start thinking about adolescents . . .

Richmond.

On 10/16/17 8:00 pm, Bob Sneidar via use-livecode wrote:

I have a great solution, which is simple, elegant and effective. Tell the end user, 
"Don't do that!" :-)

Bob S



On Oct 15, 2017, at 09:31 , Richmond Mathewson via use-livecode 
 wrote:

Normally, when I have personal problems . . .

This was, oddly enough, someone else's "personal" problem that came my way
and got me thinking . . .

Certainly, the ability to make sure chummy doesn't muck things up by keeping 
his/her finger
on a button/key is important.

I suppose an enhancement request for the rather obvious:

rawKeyStillDown  &   keyStillDown

might not be a bad idea.

Richmond.


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


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


Re: Comparing 2 Spoken words, FFT function in LiveCode?

2017-10-16 Thread hh via use-livecode
LC Script is probably not fast enough for performing a FFT.
But you could use, for example, the following digital signal processing
library for javascript via a browser widget.

https://github.com/corbanbrook/dsp.js

Or try to use LCB's java-FFI based on these approaches:

https://lstsal.wordpress.com/2015/02/25/an-easy-way-to-compare-two-audios/
https://lstsal.wordpress.com/2015/02/28/comparing-two-audio-files/

> Peter R. wrote:
> Does anyone know of an implementation of an FFT function written in LiveCode?
> I've tried joneslib but this doesn't include FFT. I'm hoping to use FFTs as
> part of my attempt to compare 2 short sound clips of people speaking a single
> word.I'm trying to judge whether a single word spoken by 2 different people
> is the same word or not. Any advice or code that might help with this would
> be most welcome.


___
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: Send "rawKeyUp"

2017-10-16 Thread Bob Sneidar via use-livecode
Adolescents are the perfect patients for this kind of thing. Better to train 
them how to use a thing properly than to try and get the thing to accomodate 
all their foibles. 

Bob S


> On Oct 16, 2017, at 10:20 , Richmond Mathewson via use-livecode 
>  wrote:
> 
> That's OK in theory until you start thinking about adolescents . . .
> 
> 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: is a date

2017-10-16 Thread Mike Kerner via use-livecode
Did I miss someone checking if the allegedly valid date is really a valid
date?  I don't think 99/99/99 is valid.

On Mon, Oct 16, 2017 at 2:07 PM, Mike Kerner 
wrote:

> HEY BOB COPYCAT!
>
> On Mon, Oct 16, 2017 at 1:34 PM, Bob Sneidar via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>
>> May want to check out the MasterLibrary then. It's got a lot of great
>> commands and functinos, one of which will format a date any way you like,
>> including sql date.
>>
>> Bob S
>>
>>
>> > On Oct 16, 2017, at 10:14 , Andrew Bell via use-livecode <
>> use-livecode@lists.runrev.com> wrote:
>> >
>> >> From: Bob Sneidar 
>> >> To: How to use LiveCode 
>> >> Subject: Re: is a date
>> >> Message-ID: <6eb529a3-5d21-4186-bd90-641746e96...@iotecdigital.com>
>> >> Content-Type: text/plain; charset="us-ascii"
>> >>
>> >> This probably matters to no one at all, but SQL does not store dates
>> with forward slashes. SQL datetime formats look like this:
>> >>
>> >> -dd-mm hh:mm:ss
>> >>
>> >> Bob S
>> >>
>> >
>> > It mattered to me recently on a project I was working on so I wrote
>> these two scripts to help me generate a LC version of the mySQL version of
>> "timestamp":
>> >
>> > on timeStamp
>> >   put the internet date into tTheDate
>> >   convert tTheDate to dateitems
>> >   put item 1 of tTheDate into tYear
>> >   put item 2 of tTheDate into tMonth
>> >   put item 3 of tTheDate into tDay
>> >   put item 4 of tTheDate into tHour
>> >   put item 5 of tTheDate into tMinute
>> >   put item 6 of tTheDate into tSecond
>> >
>> >   leadingZero tMonth
>> >   leadingZero tDay
>> >   leadingZero tHour
>> >   leadingZero tMinute
>> >   leadingZero tSecond
>> >
>> >   put tYear & "-" & tMonth & "-" & tDay && tHour & ":" & tMinute & ":"
>> & tSecond into tTimeStamp
>> >   return tTimeStamp
>> > end timeStamp
>> >
>> > on leadingZero @pDateItem
>> >   if the length of pDateItem = 1 then
>> >  put "0" before pDateItem
>> >   end if
>> > end leadingZero
>> >
>> >
>> > A new date/time format of "database" would be useful for something like
>> this.
>> >
>> > --Andrew Bell
>> >
>> >
>> > ___
>> > 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
>>
>
>
>
> --
> On the first day, God created the heavens and the Earth
> On the second day, God created the oceans.
> On the third day, God put the animals on hold for a few hours,
>and did a little diving.
> And God said, "This is good."
>



-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."
___
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: Send "rawKeyUp"

2017-10-16 Thread Richmond Mathewson via use-livecode
My experience is that adolescents have considerably less foibles than 
adults; merely that adolescents are honest enough to admit them openingly.


However, what I meant was labelling a program with "don't do this" would 
produce the opposite with adolescents.


Richmond.

On 10/16/17 8:36 pm, Bob Sneidar via use-livecode wrote:

Adolescents are the perfect patients for this kind of thing. Better to train 
them how to use a thing properly than to try and get the thing to accomodate 
all their foibles.

Bob S



On Oct 16, 2017, at 10:20 , Richmond Mathewson via use-livecode 
 wrote:

That's OK in theory until you start thinking about adolescents . . .

Richmond.


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


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


Re: Atkinson dither algorithm

2017-10-16 Thread Alex Tweedly via use-livecode



On 17/10/2017 00:21, Alex Tweedly via use-livecode wrote:

Sorry about the horrible formatting on the last post... I'll try to find 
my Forum password and post the modified version there 


I haven't tackled the second half (i.e. the actual dithering bit yet - 
maybe tomorrow).

I can trim a few ms off this, but it's really not significant.

Change the checks for being near the right hand side of the image from 
'if's to a switch.


Then,  after you've calculated and used tNewKey, change following lines 
like :


*if* tPixelPosition modtImageWidth <> 1*then**
    put (tPixelPosition + tImageWidth - 1) into tNewKey**
   add*(tDifusionError) totArray2[tNewKey]*
end* *if*


to


*if* tPixelPosition modtImageWidth <> 1*then**
    add*(tDifusionError) totArray2[tNewKey-1]*
end* *if*


but it really is nit-picking - only a tine saving.

-- Alex.

___
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: OAuth2 (LC 9) on mobile?

2017-10-16 Thread Monte Goulding via use-livecode

> On 17 Oct 2017, at 7:58 am, Ben Rubinstein via use-livecode 
>  wrote:
> 
> Plot thickens - with the additional inclusions, I do indeed get a browser 
> with an invitation to log in to, in my case, Dropbox.
> 
> However after logging into Dropbox, and getting a page asking whether I 
> approve connecting this app - touching the "allow" button has no effect.
> 
> Has anyone else tried using Oauth2 on mobile, for Dropbox or anything else?

Sorry not to have replied sooner Ben… I think this is my fault :-(

When I did OAuth2 I recall adding in some stuff for mobile but I actually can’t 
recall testing said stuff so it’s definitely feasible you are breaking new 
ground here.

It sounds like the browser isn’t redirecting but it needs investigation. Could 
you open a report with your findings and we will look into it.

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

Send "rawKeyUp"

2017-10-16 Thread Alejandro Tejada via use-livecode
Hi Bob,

Bob Sneidar wrote:
> Nowhere in the symptoms is any description
> of mental disorder.

In fact, it does affect the behavior of SOME people. Take a look:
https://www.salon.com/2015/03/27/the_parasite_made_me_do_it_how_a_common_infection_could_manipulate_our_behavior_partner/

In this blog, you could keep up to date about more recent
developments and research about this parasite:

http://toxoplasmaparasite.blogspot.com/

And this is quickly going off-topic. If you want, write me
off list to continue this interesting conversation. I will tell
you what the parasitologist Jaroslav Flegr told me when
I write to him in his facebook account...

Al

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


Re: Atkinson dither algorithm

2017-10-16 Thread Alex Tweedly via use-livecode


On 16/10/2017 19:37, Alejandro Tejada via use-livecode wrote:

Hi Bob,

Bob Sneidar wrote:

I didn't post any code I don't think, but I will certainly
take some credit for having done so! ;-)

In fact, you are not late! :-D

But I am too late - the file is called "...Final Version ..." :-) :-)
Let's have a look anyway

Please, take a look at the script of
Atkinson Dither 04 (Fastest Version)
and make it faster.

OK, did that :-)

I've been aware of this interesting discussion, but had no time to look 
at it at all (until tonight). Sorry to be late to the party.


I made a few changes, as follows:

1. (Just on principle).
I would change all these reference to "char" to "byte" when we are 
really talking about bytes in binary data.


Probably doesn't make any difference to performance - the engine will 
most likely realize that there aren't any Unicode strings involved - but 
it's just "right" to call them bytes, and to use the byte functions to 
manipulate them :-)


2. there's a function ImgToCh which extracts a single channel of data 
out the image data.
It does this with a cute 'delete' method - but that is over-thinking the 
problem.
You can (i.e. the engine can) access a single byte within a byte string 
in constant time (it's surely a single offset in the C library).


so instead of


repeat untiltempVar isempty
  putchar1oftempVar aftertResult
  deletechar1to4oftempVar
end repeat


we can simply do


*repeat* withi = 1tothenumberofcharsintempVar step4*
  put*bytei oftempVar aftertemp*
end* *repeat*

(I kept the initial delete to select which channel, just because it's so 
clever :-) - but that could have been removed and the repeat changed to

*   repeat* withi = tChannel+1tothenumberofcharsintempVar step4*
*

3. The result of that function is then passed to another function that 
converts the byte string into a sequential array of numbers (and that's 
all that's done with the byte string).

So those two should be combined into a single pass - to get :


Function ImgToChToArrayNum2 tImageData, tChannel
   -- extract a single channel's data, and convert to sequential array 
of numbers

   puttImageData intotempVar
   deletebyte1totChannel oftempVar
   putemptyintotResult
put0intotCounter
   repeat withi = 1tothenumberofbytesintempVar step4
  add1totCounter
  putbytetonum(bytei oftempVar) intotResult[tCounter]
   end repeat
   returntResult
end ImgTochToArrayNum2

This takes the time for this part of the whole process down from 250ms 
to about 75ms, and therefore the total process time down from around 
750-800ms to 600-650ms (on my aging MBP).


Trying repeated runs, the times do seem to vary more than usual - not 
sure why.


I haven't tackled the second half (i.e. the actual dithering bit yet - 
maybe tomorrow).


-- Alex.

___
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: Send "rawKeyUp"

2017-10-16 Thread Bob Sneidar via use-livecode
Toxoplasmosis is a parasitic infection spread by coming into contact with cat 
feces and ingesting the parasite. Nowhere in the symptoms is any description of 
mental disorder. 

Bob S


> On Oct 16, 2017, at 13:22 , Alejandro Tejada via use-livecode 
>  wrote:
> 
> In my experience, adult people with toxoplasmosis
> act exactly in the same way... :-(


___
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: OAuth2 (LC 9) on mobile?

2017-10-16 Thread Ben Rubinstein via use-livecode
Plot thickens - with the additional inclusions, I do indeed get a browser with 
an invitation to log in to, in my case, Dropbox.


However after logging into Dropbox, and getting a page asking whether I 
approve connecting this app - touching the "allow" button has no effect.


Has anyone else tried using Oauth2 on mobile, for Dropbox or anything else?

Many thanks,

Ben

On 16/10/2017 16:07, Ben Rubinstein via use-livecode wrote:
OAuth2 does work on mobile - I needed to include the Browser widget in the 
standalone. (The 'search for inclusions' doesn't know to include the Oauth2 
library, let alone the browser widget.)


If anyone else finds themselves sometimes spending a long time going down a 
path where the answer is to do with inclusions, I have two relevant feature 
suggestions in LQCC - I'd be interested in comments:

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

Ben

On 13/10/2017 08:17, Ben Rubinstein via use-livecode wrote:
Now that Greg's Oauth2 issue has been resolved, can I check whether anyone 
has seen the Oauth2 library work on mobile? I don't want to raise an LQCC if 
it's just me doing something wrong!


thanks,

Ben

On 11/10/2017 17:19, Ben Rubinstein via use-livecode wrote:
To clarify, by "everything still works" I mean that the OAuth2 command 
appears to have done "exit to top" without doing anything - but leaving the 
whole screen dimmed out. So other controls on the card, although dim, work. 
But no authorisation has happened.


On 11/10/2017 17:02, Ben Rubinstein via use-livecode wrote:
Does the new OAuth2 library in LC 9 work on mobile? Docs suggest it 
should, but testing on iPad I just get an interesting dimmed out effect on 
the stack - although in fact everything still works - where I would have 
expected a sheet or switching to Safari or some other way of displaying a 
web page.


TIA,

Ben



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

http://lists.runrev.com/mailman/listinfo/use-livecode



___
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: quicken dates

2017-10-16 Thread Bob Sneidar via use-livecode
Thanks Mike! I have something similar but limited in scope, where I can type in 
yesterday or tomorrow ot today and get the respective date. I will incorporate 
your method for all my date fields! Unfortunately there are a TON of line 
wrapping errors introduced by your pasted code. I'll have to sus it all out. 

Bob S


> On Oct 16, 2017, at 11:16 , Mike Kerner via use-livecode 
>  wrote:
> 
> Way back in the day, Quicken allowed all kinds of shenanigans with dates
> It allowed a variety of delimiters
> It allowed pseudo-dates:
> 20 -- 20th of the current month
> 10/20 -- 10/20/current year
> + -- tomorrow
> m -- first of this month
> h -- last of this month
> etc.
> 
> I really like this, because it makes it much easier than trying to look at
> a calendar all the time, so I wrote my own version, that expands on the
> idea:
> 
> function quickenDate what
>   /*
>   Returns current date if sent an empty string
>   Returns empty if can't figure out what "what" is supposed to be
> 
>   Delimiter can be ".", "/", ";",  or comma
>   Date can be in m/d/y, m/d, or just d format
>   Also accepts (upper or lower case)
>   T - (T)oday
>   M - First day of (M)onth
>   H - Last day of mont(H)
>   W - First day of (W)eek
>   K - Last day of wee(K)
>   Y - First day of (Y)ear
>   R - Last day of yea(R)
>   + - tomorrow
>   +x, where x is an integer, x days from today
>   - - yesterday
>   -x where x is an integer, x days before today
>   */
> 
>   if what is empty then return the short date # you got a better idea?
> 
>   put the short date into currentDateInDateItems
>   convert currentDateInDateItems to dateItems #y,m,d,h(24
> format),m,s,daynum (0 sun, 6 sat)
>   put item 1 of currentDateInDateItems into currentYear
>   put item 2 of currentDateInDateItems into currentMonth
> 
>   if what="T" then #today
>  put the short date into what
>   else if what="Y" then #first day of year
>  put "01/01/" into what
>   else if what="R" then #last day of year
>  put "12/31/" into what
>   else if what="M" then # first of month
>  put currentMonth&"01" into what
>   else if what="H" then # last day of month
>  if currentMonth is 12 then
> put "12/31/" into what
>  else #not 12, # the easiest way to do this math is to get midnight on
> the first day of the following month and then move back a second and let LC
> do the math on what the date is
> # since otherwise we have to figure out the 30 days
> have september, blah, blah, blah, and leap years, blah, blah, blah.
> add 1 to item 2 of currentDateInDateItems #next month
> put "0" into item 3 of currentDateInDateItems #I love dateItems.
> How to figure out the last day of this month?  Go to first day of next
> month and subtract 1, (making it a 0, e.g. 5/0/17 is 4/30/17)
> put currentDateInDateItems into what
>  end if #currentMonth is 12
>   else if what is "W" then #first day of week #sunday is first day of week
>  put last item of currentDateInDateItems into dayNumber
>  subtract (dayNumber-1) from item 3 of currentDateInDateItems
>  put currentDateInDateItems into what
>   else if what is "K" then #last day of week #saturday is last day of week
>  put last item of currentDateInDateItems into dayNumber
>  add (7-dayNumber) to item 3 of currentDateInDateItems
>  put currentDateInDateItems into what
>  convert what to short date
>   else if first char of what is "+" then #at least tomorrow, but if
> a nuber follows, then x days after today
>  delete first char of what # "+"
>  if what is empty then put 1 into what #"+" is tomorrow, i.e. +1
>  add what to item 3 of currentDateInDateItems
>  put currentDateInDateItems into what
>   else if first char of what is "-" then # at least yesterday, or if a
> number follows, then x days before today
>  delete first char of what #"-"
>  if what is empty then put 1 into what #"-" is yesterday, i.e. -1
>  subtract what from item 3 of currentDateInDateItems
>  put currentDateInDateItems into what
>   else # a date-ish string could be a date only or a month and a date, or
> a month and a date and a year
>  # slash, a period, or a space>
> if what contains ";" then replace ";" with slash in what
> if what contains space then replace space with slash in what
> if what contains "." then replace "." with slash in what
> if what contains comma then replace comma with slash in what
>  # and, if what doesn't contain any of those, comma will be the
> delimiter
>  # slash, a period, or a space>
> 
>  set the itemDelimiter to slash
> 
>  #
>  if the number of items in what is not 3 then put slash
> after what   # try adding a year, first
>  if the number of items in what is not 3 then put currentMonth
> before what # try adding the month, next
>  #
> 
>  if what is not a date then put empty into what #error
>   end if #what="T"
> 

Re: How to meet an integer

2017-10-16 Thread Stephen Barncard via use-livecode
I never met an integer I didn't like.

--
Stephen Barncard - Sebastopol Ca. USA -
mixstream.org

On Mon, Oct 16, 2017 at 6:11 PM, Mike Kerner via use-livecode <
use-livecode@lists.runrev.com> wrote:

> you..one?
>
> On Mon, Oct 16, 2017 at 12:12 PM, hh via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>
> > > JLG wrote:
> > > Until I met my husband, ALL my dates were zeros.
> >
> > You won.
> >
> > ___
> > 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
> >
>
>
>
> --
> On the first day, God created the heavens and the Earth
> On the second day, God created the oceans.
> On the third day, God put the animals on hold for a few hours,
>and did a little diving.
> And God said, "This is good."
> ___
> 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: Word recognition

2017-10-16 Thread Mark Wieder via use-livecode

Peter, Hermann, Frans:


Does anyone know of an implementation of an FFT function written in LiveCode?  
I've tried joneslib but this doesn't include FFT. I'm hoping to use FFTs as 
part of my attempt to compare 2 short sound clips of people speaking a single 
word.  I'm trying to judge whether a single word spoken by 2 different people 
is the same word or not. Any advice or code that might help with this would be 
most welcome.


Having recently embarked on a similar project, I'd recommend a python or 
lua interface to fftw rather than trying this in LiveCode.


http://www.fftw.org/

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


Send "rawKeyUp"

2017-10-16 Thread Alejandro Tejada via use-livecode
Hi Richmond,

Richmond wrote:
> My experience is that adolescents have considerably
> less foibles than adults; merely that adolescents are
> honest enough to admit them openingly.

> However, what I meant was labelling a program with
> "don't do this" would produce the opposite
> with adolescents.

In my experience, adult people with toxoplasmosis
act exactly in the same way... :-(

If you say them: "Don't to this or that because something
worse would happen for sure" then...
these persons would do exactly this and that, not
because they needed to, but just to prove that you
are wrong... :'-(

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


Re: Atkinson dither algorithm

2017-10-16 Thread Alejandro Tejada via use-livecode
Hi Alex,

This is Amazing! :-D
Alex, your function saved another 34%
in the running time of this handler!

In retrospect, only now it seems very obvious
that merging two functions could save more
running time in this handler... but
I just keep wondering: How far can we go
merging functions to save milliseconds
in our LiveCode handlers? This is an interesting
question that could be answered exactly
in milliseconds.

By the way, I have to add a try structure to dismiss
an error message:

Function ImgToChToArrayNum2 tImageData, tChannel
-- extract a single channel's data, and convert
-- to sequential array of numbers by Alex Tweedly

put tImageData into tempVar
delete byte 1 to tChannel of tempVar
put empty into tResult
put 0 into tCounter
repeat with i = 1 to the number of bytes in tempVar step 4
   add 1 to tCounter
   try
  put bytetonum(byte i of tempVar) into tResult[tCounter]
  end try
end repeat
return tResult
end ImgTochToArrayNum2

Alex Tweedly wrote:
> I haven't tackled the second half (i.e. the actual dithering bit yet -
> maybe tomorrow).

Excellent! Thanks a lot for your time, Alex.

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


Re: quicken dates

2017-10-16 Thread Mike Kerner via use-livecode
I'll email it to you off-list

On Mon, Oct 16, 2017 at 4:45 PM, Bob Sneidar via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Thanks Mike! I have something similar but limited in scope, where I can
> type in yesterday or tomorrow ot today and get the respective date. I will
> incorporate your method for all my date fields! Unfortunately there are a
> TON of line wrapping errors introduced by your pasted code. I'll have to
> sus it all out.
>
> Bob S
>
>
> > On Oct 16, 2017, at 11:16 , Mike Kerner via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > Way back in the day, Quicken allowed all kinds of shenanigans with dates
> > It allowed a variety of delimiters
> > It allowed pseudo-dates:
> > 20 -- 20th of the current month
> > 10/20 -- 10/20/current year
> > + -- tomorrow
> > m -- first of this month
> > h -- last of this month
> > etc.
> >
> > I really like this, because it makes it much easier than trying to look
> at
> > a calendar all the time, so I wrote my own version, that expands on the
> > idea:
> >
> > function quickenDate what
> >   /*
> >   Returns current date if sent an empty string
> >   Returns empty if can't figure out what "what" is supposed to be
> >
> >   Delimiter can be ".", "/", ";",  or comma
> >   Date can be in m/d/y, m/d, or just d format
> >   Also accepts (upper or lower case)
> >   T - (T)oday
> >   M - First day of (M)onth
> >   H - Last day of mont(H)
> >   W - First day of (W)eek
> >   K - Last day of wee(K)
> >   Y - First day of (Y)ear
> >   R - Last day of yea(R)
> >   + - tomorrow
> >   +x, where x is an integer, x days from today
> >   - - yesterday
> >   -x where x is an integer, x days before today
> >   */
> >
> >   if what is empty then return the short date # you got a better idea?
> >
> >   put the short date into currentDateInDateItems
> >   convert currentDateInDateItems to dateItems #y,m,d,h(24
> > format),m,s,daynum (0 sun, 6 sat)
> >   put item 1 of currentDateInDateItems into currentYear
> >   put item 2 of currentDateInDateItems into currentMonth
> >
> >   if what="T" then #today
> >  put the short date into what
> >   else if what="Y" then #first day of year
> >  put "01/01/" into what
> >   else if what="R" then #last day of year
> >  put "12/31/" into what
> >   else if what="M" then # first of month
> >  put currentMonth&"01" into what
> >   else if what="H" then # last day of month
> >  if currentMonth is 12 then
> > put "12/31/" into what
> >  else #not 12, # the easiest way to do this math is to get midnight
> on
> > the first day of the following month and then move back a second and let
> LC
> > do the math on what the date is
> > # since otherwise we have to figure out the 30 days
> > have september, blah, blah, blah, and leap years, blah, blah, blah.
> > add 1 to item 2 of currentDateInDateItems #next month
> > put "0" into item 3 of currentDateInDateItems #I love dateItems.
> > How to figure out the last day of this month?  Go to first day of next
> > month and subtract 1, (making it a 0, e.g. 5/0/17 is 4/30/17)
> > put currentDateInDateItems into what
> >  end if #currentMonth is 12
> >   else if what is "W" then #first day of week #sunday is first day of
> week
> >  put last item of currentDateInDateItems into dayNumber
> >  subtract (dayNumber-1) from item 3 of currentDateInDateItems
> >  put currentDateInDateItems into what
> >   else if what is "K" then #last day of week #saturday is last day of
> week
> >  put last item of currentDateInDateItems into dayNumber
> >  add (7-dayNumber) to item 3 of currentDateInDateItems
> >  put currentDateInDateItems into what
> >  convert what to short date
> >   else if first char of what is "+" then #at least tomorrow, but if
> > a nuber follows, then x days after today
> >  delete first char of what # "+"
> >  if what is empty then put 1 into what #"+" is tomorrow, i.e. +1
> >  add what to item 3 of currentDateInDateItems
> >  put currentDateInDateItems into what
> >   else if first char of what is "-" then # at least yesterday, or if a
> > number follows, then x days before today
> >  delete first char of what #"-"
> >  if what is empty then put 1 into what #"-" is yesterday, i.e. -1
> >  subtract what from item 3 of currentDateInDateItems
> >  put currentDateInDateItems into what
> >   else # a date-ish string could be a date only or a month and a date, or
> > a month and a date and a year
> >  # > slash, a period, or a space>
> > if what contains ";" then replace ";" with slash in what
> > if what contains space then replace space with slash in what
> > if what contains "." then replace "." with slash in what
> > if what contains comma then replace comma with slash in what
> >  # and, if what doesn't contain any of those, comma will be the
> > delimiter
> >  # > slash, a period, or a space>
> >
> >  set 

Re: How to meet an integer

2017-10-16 Thread Mike Kerner via use-livecode
you..one?

On Mon, Oct 16, 2017 at 12:12 PM, hh via use-livecode <
use-livecode@lists.runrev.com> wrote:

> > JLG wrote:
> > Until I met my husband, ALL my dates were zeros.
>
> You won.
>
> ___
> 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
>



-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."
___
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: libURLLast/xx/headers on mobile?

2017-10-16 Thread Ben Rubinstein via use-livecode

Aha, thanks Mark! That did it.


On 13/10/2017 18:23, Mark Waddingham via use-livecode wrote:

On 2017-10-13 12:15, Ben Rubinstein via use-livecode wrote:

I'm trying to debug a case where making some calls to an external API
works fine on desktop, but fails on mobile (both iOS and Android) with
"400 bad request".

Unfortunately it seems that libURLLastHTTPHeaders() and
libURLLastRHHeaders() aren't available on mobile. Is there some other
way to get the information on mobile (especially the latter)?


IIRC, if you are using Indy or Business, then tsNet will provide those 
functions on mobile (it provides a libURL like interface on all platforms).


I believe you just need to make sure that you are including the Internet 
library and tsNet inclusion in the s/b.


Warmest Regards,

Mark.

P.S. I'm pretty sure libURL also works on mobile in community - if you select 
the Internet inclusion, although in that case it just plain libURL, no tsNet 
as that requires Indy or Business.




___
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