[Scilab-users] Accidentally displaying huge matrices

classic Classic list List threaded Threaded
20 messages Options
Tim Wescott Tim Wescott
Reply | Threaded
Open this post in threaded view
|

[Scilab-users] Accidentally displaying huge matrices

If you're working with something humongous and you do some operation
that displays, it takes forever before your mistake is done displaying.

E.g., if x is 100000 elements long and you type

y = exp(x)

instead of

y = exp(x);

So I have two questions:

First, is there a way to get it to stop?  ctrl-C does not do the job.

Second, if not, could someone file an enhancement request, or remind me
how to do it?

TIA

--

Tim Wescott
www.wescottdesign.com
Control & Communications systems, circuit & software design.
Phone: 503.631.7815
Cell:  503.349.8432


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Antoine Monmayrant-2 Antoine Monmayrant-2
Reply | Threaded
Open this post in threaded view
|

Re: Accidentally displaying huge matrices

 
Le Jeudi 21 Mai 2015 17:48 CEST, Tim Wescott <[hidden email]> a écrit:
 

> If you're working with something humongous and you do some operation
> that displays, it takes forever before your mistake is done displaying.
>
> E.g., if x is 100000 elements long and you type
>
> y = exp(x)
>
> instead of
>
> y = exp(x);
>
> So I have two questions:
>
> First, is there a way to get it to stop?  ctrl-C does not do the job.
>
> Second, if not, could someone file an enhancement request, or remind me
> how to do it?
>
> TIA
>
> --
>
> Tim Wescott
> www.wescottdesign.com
> Control & Communications systems, circuit & software design.
> Phone: 503.631.7815
> Cell:  503.349.8432
>
>
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/users
>

