Page 8 of 9

Re: RaspberryPi Stacks

Posted: Fri Feb 16, 2018 8:39 am
by [-hh]
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 button (at bottom right) switches the order of "before" and "after" parts.
You select the proportions of the parts by sliders.

For use in your own stack you only have to provide *one* "before-image" and *one to many*
"after-images" -- as the demo shows.
  • Use LC 6.0.5 (or slower: 7.0.4) on Raspi.
  • Use LC 6.7.11 / 7.1.4 and 8.1.6/ 9.0.0 or later on Mac/Win/linux
The stack is too large for the forum. You can have it
  1. by opening an LC IDE, version as denoted above, then type in or copy-paste to msg:
    [EU] go stack url ("http://hyperhh.org/xstacks/beforeAfterI ... 0.livecode")
    [US] go stack url ("http://hh.on-rev.com/xstacks/beforeAfte ... 0.livecode")
    _or_
  2. by downloading in your browser
    [EU] http://hyperhh.org/xstacks/beforeAfterI ... vecode.zip
    [US] http://hh.on-rev.com/xstacks/beforeAfte ... vecode.zip
    Then open it in an LC IDE, version as denoted above.

Re: RaspberryPi Stacks

Posted: Thu Sep 20, 2018 9:19 am
by [-hh]
Raspberry Pi stacks collection #107 = ControlHandles67

ControlHandles is a group of handles (polygon and graphics) that essentialy work, in browse mode, as the object handles in pointer mode.

It is all in one menu button by which you include/exclude which controls are selectable as target. The rest is done by the button.

controlhandles.png
controlhandles.png (3.74 KiB) Viewed 20027 times

This works for *ALL* LC controls:
CLICK ACTIONS
  • 1,3,5,7: Resize
    1,3,5,7 + Shift- or RightClick: Resize proportionally
  • 2,6: Height
  • 4,8: Width
  • 9,10,11,12: Grab
    9,10,11,12 + Cmd or RightClick: Hide Poly
    9,10,11,12 + Shift: Hide Control and Poly
While using the handles, width x height and the rect of the control are displayed.

Scripts are 'essentially' commented. For this stack
  • use LC 6.0.5 (or slower: 7.0.4) on Raspi.
  • use LC 6.7.11/ 7.1.4/ 8.1.9/ 9.0.0 on Mac/Win/linux
An identical version of this stack that contains widgets (requires LC 8/9) : (sorry, currently not available)

## v1.0.4 Sep 20, 2018
 

Re: RaspberryPi Stacks

Posted: Thu Sep 20, 2018 9:44 am
by [-hh]
I lost oversight, a table of contents may be also comfortable for you.

Table of contents (as of Sep 11, 2019)

Re: RaspberryPi Stacks

Posted: Thu Sep 20, 2018 1:10 pm
by bogs
Every time you post, I'm amazed -hh. Awesome stuff there.

Re: RaspberryPi Stacks

Posted: Thu Sep 20, 2018 1:37 pm
by [-hh]
So there is at least one user but me! Thanks bogs.

Re: RaspberryPi Stacks

Posted: Thu Sep 20, 2018 8:09 pm
by SparkOut
You know there is more than one who thinks [-hh] and all his work is awesome

Re: RaspberryPi Stacks

Posted: Thu Sep 20, 2018 9:53 pm
by [-hh]
So there are at least two users but me! Thanks SparkOut.

Re: RaspberryPi Stacks

Posted: Thu Sep 20, 2018 9:57 pm
by Klaus
Count me in, folks! 8)

Re: RaspberryPi Stacks

Posted: Thu Sep 20, 2018 9:59 pm
by [-hh]
So there are at least three users but me! Thanks Klaus.

Re: RaspberryPi Stacks

Posted: Thu Sep 20, 2018 11:56 pm
by Simon
I'll come out of hiding to be counted.
Awesome work -hh

Re: RaspberryPi Stacks

Posted: Fri Sep 21, 2018 12:17 am
by [-hh]
So there are at least four users but me! Thanks Simon.


____________
There are three kinds of mathematicians. One kind can count and the other can not count ...

Re: RaspberryPi Stacks

Posted: Thu Jan 31, 2019 1:41 am
by [-hh]
Raspberry Pi stacks collection #108 = timeLapseCamera6789

Download: (sorry, currently not available)

The stack works with all editions of LC 6/7/8/9 on Mac/Win/linux and on Raspi 2/3 (with LC 651 and 704)

TimelapseCamera lets you ...
  • select one of the (web-)cameras attached to your machine.
  • set an interval of 5 to 86400 seconds.
  • set an imageSize (set the width to scale proportional).
  • select to see a preview.
  • select to start the timelapse (saving the snapshots).
