Re: Get URL anomaly

2018-03-06 Thread J. Landman Gay via use-livecode

On 3/6/18 8:56 AM, Graham Samuel via use-livecode wrote:

I was relying on the Standalone Application Settings option ’search for 
required inclusions’.


I always use manual inclusions for that reason. As soon as I add a 
feature to a project I also add it to the inclusions so I won't forget.


TSNet piggybacks on libURL ("internet") so that's why they're both 
necessary.


--
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: Overwriting a file on a server

2018-03-06 Thread Graham Samuel via use-livecode
OK, I’ll be looking at it: I was not planning to use LiveCode server for this 
task, although as a matter of fact I do have a copy on the site in question for 
other purposes.

Thanks to you and to Richard G. I’ll report back when I’ve sorted it out.

Graham

> On 6 Mar 2018, at 17:38, Mike Bonner via use-livecode 
>  wrote:
> 
> The specific lesson for lc server file uploads is here:
> http://lessons.livecode.com/m/4070/l/40708-how-to-upload-a-file-with-livecode-server
> 
> but as mentioned, setup https first!
> 
> On Tue, Mar 6, 2018 at 9:33 AM, Richard Gaskin via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> 
>> Graham Samuel wrote:
>> 
>>> However, I don’t seem to be able to mimic what my FTP software
>>> (Transmit on the Mac, or FileZilla) can do, which is to easily delete
>>> a file on a server  - the file in question is part of a web site
>>> hosted by DreamHost. I just want to use the URL functionality to do
>>> this, as discussed in my conversation below, but I always get 405
>>> (http) or 530 (ftp). I have a vague suspicion that I should be
>>> transmitting my credentials to the server, which of course I did when
>>> I set up my FTP client, but I have absolutely no idea how to do this.
>>> 
>>> Many members of this list must have mucked around with files on a
>>> server - can someone point me to a tutorial on all this?
>> 
>> If there were, it would not be a short one.
>> 
>> If you could delete a file via HTTP alone, then anyone with a browser
>> could delete files on your server.
>> 
>> FTP is unsafe to use on the Internet, as it sends passwords in clear text.
>> 
>> You could consider FTPS or SFTP, which are not available in the Community
>> Edition but are in others via tsNet - but not without risk:
>> 
>> FTP and its secure variants are designed for ad hoc management of remote
>> file stores. You can delete the file in question, but also any other, and
>> can modify anything on the server in any way you like.
>> 
>> This is useful in tools like Filezilla, where the password is only stored
>> on your own computer.
>> 
>> But if you hard-wire the password in a script, and that script is part of
>> a publicly-distributed app, a memory dump can reveal the key to having
>> complete control over everything on your server.
>> 
>> The most common way for apps to perform write tasks on servers is through
>> an HTTP API, which would require something on the server to process the
>> requests. That something can be PHP, Python, LiveCode Server, or other
>> languages that work well with CGI.
>> 
>> You'd still want some way to authenticate the request, but since it's used
>> only in a server script you write the scope of what can be done with it is
>> much more limited.
>> 
>> And of course that assumes your web server is using HTTPS so credentials
>> can be sent over secured connection, but given the many benefits of HTTPS
>> and the free availability of SSL certs via the Let's Encrypt project
>> (Dreamhost has a convenient option for Let's Encrypt in their control
>> panel) I'm hoping we can assume all web servers managed by developers
>> already have or will soon have HTTPS in place.
>> 
>> A tutorial for getting started with LiveCode Server is here:
>> https://livecode.com/resources/guides/server/
>> 
>> I wish I had a one-liner solution for you.  But in the hostile environment
>> of the Internet, writing network applications requires much more diligence
>> than we used to enjoy back in the day.
>> 
>> --
>> 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: Overwriting a file on a server

2018-03-06 Thread Graham Samuel via use-livecode
In case anyone was holding their breath, I have just realised that the data I 
wanted to store on the server can be stored elsewhere (in the application data 
area, as a property of a stack). So I won’t be in such a hurry to learn this 
stuff, though I know its value and will do so eventually.

Graham

I wrote just now:

> OK, I’ll be looking at it: I was not planning to use LiveCode server for this 
> task, although as a matter of fact I do have a copy on the site in question 
> for other purposes.
> 
> Thanks to you and to Richard G. I’ll report back when I’ve sorted it out.
> 
> Graham
> 
>> On 6 Mar 2018, at 17:38, Mike Bonner via use-livecode 
>>  wrote:
>> 
>> The specific lesson for lc server file uploads is here:
>> http://lessons.livecode.com/m/4070/l/40708-how-to-upload-a-file-with-livecode-server
>> 
>> but as mentioned, setup https first!
>> 
>> On Tue, Mar 6, 2018 at 9:33 AM, Richard Gaskin via use-livecode <
>> use-livecode@lists.runrev.com> wrote:
>> 
>>> Graham Samuel wrote:
>>> 
 However, I don’t seem to be able to mimic what my FTP software
 (Transmit on the Mac, or FileZilla) can do, which is to easily delete
 a file on a server  - the file in question is part of a web site
 hosted by DreamHost. I just want to use the URL functionality to do
 this, as discussed in my conversation below, but I always get 405
 (http) or 530 (ftp). I have a vague suspicion that I should be
 transmitting my credentials to the server, which of course I did when
 I set up my FTP client, but I have absolutely no idea how to do this.
 
 Many members of this list must have mucked around with files on a
 server - can someone point me to a tutorial on all this?
>>> 
>>> If there were, it would not be a short one.
>>> 
>>> If you could delete a file via HTTP alone, then anyone with a browser
>>> could delete files on your server.
>>> 
>>> FTP is unsafe to use on the Internet, as it sends passwords in clear text.
>>> 
>>> You could consider FTPS or SFTP, which are not available in the Community
>>> Edition but are in others via tsNet - but not without risk:
>>> 
>>> FTP and its secure variants are designed for ad hoc management of remote
>>> file stores. You can delete the file in question, but also any other, and
>>> can modify anything on the server in any way you like.
>>> 
>>> This is useful in tools like Filezilla, where the password is only stored
>>> on your own computer.
>>> 
>>> But if you hard-wire the password in a script, and that script is part of
>>> a publicly-distributed app, a memory dump can reveal the key to having
>>> complete control over everything on your server.
>>> 
>>> The most common way for apps to perform write tasks on servers is through
>>> an HTTP API, which would require something on the server to process the
>>> requests. That something can be PHP, Python, LiveCode Server, or other
>>> languages that work well with CGI.
>>> 
>>> You'd still want some way to authenticate the request, but since it's used
>>> only in a server script you write the scope of what can be done with it is
>>> much more limited.
>>> 
>>> And of course that assumes your web server is using HTTPS so credentials
>>> can be sent over secured connection, but given the many benefits of HTTPS
>>> and the free availability of SSL certs via the Let's Encrypt project
>>> (Dreamhost has a convenient option for Let's Encrypt in their control
>>> panel) I'm hoping we can assume all web servers managed by developers
>>> already have or will soon have HTTPS in place.
>>> 
>>> A tutorial for getting started with LiveCode Server is here:
>>> https://livecode.com/resources/guides/server/
>>> 
>>> I wish I had a one-liner solution for you.  But in the hostile environment
>>> of the Internet, writing network applications requires much more diligence
>>> than we used to enjoy back in the day.
>>> 
>>> --
>>> 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

