Discuss Scratch

DrKat123
Scratcher
1000+ posts

Snap! user discussion

Jonathan50 wrote:

DrKat123 wrote:

frodewin wrote:

Speaking of project sharing, what is the license if I share a project on Snap! btw?
Idk

Btw is there any version of BYOB for Ubuntu? I'm using Ubuntu, and i like usinf BYOB offline
http://snap.berkeley.edu/old-byob.html
those instructions are a bit outdated
for me the BYOB image doesn't run on all the Squeak VMs I've tried whereas scratch runs fine (https://scratch.mit.edu/users/Jens/#comments-19852622 – any help?)

run
sudo apt-get install scratch
first and then follow these instructions:
If you used the .deb: Put the latest BYOB image in /usr/lib/scratch (should be the same folder that contains Scratch.image). Merge these other files into the subdirectories of /usr/*share/*scratch. Finally, put this shell script (tweaked as needed) in /usr/bin/byob or anywhere in your path.
but put the image in /usr/share/scratch instead of /usr/lib/scratch.

this should work:
sudo apt-get install scratch
wget http://snap.berkeley.edu/BYOB_3_1_1_110519_w_changes.zip -O - | sudo unzip /dev/stdin -d /usr/share/scratch
wget http://snap.berkeley.edu/byoblib.tgz -O - | sudo tar -xvzC /usr/share/scratch
sudo wget http://snap.berkeley.edu/byob.debian -O /usr/bin/byob
Thx

Moving from Scratch? Don't learn C or Java, try Snap!
it haz OOP
DrKat McKatFace
First of all I'm 100% human and humans does not have a cat face
and second, the Boaty McBoatFace/Parsey McParseFace madness has just begun

λ
Sharp, my new Scratch mod
Is my post/siggy worthy for an internet?
bharvey
Scratcher
1000+ posts

Snap! user discussion

frodewin wrote:

Speaking of project sharing, what is the license if I share a project on Snap! btw?
We actually do have a Terms of Service http://snap.berkeley.edu/tos.html. It says:

Anything you share is available to other users for any purpose, including the sharing of modified versions of your projects. By sharing a project, you are agreeing to license it under the Creative Commons Attribution-NonCommercial-ShareAlike License. (Fine print: If you want your project to be considered “free software” then you should waive the “NonCommercial” part of the license, but we do not impose this choice on you.) This license also applies to any media (images, sounds, etc.) you share on this site.

frodewin
Scratcher
500+ posts

Snap! user discussion

bharvey wrote:

frodewin wrote:

Speaking of project sharing, what is the license if I share a project on Snap! btw?
We actually do have a Terms of Service http://snap.berkeley.edu/tos.html. It says:

Anything you share is available to other users for any purpose, including the sharing of modified versions of your projects. By sharing a project, you are agreeing to license it under the Creative Commons Attribution-NonCommercial-ShareAlike License. (Fine print: If you want your project to be considered “free software” then you should waive the “NonCommercial” part of the license, but we do not impose this choice on you.) This license also applies to any media (images, sounds, etc.) you share on this site.

Interesting - so I am allowed to add contents from Scratch (which are under CC BY-SA) in Snap!, but not vice versa, except if the NC-part is waived on the Snap! project.

Edit: I was wrong! CC BY-SA (the license used by Scratch) and CC BY-NC-SA (the license used by Snap!) are incompatible. Unless the assets are originally yours, you are not allowed to use them in the other system.

Additional question: How do I waive the NC part? Is it sufficient to write this in the project notes?

Last edited by frodewin (Jan. 31, 2016 20:54:40)




You can also find my best projects here or stop at my profile and say hi!
bharvey
Scratcher
1000+ posts

Snap! user discussion

frodewin wrote:

Additional question: How do I waive the NC part? Is it sufficient to write this in the project notes?
Yeah, I'm sure that'll do. It'd be trickier if you wanted to have a more restrictive license, I guess. But IANAL.

xly
Scratcher
100+ posts

Snap! user discussion

Thanks for the fix of “OBSOLETE”, the only cause of crash I ever met with Snap!

Last edited by xly (Jan. 31, 2016 15:38:34)

frodewin
Scratcher
500+ posts

Snap! user discussion

The links to the examples on the Snap! home page seem not to work as intended.

Like
http://snap.berkeley.edu/snapsource/snap.html#open:http://snap.berkeley.edu/snapsource/demo/live-tree.xml
only opens an empty project in the editor instead of loading the example.



You can also find my best projects here or stop at my profile and say hi!
liam48D
Scratcher
1000+ posts

Snap! user discussion

Dear Jens: can we pleeeeeease have a function to do this?

this.evaluate(snapLambda, function(result) {
  console.log('The result is', result);
});

Pleeeeeeeeeeeeeeease?

(Also no `invoke` hacks )

202e-202e-202e-202e-202e UNI-CODE~~~~~
bharvey
Scratcher
1000+ posts

Snap! user discussion

frodewin wrote:

The links to the examples on the Snap! home page seem not to work as intended.
Huh. Thanks for catching this. The “demo” directory seems to have disappeared altogether. Working on it…

EDIT: I've restored some but not all of the missing projects. No time for more right now.

Last edited by bharvey (Feb. 1, 2016 00:04:01)


Jens
Scratcher
100+ posts

Snap! user discussion

Liam:

1. What's “this”?
2. What's the “hack” part in “invoke()”?
3. One of us doesn't understand the concept of yielding… is it me?

BTW: There *is* a comment in “invoke()” explicitly telling you how to pass in a callback:

“ // Use ThreadManager::startProcess with a callback instead”

Doesn't that do what you want?

(hint: Bascially you make a new Process, assign a JS callback to it, initialize it for a Context - which is what you call a SnapLambda -, and then add it to the ThreadManager - which is handled by the stage. Easy peasy, right?)

Last edited by Jens (Jan. 31, 2016 23:50:25)

liam48D
Scratcher
1000+ posts

Snap! user discussion

Jens wrote:

Liam:

1. What's “this”?
2. What's the “hack” part in “invoke()”?
3. One of us doesn't understand the concept of yielding… is it me?

BTW: There *is* a comment in “invoke()” explicitly telling you how to pass in a callback:

“ // Use ThreadManager::startProcess with a callback instead”

Doesn't that do what you want?

(hint: Bascially you make a new Process, assign a JS callback to it, initialize it for a Context - which is what you call a SnapLambda -, and then add it to the ThreadManager - which is handled by the stage. Easy peasy, right?)
“this” is the scope inside a JS Function block, that way you could do something like this:
thatSprite.evaluate(script, callback);

Invoke is completely synchronous, basically a warp block, making it difficult to have callbacks, waits, etc in the script.

And what does the script have to do with yielding?

Your hit says you can make a new process.. hmm.. I tried that..

var stage = this.parentThatIsA(StageMorph) || this;
var processes = stage.threads.processes;
processes.push(new Process(script, function() {
  console.log('wowow');
}));



TypeError
topBlock.receiver is not a function

Am I not seeing something obvious?

202e-202e-202e-202e-202e UNI-CODE~~~~~
Jens
Scratcher
100+ posts

Snap! user discussion

Yes, you're not reading my instructions

1. make a Process
2. initialize it for a Context
3. stick a callback to it (or don't)
4. add it to the stage's ThreadManager

That should work.

BUT: Your RUN WITH INPUTS block really re-invents our already existing LAUNCH block, right? You can use JS functions inside LAUNCH, you know, and that does what you want.

Last edited by Jens (Feb. 1, 2016 13:02:58)

liam48D
Scratcher
1000+ posts

Snap! user discussion

Jens wrote:

Yes, you're not reading my instructions

1. make a Process
2. initialize it for a Context
3. stick a callback to it (or don't)
4. add it to the stage's ThreadManager

That should work.

BUT: Your RUN WITH INPUTS block really re-invents our already existing LAUNCH block, right? You can use JS functions inside LAUNCH, you know, and that does what you want.
Parts 1, 2, and 3 are this:
new Process(script, function(...) {...})

So I assume I'm not initializing it right.

EDIT: this is so that I can get the output of a lambda from inside my JS script. This specific run block is just a remake of launch, of course

Last edited by liam48D (Feb. 1, 2016 13:46:11)


202e-202e-202e-202e-202e UNI-CODE~~~~~
Jens
Scratcher
100+ posts

Snap! user discussion

There is a method that initializes a Process for a Context.
It's actually called like that: Proc::initializeFor(context).
That's the same method that invoke() and fork() (== LAUNCH) also use.

Can you say again WHY you feel you need this feature?
liam48D
Scratcher
1000+ posts

Snap! user discussion

Jens wrote:

There is a method that initializes a Process for a Context.
It's actually called like that: Proc::initializeFor(context).
That's the same method that invoke() and fork() (== LAUNCH) also use.

Can you say again WHY you feel you need this feature?
Ah, I see - cool!

It's useful for combining things that can only be done in JavaScript with Snap! blocks.

202e-202e-202e-202e-202e UNI-CODE~~~~~
liam48D
Scratcher
1000+ posts

Snap! user discussion

Okay, I've gotten calling the block working, but my onComplete function doesn't seem to be being called..



202e-202e-202e-202e-202e UNI-CODE~~~~~
DrKat123
Scratcher
1000+ posts

Snap! user discussion

liam48D wrote:

Okay, I've gotten calling the block working, but my onComplete function doesn't seem to be being called..


Nize m8 1234th post loominarty comfarmed.
Btw i think i'll just use Snap! online

Moving from Scratch? Don't learn C or Java, try Snap!
it haz OOP
DrKat McKatFace
First of all I'm 100% human and humans does not have a cat face
and second, the Boaty McBoatFace/Parsey McParseFace madness has just begun

λ
Sharp, my new Scratch mod
Is my post/siggy worthy for an internet?
Jonathan50
Scratcher
1000+ posts

Snap! user discussion

DrKat123 wrote:

liam48D wrote:

Okay, I've gotten calling the block working, but my onComplete function doesn't seem to be being called..


Nize m8 1234th post loominarty comfarmed.
Btw i think i'll just use Snap! online
That was the 1235th post actually
[/offtopic]

Oh, if you want to use Snap! without internet, why not download the source? You can clone it with Git or download it by clicking on the Snap! logo and clicking Download source.
Assuming you have git and python 3 installed:
git clone https://github.com/jmoenig/Snap--Build-Your-Own-Blocks.git
cd Snap--Build-Your-Own-Blocks
python3 -m http.server
then go to http://localhost:8000/

Last edited by Jonathan50 (Feb. 2, 2016 02:49:19)


Not yet a Knight of the Mu Calculus.
Jens
Scratcher
100+ posts

Snap! user discussion

there you go, Liam:



and here's the project for you to play with:

http://snap.berkeley.edu/snapsource/snap.html#present:Username=jens&ProjectName=JS-fork&editMode
liam48D
Scratcher
1000+ posts

Snap! user discussion

Jens wrote:

there you go, Liam:

snip

and here's the project for you to play with:

http://snap.berkeley.edu/snapsource/snap.html#present:Username=jens&ProjectName=JS-fork&editMode
Wow, thanks! That'll work perfectly for what I'm going for.

202e-202e-202e-202e-202e UNI-CODE~~~~~
liam48D
Scratcher
1000+ posts

Snap! user discussion

Aww..



(..don't question what I'd actually use that for. It was just an experiment..)

Last edited by liam48D (Feb. 3, 2016 12:57:34)


202e-202e-202e-202e-202e UNI-CODE~~~~~

Powered by DjangoBB