LC Buddy collaborative coding

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

AndyP
Posts: 614
Joined: Wed Aug 27, 2008 12:57 pm
Location: Seeheim, Germany (ex UK)
Contact:

LC Buddy collaborative coding

Post by AndyP » Sat Mar 09, 2019 3:32 pm

I've been working on a real time collaborative plugin for LiveCode. It's a bit crude at the moment, needs error checking added but it works. I thought this would be good for helping beginners, we could schedule live casual coding classes or help out other coders who have hit a problem and who are willing to let others at their code.

I had been looking at current code collaboration systems but all work with text only and I wanted to be able to collaborate with stacks in the LC IDE and code being edited in the LC Script Editor, which I now have.

My testing version works likes this:

1. An instance of the LC Buddy plugin is opened by someone wanting to share and collaborate on their code. This user elects to be the administrator and starts the session. Any other open LC Buddy plugins get notified that a session has started. Sessions could also be pre-arranged on the forum or by email.

2. Other LC Buddy users can request to be a member of this session.

3. The administrator shares their stack via LC Buddy.

4. The admin then starts coding and becomes the current editor, this is detected by LC Buddy and opens a script editor window on all other LC Buddy members of the session. All other members are now locked in View Mode only. Any changes to the editors script editor are pushed to all other members script editors in near real time.

5. When the current editor has finished editing, all other LC Buddy's are notified and can make a request to become the new editor which, if the admin approves then allows that member editing rights, and so on..

That's about it. There is also a chat window for comments, jokes, requests for coffee etc.

I'm also looking at adding recording for the open stack and script editor on the admins system (optional) which could be uploaded to a LC Buddy YouTube Channel. This would act as an additional learning resource and give LiveCode more exposure.

I expect to have a general first release up on LC Share about mid to late April. In the meantime I'm looking for a few beta testers to help try and iron out any problems before this release. Pleas PM me if interested.

Looking forward to any comments and suggestions.
Andy Piddock
https://livecode1001.blogspot.com Built with LiveCode
https://github.com/AndyPiddock/TinyIDE Mini IDE alternative
https://github.com/AndyPiddock/Seth Editor color theming
http://livecodeshare.runrev.com/stack/897/ LiveCode-Multi-Search

TerryL
Posts: 78
Joined: Sat Nov 23, 2013 8:57 pm

Re: LC Buddy collaborative coding

Post by TerryL » Wed Mar 27, 2019 6:48 pm

Hi AndyP. This is a great idea and I encourage you to continue. I'm surprised no one has commented. I see two difficulties. There might be collaborators in different time zones that make real-time interaction awkward. If a collaborator could post comments and suggestions then the principal could review them at convenience. Second, the principal may not appreciate collaborators altering the stack. Consider principal retaining authorship and collaborators can only offer comments and code for review. Also, there's a forum category for collaboration "Community Projects" that isn't very active. Maybe you could link in or tap that? Terry
Beginner Lab (LiveCode tutorial) and StarterKit (my public stacks)
https://tlittle72.neocities.org/info.html

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: LC Buddy collaborative coding

Post by bogs » Wed Mar 27, 2019 8:08 pm

TerryL wrote:
Wed Mar 27, 2019 6:48 pm
Hi AndyP. This is a great idea and I encourage you to continue. I'm surprised no one has commented.
I agree with Terry, it is a marvelous idea, I didn't initially comment though (started to about 6 times :wink: ) because I am a team of 1, more or less, and couldn't think of a way to really be contributory to the idea, not having a lot of experience in team coding.

That doesn't mean though that it isn't a very good idea, for a group that could make use of it :D
Image

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9580
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: LC Buddy collaborative coding

Post by dunbarx » Wed Mar 27, 2019 8:37 pm

This may entice youngsters (I suspect that the average age of the usual participants in this forum is embarrassingly high) with a comfort level that may really help promote LC.

