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

#4076 2011-11-17 04:40:33

xly
Scratcher
Registered: 2010-04-17
Posts: 100+

Re: BYOB 3 - Discussion Thread

@Jens and fanofcena
After filling the 500 items list I tried to add a new variable and then it occurred the same problem of "browser freezing". Still on the bench !

Offline

 

#4077 2011-11-17 06:31:11

fanofcena
Scratcher
Registered: 2008-07-03
Posts: 1000+

Re: BYOB 3 - Discussion Thread

xly wrote:

@Jens and fanofcena
After filling the 500 items list I tried to add a new variable and then it occurred the same problem of "browser freezing". Still on the bench !

Try a diff browser *just in case* to make sure its not memory leak issue  hmm 
Firefox generally shows such behavior when it experiences memory leak

If thats chrome i think u will have to do it step by step and log every tick  hmm

Last edited by fanofcena (2011-11-17 06:32:23)


http://i53.tinypic.com/2vxr2c0.png Click whats above u might make a cute planet happy ^_^

Offline

 

#4078 2011-11-17 09:15:38

xly
Scratcher
Registered: 2010-04-17
Posts: 100+

Re: BYOB 3 - Discussion Thread

An update of the former "drawing robot" application...stopped by the same recurrent bug. I confirm that to use a variable as a list you need to set it to a void  list. Then the simple variable box displayed into the sprite screen changes into a list box.

http://www.xleroy.net/ByobTuto/New/Snap!/robgoTxt.gif

Offline

 

#4079 2011-11-17 10:38:43

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

Re: BYOB 3 - Discussion Thread

Okay, Xavier, seems like you have two issues with lists. The first is how to initialize them and the second is about inspecting large lists in the watcher.

1) Initializing lists

In Snap 4 lists are different from Scratch and BYOB 3 in that we no longer have "named" lists that are created by pressing a "make a list" button. Instead we have - untyped - variables and first class lists. That's why you have to assign an - unnamed - list to a variable before using that variable in list blocks. That's not a bug but a new feature of variable watchers, that they now let you interact with lists, too (any variable watcher, for that matter).

2) Inspecting large lists

I can reproduce the problem with large lists in Firefox. Chrome seems to be more robust in that respect. I think one way to deal with this would be to only show a certain number of list items in the watcher (e.g. 100) along with a drow-down menu that lets you select other list ranges. In fact, I'll implement a version of this tonight, so you can play with it over the weekend...

Thanks again for the rigid testing!


Jens Mönig

Offline

 

#4080 2011-11-17 11:37:09

xly
Scratcher
Registered: 2010-04-17
Posts: 100+

Re: BYOB 3 - Discussion Thread

@Jens
"That's why you have to assign an - unnamed - list to a variable before using that variable in list blocks".
This is clear to me. I already knew this trick with Byob when using a local list temporary list defined by a Script Variable (AllButFirst block for example ) . Once upon the time , I spent hours to find how to fix a bug , as Byob did not give error message for a misdefinition of a List.
Back to Snap! If you create a variable (to name a list) and start to ADD one Item, then you get a message, not very explicit if you are not aware of the problem (PROBLEM : TypeError list.add is not a function). One should check before ADDing anything to a variable that its has be defined as an empty list or that its Watcher is a list one.

Offline

 

#4081 2011-11-17 11:44:33

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

Re: BYOB 3 - Discussion Thread

xly wrote:

then you get a message, not very explicit if you are not aware of the problem (PROBLEM : TypeError list.add is not a function).

All of the error messages are terrible right now; they're written from the implementor's point of view rather than the user's.  That helps Jens debug, but don't worry, the whole error handling system will get an overhaul before release.


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

Offline

 

#4082 2011-11-17 11:47:25

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

Re: BYOB 3 - Discussion Thread

