Hot answers tagged

7

It is a common mistake to assume something has to be printed in order to be there somehow. I cannot express this better, but something like this must be the case. You are wrong. Printing is a function that prints something on the screen. You cannot print something into a variable. The solution is very simple: a = {1, 2}; b = {3, 4}; str = {a, b}; ...


5

Documentation and Details ans Options section for CloudDeploy are saying: CloudDeploy[expr,...] automatically deploys all definitions needed to evaluate expr, much like CloudSave. and as we can see, it's not the case here. Or, it's a feature of Manipulate which boxes definitions are got by FrontEnd so maybe evaluation doesn't apply here. At the end, ...


5

It is Compress\Uncompress that is throwing a wrench in things. Why do you need that anyway? I'm sure you aren't getting much compression. This works. Export["test.txt", Encrypt["my password", img], "Text"] Decrypt["my password", ToExpression@Import["test.txt", "Text"]] You don't need to export to see that the compression is an issue, just do this: ...


4

You can use the "FieldSeparators" option to specify what is used to separate fields: ExportString[a102, "Table", "FieldSeparators" -> " . . . "] 1 . . . 1 2 . . . 1 3 . . . 5 4 . . . 10 5 . . . 30 6 . . . 26 7 . . . 91 8 . . . 84 I believe the default is a Tab, entered as "\t". How that is displayed by external software is a different issue.


4

This problem appears to be localized to HTMLFragment, possibly because HTML specifications before HTML5 did not use self-closing tags like XHTML and XML always have. Exporting the string as XML appears to solve the problem: ExportString[XMLElement["test", {"attr" -> "val"}, {}], "XML"] "<test attr='val' />"


3

You are trying to get Cases of Line in your plot. There are no lines in your plot, only points. data1 = ListLogLogPlot[Table[{i^2, i^(1/3)}, {i, 1, 20, 1}]]; Cases[data1, Point[data_] :> data, Infinity] (* {{{0., 0.}, {1.38629, 0.231049}, {2.19722, 0.366204}, {2.77259, 0.462098}, {3.21888, 0.536479}, {3.58352, 0.597253}, {3.89182, ...


2

At the cost of an extra space character (will be ignored in an html-context AFAIK): ExportString[XMLElement["input", {}, {" "}], "HTMLFragment"] "<input class=\"form-control\"> </input>" of course that does unlike your suggestion also create the closing tag, but you probably don't want to create non-XHTML-conform html-fragments these ...


2

You need this method i think: P1 = Plot[Sin[x], {x, 0, 6}]; P2 = Plot[Sin[x], {x, 0, 6}, AxesStyle -> Opacity[0]]; Overlay[{P1, P2}]


1

Confirmation rather than answer. I'm not sure the original example is entirely functional, at least it was not for me. Mine is... SetDirectory["F:\\Temp"]; (* Adjust to suit your environment *) hist = Histogram[RandomVariate[NormalDistribution[0, 1], 10000], ScalingFunctions -> "Log", ImageSize -> 600] Note log scale on y-axis in resulting ...


1

Using the "Byte" format when importing and exporting seems to work. In[1]:= CreateArchive["input", "input.zip"] Out[1]= "C:\\Users\\Andy\\Documents\\input.zip" In[2]:= enc = Encrypt["password", Import["input.zip", "Byte"]] Out[2]= EncryptedObject[<|Data -> ByteArray[< 320 >], InitializationVector -> ByteArray[< 16 >], ...



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