Forcing a device update

2018-03-06 Thread J. Landman Gay via use-livecode
Is there a way to force the IDE to look for attached mobile devices 
without restarting LiveCode?


Typically I have half a dozen scripts open and I'm doing multiple test 
builds to a cabled phone. I edit some scripts and during that time the 
phone goes into low-power mode (not asleep or locked.) When I tap it to 
show the launcher again, LC has lost the device and I have to restart LC 
to make it scan again.


I can use Terminal to rescan if necessary, but even after it sees the 
phone, LC still doesn't.


I need a message box command to make LC "see" the device again. 
Restarting loses all my open script windows and I have to relaunch the 
stack and set everything up again.


--
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: Horizontal and Portrait Scrolling on Mobile

2018-03-06 Thread Brian Milby via use-livecode
Netflix is probably another example of something like this. On the home
screen there are sections (categories) that scroll vertically and when
stopped each row of movies will scroll horizontally. You can even move
multiple rows at the same time.
On Tue, Mar 6, 2018 at 5:12 PM Sannyasin Brahmanathaswami via use-livecode <
use-livecode@lists.runrev.com> wrote:

> I am about to embark a mission to solve a design problem in Livecode
>
> The model is Spotify. The channels or collections, a single screen with
>
> 1) Scrolling labels - not scrolling left with right, maintenance fixed
> position (left to right) but scrolling top to bottom.
>
> 2) "Collections" consisting square/label (think "album cover") scrolling
> left to right
>
> 3) Series of collections, that you scroll up  (or down), top to bottom
>
> Easier if you see Spotify…
> is a common user case scenario
>
> you scroll up and down the whole area,
> but the label stick their horizontal position, but will up and down
>
> Then when user stops (scrolling up are down) they can scroll sideways to
> see the collections
> -- GROUP(s) -
>
>   Talk By Wizard
> # stays horizontally
>
> [wizard1]  [wizard2] [wizard3]  [wizard4] [wizard5]  [wizard6]
> # each of these album covers with left and right
>
> Music for Alpha
> alpha1]  [alpha2] [alpha3]  [alpha4] [alpha5]  [alpha6]
>
> Sound from the Nanosphere
> [nanosphere1]  [nanosphere2] [nanosphere3]  [nanosphere4] [nanosphere5]
> [nanosphere6]
>
> 
>
> I have thought about it… and wonder if it can even be done in LiveCode
>
> BR
>
>
>
>
>
>
> ___
> use-livecode mailing list
> use-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 URL anomaly

2018-03-06 Thread Graham Samuel via use-livecode
Thanks Jacque - since TSNet is an enforced presence on all commercial versions 
of LC, I wonder why libURL isn’t automatically included even in apps that don’t 
appear to be using internet access. It’s a gotcha that is likely to bother 
people apart from me, IMHO. Maybe ‘search for inclusions’ should be deprecated.

Anyway thanks for the explanation.

Graham

> On 6 Mar 2018, at 22:30, J. Landman Gay via use-livecode 
>  wrote:
> 
> On 3/6/18 8:56 AM, Graham Samuel via use-livecode wrote:
>> I was relying on the Standalone Application Settings option ’search for 
>> required inclusions’.
> 
> I always use manual inclusions for that reason. As soon as I add a feature to 
> a project I also add it to the inclusions so I won't forget.
> 
> TSNet piggybacks on libURL ("internet") so that's why they're both necessary.
> 
> -- 
> 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

Horizontal and Portrait Scrolling on Mobile

2018-03-06 Thread Sannyasin Brahmanathaswami via use-livecode
I am about to embark a mission to solve a design problem in Livecode

The model is Spotify. The channels or collections, a single screen with

1) Scrolling labels - not scrolling left with right, maintenance fixed position 
(left to right) but scrolling top to bottom.

2) "Collections" consisting square/label (think "album cover") scrolling left 
to right

3) Series of collections, that you scroll up  (or down), top to bottom

Easier if you see Spotify…
is a common user case scenario

you scroll up and down the whole area,
but the label stick their horizontal position, but will up and down

Then when user stops (scrolling up are down) they can scroll sideways to see 
the collections
-- GROUP(s) -

  Talk By Wizard
# stays horizontally

[wizard1]  [wizard2] [wizard3]  [wizard4] [wizard5]  [wizard6]
# each of these album covers with left and right

Music for Alpha
alpha1]  [alpha2] [alpha3]  [alpha4] [alpha5]  [alpha6]

Sound from the Nanosphere
[nanosphere1]  [nanosphere2] [nanosphere3]  [nanosphere4] [nanosphere5]  
[nanosphere6]



I have thought about it… and wonder if it can even be done in LiveCode

BR






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

Re: Get URL anomaly

2018-03-06 Thread J. Landman Gay via use-livecode

On 3/6/18 4:08 PM, Graham Samuel via use-livecode wrote:

since TSNet is an enforced presence on all commercial versions of LC, I wonder 
why libURL isn’t automatically included even in apps that don’t appear to be 
using internet access.


That seems entirely reasonable, you might want to write that up in the 
QCC. The omission may have just been an oversight.


--
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: Get URL anomaly

2018-03-06 Thread Bob Sneidar via use-livecode
Lately I've found that to be iffy. I just manually select what I know I need. 

Bob S


> On Mar 6, 2018, at 06:56 , Graham Samuel via use-livecode 
>  wrote:
> 
> Hi Charles - thanks for your help. I immediately tried your modification (use 
> ‘put’ and avoid the variable ‘it’) but it made no difference. However, I 
> think I have solved the problem:
> 
> I was relying on the Standalone Application Settings option ’search for 
> required inclusions’. 

___
use-livecode mailing list
use-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: Overwriting a file on a server

2018-03-06 Thread Bob Sneidar via use-livecode
Oh, by server, you mean WEB server. NVM.

Bob S


> On Mar 6, 2018, at 19:42 , Bob Sneidar via use-livecode 
>  wrote:
> 
> [This message was identified as a phishing scam. Learn about phishing at 
> http://aka.ms/LearnAboutPhishing]
> 
> if there is a file?
> 
> Bob S
> 
> 
>> On Mar 5, 2018, at 05:04 , Graham Samuel via use-livecode 
>>  wrote:
>> 
>> How can I grow my own, by detecting the existing file and then overwriting 
>> it anyway?
> 
> 
> ___
> use-livecode mailing list
> use-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: Overwriting a file on a server

2018-03-06 Thread Bob Sneidar via use-livecode
if there is a file?

Bob S


> On Mar 5, 2018, at 05:04 , Graham Samuel via use-livecode 
>  wrote:
> 
> How can I grow my own, by detecting the existing file and then overwriting it 
> anyway? 


___
use-livecode mailing list
use-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: [Completely OT] Withdrawal symptoms from Slashdot

2018-03-06 Thread Bob Sneidar via use-livecode
The mark of a good IT staff. :-)

Bob S


> On Mar 5, 2018, at 08:49 , Mark Wieder via use-livecode 
>  wrote:
> 
> Slashdot was having some hiccups transferring to new servers.
> They seem to have recovered nicely now.
> 
> --
> 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: tsNet or not tsNet?

2018-03-06 Thread Bob Sneidar via use-livecode
I am getting the impression that any calls to network functions in your app 
will cause tsNet to be included (assuming you have auto detect on). I could be 
wrong. 