it doesn't matter what the variable's watcher is, it's always just a variable watcher, but inside its cell it shows whichever contents is assigned to the variable. If the variable refers to a block the cell shows a block, if it's a number it shows a number, and if it's a list the cell - automatically! - shows the list watcher. What bites you is that Snap's variables are untyped - and that type errors can happen. But that's just how it is with any dynamic language, right?


Jens Mönig

Offline

 

#4083 2011-11-17 12:13:57

Khokhulin
New Scratcher
Registered: 2011-09-03
Posts: 6

Re: BYOB 3 - Discussion Thread

I have almost made localisation BYOB v. 3.1 on the Russian. All works well. But I cannot force to work as the menu for a choice of attributes. Instead of them small squares are shown.
I the teacher also want by means of BYOB to learn children to programming. But the full transfer into language habitual by it is for this purpose necessary.
Developers! Help me to bypass this glitch!

And other important question: We do not have Internet on computers.
Therefore an important question: How to start BYOB 4 (SNAP) locally?

Offline

 

#4084 2011-11-17 14:10:04

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Khokhulin wrote:

And other important question: We do not have Internet on computers.
Therefore an important question: How to start BYOB 4 (SNAP) locally?

i guess you'll have to do 'save page as'. maybe you should also download some .js files. anyway, it wouldn't be a very good idea, as it gets updated daily.
no idea about the dropdowns  sad

Offline

 

#4085 2011-11-17 15:59:56

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Khokhulin wrote:

And other important question: We do not have Internet on computers.
Therefore an important question: How to start BYOB 4 (SNAP) locally?

This is an HTML file that will allow to run the current version of Snap! without internet. I just compressed everything into one tiny little file.  big_smile


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#4086 2011-11-17 22:59:43

fanofcena
Scratcher
Registered: 2008-07-03
Posts: 1000+

Re: BYOB 3 - Discussion Thread

MathWizz wrote:

Khokhulin wrote:

And other important question: We do not have Internet on computers.
Therefore an important question: How to start BYOB 4 (SNAP) locally?

This is an HTML file that will allow to run the current version of Snap! without internet. I just compressed everything into one tiny little file.  big_smile

Or pressing ctrl + s  on the pGe works


http://i53.tinypic.com/2vxr2c0.png Click whats above u might make a cute planet happy ^_^

Offline

 

#4087 2011-11-17 23:03:07

fanofcena
Scratcher
Registered: 2008-07-03
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Jens wrote:

Okay, Xavier, seems like you have two issues with lists. The first is how to initialize them and the second is about inspecting large lists in the watcher.

1) Initializing lists

In Snap 4 lists are different from Scratch and BYOB 3 in that we no longer have "named" lists that are created by pressing a "make a list" button. Instead we have - untyped - variables and first class lists. That's why you have to assign an - unnamed - list to a variable before using that variable in list blocks. That's not a bug but a new feature of variable watchers, that they now let you interact with lists, too (any variable watcher, for that matter).

2) Inspecting large lists

I can reproduce the problem with large lists in Firefox. Chrome seems to be more robust in that respect. I think one way to deal with this would be to only show a certain number of list items in the watcher (e.g. 100) along with a drow-down menu that lets you select other list ranges. In fact, I'll implement a version of this tonight, so you can play with it ouver the weekend...

Thanks again for the rigid testing!

@jens in that case its ffoxmem leak and slow canvas renderer i waa wondering why cant the list watcher be a aimple div placex in position using css with overflow scroll it will serve as a much  better list watcher then canvas rendering


http://i53.tinypic.com/2vxr2c0.png Click whats above u might make a cute planet happy ^_^

Offline

 

#4088 2011-11-17 23:44:51

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: BYOB 3 - Discussion Thread

fanofcena wrote:

MathWizz wrote:

Khokhulin wrote:

And other important question: We do not have Internet on computers.
Therefore an important question: How to start BYOB 4 (SNAP) locally?

This is an HTML file that will allow to run the current version of Snap! without internet. I just compressed everything into one tiny little file.  big_smile

Or pressing ctrl + s  on the pGe works

