« first day (2587 days earlier)      last day (1898 days later) » 

1:06 AM
@halirutan @CarlLange I can't actually reproduce this... I downloaded the notebook, copied the code, then pasted it in a sandbox cloud notebook and hit no issues
 
@b3m2a1 I didn't download it. I created a copy within the cloud and there, strange things happen.
 
@halirutan my guess is the boxes got corrupted in typing or something
 
Yep, my guess too.
The pink bracket in my first screenshot is a good indicator that something went wrong.
 
1:22 AM
@halirutan I debugged and it turns out the cloud is complaining about this:
jac=RandomReal[{}, {5, 5}];
Eigenvalues[jac]\[IndentingNewLine]vec=Eigenvectors[jac];
gramschmidt[w_?MatrixQ] := Module[{v = ConstantArray[0, Length[w]]},
  Table[
    v[[n]] = w[[n]] -
      Sum[(v[[i]].w[[n]]/v[[i]].v[[i]])*v[[i]], {i, 1, n - 1}],
    {n, 1, Length[w]}];
 v
];
My guess is it's that \[IndentingNewLine].
Yep that's exactly the issue
 
 
4 hours later…
4:57 AM
@CarlLange It's ok. Thanks for helping :)
 
5:14 AM
@halirutan Thank you very much :)
 
 
12 hours later…
5:07 PM
Is there a way to get the infix operator associated with a symbol? Something like operator[Equal]->"==", operator[Times]->"*"
I can make something like that using operator[sym_]:=MakeBoxes[sym[_,_]][[1,2]], but that seems a bit hacky..
 
@LukasLang What is wrong with Equal[a,b] or Times[a,b]?
 
 
5 hours later…
9:50 PM
@halirutan I want to get a box representation of InputForm with some modifications - the simplest way I've found to do that is to use ToString[…,InputForm] coupled with FrontEnd`UndocumentedTestFEParserPacket. This works more or less, but I'd like to prettify some things, such a Inequality[…] (hence the need for a function to get the infix operator)
Another solution I could imagine is to build a custom version of MakeBoxes from scratch, but that would also require a robust way to get the infix operator versions, otherwise it'll probably explode into a million hardcoded cases for different operators...
 
@LukasLang define 'associated'. Often the name is just right:
RawBoxes@StringTemplate["\[``]"]@Equal
 
@Kuba I would define "associated" by demanding that given a symbol sym, MakeExpression@RowBox@{"x", operator[sym], "y"} returns an expression of the form HoldComplete[sym[x,y]]
most of the time, InputForm[…] will return something with the proper infix form, but I've seen it "fail" for e.g. StringForm and Inequality
The \[…] method works only in some cases, specifically when the infix operator is a special character, so none of /@, @@, <>, … will be found. It will also fail for Unequal, where the infix operator is \[NotEqual] for some reason
Of course, such a function will not be possible in general (Notation package and similar), but it would be nice to at least cover all default operators
 
10:10 PM
@LukasLang right. Yeah, unfortunately MakeExpression's down values are hidden :(
Maybe WL Data or whatever those entities are called?
Or just parse some kind of operator table from docs :)
 
@Kuba WolframLanguageData were a great idea: WolframLanguageData["Equal", "ShortNotations"] returns {"==", "\[Equal]", "\[LongEqual]"}, which is exactly what I wanted - thanks!
 
10:50 PM
You're welcome :)
 

« first day (2587 days earlier)      last day (1898 days later) »