Hot answers tagged

7

Files Let's create some test files Table[ Export[ StringTemplate["Test``.jpg"][k], Rasterize@TextCell[ RandomChoice[DictionaryLookup["*"]], RandomChoice[{"Text", "Subsection", "Section", "Title"}] ] ] , {k, 10} ] RunProcess Test a single file using RunProcess (advisable). RunProcess[ { "C:\\Program Files (x86)\\Tesseract-OCR\\...


7

Here is some code I wrote to make a palette that I use a lot. Maybe the it will work you, or at least give you ideas on how to do it. CreatePalette[ Framed @ Column[{ Button["Evaluate Cells", FrontEndExecute[FrontEndToken["EvaluateCells"]], Appearance -> "Palette", ImageSize -> 140], Button["Evaluate Notebook", ...


7

If you prepend bash -c to your RunProcess command, you can pass ls -ltr | tail -1 as a single argument (at least with v12 on Windows 7 with cygwin or Windows 10 with the subsystem for linux). RunProcess[{"bash", "-c", "ls -ltr | tail -1"}, "StandardOutput"]


3

I have figured out a work-around, that requires Mathematica 11.3 or later. In this version, there is a new command, RemoteRun[], that works like Run[] but on a remote server. If anyone knows a way of actually tunneling the Mathematica commands, and not just getting access to the remote Terminal, I would still appreciate it. What worked for me is the ...


3

I assume you created a notebook, wrote something in it, then used File -> Save As... and chose "m. file"? First of all, if you are looking for create a plain text Mathematica script (.m file or .wl file), it is best not to use notebooks at all. Create an .m file directly, and edit that. That said, if you need to save a notebook as an .m file, ...


3

I think due to presence of radicals and denominators it is necessary to use exact (or at least high precision) arithmetic here. y = 1/100; x = 57/1000; n0 = 0; n1 = 1; gE0 = 1/g0 - Sqrt[1 + z^2/(Pi*(2*n0 + 1)*y + 44/10*x*Pi*g0)^2]; gE1 = 1/g1 - Sqrt[1 + z^2/(Pi*(2*n1 + 1)*y + 44/10*x*Pi*g1)^2]; sce0 = 2*Pi*1/ 100*(((2*n0 + 1)* Pi*1/100*(g0 - 1))/((...


2

One way is to write away the standard output to a file using the shell redirect "> file" to create a temporary file and read from there. run[command_String]:=Module[{out}, Run[command<>" > tmpstout.txt"]; out=Import["tmpstout.txt","Text"]; DeleteFile["tmpstout.txt"]; out] Works for this for example. Ironically the temporary file will first be ...


1

Ok, I'm not sure why, but after rationalizing your equations, performing the elimination in sequence seemed to work: y = Rationalize@0.01; x = Rationalize@0.057; n0 = 0; n1 = 1; gE0 = 1/g0 - Sqrt[1 + z^2/(Pi*(2*n0 + 1)*y + Rationalize[4.4]*x*Pi*g0)^2]; gE1 = 1/g1 - Sqrt[1 + z^2/(Pi*(2*n1 + 1)*y + Rationalize[4.4]*x*Pi*g1)^2]; sce0 = 2*Pi*(1/ ...


Only top voted, non community-wiki answers of a minimum length are eligible