It only downloads the HTML file and not the js files in Chrome for me.  neutral


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#4089 2011-11-18 06:50:29

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

Re: BYOB 3 - Discussion Thread

okay, gang, could you please play with lists and list-watchers in our Snap pre-alpha version again, because last night I reworked the watcher to - hopefully - improve performance and stability. Now the watcher only diplays a range of 100 list items, but you can navigate to other index-ranges by way of a littly drop-down menu that pops up when you either click on the (new) down-arrow below the vertical scroll bar (above the resize handle) or on the length indicator at the bottom of the watcher.

Thanks!


Jens Mönig

Offline

 

#4090 2011-11-18 09:02:15

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

Re: BYOB 3 - Discussion Thread

Jens wrote:

okay, gang, could you please play with lists and list-watchers in our Snap pre-alpha version again, because last night I reworked the watcher to - hopefully - improve performance and stability. Now the watcher only diplays a range of 100 list items, but you can navigate to other index-ranges by way of a littly drop-down menu that pops up when you either click on the (new) down-arrow below the vertical scroll bar (above the resize handle) or on the length indicator at the bottom of the watcher.

Thanks!

Can you watch nested lists? I tried, but it the watcher turned very weird looking in Firefox (Mac) when I tried, and Safari just told me I had an unresponsive script.


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

Offline

 

#4091 2011-11-18 09:32:18

xly
Scratcher
Registered: 2010-04-17
Posts: 100+

Re: BYOB 3 - Discussion Thread

@Jens
The drop-down menu of list-box is blocked.
Yesterday I've finally decided to switch to Chrome for Snap!, but only dedicated to Snap!, without anything else (plugins, extensions etc). It seems to fit better to Snap! than Firefox.

Offline

 

#4092 2011-11-18 09:48:23

fanofcena
Scratcher
Registered: 2008-07-03
Posts: 1000+

Re: BYOB 3 - Discussion Thread

xly wrote:

@Jens
The drop-down menu of list-box is blocked.
Yesterday I've finally decided to switch to Chrome for Snap!, but only dedicated to Snap!, without anything else (plugins, extensions etc). It seems to fit better to Snap! than Firefox.

GOD wrote:

Here is a small list of what a browser is good for

Chrome : Canvas & WebGL rendering (like snap has)

Firefox : Robust performance with CSS 3 (the fastest web)

Internet Explorer : To download the above said two browser.

@Jens tested on andriod -_- u seriously dont wanna know what happened,

T.T sowee i dont have a laptop with me right now


:> will give response ASAP.

Last edited by fanofcena (2011-11-18 09:50:35)


http://i53.tinypic.com/2vxr2c0.png Click whats above u might make a cute planet happy ^_^

Offline

 

#4093 2011-11-18 11:06:06

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: BYOB 3 - Discussion Thread

@jens: works, SLOW  hmm , but works...
maybe try css3 as fanofcena said?

Offline

 

#4094 2011-11-18 12:33:14

fanofcena
Scratcher
Registered: 2008-07-03
Posts: 1000+

Re: BYOB 3 - Discussion Thread

roijac wrote:

@jens: works, SLOW  hmm , but works...
maybe try css3 as fanofcena said?

What I said is CSS2 very simple div placements using JS... It will be optimized and superior - with a small amount of tweaking a div with an input tag for each element in the list will serve as a superb solution. I can write CSS but not on my cell.  sad   sad   sad


I am uploading my server side scratch soon in here hopefully u will like it ^^

Last edited by fanofcena (2011-11-18 12:37:14)


http://i53.tinypic.com/2vxr2c0.png Click whats above u might make a cute planet happy ^_^

Offline

 

#4095 2011-11-18 17:58:11

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

Re: BYOB 3 - Discussion Thread

Everything works well for me!  smile

Offline

 

#4096 2011-11-18 18:22:45

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Jens wrote:

