MathGroup Archive 1998

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Protection against some Front end problems and crashes

  • To: mathgroup at smc.vnet.net
  • Subject: [mg13201] Re: Protection against some Front end problems and crashes
  • From: "Allan Hayes" <hay at haystack.demon.cc.uk>
  • Date: Mon, 13 Jul 1998 07:42:50 -0400
  • References: <6n6i1o$uo$1@dragonfly.wolfram.com> <6nc6og$fas@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Torben Winther Graversen wrote in message <6nc6og$fas at smc.vnet.net>...
>Barthelet, Luc (lucb at ea.com) wrote:
>
>: As mentionned in a few messages recently it is not uncommon to make a
>: mistake and then get a huge output to be generated. When that happens,
>: one is either stuck for a long time or crashes.
>
>[...]
>
>: reallyBig[x_] := If[ByteCount[x] > 200000, "Too Large", x];
>:   $Post = reallyBig;
>
>: It will replace any "large" output by the string "Too Large". I cannot
>: count how many times this saved me. Hope it helps you too.
>
>[...]
>
>However, a large plot of 10000 points will easily produce an output
>greater than 200000, but it will be formatted as "- SurfaceGraphics -",
>which is no problem to the frontend.

>Any suggestions for a way to only print "Too Large" when the formatted form
actually
> generates a huge amount of data?

Torben:

reallyBig[x_] :=
If[ByteCount[x] > 20 &&
 !MatchQ[
  Head[x],
  Graphics|Graphics3D|SurfaceGraphics|
  ContourGraphics|GraphicsArray|DensityGraphics
 ],
 Short[x], (*or "Too Large" or Shallow[x]*)
 x
];
$Post= reallyBig;

Allan,


------------------------------------------------------------- Allan
HayesTraining and Consulting
Leicester UK
http://www.haystack.demon.co.uk
hay at haystack.demon.co.uk
voice: +44 (0)116 271 4198
fax: +44(0)116 271 8642





  • Prev by Date: Ugly Trig Mess
  • Next by Date: Re: Derivatives D[ ] as Functions inside Tables; Need Help!
  • Previous by thread: Ugly Trig Mess
  • Next by thread: nlim error message using an NIntegrate function in Plot[]