Re: ...and a challenge

2019-10-05 Thread Peter W A Wood via use-livecode
Colin

> On 6 Oct 2019, at 11:34, Colin Holgate via use-livecode 
>  wrote:
> 
> Pi is a reserved work, so I used pie. I haven’t seen this way of producing Pi 
> before, and in both JavaScript and LivceCode it seems to be instantaneous. I 
> think it’s a rewording of 4*(1-1/3+1/5-1/7+1/9…)

…

> set numberformat to “x.xxx"
> 
Your solution seems to be missing a few hundred thousand digits ;-) The 
JavaScript solution prints the first 1,000,000 digits of Pi.

Actually, the article says that the script only can produce 1,000,000 digits 
when run in a Chrome console. It will only print the first 315,633 digits in 
Firefox. (I haven’t tried that to confirm it.)

...


> BTW, I haven’t seen JavaScript using ‘let’ before, or having ’n’ to indicate 
> a floating point number. That could be a dot net thing.

“Let” was introduced into JavaScript some time ago. It provides block-level 
scope. This console session may demonstrate the difference:
>>> j = 0;
0
>>> for (var j = 0; j < 10; j++) {};
>>> print(j);
10

>>> k = 0;
0
>>> for (let k = 0; k < 10; k++) {};
>>> print(k);
0

Big Integer support was recently introduced into JavaScript. The ’n’ suffix 
denotes a Big Integer, “primitive” numbers are always floats in JavaScript.

Regards

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


Re: [OT] Working with Android devices

2018-09-14 Thread Peter W A Wood via use-livecode
Many thanks Jacque, Richard and Bob.

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


[OT] Working with Android devices

2018-09-14 Thread Peter W A Wood via use-livecode
I have recently got an Android tablet and am seeking advice on how best to work 
with it in general, not so much with Livecode yet. My main machine is a Mac. I 
would like to be able to easily swap files with the Android tablet via wifi and 
to remotely login to it from the Mac. I am hoping that I can do so over the 
local wifi rather than having to connect the Android tablet via USB.

I have a couple of Raspberry Pis on which I installed netatalk so that I can 
access their file systems in macOS Finder. It makes swapping data between the 
Mac and the Raspberry Pi a simple matter of drag and drop. Does anybody know if 
it is possible to install netatalk on an Android device?

I usually use SSH to run programs on the Raspberry Pi. I see that there is an 
app called SSHDroid. Has anybody used it or something similar? 

When I want to access the Raspberry Pi desktop, I connect to the VNC server 
running on the Raspberry Pi. Is anybody connecting to their Android "tablet 
top” from a Mac? How do yo do it?

Sorry about going off topic.

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

Re [OT] Snakey Problem

2018-08-13 Thread Peter W A Wood via use-livecode
Richmond

I am no Python expert having only got over Pythonaphobia, which I contracted 
last century, in the last few months.

The standard Python library, which is included in the distribution, includes 
the TKinter GUI library. When Python starts up, it doesn’t load many of the 
standard libraries automatically. That’s why you need the imports before you 
use them. (It imports them from the standard library).

Here is the smallest hello Richmond program that I could find:

import tkinter as tk

gui = tk.Tk()
w = tk.Label(gui, text="Hello, Richmond!")
w.pack()
w.mainloop()

 
It should run in any standard Python3 distribution.

You might want to think about using the new Mu Editor which is aimed at 
beginners. It includes it’s own version of Python3 (3.6 in the current 
release). It’s website is https://codewith.mu  There’s an 
introduction to it at https://www.raspberrypi.org/blog/mu-python-ide/ 


Hope this helps

Peter

> On 13 Aug 2018, at 16:23, Richmond Mathewson via use-livecode 
> mailto:use-livecode@lists.runrev.com>> wrote:
> 
> Like it or not (and mainly NOT), I have to offer Python to kids this fall . . 
> .
> 
> This is a b*gger for several reasons:
> 
> 1. I love LiveCode.
> 
> 2. To use Python to any effect apart from rather goofy manipulations with 
> numbers and text an install
> requires 'modules' which are usually installed using a daft command-line 
> system using something call
> 'PIP' [ "Permanently Injurious Python" perhaps? ] . . . which I have signally 
> failed to get to work on either
> Macintosh or Linux.
> 
> I wonder of anyone knows of a way to install Python 3 on Linux with the main 
> GUI modules "bound in":
> i.e. a one-stop install.
> 
> Frankly, Python, by using this module system seems to defeat itself to a 
> certain extent: or, maybe I'm just
> spoilt by LiveCode.
> 
> This question is very timely as Wednesday is Nag Panchami: the day of snakes!
> 
> 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: Livecode Content Management System

2017-12-04 Thread Peter W A Wood via use-livecode
Andre