Of course you can have snapshots from different cameras at (roughly) the same time by running renamed copies of the stack in different folders.

Then the snapshots are made at the given time intervals and saved to a folder "CAM" in the stack's folder (if the stack is not yet saved it depends on the OS where "CAM" will be created...).
So, when loading from "Sample Stacks", first save the stack, then close and reopen it and you'll get no errors.

The 'core-job' is done by non-LC utilities. They could run in the temporary folder but I save them to the stack's folder so that they are easier to find for you.

NOTE. The stack is tested to run with LC 6 and LC 9 on all the above platforms. Any problems you encounter may result from a file path that contains spaces or single quotes (like "Joe's folder").
I leave it up to you to solve such problems.

License MIT (due to the utilities).

Re: RaspberryPi Stacks

Posted: Sat Aug 10, 2019 5:59 pm
by [-hh]
Raspberry Pi stacks collection #109 = PasswordRules

Often passwords should obey some rules, e.g.
contain at least a certain number of digits, lowercase chars, uppercase chars, xtra chars with an ascii number in range 32-127 or special local chars as "åáãçß". Or contain only some of these char groups.

Stack PasswordRules allows
  • to check whether a given password fulfils some "char group rules" or
  • to create a random password that fulfils these rules.
Char groups are digits, lowercase a-z, uppercase A-Z, several extras (!"#$%&'()*+,-./ etc.) and an editable one.

The stack works with all editions of LC 6/7/8/9 on Mac/Win/linux and on Raspi 2/3 (with LC 651 and 704)

Download: (sorry, currently not available)
 

Re: RaspberryPi Stacks

Posted: Fri Aug 16, 2019 1:36 pm
by [-hh]
Raspberry Pi stacks collection #110 = CountUpOrDown_v2b

You set a target date by dateItems that is then converted to internet date. Then
  • if the target date is in the future then the stack counts down to it from the current internet date,
  • if the target date is in the past then the stack counts up from it to the current internet date.
The count respects (by using the internet date) leap years and daylight savings and is displayed as
  • (approximate) years
  • (approximate) months
  • (exact) weeks
  • (exact) days
  • (exact) hours
  • (exact) minutes
  • (exact) seconds
Each of these is a display of its own, not to read additively.
So, if you give for example your exact birth date as (year, month, day, hour, minute) you can directly see your age in full years, full months, etc.

The aprroximation of years and months is good. The core function is

Code: Select all

function dateUnits s -- s is in seconds
  put s/31556952 into y
  -- 31556952=365.2425*86400 as approximation (hint of Craig)
  put format("%.3f",y) into year
  put format("%.2f",y*12) into month
  put format("%.1f",s/604800) into week
  put format("%.1f",s/86400) into day
  put format("%.1f",s/3600) into hour
  put format("%.1f",s/60) into minute
  return year,month,week,day,hour,minute,s
end dateUnits
You need a bold monospaced font for the display. Find attached the one I used.
The stack works with all editions of LC 6/7/8/9 on Mac/Win/linux and on Raspi 2/3 (with LC 651 and 704)
 
[Edit (Aug 17, 2019): Removed an error in an earlier version.]
 

Re: RaspberryPi Stacks

Posted: Tue Sep 10, 2019 11:10 pm
by [-hh]
Raspberry Pi stacks collection #111 = OSTimeInfo_v105

This is a project that challenged me.

The stack now works with LC 6/7/8/9 on Mac, Win 7/10, linux (Ubuntu 1904 flavours) and with LC 6.5.1/7.0.4 on Raspi 3/4 running Raspbian or Lubuntu.

The goal is simple:
  • Show the uptime (since last reboot) and
  • show last reboot, last shutdown and last uptime
We simply need three timestamps for that.
  • the last reboot
  • the last shutdown
  • the before-last reboot
All above systems except windows have "uptime" available (though I don't use it), so the uptime and last reboot are easy to get.
The last shutdown and before-last reboot are only on Mac an linux desktop simple easy to get.
On windows you have to dive deep into a huge log file using powershell and on Raspi you have to work around the fact that reboots are at a time when a clock isn't available (Raspi has no own clock, gets the time from internet).

Nevertheless, I found a solution.

The start lasts on Windows up to a few seconds, else the results are immediately available.
And there may be extreme scenarios where you get 'wrong' times.
For example if you use a virtual machine where the guest uses a different time zone than the host. Then you may get negative uptimes.
Or if you save the state of a VM, then the time until the reboot from such a saved state counts as uptime.

Sometimes it needs two restarts on Raspi until the wtmp log is established (which is used by "last -x"). After that it should work correctly.
Please report if you see any problem or error.

Have fun!