> On Mar 5, 2018, at 02:18 , Graham Samuel via use-livecode 
>  wrote:
> 
> [This message was identified as a phishing scam. Learn about phishing at 
> http://aka.ms/LearnAboutPhishing]
> 
> This message may be a repeat. If you see two copies on the list, I apologise.
> 
> ===
> 
> I’ve been executing this line of script in an app made on a Mac with LC 9.0.0 
> dp11
> get URL “http://www.myserver.com/mytextfile 
> .txt
> 
> It works fine, but I also wanted to detect what happens when the connection 
> can't be established, so I made the command fail by switching off internet 
> access on my machine. I got an error in ‘the result’, as expected. Or at 
> least I got one when the line was executed in the IDE, and this was a tsNet 
> error. As I had not initialised tsNet in my script - according to the 
> dictionary, this **must** be done before tsNet functions are used - I 
> concluded that the IDE had done it for me.
> 
> Fair enough, but I then reasoned that if I wanted to see the same kind of 
> explicit error messages in my standalone, I would have to include a call to 
> tsNetInit in my script. However, I created a little test app which 
> **doesn’t** make any tsNet calls, certainly not initialising the package, but 
> I still get a tsNet style error, e.g.
> 
>> tsneterr: (6) Could not resolve host: www.myserver.com 
>> 
> 
> So, what’s going on? Is tsNet now always included in a standalone, and if so, 
> how does it get initialised?
> 
> Puzzled, not for the first time.
> 
> Graham
> 
> ___
> use-livecode mailing list
> use-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: Android Studio how to create AVD?

2018-03-06 Thread Clarence Martin via use-livecode
The links that you provided don't seem to work. I get a 404 error

-Original Message-
From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf Of 
panagiotis merakos via use-livecode
Sent: Friday, March 02, 2018 4:03 AM
To: How to use LiveCode 
Cc: panagiotis merakos 
Subject: Re: Android Studio how to create AVD?

Hi Bob,

Just a suggestion, I personally find it easier to download an install just the 
Android SDK Tools, not Android Studio.

The problem is that the newest versions of the Android SDK Tools don't work 
well with LC, because you can mainly run commands from the command line instead 
of having a UI for Android AVD Manager and Android SDK Manager etc So you have 
to download an older version of the Android SDK Tools.

I have installed version 19 and it works like a charm with all LC versions I 
have tried (from 6.7.11 to 9.0)

The link is a bit difficult to find, it has this format:

http://dl-ssl.google.com/android/repository/tools_r[rev]-windows.zip
http://dl-ssl.google.com/android/repository/tools_r[rev]-linux.zip
http://dl-ssl.google.com/android/repository/tools_r[rev]-macosx.zip

For example http://dl-ssl.google.com/android/repository/tools_r19-macosx.zip
for version 19 on Mac.

On other machines I have installed more recent versions, I *think* 20-23, and 
they work fine too.

After downloading an older version of the Android Tools, use the instructions 
in this lesson 
http://lessons.livecode.com/m/2571/l/27389-how-do-i-become-an-android-developer-on-a-mac

to download the other dependencies (SDK Platform Android 4.0.3 package) using 
the Android SDK Manager and configure Android AVD Manager.

Hope this helps,
Panos
--


On Fri, Mar 2, 2018 at 11:39 AM, bob--- via use-livecode < 
use-livecode@lists.runrev.com> wrote:

>
> >
> > Once you've done that you can choose Tools > Android > AVD Manager 
> > and create a device. You'll need to choose something with armeabi
> architecture,
> > not x86, when you create the device. Once it has booted up you 
> > should see it in the target list.
> >
>
> Thanks for the clearing this up Ali. When I go to the Tools menu 
> Android is not listed. BUT, you gave me a hint as to what was up. I 
> did some searches and it turns out that there’s still an issue with 
> the default installation of Android Studio — apparently, in Googles 
> infinite wisdom, the Android menu is not installed with the default 
> configuration (dope slap to Google). You need to select custom install 
> and add the AVD and other options for installation.
>
> I had 2 options to get things working. Completely uninstall Android 
> Studio (not something I wanted to tackle since it’s not just uninstall 
> the app and I use JetBrains for other dev work) or let AStudio fix 
> itself. I choose Option 2.
>
> Option 1 Uninstall: https://stackoverflow.com/ 
> questions/47272832/no-android-option-in-tool-menu-and-no-avd-manager <
> https://stackoverflow.com/questions/47272832/no-android-
> option-in-tool-menu-and-no-avd-manager> <— for windows, mac looks 
> option-in-tool-menu-and-no-avd-manager> similar
> Option 2 Let AStudio fix itself: https://stackoverflow.com/ 
> questions/46948322/how-to-open-avd-manager-in-android-studio-3-0-versi
> on <
> https://stackoverflow.com/questions/46948322/how-to-
> open-avd-manager-in-android-studio-3-0-version>
>
> Not out of the woods yet but I do have the Android menu now (YIPEE!).
>
> I’ve created a AVD (Nexus 5 API 15 IceCreamSandwidch). I had installed 
> this from the configuration menu of AStudio. When I tried to created 
> an AVD I got an error:
> "Emulator: emulator: ERROR: This AVD's configuration is missing a 
> kernel file! Please ensure the file "kernel-qemu" is in the same 
> location as your system image.”
> "Emulator: emulator: ERROR: ANDROID_SDK_ROOT is undefined”
>
> I went back and created a API 17 based AVD. This device is able to 
> boot after I downloaded the image.
>
> Back to LC. Development->Test Target and select the Android emulator. 
> Then
> Development->Test.
>
> LC: “Unable to build app for testing: could not compile Application class”
>
> Troubleshooting continues but thanks for moving me forward.
>
> Bob H.
> ___
> use-livecode mailing list
> use-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:

Re: Overwriting a file on a server

2018-03-06 Thread Charles Warwick via use-livecode
Hi,

> Graham Samuel wrote:
> 
>> However, I don’t seem to be able to mimic what my FTP software
>> (Transmit on the Mac, or FileZilla) can do, which is to easily delete
>> a file on a server  - the file in question is part of a web site
>> hosted by DreamHost. I just want to use the URL functionality to do
>> this, as discussed in my conversation below, but I always get 405
>> (http) or 530 (ftp). I have a vague suspicion that I should be
>> transmitting my credentials to the server, which of course I did when
>> I set up my FTP client, but I have absolutely no idea how to do this.

Using delete via HTTP will generally fail unless the HTTP server and website 
are specifically configured to allow it (it would usually also require 
credentials).  Some HTTP APIs do allow the DELETE method.  I expect this is not 
what you are after. :-)

As you mentioned above, Transmit would be doing this via FTP, but you would 
need to send your credentials as part of the request.  You can do this with put 
URL and delete URL (for any supported protocol) by encoding them into the URL 
that you use like this:

put urlEncode(“username”) into tUser
put urlEncode(“password”) into tPass
put “ftp://“ & tUser & “:” & tPass & “@ftp.mydomain.com/path/to/file.txt” into 
tUrl

I expect that would likely solve your issue, but as Richard has mentioned, 
there are security issues to be considered that are all dependant on the 
environment that you are using your application in.

Cheers.

Charles



___
use-livecode mailing list
use-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: Reverse 'pixelcoloring' and total amount of colors

2018-03-06 Thread William de Smet via use-livecode
Hi Mike,

