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).
Offline
bharvey wrote:
someone who claims not to be able to understand lambda
That could be me.
Offline
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)
Offline
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.
Offline
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).
Offline
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.
I already have code to fetch a project and media (sounds and SVG costumes).
Offline
Cool. Sounds like fun.
Offline
blob8108 wrote:
And I was wondering just the other day why Snap!'s float calculations were off...
![]()
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:
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)
Offline
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
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. (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.
Offline
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)
Offline
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.
Offline
Offline
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
@blob: And then there are these:
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...
P^3S: But I should have. I'm an idiot. Here:
Last edited by bharvey (2013-02-05 14:43:33)
Offline
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.
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. 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.
![]()
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?
Offline
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.
I looked up SICP on Amazon, and saw this review. [...] That wouldn't happen to be you, would it?
![]()
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)
Offline
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.
The ideas are great.
You're modest. 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
Alrighty, I've got variables and sprites (no costumes yet) implemented! That leaves costumes, scripts, and miscellaneous stuff.
Offline
@Jens text doesn't work in SVG rasterization, you may want to fix that. And I got costumes working! Now I can import everything except scripts and sounds!
Offline
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
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.
Offline
@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. Thanks!
Last edited by technoboy10 (2013-02-06 13:02:50)
Offline