I suspect that a lot of "us" work alone (I do), and are not experienced with the sort of collaboration that Andy is talking about (I am not). LC is leaving a lot on the table if it appeals only to rogue coders having a blast.

How do, say, Richard Gaskin or Jaqueline Gay work?

Craig Newman

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: LC Buddy collaborative coding

Post by bogs » Wed Mar 27, 2019 9:52 pm

dunbarx wrote:
Wed Mar 27, 2019 8:37 pm
(I suspect that the average age of the usual participants in this forum is embarrassingly high)
Just because the candles on my birthday cake started that forest fire, there is no need to bring age up! :P

Richard mentioned code reviewing, I'd suspect he'd be an excellent trial for this.
Image

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9580
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: LC Buddy collaborative coding

Post by dunbarx » Wed Mar 27, 2019 10:34 pm

Bogs.

Groucho said it better to Margaret Dumont, talking about her mother, "there is no reason to bring the civil war into this"

Craig

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: LC Buddy collaborative coding

Post by bogs » Thu Mar 28, 2019 6:12 am

Yes, I wish I had thought of that reference myself :mrgreen:
Image

AndyP
Posts: 614
Joined: Wed Aug 27, 2008 12:57 pm
Location: Seeheim, Germany (ex UK)
Contact:

Re: LC Buddy collaborative coding

Post by AndyP » Thu Mar 28, 2019 12:24 pm

Thanks for the feedback. I had actually put this aside because of the the lack of prior responses, thinking it was a dead duck! But now back on the case.

I want to start with a very basic proof of concept which will include all of the functions in my original post. Once this is deemed to be functional and relativity stable, I want to get it up on GitHub, so that the community can add and improve it.

Q. to be useful on GitHub this needs to be script only plus a binary GUI stack, this arrangement I find messy for plugins. Any thought on this?

Because this will be available to all, it must run within Community versions of LiveCode which means no TsNet which I thought I would have to use to keep transfer speeds high and blocking instances low. This I thought would be a problem but testing seems to indicate that just using the standard internet library will do the job as apart from the chat, only one user can be editing and pushing out changes, all other users are just getting new data pushed to their editor every 5 seconds or so.

Q. I need some input on how to make the server scripts secure.
At the moment data is posted to the sever and includes a security key which is ok until the code becomes open on GitHub as the security key will then be viewable in the code. Server scripts are livecode .lc and they check for the security key and a few other tests are performed on the posted data.

What I'm concerned about is that it would be possible for someone to post malicious code to the server which would then get pulled into users editors which if run could leave the users system open to attack.
How would you prevent this?

Looking forward to all comments.
Andy Piddock
https://livecode1001.blogspot.com Built with LiveCode
https://github.com/AndyPiddock/TinyIDE Mini IDE alternative
https://github.com/AndyPiddock/Seth Editor color theming
http://livecodeshare.runrev.com/stack/897/ LiveCode-Multi-Search

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: LC Buddy collaborative coding

Post by bogs » Thu Mar 28, 2019 2:04 pm

AndyP wrote:
Thu Mar 28, 2019 12:24 pm
I had actually put this aside because of the the lack of prior responses, thinking it was a dead duck! But now back on the case.
This was the reason I almost posted 6 times prior. Unfortunately, I still don't think I can add anything useful :?

I think the two questions are backwards though, especially in today's world, security should be the first part, you can always tweak it to be fast(er) down the road. Unfortunately, I have no experience with any part of what you need to get done to draw on :(
Image

bwmilby
Posts: 438
Joined: Wed Jun 07, 2017 5:37 am
Location: Henrico, VA
Contact:

Re: LC Buddy collaborative coding

Post by bwmilby » Fri Mar 29, 2019 12:51 am

I would suggest ScriptTracker for posting to GitHub. For a plugin, it would be an ideal way to keep the scripts inside the binary but also visible in GitHub for others to review and suggest changes. Whenever updates are pushed, the binary stack would be included with the script files. GitHub would allow easy viewing of the differences for each commit.
Brian Milby

