Search found 1633 matches

by [-hh]
Sat Feb 24, 2018 7:12 pm
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Hyphenation of long words
Replies: 24
Views: 516

Re: Hyphenation of long words

... does anyone know the actual Knuth–Liang hyphenation algorithm? Here's Liang's thesis as PDF http://www.tug.org/docs/liang/ Beneath my link above (hunspell) there is also a brilliant JavaScript implementation based on that: https://github.com/mnater/Hyphenator I implemented it already (via a bro...
by [-hh]
Fri Feb 23, 2018 4:29 pm
Forum: LiveCode Builder
Topic: NEW Player for Liveocode on Linux
Replies: 1
Views: 59

Re: NEW Player for Liveocode on Linux

There is no "shell" or "process" handling in LCB to reach a mplayer binary, except going back and forth to LC Script (but the 'places' where you can do this are changed with every LCB version). You could try to use the source code of mplayer and FFI, see (esp. the links there): http://forums.livecod...
by [-hh]
Wed Feb 21, 2018 10:33 pm
Forum: Feature Requests
Topic: a roundDown function
Replies: 6
Views: 179

Re: a roundDown function

This is possibly what you want for rounding down:

To have *always* one decimal place (also for integers) you could use

Code: Select all

put format("%.1f",var1) into fld 1
This is good for currency (yields *always* two decimal places)

Code: Select all

put format("$%.2f",var1) into fld 1
by [-hh]
Tue Feb 20, 2018 8:49 pm
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Not declaring Local Variables and script works ! why declaring them then ?
Replies: 13
Views: 356

Re: Not declaring Local Variables and script works ! why declaring them then ?

There is moreover one important feature of local variables.
They are comfortable in that they can have a default value, so no check for empty is needed after startup.
For example

Code: Select all

local mySwitch=true, myName="donald", myNumber=42
by [-hh]
Tue Feb 20, 2018 8:46 pm
Forum: Getting Started with LiveCode - Experienced Developers
Topic: carriage return
Replies: 34
Views: 415

Re: carriage return

This is not a problem of LC Server but a general bug of LC 8/9 with putting something into the message box. That is: "put <string>" has in many scenarios NO effect.

Try putting into a variable or into a field. That works.
by [-hh]
Tue Feb 20, 2018 8:39 pm
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Hyphenation of long words
Replies: 24
Views: 516

Re: Hyphenation of long words

Hyphenation is a non-trivial optimization problem. Knuth did a lot in that field for TeX.
https://en.wikipedia.org/wiki/Hyphenation_algorithm

Here a linguistic approach based on that and hunspell (link from the page above).
http://www.ushuaia.pl/hyphen/?ln=en
by [-hh]
Fri Feb 16, 2018 8:39 am
Forum: Raspberry Pi
Topic: RaspberryPi Stacks
Replies: 105
Views: 44550

Re: RaspberryPi Stacks

Raspberry Pi stacks collection #106 = beforeAfterImage.livecode Before-After-Image = LC-Magick #12 version 1.0.0 of Feb 16, 2018 Before-After-Image shows an "original" image (image "before") and a selectable horizontal or vertical part of it visually replaced by the changed image (image "after"). A...
by [-hh]
Fri Feb 16, 2018 8:03 am
Forum: Raspberry Pi
Topic: LiveCode 651/704 on Raspi 3 running Raspbian Stretch
Replies: 14
Views: 304

LiveCode 651/704 on Raspi 3 running Raspbian Stretch

LiveCode 651 and 704 work fine on the new Raspbian Stretch with desktop (2017-11-29). And they work (nearly) "out of the box" on Raspi 3. All you have to do is Adjust the launcher for 6.5.1 Go to /home/pi/.local/share/applications, right-click "LiveCode Community 6.5.1", open it with TextEditor and ...
by [-hh]
Wed Feb 14, 2018 8:16 pm
Forum: Raspberry Pi
Topic: Raspberry Pi GPIO
Replies: 16
Views: 3938

Re: Raspberry Pi GPIO

Take care. There are (tiny) differences between the models.
A good info is here:
https://raspberrypi.stackexchange.com/q ... -b-and-3-b
by [-hh]
Wed Feb 14, 2018 7:26 pm
Forum: Talking LiveCode
Topic: is a color
Replies: 15
Views: 333

Re: is a color

@Richmond. A glass of wine is also for me good for thinking about colors ... What was the fill of the glass after reading: 50% or -50%? Half full or half empty? [@all. What's nice with that is that the inverse of a color (r, g, b) is (-r, -g, -b) , where r,g,b are integers in range [0,255] and not e...
by [-hh]
Wed Feb 14, 2018 6:46 pm
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Getting normal distributions out of random(number)
Replies: 10
Views: 252

Re: Getting normal distributions out of random(number)

I'll publish a stack in the Raspi stacks collection with a graphical display for several more distribution functions within the next weeks. For now make a new stack with a field "out" and a field "out1". Then script a button with the following. This generates with each click N=25000 random numbers o...
by [-hh]
Wed Feb 14, 2018 4:33 pm
Forum: Talking LiveCode
Topic: is a color
Replies: 15
Views: 333

Re: is a color

Obviously we have: Each comma delimited-list of three integers is a color. This has its own logic: The following color setting algorithm is used by LC for each input integer, making any input of three integers to a color. If abs(<integer>) > 255 then it is taken modulo 255. If the result or <integer...
by [-hh]
Wed Feb 14, 2018 3:27 am
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Getting normal distributions out of random(number)
Replies: 10
Views: 252

Re: Getting normal distributions out of random(number)

I gave you already all essential help. The rest is simple. Are you bachelor student and is this your homework (a typical bachelor homework in year 2)? If not I'll publish a stack that gives you such numbers with a click. I already implemented it, LC 6.7.11 generates 10000 such numbers in at about 18...
by [-hh]
Tue Feb 13, 2018 11:12 pm
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Getting normal distributions out of random(number)
Replies: 10
Views: 252

Re: Getting normal distributions out of random(number)

How did I know that Hermann was going to be the next one to post? Perhaps I told you some time ago that mathematical statistics is a field in math I know a bit more than nothing (after 30 years of learning in that field, with my job). p.s. @totb I forgot that the polar method starts from "tranforme...
by [-hh]
Tue Feb 13, 2018 10:50 pm
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Getting normal distributions out of random(number)
Replies: 10
Views: 252

Re: Getting normal distributions out of random(number)

Hi all. This is a general principle in mathematical statistics. One starts always with (real) random numbers out of range [0,1] which are uniformly distributed. These are easily generated in LiveCode by dividing: For example, set maxx=10^9. Then take v= (random(maxx+1)-1)/maxx . Then one takes the x...

Go to advanced search