Page 2 of 8

### Re: RaspberryPi Stacks

Posted: Mon May 05, 2014 10:35 pm
Raspberry Pi stacks collection #26 = colorNine2.livecode
Raspberry Pi stacks collection #27 = cubeNine1.livecode

colorNine is a *tiny* stack, that moves along Bezier curves over your screen.
RightClick on the center to get a menu "Flyer" for that.
This stacks shows *extreme* differences in grahic animation between LC 6 and LC 7, the latter is up to a factor of 20 slower (you have to adjust the number of iterations on Raspi).
cubeNine, displays date and time. Options available.
cubeNine displays the time (and date) like gaming dices, also selectable are some number bases that are NOT base10. Funny for developers to read this fast, while some other's can't.

### Re: RaspberryPi Stacks

Posted: Sat May 10, 2014 2:08 am
Raspberry Pi stacks collection #28 = Shuffle4cards1.livecode.zip

ShuffleCards is a stack that answer a question that is very often asked.
How to order randomly the cards of a stack or the images of a folder or some other N objects. Reorder means: If there is a set of N different objects (may be distinguished by a number or something else like name) in a set then there are again exactly these N different objects in the new set but in a new random order. This new order is usually different from the first, but the same order is also a possible outcome.

There are N possible choices for the first new place, n-1 possible choices for the second new place, ..., in total N!= N*(N-1)*(N-2)*...*2*1 choices.
We show some tests for n=4, that is 4!=4*3*2*1=24 possible outcomes of a reorder.
Two methods are used to be found in the stack's script.
• The Knuth-Fisher-Yates algorithm that uses the usual pseudo random() in a special way.
• The usualRandomSort that sorts the numbers 1 to N (in N lines) by random(large-number).
Both methods are set to get a new randomSeed at start and show for increasing N a surprisingly good distribution to the 24 possible reorder-outcomes.
.

### Re: RaspberryPi Stacks

Posted: Wed May 21, 2014 12:15 pm
Raspberry Pi stacks collection #29 = wakeUpNeo.livecode

If Neo had know that only a LC stack window was running on his screen ...

The stack shows the internet date in line 1 and "emulates" Neo's famous terminal (now yours). It is not front-fullscreen but fills the working screenrect and may be used as a kind of screensaver, coming to front if you click it and goes back if you use the LC 'Window' menu, and it stops if you click the mouse or hit any key (without some specials, see the tooltip of the field after opening the stack).
.

### Re: RaspberryPi Stacks

Posted: Fri May 23, 2014 1:39 am
Raspberry Pi stacks collection #30 = SmoothDraw4.livecode

This stack is a common work of 'mag' and me.
To use it, some exercise is needed. The scripts try to smooth your hand-drawing or mouse-drawing or pen-drawing from an usb-tablet respectively in such a way that the characteristics of your drawing are not removed.
The drawn objects are polygons (graphics), that can be edited later on. There are some techniques to reduce the number of points (vertices) of these polygons and a 'core' smoothing algorithm (by deCasteljau), that essentially computes (approximates) Bezier curves. We are using quadratic Bezier curves only here.

Scripts are largely commented, every action button has help (tooltip). There are a few demos added. The stack is ready-made for different cards that retain linesize and color.
Also saved are for each 'canvas' (card) ...
• ... the choosable 'flatness-limit'. This is used by a simple computation that decides whether a segment is "flat" enough not to be curve-smoothed ('rounded').
• ... the choosable 'wait-rate'. This is the speed of the repeat loop that collects the points for the polygons while you are drawing.
SmoothDraw4.jpg (22.13 KiB) Viewed 6579 times
Remarks.
• If the result is too 'curvy' try to draw slower and to draw short segments (e.g. M as three segments, D as two segments (straight and curved), ...) and try with increasing the flatness-limit.
• If the result is not smooth enough try to draw faster and to draw one-chars (e.g. M as one segments, V as one segment, D as one segment, ...) and try with decreasing the flatness-limit.
• On PPC (older machines) start with a wait-rate of 48 millisecs and then go upward if needed.
• On Raspi start with the maximal wait-rate of 128 millisecs and then go downward if needed.
• On fast machines or if using a highly sensitive usb-tablet (Bamboo or better) try in the range of 4-32 millisecs. If for some reason user is not enough exercised, go up to 128 milliseconds.
• A good start could be to try to write the word "Step" and change parameters until the drawing is close to your wishes (hope this is possible).
SmoothDraw4-krikel.jpg (23.6 KiB) Viewed 6579 times
== The drawing is now in such a way that you can "react" on smoothing so far with your movements. Just try, it's funny, like very old Disney animations.
== There are other "tools", additional to the simple brush. Yes these are still graphic tools, not painting tools ...

### Re: RaspberryPi Stacks