The 'put into field instructions2' was in there to check what was going on.
It works now the way I like it.
Thanks again!


greetings,

William



2018-03-05 21:37 GMT+01:00 Mike Bonner via use-livecode <
use-livecode@lists.runrev.com>:

> Hmm. In this case, you know the condition of failure, so if everything else
> is working as you need, i'd just check for that condition and act
> accordingly..
> if char 1 of the last item of tInstructions is "W" and the number of items
> of tInstructions > 1 then..
>
> Do you want tInstructions to be empty in the case of 7 white squares?  And
> W7 to be put into field instructions2?
>
> Either way..
> if there is only 1 item in tInstructions, and char 1 of tInstructions is
> "W" then
>put whatever into field "instructions2" that you need
>put empty into tInstructions
> else
>put whatever into field "instructions2" that you need
>delete item -1 of tInstructions
> end if
>
> Not sure what end results you want, or how if fails, but maybe something ^
> there will help.
>
> On Mon, Mar 5, 2018 at 12:13 PM, William de Smet via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>
> > Thanks Mike that helped a lot!
> > I extended your script with this:
> >
> > 
> > repeat with x= 1 to the number of items of tInstructions
> > put char 2 of item x of tInstructions into tChar
> > put "v" into tNaam
> > set the label of btn tNaam to tChar
> > set the showname of btn tNaam to true
> > put char 1 of item x of tInstructions into tLetter
> > if tLetter is "W"
> > then
> > set the backgroundcolor of btn tNaam to 255,255,255
> > else
> > set the backgroundcolor of btn tNaam to 90,200,250
> > end if
> > end repeat
> > ---
> >
> > Now it almost looks like this:
> > http://www.camelcaps.nl/pixelcoding/pixelcoding.jpg
> >
> > One thing left:
> > If the last button(s) is/are white it doesn't have to be shown on the
> > instruction.
> > So how do I leave it out?
> > When I add this it almost works:
> > --
> > if char 1 of the last item of tInstructions is "W"
> > then
> > put the last item of tInstructions into fld "instructions2"
> > delete the last item of tInstructions
> > --
> > This fails if the last item is the first and only item (when there are 7
> > white buttons).
> > Any thoughts on this?
> >
> >
> >
> > greetings,
> >
> > William
> >
> >
> >
> > 2018-03-05 17:41 GMT+01:00 Mike Bonner via use-livecode <
> > use-livecode@lists.runrev.com>:
> >
> > > Ah, I understand better now.
> > > Something like this should work.  Its just a quicky, no time to really
> > test
> > > before my doc appointment.
> > >
> > >
> > > on mouseup
> > > local tInstructions -- gotta have this cause a non declared isn't seen
> as
> > > empty
> > >
> > >repeat with i = 1 to 4
> > >   switch
> > >  case the backgroundcolor of button ("b" & i) is "255,255,255"
> > > if tInstructions is empty then put "W0" into tInstructions
> > > if char -2 of tInstructions is not "W" then put comma &
> "W0"
> > > after tInstructions
> > > add 1 to char -1 of tInstructions
> > > break
> > >  case the backgroundcolor of button ("b" & i) is "0,0,255"
> > > if tInstructions is empty then put "B0" into tInstructions
> > > if char -2 of tInstructions is not "B" then put comma &
> "B0"
> > > after tInstructions
> > > add 1 to char -1 of tInstructions
> > > break
> > >  default
> > > if tInstructions is empty then
> > >put "E" into tInstructions
> > > else
> > >put comma & "E" after tInstructions
> > > end if
> > >   end switch
> > >end repeat
> > >
> > >put tInstructions
> > > end mouseup
> > >
> > > On Mon, Mar 5, 2018 at 8:28 AM, William de Smet via use-livecode <
> > > use-livecode@lists.runrev.com> wrote:
> > >
> > > > Hi Mike,
> > > >
> > > > Thanks for your answer!
> > > > The exercises are actually binary exercises but the children don't
> > know.
> > > > All they know is a 'puzzle' to solve with pixelcoloring.
> > > > Funny I can solve it this way :-)
> > > > Still figuring how to do it because the children instruction is not
> > just
> > > > binary writing as you explained it.
> > > >
> > > > Did you see my picture?
> > > > http://www.camelcaps.nl/pixelcoding/pixelcoding.jpg
> > > >
> > > >
> > > > greetings.
> > > >
> > > > William
> > > >
> > > >
> > > >
> > > > 2018-03-05 16:10 GMT+01:00 Mike Bonner via use-livecode <
> > > > use-livecode@lists.runrev.com>:
> > > >
> > > > > If you want to know which "pixel" is on in a row, you could treat
> > them
> > > as
> > > > > binary bits.  Farthest right in a row is bit 1, next to the left is
> > bit
> > > > 2..
> > > > >
> > > > > So your buttons could be   0   0   1   0   1   0  1
> > > > >   64 32 16  8   4   2   1
> > > > > for a total of 21 which would then tell you the "bit patteren" of
> > your
> > 

Re: Overwriting a file on a server

2018-03-06 Thread Graham Samuel via use-livecode
More wisdom from Charles, sincere thanks!

However, I don’t seem to be able to mimic what my FTP software (Transmit on the 
Mac, or FileZilla) can do, which is to easily delete a file on a server  - the 
file in question is part of a web site hosted by DreamHost. I just want to use 
the URL functionality to do this, as discussed in my conversation below, but I 
always get 405 (http) or 530 (ftp). I have a vague suspicion that I should be 
transmitting my credentials to the server, which of course I did when I set up 
my FTP client, but I have absolutely no idea how to do this.

Many members of this list must have mucked around with files on a server - can 
someone point me to a tutorial on all this?

TIA

Graham

> On 6 Mar 2018, at 08:59, Charles Warwick via use-livecode 
>  wrote:
> 
> Hi Graham,
> 
>> On 5 Mar 2018, at 11:04 pm, Graham Samuel via use-livecode 
>>  wrote:
>> 
>> Another dumb question, I’m afraid. The dictionary says I can do
>> 
>> put tdata into URL [some url]
>> 
>> well, I want to put a file on my server (in this example, it’s a text file) 
>> to replace one of the same name. If I just try to steamroller it by ignoring 
>> the existing file, I get a ‘405’ error (forbidden method, I think). If I use 
>> an FTP client like Transmit, I get a warning about overwriting the file and 
>> a manual override.
>> 
>> How can I grow my own, by detecting the existing file and then overwriting 
>> it anyway? Should I delete the existing file as a separate operation? How 
>> can I be sure I have enough permission to do so?
> 
> You can use ‘delete URL’ to delete an FTP file.  If the result is not empty, 
> then it failed to delete it.
> 
> You could always try the ‘put’ first, and if you get a 405 error, try the 
> ‘delete’.  If the delete is successful, you can ‘put’ again.  If the delete 
> is unsuccessful, advise the user.
> 
> Cheers,
> 
> Charles
> 
> ___
> use-livecode mailing list
> use-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: Reverse 'pixelcoloring' and total amount of colors

2018-03-06 Thread James At The Hale via use-livecode
Just wanted to delete all the appended quotes!

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

2018-03-06 Thread jbv via use-livecode
"start using font file.." is the first option that I tried, but
unfortunately it returns "can't load font file"...
The ttf file is on the server next to my script, and I have also
tried with the full absolute path for that ttf file.
Could you please make a test on your own on-rev account with any
ttf file (different from the default fonts in fontnames) and let us
know of it works ?

