Currying with Mathematica

I don’t think there is any way to have attributes apply to the later parts of such an “upvalue” pattern definition. One alternative is to use pure functions with attributes. Not as convenient as pattern matching, but when you evaluate f[2+2][8/4], it actually gives a result Curry would have liked. (“Function” is Mathematica’s “lambda”, if … Read more

How to determine PlotRange to include all of graphics?

I can suggest the following Ticks hack: pl = Plot[Sin[x], {x, 0, 10}]; Reap[Rasterize[Show[pl, Ticks -> {Sow[{##}] &, Sow[{##}] &}, ImageSize -> 0], ImageResolution -> 1]][[2, 1]] => {{-0.208333, 10.2083}, {-1.04167, 1.04167}} The trick is that real PlotRange is determined by the FrontEnd, not by the Kernel. So we must force the FrontEnd to render … Read more

Customizing Mathematica shortcuts

Here is a nice article. Also, FROM HERE (unchecked) Question: How do I modify the front end to add new keyboard shortcuts? Answer: (mathgroup May 2005, trevor baca:) I’ve been mucking around in KeyEventTranslations.tr setting up keyboard shortcuts recently and i’ve learned that front end tokens are pretty cool. this wolfram page gives pretty good … Read more

Simple programming techniques / tricks in Mathematica for making graphics for the math book? [closed]

Here is a simple/basic way to do the first one: Graphics[{ (* The dashed circle segment *) { Dashing[{.04, .01}], Darker[Orange], AbsoluteThickness[2], Circle[{0, 0}, 1, {1, 2 \[Pi]}] }, (* The solid circle segment *) { Orange, AbsoluteThickness[2], Circle[{0, 0}, 1, {0, 1}] }, (* The radial lines and the small circle segment *) Line[{{0, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)