> I am talking beyond the current HTML5 deployment (which I don't own a
> license and can't play with)

I thought that you can deploy to HTML5 with the community licence. The GPL 
wouldn’t put you off playing with it, would it?

Peter
___
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: Call for Speakers 2018

2017-10-24 Thread Peter W A Wood via use-livecode
On 25 Oct 2017, at 09:34, Mark Wieder via use-livecode 
 wrote:

> That sounds like the last nail in the coffin for the actual conferences.

Sounds like a great opportunity for you to launch Mark Wieder Event Management 
Inc.

;-)

Peter
___
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: CouchDB, DayBed, etc.

2017-08-24 Thread Peter W A Wood via use-livecode
Alex 

> On 23 Aug 2017, at 22:28, Alex Tweedly via use-livecode 
>  wrote:
> 
> With the exception of a couple of things that basically scraped data off some 
> web pages, every app I've done in the last couple of years (all for personal 
> use by myself or friends - I'm a hobbyist) have shared one characteristic : 
> they have local storage, and that data is subsequently synched to "the cloud" 
> to be shared with other devices/users, or at the very least backed-up to the 
> cloud (i.e. my on-rev or HostM server account).
> 
> I haven't yet done anything on mobile - but because of where I live and other 
> circumstances, even for laptops I *need* to have things work without an 
> Internet connection and synch up when available.
> 
> This doesn't seem to fit well with, say, CouchDB; the REST API lets me do 
> great things when I talk to the server - but when working locally I have to 
> forego all those features, and, for instance, revert to an array which I 
> 'manually' search / filter / etc.

You can easily run CouchDB on a laptop or PC. There is a little more admin that 
SQLite but not very much. One of the strengths of CouchDB is it’s database 
synchronisation (one-way or both-ways) - 
http://docs.couchdb.org/en/2.1.0/replication/index.html 
.

There is also a mobile embedded Couchbase that should sync with CouchDB - 
https://developer.couchbase.com/mobile  
- I guess that would need a LiveCode Builder wrapper before it could be 
accessed from LiveCode.

Peter
 


___
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: First 1000 characters without loop?

2017-06-22 Thread Peter W A Wood via use-livecode
Richard

> How can we know which is in use for a given string?
> 
> Suppose I wanted to process a lot of text, so performance is critical. Using 
> bytes would be optimal, since any chunk type or even Unicode characters may 
> vary in length.
> 
> So if I wanted to create an index of byte offsets into a large chunk of text, 
> how would I know how long a character is?

Some Unicode characters, such as emojis, have to be represented by two 
codepoints in UTF-16 (known as surrogates) so they take four bytes not two. 
Additionally, the number of bytes for characters with accents will take either 
one codepoint or two depending on whether they have been coded in pre-composed 
or decomposed form. (e.g. ç can be either U+0063 U+0327 (decomposed) or U+00E7 
(precomposed).

So it is isn’t easy to estimate the number of bytes in a UTF-16 string.

I would guess that LiveCode will store the characters of a string in single 
bytes if all the letters of the string conform to ISO-8859-1. So if you can be 
certain that your text is all ISO-8859-1 encoded, you can estimate at 1 byte 
per character. (The guess is base on the fact that the first 256 Unicode code 
points replicate ISO-8859-1).

Regards

Peter


___
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: Kognition Beta Test - call for volunteers

2017-04-28 Thread Peter W A Wood via use-livecode
Dear Kevin 

First, congratulations on reaching Beta stage of Kognition. Your description on 
if it is very intriguing.

I think I can offer you an interesting beta test environment. At the moment, I 
have three primary projects (and a number of smaller ones), the data for each 
is stored in diverse forms but, in most cases, very common forms. I think this 
would provide a good test of Kognition’s reach.

Here are the main data sources for each project:

Project 1
Atlassian JIRA - Cloud System - issue and task data
Atlassian HipChat - Cloud System with local client - project 
discussions including requests for action
Atlassian Confluence - Cloud System - project documents
Google Calendar  - Cloud System - project meeting schedule
Google Mail - Cloud System - project email and notifications 
(no local copies)
Project Artefacts - Local Files - documents (markup, pdf), 
code, binary data

Project 2
Google Docs - Cloud System - documents, spreadsheets, 
presentations
AltME Messaging System - Local Files - documents (text, markup, 
pdf), to-do lists, contact list, chat
Project Artefacts - Local Files -  documents (markup, pdf), 
code, binary data
Email (Apple Mail.app) - Local Files - messages + attachments

Project 3
Gitter - Cloud System - project discussion with actionable items
Github - Cloud System - project issues, documentation (markup)
GitBook - Cloud System - published documentation
Trello - Cloud System - project tasks
Blogger - Cloud System - website source and management, user 
comment management
Website - Cloud - project website
Google Groups - Cloud System - membership data, messages
Google Mail - Cloud System - project email

I believe that would provide a good test of Kognition’s data acquisition 
capabilities though the relationships between the data will be relatively 
simple.

I have a MacBook Pro(Retina, 15-inch, Mid 2014), it has a 2.5 Ghz Intel Core 
i7. 

Best regards

Peter



___
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