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
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
Last edited by fanofcena (2011-11-17 06:32:23)
Offline
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.
Offline
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!
Offline
@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
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.
Offline
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?
Offline
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
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
Offline
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.
Offline
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.
Or pressing ctrl + s on the pGe works
Offline
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
Offline
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.
Or pressing ctrl + s on the pGe works
It only downloads the HTML file and not the js files in Chrome for me.
Offline
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!
Offline
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.
Offline
@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
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)
Offline
roijac wrote:
@jens: works, SLOW , 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.
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)
Offline
Everything works well for me!
Offline
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.
Offline
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.
Offline
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
Offline
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 ?
<!-- 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)
Offline