Thanks in advance.

On Tue, March 6, 2018 3:03 pm, Mike Bonner via use-livecode wrote:
> My apologies.. Had a brain fritz, it should be "start using font file.."
> load url would just load whatever url into cache and not font it up.
>
> On Tue, Mar 6, 2018 at 1:07 AM, jbv via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>
>> When using
>> load font file "nameofyourfont.ttf" the result contains Handler: can't
>> find handler (file)
>>
>> It looks like "load" is accepted only in the form "load URL"...
>>
>>
>> On Mon, March 5, 2018 9:28 pm, Mike Bonner via use-livecode wrote:
>>
>>> Hmm. Not sure what to do about loading a fontfile then.  Out of
>>> curiosity, what is the error?
>>>
>>> On Mon, Mar 5, 2018 at 11:39 AM, jbv via use-livecode <
>>> use-livecode@lists.runrev.com> wrote:
>>>
 Hi Mike,
 Thanks for your reply.



 Yes, I managed to set the textfont of a btn or fld to one of the
 fonts available in the fontnames, but I still can't figure how to
 use any
>> other
 ttf font... load font file "nameofyourfont.ttf" -> returns an error
 I
 tried load URL "nameofyourfont.ttf", it works, but then the textfont
  property isn't updated...

 On Mon, March 5, 2018 3:59 pm, Mike Bonner via use-livecode wrote:


> With on-rev, I put up this script..
>
>
>
>
>  create button "mybtn"
>
> repeat for each line tLIne in the fontnames -- will make 1 png
> per font
>
> set the label of btn "mybtn" to tLine set the textfont of button
> "mybtn"
> to tLine set the width of button "mybtn" to the formattedwidth of
> button "mybtn" + 5
>
>
>
> export snapshot from button "mybtn" to file (tLine & ".png") as
> PNG
>
>
> put the textfont of button "mybtn" && " & quote & ">" & cr
> end repeat ?>
>
>
> And it works fine, with the exception of fonts with a - in the
> name. All
> of them are Hershey fonts, so not sure if its the font family that
> is broken, or the dashes causing the issue.
>
> If you have a ttf font file to use, you can probably put it on
> your server next to your script and: load font file
> "nameofyourfont.ttf"
> and
 then
> set the textfont to "nameofyourfont" and it will likely work.
>
> To see my script in action, check here:
> http://guidezone.info/fonttest.lc
>
>
>
>
> On Sun, Mar 4, 2018 at 8:21 AM, Warren Samples via use-livecode <
>  use-livecode@lists.runrev.com> wrote:
>
>> On 03/02/2018 04:14 AM, jbv via use-livecode wrote:
>>
>>
>>
>>
>>> Hello list
>>> How can I load ttf font files with LC server, at least version
>>> 7.1
>>> available on my on-rev account ? Neither "revFontLoad" nor
>>> "start using
>>> font file" seem to work... And the list of available fonts
>>> returned by "the fontNames" is quite limited...
>>>
>>> Thanks in advance.
>>> jbv
>>>
>>>
>>>
>> Does on-rev run on Linux? If you create a directory called
>> '.fonts'
>> under your user name and install the fonts you want to use in
>> your images in that directory, LiveCode will find them.
>>
>> A quick test shows this to be true using LC Server 8.1.4, but
>> you may have to do some experimenting to get them working in a
>> script accessed through your web server. Executing a script to
>> show the fontnames works from the command line but without
>> having done any real investigating, I have to admit it's not
>> working when accessed through my server. This isn't an on-rev
>> nor an Apache server so ymmv. If you decide to go the standalone
>> route, you should be able to install your fonts this way to use
>> them in the standalone.
>>
>> Good luck!
>>
>>
>>
>>
>> Warren
>>
>>
>>
>>
>>
>> ___
>> use-livecode mailing list use-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: LC server and fonts

2018-03-06 Thread Mike Bonner via use-livecode
Sure, i'll dig up a font file and try.

On Tue, Mar 6, 2018 at 7:37 AM, jbv via use-livecode <
use-livecode@lists.runrev.com> wrote:

> "start using font file.." is the first option that I tried, but
> unfortunately it returns "can't load font file"...
> The ttf file is on the server next to my script, and I have also
> tried with the full absolute path for that ttf file.
> Could you please make a test on your own on-rev account with any
> ttf file (different from the default fonts in fontnames) and let us
> know of it works ?
>
> Thanks in advance.
>
> On Tue, March 6, 2018 3:03 pm, Mike Bonner via use-livecode wrote:
> > My apologies.. Had a brain fritz, it should be "start using font file.."
> > load url would just load whatever url into cache and not font it up.
> >
> > On Tue, Mar 6, 2018 at 1:07 AM, jbv via use-livecode <
> > use-livecode@lists.runrev.com> wrote:
> >
> >> When using
> >> load font file "nameofyourfont.ttf" the result contains Handler: can't
> >> find handler (file)
> >>
> >> It looks like "load" is accepted only in the form "load URL"...
> >>
> >>
> >> On Mon, March 5, 2018 9:28 pm, Mike Bonner via use-livecode wrote:
> >>
> >>> Hmm. Not sure what to do about loading a fontfile then.  Out of
> >>> curiosity, what is the error?
> >>>
> >>> On Mon, Mar 5, 2018 at 11:39 AM, jbv via use-livecode <
> >>> use-livecode@lists.runrev.com> wrote:
> >>>
>  Hi Mike,
>  Thanks for your reply.
> 
> 
> 
>  Yes, I managed to set the textfont of a btn or fld to one of the
>  fonts available in the fontnames, but I still can't figure how to
>  use any
> >> other
>  ttf font... load font file "nameofyourfont.ttf" -> returns an error
>  I
>  tried load URL "nameofyourfont.ttf", it works, but then the textfont
>   property isn't updated...
> 
>  On Mon, March 5, 2018 3:59 pm, Mike Bonner via use-livecode wrote:
> 
> 
> > With on-rev, I put up this script..
> >
> >
> >
> >
> >  > create button "mybtn"
> >
> > repeat for each line tLIne in the fontnames -- will make 1 png
> > per font
> >
> > set the label of btn "mybtn" to tLine set the textfont of button
> > "mybtn"
> > to tLine set the width of button "mybtn" to the formattedwidth of
> > button "mybtn" + 5
> >
> >
> >
> > export snapshot from button "mybtn" to file (tLine & ".png") as
> > PNG
> >
> >
> > put the textfont of button "mybtn" && " > & quote & ">" & cr
> > end repeat ?>
> >
> >
> > And it works fine, with the exception of fonts with a - in the
> > name. All
> > of them are Hershey fonts, so not sure if its the font family that
> > is broken, or the dashes causing the issue.
> >
> > If you have a ttf font file to use, you can probably put it on
> > your server next to your script and: load font file
> > "nameofyourfont.ttf"
> > and
>  then
> > set the textfont to "nameofyourfont" and it will likely work.
> >
> > To see my script in action, check here:
> > http://guidezone.info/fonttest.lc
> >
> >
> >
> >
> > On Sun, Mar 4, 2018 at 8:21 AM, Warren Samples via use-livecode <
> >  use-livecode@lists.runrev.com> wrote:
> >
> >> On 03/02/2018 04:14 AM, jbv via use-livecode wrote:
> >>
> >>
> >>
> >>
> >>> Hello list
> >>> How can I load ttf font files with LC server, at least version
> >>> 7.1
> >>> available on my on-rev account ? Neither "revFontLoad" nor
> >>> "start using
> >>> font file" seem to work... And the list of available fonts
> >>> returned by "the fontNames" is quite limited...
> >>>
> >>> Thanks in advance.
> >>> jbv
> >>>
> >>>
> >>>
> >> Does on-rev run on Linux? If you create a directory called
> >> '.fonts'
> >> under your user name and install the fonts you want to use in
> >> your images in that directory, LiveCode will find them.
> >>
> >> A quick test shows this to be true using LC Server 8.1.4, but
> >> you may have to do some experimenting to get them working in a
> >> script accessed through your web server. Executing a script to
> >> show the fontnames works from the command line but without
> >> having done any real investigating, I have to admit it's not
> >> working when accessed through my server. This isn't an on-rev
> >> nor an Apache server so ymmv. If you decide to go the standalone
> >> route, you should be able to install your fonts this way to use
> >> them in the standalone.
> >>
> >> Good luck!
> >>
> >>
> >>
> >>
> >> Warren
> >>
> >>
> >>
> >>
> >>
> >> ___
> >> use-livecode mailing list use-livecode@lists.runrev.com Please
> >> visit
> >>
>  this
> >> url to subscribe, unsubscribe and manage your subscription
> 

