Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1998

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

Search the Archive

RE: Protection against some Fr

  • To: mathgroup at
  • Subject: [mg13038] RE: [mg12943] Protection against some Fr
  • From: Ersek_Ted%PAX1A at
  • Date: Sat, 4 Jul 1998 16:44:45 -0400
  • Sender: owner-wri-mathgroup at

  I would rather be more conservative and use: $ManyBytes=50000;
reallyBig[x_] := If[ByteCount[x] >$ManyBytes, "Too Large", x];
 $Post = reallyBig;

I can always temporarily change $ManyBytes to a larger number if I want

Now suppose ByteCount[x] is far bigger than 50000 ( ie. on the order of
10^7  ).  The code above will not finish until it computes the exact
value of  ByteCount[x].  It would be nice if I could let the test come
out False as  soon as the kernel counts 50001 bytes in (x).   That
would make $Post run a  lot faster when the output expression is very
large.  How can I do what I  want?

Ted Ersek
|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. |
|A while back, support at Wolfram gave me this trick that I now have at
|the top of any notebook manipulating large amount of data: |
|reallyBig[x_] := If[ByteCount[x] > 200000, "Too Large", x]; |  $Post =
|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. |
|Experience as shown that 200000 enabled me to always see what I want. |
|Luc Barthelet
|GM at day, Mayor at Night

  • Prev by Date: Mathematica Printing in Windows 98?
  • Next by Date: problem with eps: no scandinavian letters
  • Previous by thread: Re: Mathematica Printing in Windows 98?
  • Next by thread: problem with eps: no scandinavian letters