Me too!
If there is a way to interrupt the display of a huge variable, I'll be happy to know it.
If not, it's worth writting a feature request.
It's a common mistake to forget a ";" when doing some data processing/debugging on the fly and it's such a pain to wait forever for your "fat-fingering" to finish.
To misquote xkcd ( https://xkcd.com/303/ ):

<<The #1 scilab user excuse for legitimately slacking off: "my data is displaying".>>

Antoine
 
 


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
mottelet mottelet
Reply | Threaded
Open this post in threaded view
|

Re: Accidentally displaying huge matrices

Le 22/05/2015 02:42, Antoine Monmayrant a écrit :

>  
> Le Jeudi 21 Mai 2015 17:48 CEST, Tim Wescott <[hidden email]> a écrit:
>  
>> If you're working with something humongous and you do some operation
>> that displays, it takes forever before your mistake is done displaying.
>>
>> E.g., if x is 100000 elements long and you type
>>
>> y = exp(x)
>>
>> instead of
>>
>> y = exp(x);
>>
>> So I have two questions:
>>
>> First, is there a way to get it to stop?  ctrl-C does not do the job.
>>
>> Second, if not, could someone file an enhancement request, or remind me
>> how to do it?
>>
>> TIA
>>
>> --
>>
>> Tim Wescott
>> www.wescottdesign.com
>> Control & Communications systems, circuit & software design.
>> Phone: 503.631.7815
>> Cell:  503.349.8432
>>
>>
>> _______________________________________________
>> users mailing list
>> [hidden email]
>> http://lists.scilab.org/mailman/listinfo/users
>>
> Me too!
> If there is a way to interrupt the display of a huge variable, I'll be happy to know it.
> If not, it's worth writting a feature request.
> It's a common mistake to forget a ";" when doing some data processing/debugging on the fly and it's such a pain to wait forever for your "fat-fingering" to finish.
> To misquote xkcd ( https://xkcd.com/303/ ):
>
> <<The #1 scilab user excuse for legitimately slacking off: "my data is displaying".>>
>
> Antoine
>  
>  
>
>
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/users
Hello,

Here's the behavior of Julia in such a situation, it displays dots in
order that the matrix fits the console :

julia> a=rand(1000,1000)
1000x1000 Array{Float64,2}:
  0.297296   0.695023   0.12543   …  0.0390378  0.121275   0.797062
  0.402998   0.357607   0.191826     0.279725   0.0920303  0.467992
  0.157744   0.277739   0.171729     0.866273   0.515654   0.552807
  0.983393   0.295298   0.824318     0.0157045  0.0258212  0.0930282
  0.17687    0.316168   0.708928     0.0952159  0.0667878  0.393212
  0.854294   0.742688   0.976253  …  0.515331   0.665953   0.390016
  0.788685   0.223257   0.288901     0.144894   0.154689   0.29596
  0.355145   0.610686   0.3717       0.779741   0.234286   0.547859
  0.749667   0.48559    0.604402     0.100194   0.655009   0.806418
  0.990547   0.986391   0.578132     0.0591879  0.203927   0.299021
  ⋮                               ⋱
  0.974187   0.042388   0.899955     0.662621   0.524229   0.862864
  0.592462   0.0955458  0.335428     0.0547896  0.0658267  0.49732
  0.373501   0.729753   0.610205     0.111113   0.210496   0.547695
  0.156943   0.84622    0.814482     0.600968   0.544893   0.205719
  0.139698   0.030804   0.239184  …  0.737796   0.887846   0.547925
  0.706966   0.472414   0.911365     0.670605   0.984223   0.197314
  0.0927397  0.765639   0.261038     0.859728   0.808865   0.782755
  0.653529   0.358696   0.350873     0.581111   0.127847   0.461723
  0.0687691  0.317925   0.615902     0.610041   0.196348   0.219813

S.
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

Re: Accidentally displaying huge matrices

In reply to this post by Tim Wescott
Hello Tim,

Le 21/05/2015 17:48, Tim Wescott a écrit :
> .../...
> First, is there a way to get it to stop?  ctrl-C does not do the job.
In your startup file .scilab or scilab.ini, you may add the instruction
lines(1000)
in order to turn on the pager and make it prompting the user to continue
listing lines after each block of 1000 lines (or whatever you want).
At the prompt, CTRL+C + abort works.

Regards
Samuel

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Antoine Monmayrant-2 Antoine Monmayrant-2
Reply | Threaded
Open this post in threaded view
|

Re: Accidentally displaying huge matrices

 
Le Samedi 23 Mai 2015 00:05 CEST, Samuel Gougeon <[hidden email]> a écrit:
 

> Hello Tim,
>
> Le 21/05/2015 17:48, Tim Wescott a écrit :
> > .../...
> > First, is there a way to get it to stop?  ctrl-C does not do the job.
> In your startup file .scilab or scilab.ini, you may add the instruction
> lines(1000)
> in order to turn on the pager and make it prompting the user to continue
> listing lines after each block of 1000 lines (or whatever you want).
> At the prompt, CTRL+C + abort works.

OK, but this also interrupts the execution of any script that display more than 1000 lines on the command line!
This can be particularly annoying when using scripts that process big data and  output some progression infos on the command line.
It's never nice to find out the next morning that your script stopped at 10% to ask whether it should keep on displaying text.
For me, this is more a workaround (with one big caveat) than a real solution.
The Julia way of displaying big matrices seems interesting.
Would it be hard to implement?
(honest question, I have no idea what work it implies)
As someone filled a bug/feature request?

Cheers,

Antoine

>
> Regards
> Samuel
>
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/users
>
 
 
 
 


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

[Scilab-users] unwrapped display in console <= Re: Accidentally displaying huge matrices

In reply to this post by mottelet
Hello,

Le 21/05/2015 23:19, Stéphane Mottelet a écrit :

> .../...
> Hello,
>
> Here's the behavior of Julia in such a situation, it displays dots in
> order that the matrix fits the console :
>
> julia> a=rand(1000,1000)
> 1000x1000 Array{Float64,2}:
>  0.297296   0.695023   0.12543   …  0.0390378  0.121275   0.797062
> 0.749667   0.48559    0.604402     0.100194   0.655009   0.806418
>  0.990547   0.986391   0.578132     0.0591879  0.203927   0.299021
>  ⋮                               ⋱
>  0.974187   0.042388   0.899955     0.662621   0.524229   0.862864
>  0.592462   0.0955458  0.335428     0.0547896  0.0658267  0.49732
> 0.653529   0.358696   0.350873     0.581111   0.127847   0.461723
>  0.0687691  0.317925   0.615902     0.610041   0.196348   0.219813
>
> S.

Another way would be to have an non-wrapping display mode: each line of
a matrix (or anything else) would be displayed on a single line in the
console, without wrapping. This could make hugely wide lines, that
nevertheless could be easily browsed using the horizontal scroll bar. In
addition, such a mode could enable displaying columns numbers in header
; this could be repeated every console_height lines.
Specifying a negative console width could trigger this behavior.

Samuel

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Serge Steer-3 Serge Steer-3
Reply | Threaded
Open this post in threaded view
|

Re: Accidentally displaying huge matrices

In reply to this post by Antoine Monmayrant-2
Le 25/05/2015 15:29, Antoine Monmayrant a écrit :

>  
> Le Samedi 23 Mai 2015 00:05 CEST, Samuel Gougeon <[hidden email]> a écrit:
>  
>> Hello Tim,
>>
>> Le 21/05/2015 17:48, Tim Wescott a écrit :
>>> .../...
>>> First, is there a way to get it to stop?  ctrl-C does not do the job.
>> In your startup file .scilab or scilab.ini, you may add the instruction
>> lines(1000)
>> in order to turn on the pager and make it prompting the user to continue
>> listing lines after each block of 1000 lines (or whatever you want).
>> At the prompt, CTRL+C + abort works.
> OK, but this also interrupts the execution of any script that display more than 1000 lines on the command line!
> This can be particularly annoying when using scripts that process big data and  output some progression infos on the command line.
If one as set lines(1000), it is possible to stop the display just
entering "n" when the system proposes to continue or to stop the display.

> It's never nice to find out the next morning that your script stopped at 10% to ask whether it should keep on displaying text.
> For me, this is more a workaround (with one big caveat) than a real solution.
> The Julia way of displaying big matrices seems interesting.
> Would it be hard to implement?
> (honest question, I have no idea what work it implies)
> As someone filled a bug/feature request?
>
> Cheers,
>
> Antoine
>
>> Regards
>> Samuel
>>
>> _______________________________________________
>> users mailing list
>> [hidden email]
>> http://lists.scilab.org/mailman/listinfo/users
>>
>  
>  
>  
>  
>
>
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/users

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Antoine Monmayrant Antoine Monmayrant
Reply | Threaded
Open this post in threaded view
|

Re: Accidentally displaying huge matrices

Le 05/26/2015 11:34 AM, Serge Steer a écrit :

> Le 25/05/2015 15:29, Antoine Monmayrant a écrit :
>>  
>> Le Samedi 23 Mai 2015 00:05 CEST, Samuel Gougeon <[hidden email]> a écrit:
>>  
>>> Hello Tim,
>>>
>>> Le 21/05/2015 17:48, Tim Wescott a écrit :
>>>> .../...
>>>> First, is there a way to get it to stop?  ctrl-C does not do the job.
>>> In your startup file .scilab or scilab.ini, you may add the instruction
>>> lines(1000)
>>> in order to turn on the pager and make it prompting the user to continue
>>> listing lines after each block of 1000 lines (or whatever you want).
>>> At the prompt, CTRL+C + abort works.
>> OK, but this also interrupts the execution of any script that display more than 1000 lines on the command line!
>> This can be particularly annoying when using scripts that process big data and  output some progression infos on the command line.
> If one as set lines(1000), it is possible to stop the display just
> entering "n" when the system proposes to continue or to stop the display.

Exactly, and all the calculations are stopped, waiting for the user input.
If this occurs in the middle of the night while the user is sleeping, it
means half a night of calculations wasted.
It occured to me a couple of times and it's a pain.

Antoine

>> It's never nice to find out the next morning that your script stopped at 10% to ask whether it should keep on displaying text.
>> For me, this is more a workaround (with one big caveat) than a real solution.
>> The Julia way of displaying big matrices seems interesting.
>> Would it be hard to implement?
>> (honest question, I have no idea what work it implies)
>> As someone filled a bug/feature request?
>>
>> Cheers,
>>
>> Antoine
>>
>>> Regards
>>> Samuel
>>>
>>> _______________________________________________
>>> users mailing list
>>> [hidden email]
>>> http://lists.scilab.org/mailman/listinfo/users
>>>
>>  
>>  
>>  
>>  
>>
>>
>> _______________________________________________
>> users mailing list
>> [hidden email]
>> http://lists.scilab.org/mailman/listinfo/users
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/users
>


--
+++++++++++++++++++++++++++++++++++++++++++++++++++++++

  Antoine Monmayrant LAAS - CNRS
  7 avenue du Colonel Roche
  BP 54200
  31031 TOULOUSE Cedex 4
  FRANCE

  Tel:+33 5 61 33 64 59
 
  email : [hidden email]
  permanent email : [hidden email]

+++++++++++++++++++++++++++++++++++++++++++++++++++++++

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
mottelet mottelet
Reply | Threaded
Open this post in threaded view
|

Re: Accidentally displaying huge matrices

In reply to this post by Serge Steer-3
btw how can you overload the display of double matrices ?

S.

Le 26/05/2015 11:34, Serge Steer a écrit :

> Le 25/05/2015 15:29, Antoine Monmayrant a écrit :
>>  
>> Le Samedi 23 Mai 2015 00:05 CEST, Samuel Gougeon <[hidden email]> a écrit:
>>  
>>> Hello Tim,
>>>
>>> Le 21/05/2015 17:48, Tim Wescott a écrit :
>>>> .../...
>>>> First, is there a way to get it to stop?  ctrl-C does not do the job.
>>> In your startup file .scilab or scilab.ini, you may add the instruction
>>> lines(1000)
>>> in order to turn on the pager and make it prompting the user to continue
>>> listing lines after each block of 1000 lines (or whatever you want).
>>> At the prompt, CTRL+C + abort works.
>> OK, but this also interrupts the execution of any script that display more than 1000 lines on the command line!
>> This can be particularly annoying when using scripts that process big data and  output some progression infos on the command line.
> If one as set lines(1000), it is possible to stop the display just
> entering "n" when the system proposes to continue or to stop the display.
>> It's never nice to find out the next morning that your script stopped at 10% to ask whether it should keep on displaying text.
>> For me, this is more a workaround (with one big caveat) than a real solution.
>> The Julia way of displaying big matrices seems interesting.
>> Would it be hard to implement?
>> (honest question, I have no idea what work it implies)
>> As someone filled a bug/feature request?
>>
>> Cheers,
>>
>> Antoine
>>
>>> Regards
>>> Samuel
>>>
>>> _______________________________________________
>>> users mailing list
>>> [hidden email]
>>> http://lists.scilab.org/mailman/listinfo/users
>>>
>>  
>>  
>>  
>>  
>>
>>
>> _______________________________________________
>> users mailing list
>> [hidden email]
>> http://lists.scilab.org/mailman/listinfo/users
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/users


--
Département de Génie Informatique
EA 4297 Transformations Intégrées de la Matière Renouvelable
Université de Technologie de Compiègne -  CS 60319
60203 Compiègne cedex

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

Re: Accidentally displaying huge matrices

>btw how can you overload the display of double matrices ?

you can redefine disp(), but AFAIK it is not possible to overload the default display for native types such as booleans, decimal or complex numbers, strings...
For instance, if you define %s_p(), it won't never be called when displaying a matrix of decimals or complexes.

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Tim Wescott Tim Wescott
Reply | Threaded
Open this post in threaded view
|

Re: Accidentally displaying huge matrices

In reply to this post by Antoine Monmayrant-2
On Mon, 2015-05-25 at 15:29 +0200, Antoine Monmayrant wrote:

>  Le Samedi 23 Mai 2015 00:05 CEST, Samuel Gougeon <[hidden email]> a écrit:
>  
> > Hello Tim,
> >
> > Le 21/05/2015 17:48, Tim Wescott a écrit :
> > > .../...
> > > First, is there a way to get it to stop?  ctrl-C does not do the job.
> > In your startup file .scilab or scilab.ini, you may add the instruction
> > lines(1000)
> > in order to turn on the pager and make it prompting the user to continue
> > listing lines after each block of 1000 lines (or whatever you want).
> > At the prompt, CTRL+C + abort works.
>
> OK, but this also interrupts the execution of any script that display more than 1000 lines on the command line!
> This can be particularly annoying when using scripts that process big data and  output some progression infos on the command line.
> It's never nice to find out the next morning that your script stopped at 10% to ask whether it should keep on displaying text.
> For me, this is more a workaround (with one big caveat) than a real solution.
> The Julia way of displaying big matrices seems interesting.
> Would it be hard to implement?
> (honest question, I have no idea what work it implies)
> As someone filled a bug/feature request?

Argh.  I just did the lines(1000) thing, and now I think I'm going to
take it out, because I do NOT want this to happen!

Is it all that hard to interrupt the display of a large matrix with
ctrl-C?

(I vote for the Julia way of displaying things, even though I have no
clue what Julia is, BTW).

--

Tim Wescott
www.wescottdesign.com
Control & Communications systems, circuit & software design.
Phone: 503.631.7815
Cell:  503.349.8432


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Antoine Monmayrant-2 Antoine Monmayrant-2
Reply | Threaded
Open this post in threaded view
|

Re: Accidentally displaying huge matrices

 
Le Mardi 26 Mai 2015 19:03 CEST, Tim Wescott <[hidden email]> a écrit:
 

> On Mon, 2015-05-25 at 15:29 +0200, Antoine Monmayrant wrote:
> >  Le Samedi 23 Mai 2015 00:05 CEST, Samuel Gougeon <[hidden email]> a écrit:
> >  
> > > Hello Tim,
> > >
> > > Le 21/05/2015 17:48, Tim Wescott a écrit :
> > > > .../...
> > > > First, is there a way to get it to stop?  ctrl-C does not do the job.
> > > In your startup file .scilab or scilab.ini, you may add the instruction
> > > lines(1000)
> > > in order to turn on the pager and make it prompting the user to continue
> > > listing lines after each block of 1000 lines (or whatever you want).
> > > At the prompt, CTRL+C + abort works.
> >
> > OK, but this also interrupts the execution of any script that display more than 1000 lines on the command line!
> > This can be particularly annoying when using scripts that process big data and  output some progression infos on the command line.
> > It's never nice to find out the next morning that your script stopped at 10% to ask whether it should keep on displaying text.
> > For me, this is more a workaround (with one big caveat) than a real solution.
> > The Julia way of displaying big matrices seems interesting.
> > Would it be hard to implement?
> > (honest question, I have no idea what work it implies)
> > As someone filled a bug/feature request?
>
> Argh.  I just did the lines(1000) thing, and now I think I'm going to
> take it out, because I do NOT want this to happen!
>
> Is it all that hard to interrupt the display of a large matrix with
> ctrl-C?
>
> (I vote for the Julia way of displaying things, even though I have no
> clue what Julia is, BTW).

It's a fairly new language that aims at solvaing the two language problem, ie reducing the gap between interactive, easy to use and prototype in but also slow languages (scilab, matlab, python, ...) and more efficient and less friendly languages (C, Fortran, ...).
It's new and still evolving a lot but quite interesting (more info at julialang.org).

But back to the discussion, I also think that the julia way of displaying is a good solution.

>
> --
>
> Tim Wescott
> www.wescottdesign.com
> Control & Communications systems, circuit & software design.
> Phone: 503.631.7815
> Cell:  503.349.8432
>
>
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/users
>
 
 
 
 


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Serge Steer-3 Serge Steer-3
Reply | Threaded
Open this post in threaded view
|

Re: Accidentally displaying huge matrices

In reply to this post by Antoine Monmayrant-2
For me displaying a huge matrix (or huge structure) on the screen has in
general no interest. So it should be convenient to display only its size
and type as it is done when displaying a struct which contain a large array:
-->S.A=rand(1000,1000)
S  =
 
   A: [1000x1000 constant]
This solution can be set as a default display mode, keeping others as
options.

Serge Steer

 25/05/2015 15:29, Antoine Monmayrant a écrit :

>  
> Le Samedi 23 Mai 2015 00:05 CEST, Samuel Gougeon <[hidden email]> a écrit:
>  
>> Hello Tim,
>>
>> Le 21/05/2015 17:48, Tim Wescott a écrit :
>>> .../...
>>> First, is there a way to get it to stop?  ctrl-C does not do the job.
>> In your startup file .scilab or scilab.ini, you may add the instruction
>> lines(1000)
>> in order to turn on the pager and make it prompting the user to continue
>> listing lines after each block of 1000 lines (or whatever you want).
>> At the prompt, CTRL+C + abort works.
> OK, but this also interrupts the execution of any script that display more than 1000 lines on the command line!
> This can be particularly annoying when using scripts that process big data and  output some progression infos on the command line.
> It's never nice to find out the next morning that your script stopped at 10% to ask whether it should keep on displaying text.
> For me, this is more a workaround (with one big caveat) than a real solution.
> The Julia way of displaying big matrices seems interesting.
> Would it be hard to implement?
> (honest question, I have no idea what work it implies)
> As someone filled a bug/feature request?
>
> Cheers,
>
> Antoine
>
>> Regards
>> Samuel
>>
>> _______________________________________________
>> users mailing list
>> [hidden email]
>> http://lists.scilab.org/mailman/listinfo/users
>>
>  
>  
>  
>  
>
>
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/users

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Alain LAMY Alain LAMY
Reply | Threaded
Open this post in threaded view
|

Re: Accidentally displaying huge matrices

It does not seem so simple to me.

A = rand(1000, 1000);

disp(A)
=> we probably don't want see all the values
               
disp(A(1:100,1))
=> we probably expect to see all the elements from 1 to 100 (for debugging purposes)

A = [1,2; 3,4]
=> we expect to see [1,2; 3,4]

L = list of 1000 elements
disp(L)
=> we don't necessarily want all the values displayed
(but sometimes we want)

etc...

Maybe define a second function  ?

disp => displays in the "julia" way (for instance)
disp_all =>  display all elements whatever the size (it's the user responsibility to limit the size to something reasonable)

 
Alain


-----Message d'origine-----
De : users [mailto:[hidden email]] De la part de Serge Steer
Envoyé : mercredi 27 mai 2015 09:41
À : International users mailing list for Scilab.
Objet : Re: [Scilab-users] Accidentally displaying huge matrices

For me displaying a huge matrix (or huge structure) on the screen has in general no interest. So it should be convenient to display only its size and type as it is done when displaying a struct which contain a large array:
-->S.A=rand(1000,1000)
S  =
 
   A: [1000x1000 constant]
This solution can be set as a default display mode, keeping others as options.


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

Re: Accidentally displaying huge matrices

Le 27/05/2015 10:06, Lamy Alain a écrit :
> Maybe define a second function  ?
>
> disp => displays in the "julia" way (for instance)
> disp_all =>  display all elements whatever the size (it's the user responsibility to limit the size to something reasonable)
I guess that Serge was wondering about the default display, when an
instruction is not followed by ";".
disp() is something else. When we use disp(), the output is intentional
and required. So there should not have any abstract with disp().

For the default output, i rather agree with Serge. But the limit between
a full display and an abstract should be tunable (in addition to a
switch to an non-wrapped mode).
For instance, a max number of lines set through lines() <0 could mean
that an abstract is preferred for taller output. If it is >0, the
pagging mode is preferred. And if it is 0, no limit would be set (as it
is presently).

Samuel

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Serge Steer-3 Serge Steer-3
Reply | Threaded
Open this post in threaded view
|

Re: Accidentally displaying huge matrices

Le 27/05/2015 10:46, Samuel Gougeon a écrit :

> Le 27/05/2015 10:06, Lamy Alain a écrit :
>> Maybe define a second function  ?
>>
>> disp => displays in the "julia" way (for instance)
>> disp_all =>  display all elements whatever the size (it's the user
>> responsibility to limit the size to something reasonable)
> I guess that Serge was wondering about the default display, when an
> instruction is not followed by ";".
> disp() is something else. When we use disp(), the output is
> intentional and required. So there should not have any abstract with
> disp().
>
> For the default output, i rather agree with Serge. But the limit
> between a full display and an abstract should be tunable (in addition
> to a switch to an non-wrapped mode).
> For instance, a max number of lines set through lines() <0 could mean
> that an abstract is preferred for taller output. If it is >0, the
> pagging mode is preferred. And if it is 0, no limit would be set (as
> it is presently).
>
Just take care that lines() does not rule olny the display of a
variable, it also rules the display of all outputs generated by an
intruction as in the following example:

lines(10)
for i=1:20,i,end


Serge
> Samuel
>
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/users

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Vincent COUVERT-2 Vincent COUVERT-2
Reply | Threaded
Open this post in threaded view
|

Re: Accidentally displaying huge matrices

Hi all,

What would you think about a feature describe as follows?

We coud add a specific calling sequence for lines function (e.g
lines(-1000)) that will switch automatically the display of Scilab to
the "short" mode [1000x1000 constant] for a matrix (or hypermatrix)
having a dimension greater that 1000.

Regards.

Le 27/05/2015 11:02, Serge Steer a écrit :

> Le 27/05/2015 10:46, Samuel Gougeon a écrit :
>> Le 27/05/2015 10:06, Lamy Alain a écrit :
>>> Maybe define a second function  ?
>>>
>>> disp => displays in the "julia" way (for instance)
>>> disp_all =>  display all elements whatever the size (it's the user
>>> responsibility to limit the size to something reasonable)
>> I guess that Serge was wondering about the default display, when an
>> instruction is not followed by ";".
>> disp() is something else. When we use disp(), the output is
>> intentional and required. So there should not have any abstract with
>> disp().
>>
>> For the default output, i rather agree with Serge. But the limit
>> between a full display and an abstract should be tunable (in addition
>> to a switch to an non-wrapped mode).
>> For instance, a max number of lines set through lines() <0 could mean
>> that an abstract is preferred for taller output. If it is >0, the
>> pagging mode is preferred. And if it is 0, no limit would be set (as
>> it is presently).
>>
> Just take care that lines() does not rule olny the display of a
> variable, it also rules the display of all outputs generated by an
> intruction as in the following example:
>
> lines(10)
> for i=1:20,i,end
>
>
> Serge
>> Samuel
>>
>> _______________________________________________
>> users mailing list
>> [hidden email]
>> http://lists.scilab.org/mailman/listinfo/users
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/users

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Serge Steer-3 Serge Steer-3
Reply | Threaded
Open this post in threaded view
|

Re: Accidentally displaying huge matrices

Le 27/05/2015 14:15, Vincent COUVERT a écrit :
> Hi all,
>
> What would you think about a feature describe as follows?
>
> We coud add a specific calling sequence for lines function (e.g
> lines(-1000)) that will switch automatically the display of Scilab to
> the "short" mode [1000x1000 constant] for a matrix (or hypermatrix)
> having a dimension greater that 1000.
>
I think using lines(-1000) or a similar solution is not a good solution
because as I said lines function does not rules the display of a single
variable, but the display of all output generated by an instruction

In my opinion it should be better to extend the format function adding
an optional argument or modifying the function to allow syntax like
format("type","v","digits",10,"max_lines",100)
format("max_lines",100)

Serge

> Regards.
>
> Le 27/05/2015 11:02, Serge Steer a écrit :
>> Le 27/05/2015 10:46, Samuel Gougeon a écrit :
>>> Le 27/05/2015 10:06, Lamy Alain a écrit :
>>>> Maybe define a second function  ?
>>>>
>>>> disp => displays in the "julia" way (for instance)
>>>> disp_all =>  display all elements whatever the size (it's the user
>>>> responsibility to limit the size to something reasonable)
>>> I guess that Serge was wondering about the default display, when an
>>> instruction is not followed by ";".
>>> disp() is something else. When we use disp(), the output is
>>> intentional and required. So there should not have any abstract with
>>> disp().
>>>
>>> For the default output, i rather agree with Serge. But the limit
>>> between a full display and an abstract should be tunable (in addition
>>> to a switch to an non-wrapped mode).
>>> For instance, a max number of lines set through lines() <0 could mean
>>> that an abstract is preferred for taller output. If it is >0, the
>>> pagging mode is preferred. And if it is 0, no limit would be set (as
>>> it is presently).
>>>
>> Just take care that lines() does not rule olny the display of a
>> variable, it also rules the display of all outputs generated by an
>> intruction as in the following example:
>>
>> lines(10)
>> for i=1:20,i,end
>>
>>
>> Serge
>>> Samuel
>>>
>>> _______________________________________________
>>> users mailing list
>>> [hidden email]
>>> http://lists.scilab.org/mailman/listinfo/users
>> _______________________________________________
>> users mailing list
>> [hidden email]
>> http://lists.scilab.org/mailman/listinfo/users
>
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/users

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Tim Wescott Tim Wescott
Reply | Threaded
Open this post in threaded view
|

Re: Accidentally displaying huge matrices

In reply to this post by Serge Steer-3
With the caveat that the threshold size that determines what gets
displayed in its entirety and what doesn't is tunable, this works for
me.

The root problem that I'm addressing is the pitfall of doing something
that prints for ever and ever just because I forgot the ';'.

On Wed, 2015-05-27 at 09:41 +0200, Serge Steer wrote:

> For me displaying a huge matrix (or huge structure) on the screen has in
> general no interest. So it should be convenient to display only its size
> and type as it is done when displaying a struct which contain a large array:
> -->S.A=rand(1000,1000)
> S  =
>  
>    A: [1000x1000 constant]
> This solution can be set as a default display mode, keeping others as
> options.
>
> Serge Steer
>
>  25/05/2015 15:29, Antoine Monmayrant a écrit :
> >  
> > Le Samedi 23 Mai 2015 00:05 CEST, Samuel Gougeon <[hidden email]> a écrit:
> >  
> >> Hello Tim,
> >>
> >> Le 21/05/2015 17:48, Tim Wescott a écrit :
> >>> .../...
> >>> First, is there a way to get it to stop?  ctrl-C does not do the job.
> >> In your startup file .scilab or scilab.ini, you may add the instruction
> >> lines(1000)
> >> in order to turn on the pager and make it prompting the user to continue
> >> listing lines after each block of 1000 lines (or whatever you want).
> >> At the prompt, CTRL+C + abort works.
> > OK, but this also interrupts the execution of any script that display more than 1000 lines on the command line!
> > This can be particularly annoying when using scripts that process big data and  output some progression infos on the command line.
> > It's never nice to find out the next morning that your script stopped at 10% to ask whether it should keep on displaying text.
> > For me, this is more a workaround (with one big caveat) than a real solution.
> > The Julia way of displaying big matrices seems interesting.
> > Would it be hard to implement?
> > (honest question, I have no idea what work it implies)
> > As someone filled a bug/feature request?
> >
> > Cheers,
> >
> > Antoine
> >
> >> Regards
> >> Samuel
> >>
> >> _______________________________________________
> >> users mailing list
> >> [hidden email]
> >> http://lists.scilab.org/mailman/listinfo/users
> >>
> >  
> >  
> >  
> >  
> >
> >
> > _______________________________________________
> > users mailing list
> > [hidden email]
> > http://lists.scilab.org/mailman/listinfo/users
>
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/users

--

Tim Wescott
www.wescottdesign.com
Control & Communications systems, circuit & software design.
Phone: 503.631.7815
Cell:  503.349.8432


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

Re: Accidentally displaying huge matrices

In reply to this post by Vincent COUVERT-2
Le 27/05/2015 14:15, Vincent COUVERT a écrit :
> Hi all,
>
> What would you think about a feature describe as follows?
>
> We coud add a specific calling sequence for lines function (e.g
> lines(-1000)) that will switch automatically the display of Scilab to
> the "short" mode [1000x1000 constant] for a matrix (or hypermatrix)
> having a dimension greater that 1000.

I agree with Serge that my initial proposal using existing lines() flags
and just adding a sign convention is not good, for the reason he
explained, and also because such a convention would be closed, would
prevent any extension for further paging or overall formating modes.
But i disagree about extending format() instead, because presently
format() works only on formating numbers (for disp() and string()). This
would turn its role confused.

I would rather advice to keep lines() to implement new paging modes --
because it is already its job, not the format()'s one : Scilab's
format() is not Matlab's one --, but to extend its size.
Hence, L = lines(); L(3)=100 could be a new flag thresholding
full/abstract modes.
In the same way, a non-wrapping mode could be tuned through L(4),
instead of highjacking L(2) with any sign convention.

Finally, if a compact output mode without extra blank lines should be
implemented & switched, lines() would also be involved, not format().

Samuel

PS : format() could also be extended, in the first place for instance to
replace xset("fpf",v) -- that has still no set() equivalence ; but this
is another discussion.

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users