Script Tracker https://github.com/bwmilby/scriptTracker

TerryL
Posts: 78
Joined: Sat Nov 23, 2013 8:57 pm

Re: LC Buddy collaborative coding

Post by TerryL » Mon Apr 01, 2019 7:44 pm

Hi AndyP. Another thought. This would be useful where teacher demonstrates to students in computer lab, or where software startup coworkers interacting around a table include flex-hour worker at home, or a regional LC usergroup demonstrates a lesson or topic to members at home. Terry
Beginner Lab (LiveCode tutorial) and StarterKit (my public stacks)
https://tlittle72.neocities.org/info.html

AndyP
Posts: 614
Joined: Wed Aug 27, 2008 12:57 pm
Location: Seeheim, Germany (ex UK)
Contact:

Re: LC Buddy collaborative coding

Post by AndyP » Thu Jun 06, 2019 11:39 am

Thanks for all the suggestions.

Not a lot has happened with LC Buddy, I've been kept quite busy lately and unfortunately nothing code related.

Before I get back to LC Buddy, I've been thinking (a lot) about how I work with GitHub and script only files and came to the conclusion that I wanted a dead simple and transparent way of organizing and assigning script only behavior files without using any framework or other 3rd party utilities. These are great to have and work well but add that extra whats going on, am I really in control here uncertainty so....

What I've come up with which works really well for me is this... The main Binary GUI stack has very little code and all this code does is to open and load a script only stack which contains a list of the script only behavior stacks which in turn are opened and assigned as behaviors to the stack, card and controls of the main binary stack, nice and simple. I can see easily what script files I am using and what they are assigned too all in one file.

updating becomes a breeze as I just need to amend this file and add the new script only file(s) and I do not need to touch the binary GUI stack unless new controls are added...done.

Here is an example, code in the binary stack, named StackLoader.livecode with 1 card named Main

Code: Select all

global gMainStack //this is the binary calling main stack

on preOpenStack
   //this is the binary calling main stack
   put "StackLoader" into gMainStack
   
   //open the StackFilesList script file
   //this starts with a list of all script stacks so that they can be loaded and set as behaviors
   //allows for behavior scripts to be added and mapped dynamically
   open stack (mainAppPath() & "/StackFilesList.livecodescript")
   if there is not a stack "StackFilesList" then
      answer "Error loading StackFilesList script!"
      exit "preOpenStack"
   end if
end preOpenStack


//get and set the path to the top main calling stack
function mainAppPath
   local tPath
   put the filename of stack gMainStack into tPath
   set the itemdel to "/"
   put empty into the last item of tPath
   if char -1 of tPath is "/" then put empty into char -1 of tPath
   return tPath
end mainAppPath
and the script only loader named StackFilesList.livecodescript

Code: Select all

script "StackFilesList"

global gMainStack //this is the binary calling main stack, assigned by the binary

on openStack  
   buildStackList
end openStack


//load and open all script only stacks
command buildStackList
  
  //build your stack files list
   local tStackFilesList
   //e.g. 2 stack only files, MainStackBehavior.livecodescript and MainCardBehavior.livecodescript
   //to be loaded and assigned
   put "MainStackBehavior" & return into tStackFilesList
   put "MainCardBehavior" after tStackFilesList
   
   repeat with TRep = 1 to the number of lines of tStackFilesList
      //check that stack is found, abort loading if not
      if there is not a stack (AppPath() & "/" & line tRep of tStackFilesList & ".livecodescript") then
         answer "Error loading" && line tRep of tStackFilesList
         exit "buildStackList"
      end if
      open stack (AppPath() & "/" & line tRep of tStackFilesList & ".livecodescript")
   end repeat
   
   answer tStackFilesList & return & return & "loaded ok" //for testing
   assignBehaviors
end buildStackList


//asign the script only stacks as behaviors to stacks,cards,controls
command assignBehaviors
   set the behavior of stack gMainStack to (the long id of stack "MainStackBehavior")
   set the behavior of card "Main" of stack gMainStack to (the long id of stack "MainCardBehavior")
