This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#6751 2013-02-05 06:26:26

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Hey Jens and bharvey, would you guys like me to write a utility to convert Scratch 2.0 projects to Snap! projects? I could ignore cloud variables and camera features (the only things that Snap! doesn't support yet); and somehow convert SVG to png (@blob: that's why I wanted that utility).


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#6752 2013-02-05 09:18:39

technoboy10
Scratcher
Registered: 2007-08-25
Posts: 1000+

Re: BYOB 3 - Discussion Thread

bharvey wrote:

someone who claims not to be able to understand lambda

That could be me.  tongue


So long, 1.4.
http://goo.gl/3JEV9

Offline

 

#6753 2013-02-05 09:21:25

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: BYOB 3 - Discussion Thread

blob8108 wrote:

@bharvey Can you give an example that doesn't use reduce/map/filter?

Hardmath123 wrote:

You mean like this? ...

Ah, sorry! I meant an example of a problem... like, what "functional" operations are there that I wouldn't intuitively think of?

Last edited by blob8108 (2013-02-05 09:21:48)


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#6754 2013-02-05 09:22:36

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Hardmath123 wrote:

@blob: that's why I wanted that utility

Ah, I see... Just write it in Javascript! I'm sure there's some way of exploting Canvas or something.  tongue


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#6755 2013-02-05 10:36:58

Jens
Scratcher
Registered: 2007-06-04
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Hardmath123 wrote:

Hey Jens and bharvey, would you guys like me to write a utility to convert Scratch 2.0 projects to Snap! projects? I could ignore cloud variables and camera features (the only things that Snap! doesn't support yet); and somehow convert SVG to png (@blob: that's why I wanted that utility).

Sure, that would be awesome! You can keep SVGs, because Snap already supports them, but for the time automatically rasterizes them internally. There are some other things Snap! doesn't have, like "Turbo Mode" and Scratch's cloning mechanism. But I've already got experimental versions of those working, too. (Turbo mode is called "fast tracking" in Snap and even has blocks for it, although you can also shift-click on the green flag, just like in Scratch, and Clones are working in my dev version which I might post sometime soon again, for the moment just consider those same blocks to be present in Snap, also).


Jens Mönig

Offline

 

#6756 2013-02-05 10:52:35

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: BYOB 3 - Discussion Thread

I was going to enclose atomic blocks in WARP blocks. The SVG thing is a huge relief—can you really quickly show me how you would embed an SVG costume in the project.xml? Can I just make a data:uri with it? That would be awesome. Thanks.  smile

I already have code to fetch a project and media (sounds and SVG costumes).


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#6757 2013-02-05 11:07:43

Jens
Scratcher
Registered: 2007-06-04
Posts: 1000+

Re: BYOB 3 - Discussion Thread

yup, data:uri should work fine, and the atomicity things should also just work :-)


Jens Mönig

Offline

 

#6758 2013-02-05 11:23:01

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Cool. Sounds like fun.  smile


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#6759 2013-02-05 11:34:23

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

blob8108 wrote:

And I was wondering just the other day why Snap!'s float calculations were off...  tongue

Ah, do you have a specific example?  Maybe we can fix it...

Can you give an example that doesn't use reduce/map/filter?

Hmm.  Hardmath read that as "an example of doing acronym iteratively" but I read it as "an example of a functional program not based on HOFs."  If the latter, have a look at the picture language project in SICP 2.2.4.  It uses HOFs in passing, but is mostly about recursive procedures and representing pictures as functions.

EDIT:  OK, now I read your reply to Hardmath.  How about these:

http://cs.berkeley.edu/~bh/fn-algebra.png

EDIT2:  Of course these are higher order functions; they're just not the list-processing trinity.  They're the beginning of an algebra of functions, in which everything is computed at the level of functions rather than of regular data like numbers or lists.

And, note that I had to use the "ringify" and "unringify" context menu items a lot to get these to come out right.  We have a general "do the right thing" set of rules that will work for almost everyone, but once you start playing around with functions of functions, you have to be more explicit about what gets thunked and what doesn't.

Last edited by bharvey (2013-02-05 12:27:43)


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#6760 2013-02-05 11:52:09