okay, gang, could you please play with lists and list-watchers in our Snap pre-alpha version again, because last night I reworked the watcher to - hopefully - improve performance and stability. Now the watcher only diplays a range of 100 list items, but you can navigate to other index-ranges by way of a littly drop-down menu that pops up when you either click on the (new) down-arrow below the vertical scroll bar (above the resize handle) or on the length indicator at the bottom of the watcher.

Thanks!

If you wanted a super-performant list structure, I could try to implement virtual lists. Then you could have a list of millions of items with no less performance, all in one big page.


nXIII

Offline

 

#4097 2011-11-18 19:55:02

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

Re: BYOB 3 - Discussion Thread

nXIII wrote:

If you wanted a super-performant list structure, I could try to implement virtual lists. Then you could have a list of millions of items with no less performance, all in one big page.

I think it's the display, not the accessing, that's at issue.

But, n, we talked about this...  I want hybrid lists, that are linked car/cdr lists if you do reporters on them and dynamic arrays if you do commands on them.  And they convert back and forth if you send the wrong message to the kind of list you have.  All invisibly to the user except that if you mix modes things slow down.


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

Offline

 

#4098 2011-11-18 21:54:54

fanofcena
Scratcher
Registered: 2008-07-03
Posts: 1000+

Re: BYOB 3 - Discussion Thread

bharvey wrote:

nXIII wrote:

If you wanted a super-performant list structure, I could try to implement virtual lists. Then you could have a list of millions of items with no less performance, all in one big page.

I think it's the display, not the accessing, that's at issue.

But, n, we talked about this...  I want hybrid lists, that are linked car/cdr lists if you do reporters on them and dynamic arrays if you do commands on them.  And they convert back and forth if you send the wrong message to the kind of list you have.  All invisibly to the user except that if you mix modes things slow down.

The amount of data inside the list is slowing it down whwen rendering as bharvey said , hence i dnt think virtual list are going to change the situation. But maybe writing a dom approach will be a plus as dom is mich much faster then canvas with native aupport for scrollers


http://i53.tinypic.com/2vxr2c0.png Click whats above u might make a cute planet happy ^_^

Offline

 

#4099 2011-11-18 22:28:23

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Virtual lists only draw what is showing and nothing that isn't showing, therefore making drawing much faster.

Last edited by MathWizz (2011-11-18 22:29:08)


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#4100 2011-11-18 22:36:17

fanofcena
Scratcher
Registered: 2008-07-03
Posts: 1000+

Re: BYOB 3 - Discussion Thread

MathWizz wrote:

Virtual lists only draw what is showing and nothing that isn't showing, therefore making drawing much faster.

Inst jens already implementing that ?
also why make a 100 line extra code when the browser has a native Accelerated support for the purpose ?

Code:

<!-- Requires jQuery and Draggable widget from jQuery UI just to make things look small -->
<script>

  // Creator
  function Cr8(name){
   // Native list creation code
   // For convinience lets assume lists goes to window.arrays object
   $('#canvas').append('<div id="'+name+'" style="top:200px;left:300px">');
   $('#'+name).data('id',name); // Pointers cannot be used here (upto the best of my knowledge hence just using the reference )
   $('#List1').draggable({
    container:'world';
   });  
 }
  // The code to change the stuff 
  $('#List1').children('input').bind('change',function(){
     window.arrays[$(this).parent().data('id')][$(this).data('index')] = $(this).attr('value'); // Oh and yes that $(this).data('index'); can be replaced by finding which child of the parent is this input tag .
  });
   
  );
</script>
Working output should look like this :

<div id="List1" style="top:200px;left:300px;height:300px;overflow-y:auto;">
 <input type="text">Hello</input>
 <input type="text">Hello</input>
 <input type="text">Hello</input>
</div>

the above code is what i can code from my andriod so may have some typing errors but it pretty much tells how to actually do the stuff of lists using CSS

Last edited by fanofcena (2011-11-18 22:39:10)


http://i53.tinypic.com/2vxr2c0.png Click whats above u might make a cute planet happy ^_^

Offline

 

Board footer