end assignBehaviors


//get and set the path to the top main calling stack
function AppPath
   local tPath
   put the filename of stack gMainStack into tPath
   set the itemdel to "/"
   put empty into the last item of tPath
   if char -1 of tPath is "/" then put empty into char -1 of tPath
   return tPath
end AppPath

So now I have this in place, back to LC Buddy.. starting afresh.
Andy Piddock
https://livecode1001.blogspot.com Built with LiveCode
https://github.com/AndyPiddock/TinyIDE Mini IDE alternative
https://github.com/AndyPiddock/Seth Editor color theming
http://livecodeshare.runrev.com/stack/897/ LiveCode-Multi-Search

AndyP
Posts: 614
Joined: Wed Aug 27, 2008 12:57 pm
Location: Seeheim, Germany (ex UK)
Contact:

Re: LC Buddy collaborative coding

Post by AndyP » Thu Jun 06, 2019 3:49 pm

OK back to LC Buddy!

So I've got a lot of the server stuff sorted and am now restarting the LC Buddy stack coding but, before I really start digging into this, can you please look at my project notes below and make comments. suggestions on what I've outlined. I'm particularly interested in tying down any security aspects.

LC Buddy 06-06-19

Purpose

1. To allow multiple remotely connected users to edit/observe live scripting sessions from within the LC ide using the LC script editor.
2. Provide a YouTube channel with recordings of sessions as an extra LiveCode learning resource.

Important Notes
1. LC Buddy should be open to all so MUST be coded using a Community version of LiveCode
2. All stacks and scripts used in a LC Buddy session should be deemed free to use and copyright free
3. Local LC Buddy scripts MUST be not encrypted for transparency
4. Local LC Buddy stacks and scripts to be posted to GitHub for community enhancement
5. Full Server scripts not posted to GitHub to aid security

Security
1. Needs to be made clear that all users use LC Buddy at their own risk as using LC Buddy requires that another user is editing code that will be pushed to each user.
2. Transfers should be over SSL ..?? community version
3. There will be no direct link between users computers, all transfers will be via a https web site running lc server script or PHP

Objectives

Users
1. Users should be able to login to LC Buddy (invited?)
1a. One user should be assigned moderating rights
1b. Only one user can be editing at once
1c. All users should be able to request editing sessions
1d. All users should be listed

Communications
2. Provide real time chat and commenting
2a. Indicate which user is editing
2b. Indicate which user is moderating

Scripting
3. The current editors stacks(s) to be available to users on login
3a. Changes to the editors stack/script(s) to be pushed to logged in users

Recording
4. Sessions for each editor should be recorded
4a. Each editors session recording to be automatically joined to the previous recording
4b. Joined and completed recordings to be uploaded to a new YouTube channel
4c. Editors should be credited in the recording
Andy Piddock
https://livecode1001.blogspot.com Built with LiveCode
https://github.com/AndyPiddock/TinyIDE Mini IDE alternative
https://github.com/AndyPiddock/Seth Editor color theming
http://livecodeshare.runrev.com/stack/897/ LiveCode-Multi-Search

gagsoft
Posts: 168
Joined: Sat Jun 29, 2013 7:56 pm

Re: LC Buddy collaborative coding

Post by gagsoft » Thu Jun 06, 2019 7:07 pm

This is I think is somewhat off topic.
I have been looking at Apps where one can store code snippets to be more productive.
Is it possible to export the LC in an Industry standard so that on can import it into something like
SnippetLab which one can use to store code snippets in for re-use later on.

Also is there any body using code snippet library apps at the moment
Would really like to know.
Perhaps this is something to put on the wish-list as a future plugin for LC :D

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: LC Buddy collaborative coding

Post by bogs » Thu Jun 06, 2019 9:36 pm

I believe Hugh (?) of the Flexible Learning Co. already put out just what your talking about.
Image

Post Reply

Return to “Talking LiveCode”