Re: Get URL anomaly

2018-03-06 Thread Graham Samuel via use-livecode
Hi Charles - thanks for your help. I immediately tried your modification (use 
‘put’ and avoid the variable ‘it’) but it made no difference. However, I think 
I have solved the problem: 

I was relying on the Standalone Application Settings option ’search for 
required inclusions’. This did however not include something called ‘internet’, 
which presumably is not tsNet but something else. Anyway when I chose that 
option, the behaviour in the IDE and the standalone suddenly appeared the same. 
I don’t know why it worked in some simpler standalones used for testing - 
perhaps the LC search for inclusions was confused by something in my real app 
and not in the simpler ones. Without this inclusion, the ‘put’ (or ‘get’) 
apparently works - nothing in ‘the result’ - but no data is transferred. With 
the inclusion, data is transferred as expected.

If I can, I will report this as a bug, but it’s going to be tricky to 
demonstrate it in its original context.

If anyone else is reading this, have you had any negative experience with the 
‘search for required inclusions’ feature of the LC Standalone settings?

Thanks again

Graham

> On 6 Mar 2018, at 08:50, Charles Warwick via use-livecode 
>  wrote:
> 
> Hi Graham,
> 
> 
>> On 5 Mar 2018, at 10:56 pm, Graham Samuel via use-livecode 
>>  wrote:
>> 
>> As in some of my previous mails, I’m talking about having to retrieve a tiny 
>> text file from a server (and later put a modified version of it back, but 
>> let’s get one problem solved at a time) The whole thing is just a few lines 
>> of code:
>> 
>> constant myFileOnTheServer = "www.myserver.comm/mytextfile.txt”
>> 
>> put “http://“ & myFileOnTheServer into t1
>> 
>> get URL t1
>> 
>> if the result is empty then
>> 
>>   do stuff with ‘it’, where the text file is placed
>> 
>>  …
> 
> I would recommend using:
> 
> put URL t1 into tData
> 
> The contents of ‘it’ can be changed by other commands, so if you are having 
> issues in a more complex app, maybe something else is overwriting that value?
> 
> Cheers,
> 
> Charles
> 
> ___
> use-livecode mailing list
> use-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: LC server and fonts

2018-03-06 Thread Mike Bonner via use-livecode
My apologies.. Had a brain fritz, it should be "start using font file.."
load url would just load whatever url into cache and not font it up.

On Tue, Mar 6, 2018 at 1:07 AM, jbv via use-livecode <
use-livecode@lists.runrev.com> wrote:

> When using
>   load font file "nameofyourfont.ttf"
> the result contains
>   Handler: can't find handler (file)
>
> It looks like "load" is accepted only in the form "load URL"...
>
> On Mon, March 5, 2018 9:28 pm, Mike Bonner via use-livecode wrote:
> > Hmm. Not sure what to do about loading a fontfile then.  Out of
> > curiosity, what is the error?
> >
> > On Mon, Mar 5, 2018 at 11:39 AM, jbv via use-livecode <
> > use-livecode@lists.runrev.com> wrote:
> >
> >> Hi Mike,
> >> Thanks for your reply.
> >>
> >>
> >> Yes, I managed to set the textfont of a btn or fld to one of the fonts
> >> available in the fontnames, but I still can't figure how to use any
> other
> >> ttf font... load font file "nameofyourfont.ttf" -> returns an error I
> >> tried load URL "nameofyourfont.ttf", it works, but then the textfont
> >> property isn't updated...
> >>
> >> On Mon, March 5, 2018 3:59 pm, Mike Bonner via use-livecode wrote:
> >>
> >>> With on-rev, I put up this script..
> >>>
> >>>
> >>>
> >>>  >>> create button "mybtn"
> >>>
> >>> repeat for each line tLIne in the fontnames -- will make 1 png per
> >>> font
> >>>
> >>> set the label of btn "mybtn" to tLine set the textfont of button
> >>> "mybtn"
> >>> to tLine set the width of button "mybtn" to the formattedwidth of
> >>> button "mybtn" + 5
> >>>
> >>>
> >>>
> >>> export snapshot from button "mybtn" to file (tLine & ".png") as PNG
> >>>
> >>> put the textfont of button "mybtn" && " >>> & quote & ">" & cr
> >>> end repeat ?>
> >>>
> >>>
> >>> And it works fine, with the exception of fonts with a - in the name.
> >>> All
> >>> of them are Hershey fonts, so not sure if its the font family that is
> >>> broken, or the dashes causing the issue.
> >>>
> >>> If you have a ttf font file to use, you can probably put it on your
> >>> server next to your script and: load font file "nameofyourfont.ttf"
> >>> and
> >> then
> >>> set the textfont to "nameofyourfont" and it will likely work.
> >>>
> >>> To see my script in action, check here:
> >>> http://guidezone.info/fonttest.lc
> >>>
> >>>
> >>>
> >>> On Sun, Mar 4, 2018 at 8:21 AM, Warren Samples via use-livecode <
> >>> use-livecode@lists.runrev.com> wrote:
> >>>
>  On 03/02/2018 04:14 AM, jbv via use-livecode wrote:
> 
> 
> 
> > Hello list
> > How can I load ttf font files with LC server, at least version 7.1
> >  available on my on-rev account ? Neither "revFontLoad" nor
> > "start using
> > font file" seem to work... And the list of available fonts
> > returned by "the fontNames" is quite
> > limited...
> >
> > Thanks in advance.
> > jbv
> >
> >
> >
>  Does on-rev run on Linux? If you create a directory called '.fonts'
>   under your user name and install the fonts you want to use in your
>   images in that directory, LiveCode will find them.
> 
>  A quick test shows this to be true using LC Server 8.1.4, but you
>  may have to do some experimenting to get them working in a script
>  accessed through your web server. Executing a script to show the
>  fontnames works from the command line but without having done any
>  real investigating, I have to admit it's not working when accessed
>  through my server. This isn't an on-rev nor an Apache server so
>  ymmv. If you decide to go the standalone route, you should be able
>  to install your fonts this way to use them in the standalone.
> 
>  Good luck!
> 
> 
> 
>  Warren
> 
> 
> 
> 
>  ___
>  use-livecode mailing list use-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: LC server and fonts