shadowmouse
New Scratcher
Registered: 2013-02-03
Posts: 100+

Re: BYOB 3 - Discussion Thread

Hey Jens, could you make it possible to add to the permanet library of their copy of Snap! instead of just making temporary user-created blocks, because some blocks (in my case such as 'do random' 'greater than or equal to' less than or equal to' and 'if else-if else'? Of course if someone made a block that didn't work, they would be able to remove it.

Offline

 

#6761 2013-02-05 12:07:44

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Hardmath123 wrote:

guys like me

This cracked me up -- I have this vision of you leading all the kids at your school on a crusade.  tongue   (I know, I know, the other kids aren't like you and that isn't what you meant at all.  It still cracks me up.)

And, yes, of course, that would be awesome.


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#6762 2013-02-05 12:11:59

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Jens wrote:

Clones are working in my dev version

NOOOO, no no no nononononono NO!

I know, you don't want to argue in public, but really, you should have predicted that this is something we have to talk about.

Sorry, n, but this discussion is going to email -- but really you can guess what I'm going to say.  (EDIT:  But don't, here, please.)

Last edited by bharvey (2013-02-05 13:14:06)


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#6763 2013-02-05 12:19:37

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

shadowmouse wrote:

Hey Jens, could you make it possible to add to the permanet library of their copy of Snap! instead of just making temporary user-created blocks, because some blocks (in my case such as 'do random' 'greater than or equal to' less than or equal to' and 'if else-if else'? Of course if someone made a block that didn't work, they would be able to remove it.

You can do this.  Just choose "export blocks" from the File menu in the toolbar.  You get to pick exactly which blocks to export.  Then you can import the resulting XML file whenever you want.


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#6764 2013-02-05 13:13:25

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

technoboy10 wrote:

That could be me.

Have you tried BYOB Tutorial 2?


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#6765 2013-02-05 13:36:14

shadowmouse
New Scratcher
Registered: 2013-02-03
Posts: 100+

Re: BYOB 3 - Discussion Thread

Thanks bharvey, I'm relatively new to byob and hadn't found that yet, it is going to help a lot in the future.

Offline

 

#6766 2013-02-05 14:34:07

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

@blob:  And then there are these:

http://cs.berkeley.edu/~bh/calculus.png

PS @Hardmath:  RANGE is a good argument for lazy evaluation.  There's no need actually to construct the huge list of numbers RANGE calls for; you really only need one of them at a time in MAP.

PPS: I haven't actually tested these...   tongue

P^3S:  But I should have.  I'm an idiot.  Here:

http://cs.berkeley.edu/~bh/integral.png

Last edited by bharvey (2013-02-05 14:43:33)


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#6767 2013-02-05 18:17:27

shadow_7283
Scratcher
Registered: 2007-11-07
Posts: 1000+

Re: BYOB 3 - Discussion Thread

bharvey wrote:

Whoa!  This from someone who claims not to be able to understand lambda?  (Or am I misremembering?)

I find myself naturally incorporating lambda into my code now that I'm familiar with JavaScript. But it did give me a bit of a headache before.  tongue

bharvey wrote:

Is there, in fact, an available source of traffic light data?  And does "data" in this context mean how the light is facing right now, or the light's duty cycle, or what?

This was one of the later goals of my project that I haven't yet gotten around to- I contacted the Austin department of transportation and they said they gave access to that information on a per-request basis. Unfortunately, I'm not sure if my code can handle that giant amount of data, and I don't know if I can limit my request area, or even if they have the information accessible from a database.

bharvey wrote:

There's no such thing as a syntax free language.

Sorry- I often lack subtlety.  wink  Thanks for pointing out the distinction.

bharvey wrote:

Imho you're trying way too hard to use formal language

That's one of my teacher's requirements for the research paper... non-personal "proffesional" language. It made me word some sentences pretty awkwardly. I would have done a science fair project even without the requirement, but yeah...

bharvey wrote:

Sorry, I don't suppose you posted the link because you wanted textual criticism; I can't help it -- I'm a teacher.  smile

No, thanks for the advice. And the sig-figs explanation.

I looked up SICP on Amazon, and saw this review.

But, the truth is SICP has SO MUCH to offer. Unfortunatedly, the book is only as educational as the CS professor who teaches it. It turns out that the Berkeley professor who said that SICP is "the greatest CS book ever written" is the finest CS teacher at Berkeley. Unfortunatedly, most CS professors are not even 1/10th as good as he is and therefore help make SICP a tortorous excursion.

That wouldn't happen to be you, would it?  tongue

Offline

 

#6768 2013-02-05 22:45:52

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

shadow_7283 wrote:

I find myself naturally incorporating lambda into my code now that I'm familiar with JavaScript.

Yay!  I've been worrying about that a bit.

(EDIT:  Why was it easier in JS?  I hope it's not going to turn out that text languages are easier than visual languages after all!)

I contacted the Austin department of transportation and they said they gave access to that information on a per-request basis.

I bet you can get them to send you a document about the data representation format, and probably if you tell them you're a kid doing a project you can find someone who'll exert himself to get you a block of sample data.

That's one of my teacher's requirements for the research paper... non-personal "professional" language.

Oh, your teacher's an idiot.  You and Hardmath should get together.  smile

I looked up SICP on Amazon, and saw this review. [...] That wouldn't happen to be you, would it?  tongue

Wow!  Yeah, I guess it is.  Honestly I never really understand why people think my lectures are so great, aside from the fact that I don't use Powerpoint.  The ideas are great.  (EDIT: In case this wasn't clear, I meant Abelson's and Sussman's ideas.)

Last edited by bharvey (2013-02-05 23:43:08)


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#6769 2013-02-06 08:19:08

shadow_7283
Scratcher
Registered: 2007-11-07
Posts: 1000+

Re: BYOB 3 - Discussion Thread

bharvey wrote:

(EDIT:  Why was it easier in JS?

Because for me, at least, Scratch scripts never represented functions. I didn't make the connection, and since JavaScript has a basic but rigid function syntax, it's only a matter of time before you figure out that you want anonymous functions.

I bet you can get them to send you a document...

Yeah, I think you're right. I just don't want to go to the trouble of writing a letter. I don't know why they don't allow email requests.  tongue

The ideas are great.

You're modest.  wink  I hadn't realized SICP was Creative Commons, so I think I'll start reading it!

Last edited by shadow_7283 (2013-02-06 08:19:41)

Offline

 

#6770 2013-02-06 09:18:57

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Alrighty, I've got variables and sprites (no costumes yet) implemented! That leaves costumes, scripts, and miscellaneous stuff.  big_smile


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#6771 2013-02-06 11:47:18

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: BYOB 3 - Discussion Thread

@Jens text doesn't work in SVG rasterization, you may want to fix that.  smile  And I got costumes working! Now I can import everything except scripts and sounds!  big_smile


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#6772 2013-02-06 12:01:21

shadow_7283
Scratcher
Registered: 2007-11-07
Posts: 1000+

Re: BYOB 3 - Discussion Thread

That's a fast turnaround. Can't wait to test it out Hardmath!

Last edited by shadow_7283 (2013-02-06 12:01:34)

Offline

 

#6773 2013-02-06 12:41:24

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Hardmath123 wrote:

Now I can import everything except scripts and sounds!  big_smile

Wow!  Great start.

Scripts are pretty important.   tongue

When you get this done, what do you want to build next?  The debugger?


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#6774 2013-02-06 12:43:19

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

shadow_7283 wrote:

Because for me, at least, Scratch scripts never represented functions. I didn't make the connection, and since JavaScript has a basic but rigid function syntax, it's only a matter of time before you figure out that you want anonymous functions.

Thanks.  I'll have to think about that.  I guess we need a tutorial that starts with non-anonymous functions, factorial and stuff, before doing anonymous ones.


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#6775 2013-02-06 12:59:46

technoboy10
Scratcher
Registered: 2007-08-25
Posts: 1000+

Re: BYOB 3 - Discussion Thread

@bharvey and blob8108 If I want to get a college degree in something computer science-y, what should I learn in my last two years of high school? I'm homeschooled, so I can pretty much pick and choose what to learn.  smile  Thanks!

Last edited by technoboy10 (2013-02-06 13:02:50)


So long, 1.4.
http://goo.gl/3JEV9

Offline

 

Board footer