Posted: Sat May 31, 2014 7:27 am
Raspberry Pi stacks collection #31 = UnQuotate.livecode
Raspberry Pi stacks collection #32 = ScriptMarks.livecode

Un-Quotate
puts quotes around multiline strings or unquotates these.

Marks in scripteditor
Marks are lines in a script that start with any of the sequences
commentChar(s) & colon & "M" & space that is '#:M ' or '//:M ' or '--:M '.

The button lists, prefixed by the line number of the marks location, the marks of the currently active tab of the scripteditor, wherever this script is from. The reading of marks is live (works even with a not yet saved script). Picking a mark from the menu causes a jump to and hiliting of the marks line in scripteditor.
The script is fully commented and very short, you may alter it to your needs.

For the layout of the buttons's menu one can use
Giving marks for dividers: #:M -text
and for disabled items: #:M (text
.

### Re: RaspberryPi Stacks

Posted: Tue Jun 10, 2014 11:31 pm
Raspberry Pi stacks collection #33 = checksum.livecode
Raspberry Pi stacks collection #34 = LCInfo.livecode
Raspberry Pi stacks collection #35 = summary6.livecode

Checksum is for use of md5 and/or sha-1.
The other two stacks are usable in IDE for several infos.

### Re: RaspberryPi Stacks

Posted: Mon Jul 07, 2014 10:06 pm
Raspberry Pi stacks collection #36 = accordeon16.livecode
Empty accordeon fields
accordeon1.jpg (11.58 KiB) Viewed 6580 times
Accordeon using images
accordeon2.jpg (36.2 KiB) Viewed 6580 times
The red<->blue switch is for users of LC 6.5.1 on Raspi (takes some time).

### Re: RaspberryPi Stacks

Posted: Mon Jul 07, 2014 10:22 pm
Raspberry Pi stacks collection #37 = splash213131.livecode (uses windowShape)
Raspberry Pi stacks collection #38 = morphImages.livecode
Raspberry Pi stacks collection #39 = FlippingProjX2b.livecode

The first stack is a windowshaped stack that zooms as its own 'splash'. It is currently not for Raspi, (works but doesn't look good). It's there for the future, as soon as windowShape will work there too.
The second stack is a demo of how to use maskData of images for 'combining' (stack is quick-and-dirty made for a forum answer).
The third stack is based on an idee and from a topic, that Richmond once started. It resulted in a "wiper"-transition for images.

[No longer 'easteregg' of first stack: Cmd-Click btn 'Demo" for a nice additional optical effect.]

### Re: RaspberryPi Stacks

Posted: Thu Jul 17, 2014 11:20 pm
Raspberry Pi stacks collection #40 = hhClosestColorNames2b.livecode
Raspberry Pi stacks collection #41 = colorHarmonies2_7.livecode

The first stack finds closest colours (determined by a math distance measure) to a given one.

The second stack creates standard "colour harmonies" (Analogue, Complement, Monochrome, SplitComplement, Square, Tetradic, Triadic) from a RGB "base colour" of your choice.

The harmony is displayed in the most left column, the second column is a choosable percentage of these four colours.
Button "Copy Harmony" creates a new stack with a scripted button that holds the harmony and displays it in a circle.

Also determined are closest 'safe' Hex colour (for the Web) and closest named colour, closest to your chosen baseColor (like part of first stack --- in case you need only this).

### Re: RaspberryPi Stacks

Posted: Thu Jul 17, 2014 11:40 pm
-hh,
hhClosestColorNames1.livecode just makes me smile from ear to ear.

Simon

### Re: RaspberryPi Stacks

Posted: Thu Jul 17, 2014 11:51 pm
The following 'bug' Simon mentions is removed in current LC.

### Re: RaspberryPi Stacks

Posted: Fri Jul 18, 2014 12:13 am
Hi Hermann,
I think I have kept up with all the release notes and don't recall anything about color properties.
Possible bug?

Simon

### Re: RaspberryPi Stacks

Posted: Fri Jul 18, 2014 1:18 am
[Removed, wasn't up-todate here.]

### Re: RaspberryPi Stacks

Posted: Fri Jul 18, 2014 11:34 am
Hi Hermann,

that is a very nice stack. Thank you.

Regarding LC7 dp6:

LC7 dp6 returns the thumbPositon as decimal and for LC7 dp6 that is not a valid RGB value

if you change your code in the card script, handler "on scrollbarDrag" to

Code: Select all

``````on scrollbarDrag p,q,x
put trunc (the thumbposition of sb "Red") into r
put trunc (the thumbposition of sb "Green") into g
put trunc (the thumbposition of sb "Blue") into b``````
your stack works in LC7 dp6

you might want to report this as a bug.

Kind regards
Bernd

### Re: RaspberryPi Stacks

Posted: Fri Jul 18, 2014 11:52 am
The 'integer-hints' of Bernd are now already included in stack #41 above.