2018-03-06 Thread Mike Bonner via use-livecode
Well, it looks like fontconfig is installed in on-rev, but neither
/home//.fonts or /home//.local/share/fonts are being updated
automatically.  I tried to run fc-cache -f -v /home//.fonts and the
font is indeed found, but I don't think I have all the required support
directories, so there is no writable place to actually store the cache
data. The command fails because of this.  If it were me, I'd contact on-rev
and see if they could help set things up to actually look at a fonts
directory in your account and add any fonts there.  All the software seems
to be installed to do this, I just don't know enough about fontconfig to
force it from the user side. (It should be possible, but again I don't know
enough about fontconfig to know what to do yet)

As for start using font file.. Yep, it fails every time with an error
message that is just a bit lacking.  Getting on-rev/fontconfig set up to
handle this for you sounds like the way to go.

On Tue, Mar 6, 2018 at 7:41 AM, Mike Bonner  wrote:

> Sure, i'll dig up a font file and try.
>
> On Tue, Mar 6, 2018 at 7:37 AM, jbv via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>
>> "start using font file.." is the first option that I tried, but
>> unfortunately it returns "can't load font file"...
>> The ttf file is on the server next to my script, and I have also
>> tried with the full absolute path for that ttf file.
>> Could you please make a test on your own on-rev account with any
>> ttf file (different from the default fonts in fontnames) and let us
>> know of it works ?
>>
>> Thanks in advance.
>>
>> On Tue, March 6, 2018 3:03 pm, Mike Bonner via use-livecode wrote:
>> > My apologies.. Had a brain fritz, it should be "start using font file.."
>> > load url would just load whatever url into cache and not font it up.
>> >
>> > On Tue, Mar 6, 2018 at 1:07 AM, jbv via use-livecode <
>> > use-livecode@lists.runrev.com> wrote:
>> >
>> >> When using
>> >> load font file "nameofyourfont.ttf" the result contains Handler: can't
>> >> find handler (file)
>> >>
>> >> It looks like "load" is accepted only in the form "load URL"...
>> >>
>> >>
>> >> On Mon, March 5, 2018 9:28 pm, Mike Bonner via use-livecode wrote:
>> >>
>> >>> Hmm. Not sure what to do about loading a fontfile then.  Out of
>> >>> curiosity, what is the error?
>> >>>
>> >>> On Mon, Mar 5, 2018 at 11:39 AM, jbv via use-livecode <
>> >>> use-livecode@lists.runrev.com> wrote:
>> >>>
>>  Hi Mike,
>>  Thanks for your reply.
>> 
>> 
>> 
>>  Yes, I managed to set the textfont of a btn or fld to one of the
>>  fonts available in the fontnames, but I still can't figure how to
>>  use any
>> >> other
>>  ttf font... load font file "nameofyourfont.ttf" -> returns an error
>>  I
>>  tried load URL "nameofyourfont.ttf", it works, but then the textfont
>>   property isn't updated...
>> 
>>  On Mon, March 5, 2018 3:59 pm, Mike Bonner via use-livecode wrote:
>> 
>> 
>> > With on-rev, I put up this script..
>> >
>> >
>> >
>> >
>> > > > create button "mybtn"
>> >
>> > repeat for each line tLIne in the fontnames -- will make 1 png
>> > per font
>> >
>> > set the label of btn "mybtn" to tLine set the textfont of button
>> > "mybtn"
>> > to tLine set the width of button "mybtn" to the formattedwidth of
>> > button "mybtn" + 5
>> >
>> >
>> >
>> > export snapshot from button "mybtn" to file (tLine & ".png") as
>> > PNG
>> >
>> >
>> > put the textfont of button "mybtn" && "> > & quote & ">" & cr
>> > end repeat ?>
>> >
>> >
>> > And it works fine, with the exception of fonts with a - in the
>> > name. All
>> > of them are Hershey fonts, so not sure if its the font family that
>> > is broken, or the dashes causing the issue.
>> >
>> > If you have a ttf font file to use, you can probably put it on
>> > your server next to your script and: load font file
>> > "nameofyourfont.ttf"
>> > and
>>  then
>> > set the textfont to "nameofyourfont" and it will likely work.
>> >
>> > To see my script in action, check here:
>> > http://guidezone.info/fonttest.lc
>> >
>> >
>> >
>> >
>> > On Sun, Mar 4, 2018 at 8:21 AM, Warren Samples via use-livecode <
>> >  use-livecode@lists.runrev.com> wrote:
>> >
>> >> On 03/02/2018 04:14 AM, jbv via use-livecode wrote:
>> >>
>> >>
>> >>
>> >>
>> >>> Hello list
>> >>> How can I load ttf font files with LC server, at least version
>> >>> 7.1
>> >>> available on my on-rev account ? Neither "revFontLoad" nor
>> >>> "start using
>> >>> font file" seem to work... And the list of available fonts
>> >>> returned by "the fontNames" is quite limited...
>> >>>
>> >>> Thanks in advance.
>> >>> jbv
>> >>>
>> >>>
>> >>>
>> >> Does on-rev run on Linux? If you create a 

Re: Overwriting a file on a server

2018-03-06 Thread Mike Bonner via use-livecode
The specific lesson for lc server file uploads is here:
http://lessons.livecode.com/m/4070/l/40708-how-to-upload-a-file-with-livecode-server

but as mentioned, setup https first!

On Tue, Mar 6, 2018 at 9:33 AM, Richard Gaskin via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Graham Samuel wrote:
>
> > However, I don’t seem to be able to mimic what my FTP software
> > (Transmit on the Mac, or FileZilla) can do, which is to easily delete
> > a file on a server  - the file in question is part of a web site
> > hosted by DreamHost. I just want to use the URL functionality to do
> > this, as discussed in my conversation below, but I always get 405
> > (http) or 530 (ftp). I have a vague suspicion that I should be
> > transmitting my credentials to the server, which of course I did when
> > I set up my FTP client, but I have absolutely no idea how to do this.
> >
> > Many members of this list must have mucked around with files on a
> > server - can someone point me to a tutorial on all this?
>
> If there were, it would not be a short one.
>
> If you could delete a file via HTTP alone, then anyone with a browser
> could delete files on your server.
>
> FTP is unsafe to use on the Internet, as it sends passwords in clear text.
>
> You could consider FTPS or SFTP, which are not available in the Community
> Edition but are in others via tsNet - but not without risk:
>
> FTP and its secure variants are designed for ad hoc management of remote
> file stores. You can delete the file in question, but also any other, and
> can modify anything on the server in any way you like.
>
> This is useful in tools like Filezilla, where the password is only stored
> on your own computer.
>
> But if you hard-wire the password in a script, and that script is part of
> a publicly-distributed app, a memory dump can reveal the key to having
> complete control over everything on your server.
>
> The most common way for apps to perform write tasks on servers is through
> an HTTP API, which would require something on the server to process the
> requests. That something can be PHP, Python, LiveCode Server, or other
> languages that work well with CGI.
>
> You'd still want some way to authenticate the request, but since it's used
> only in a server script you write the scope of what can be done with it is
> much more limited.
>
> And of course that assumes your web server is using HTTPS so credentials
> can be sent over secured connection, but given the many benefits of HTTPS
> and the free availability of SSL certs via the Let's Encrypt project
> (Dreamhost has a convenient option for Let's Encrypt in their control
> panel) I'm hoping we can assume all web servers managed by developers
> already have or will soon have HTTPS in place.
>
> A tutorial for getting started with LiveCode Server is here:
> https://livecode.com/resources/guides/server/
>
> I wish I had a one-liner solution for you.  But in the hostile environment
> of the Internet, writing network applications requires much more diligence
> than we used to enjoy back in the day.
>
> --
>  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: Overwriting a file on a server

2018-03-06 Thread Richard Gaskin via use-livecode

Graham Samuel wrote:

> However, I don’t seem to be able to mimic what my FTP software
> (Transmit on the Mac, or FileZilla) can do, which is to easily delete
> a file on a server  - the file in question is part of a web site
> hosted by DreamHost. I just want to use the URL functionality to do
> this, as discussed in my conversation below, but I always get 405
> (http) or 530 (ftp). I have a vague suspicion that I should be
> transmitting my credentials to the server, which of course I did when
> I set up my FTP client, but I have absolutely no idea how to do this.
>
> Many members of this list must have mucked around with files on a
> server - can someone point me to a tutorial on all this?

If there were, it would not be a short one.

If you could delete a file via HTTP alone, then anyone with a browser 
could delete files on your server.


FTP is unsafe to use on the Internet, as it sends passwords in clear text.

You could consider FTPS or SFTP, which are not available in the 
Community Edition but are in others via tsNet - but not without risk:


FTP and its secure variants are designed for ad hoc management of remote 
file stores. You can delete the file in question, but also any other, 
and can modify anything on the server in any way you like.


This is useful in tools like Filezilla, where the password is only 
stored on your own computer.


But if you hard-wire the password in a script, and that script is part 
of a publicly-distributed app, a memory dump can reveal the key to 
having complete control over everything on your server.


The most common way for apps to perform write tasks on servers is 
through an HTTP API, which would require something on the server to 
process the requests. That something can be PHP, Python, LiveCode 
Server, or other languages that work well with CGI.


You'd still want some way to authenticate the request, but since it's 
used only in a server script you write the scope of what can be done 
with it is much more limited.


And of course that assumes your web server is using HTTPS so credentials 
can be sent over secured connection, but given the many benefits of 
HTTPS and the free availability of SSL certs via the Let's Encrypt 
project (Dreamhost has a convenient option for Let's Encrypt in their 
control panel) I'm hoping we can assume all web servers managed by 
developers already have or will soon have HTTPS in place.


A tutorial for getting started with LiveCode Server is here:
https://livecode.com/resources/guides/server/

I wish I had a one-liner solution for you.  But in the hostile 
environment of the Internet, writing network applications requires much 
more diligence than we used to enjoy back in the day.


--
 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: Overwriting a file on a server

2018-03-06 Thread Charles Warwick via use-livecode
Hi Graham,

> On 5 Mar 2018, at 11:04 pm, Graham Samuel via use-livecode 
>  wrote:
> 
> Another dumb question, I’m afraid. The dictionary says I can do
> 
>  put tdata into URL [some url]
> 
> well, I want to put a file on my server (in this example, it’s a text file) 
> to replace one of the same name. If I just try to steamroller it by ignoring 
> the existing file, I get a ‘405’ error (forbidden method, I think). If I use 
> an FTP client like Transmit, I get a warning about overwriting the file and a 
> manual override.
> 
> How can I grow my own, by detecting the existing file and then overwriting it 
> anyway? Should I delete the existing file as a separate operation? How can I 
> be sure I have enough permission to do so?

You can use ‘delete URL’ to delete an FTP file.  If the result is not empty, 
then it failed to delete it.

You could always try the ‘put’ first, and if you get a 405 error, try the 
‘delete’.  If the delete is successful, you can ‘put’ again.  If the delete is 
unsuccessful, advise the user.

Cheers,

Charles

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

2018-03-06 Thread jbv via use-livecode
When using
  load font file "nameofyourfont.ttf"
the result contains
  Handler: can't find handler (file)

It looks like "load" is accepted only in the form "load URL"...

On Mon, March 5, 2018 9:28 pm, Mike Bonner via use-livecode wrote:
> Hmm. Not sure what to do about loading a fontfile then.  Out of
> curiosity, what is the error?
>
> On Mon, Mar 5, 2018 at 11:39 AM, jbv via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>
>> Hi Mike,
>> Thanks for your reply.
>>
>>
>> Yes, I managed to set the textfont of a btn or fld to one of the fonts
>> available in the fontnames, but I still can't figure how to use any other
>> ttf font... load font file "nameofyourfont.ttf" -> returns an error I
>> tried load URL "nameofyourfont.ttf", it works, but then the textfont
>> property isn't updated...
>>
>> On Mon, March 5, 2018 3:59 pm, Mike Bonner via use-livecode wrote:
>>
>>> With on-rev, I put up this script..
>>>
>>>
>>>
>>> >> create button "mybtn"
>>>
>>> repeat for each line tLIne in the fontnames -- will make 1 png per
>>> font
>>>
>>> set the label of btn "mybtn" to tLine set the textfont of button
>>> "mybtn"
>>> to tLine set the width of button "mybtn" to the formattedwidth of
>>> button "mybtn" + 5
>>>
>>>
>>>
>>> export snapshot from button "mybtn" to file (tLine & ".png") as PNG
>>>
>>> put the textfont of button "mybtn" && ">> & quote & ">" & cr
>>> end repeat ?>
>>>
>>>
>>> And it works fine, with the exception of fonts with a - in the name.
>>> All
>>> of them are Hershey fonts, so not sure if its the font family that is
>>> broken, or the dashes causing the issue.
>>>
>>> If you have a ttf font file to use, you can probably put it on your
>>> server next to your script and: load font file "nameofyourfont.ttf"
>>> and
>> then
>>> set the textfont to "nameofyourfont" and it will likely work.
>>>
>>> To see my script in action, check here:
>>> http://guidezone.info/fonttest.lc
>>>
>>>
>>>
>>> On Sun, Mar 4, 2018 at 8:21 AM, Warren Samples via use-livecode <
>>> use-livecode@lists.runrev.com> wrote:
>>>
 On 03/02/2018 04:14 AM, jbv via use-livecode wrote:



> Hello list
> How can I load ttf font files with LC server, at least version 7.1
>  available on my on-rev account ? Neither "revFontLoad" nor
> "start using
> font file" seem to work... And the list of available fonts
> returned by "the fontNames" is quite
> limited...
>
> Thanks in advance.
> jbv
>
>
>
 Does on-rev run on Linux? If you create a directory called '.fonts'
  under your user name and install the fonts you want to use in your
  images in that directory, LiveCode will find them.

 A quick test shows this to be true using LC Server 8.1.4, but you
 may have to do some experimenting to get them working in a script
 accessed through your web server. Executing a script to show the
 fontnames works from the command line but without having done any
 real investigating, I have to admit it's not working when accessed
 through my server. This isn't an on-rev nor an Apache server so
 ymmv. If you decide to go the standalone route, you should be able
 to install your fonts this way to use them in the standalone.

 Good luck!



 Warren




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



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