26

Fixes by Mathematica version. Note that unfixed bugs may apply to earlier versions as well; e.g. TableAlignments -> Left not working also applies to version 7. Version 10.1 Fix syntax highlighting in Trace: Unprotect[Trace]; SyntaxInformation[Trace] = {"ArgumentsPattern" -> {_, _., OptionsPattern[]}}; Protect[Trace]; Fix Incompatibility of Row and ...


20

There are two typical locations where a user can add an init.m file to be loaded at run-time: $BaseDirectory and $UserBaseDirectory. $BaseDirectory is useful for installation wide customizations that apply to all users while $UserBaseDirectory is used for a specific users customizations. So, anything in $UserBaseDirectory is loaded after the files found in $...


16

Shortly: automatic behavior happens when you use a backtick `. I think there are multiple typos in docs for Get. I added Test2 dir and and Test2\init.m file to the first path in $Path. In my case Links dir. According to Get documentation <<Test2 should get it. It won't but <<Test2` will. Additionally this will work, even without SetDirectory: ...


16

Apparently, Throw is deactivated during kernel initialization. The following function can determine if Throw is inoperative: throwInoperativeQ[] := CheckAll[Catch[Throw[False]], # /. Null -> True &] The undocumented function CheckAll is used here because Check also appears to be unreliable when Throw is inoperative. If we make the assumption that ...


15

The only solution I have found is to delete the contents of the directory given by: FileNameJoin[{$UserBaseDirectory, "Paclets"}] More specifically it appears to be sufficient to delete a single file: FileNameJoin[{$UserBaseDirectory, "Paclets", "Configuration", "pacletSiteData_10.pmd2"}] To prevent Mathematica freezing on the next start-up I need to ...


14

After some spelunking, I found a file which contains a lot of initialization code, including reading the kernel init.m file, loading Autoload packages, loading anything set with the -initfile option, starting the paclet manager (which may autoload packages), and many other things. It is SystemFiles/Kernel/SystemResources/$SystemID/sysinit.m Towards the ...


13

It's a type of otherwise harmless bug that tends to come and go with versions. I would suggest to report it to Wolfram, but also not to worry about it. Notice that the symbols have no associated definitions, which means that they will not interfere with your code. A potential way in which such a situation can arise is the following. Imagine you put Sqr[x_] ...


11

Here is one that came from a Wolfram employee so it should be safe to add in version 9: FindInstance returns Indeterminate in version 9, but not in 8


9

I found two ways to do this. Both are undocumented, so all usual caveats apply. Parallel`Developer`$InitCode This can be done using Parallel`Developer`$InitCode. While undocumented, this does appear fairly stable. First trigger loading the parallel tools: Parallelize; ?Parallel`Developer`$InitCode ReleaseHold[$InitCode] is run on every new ...


9

Here's a patch from Adam Strzebonski of Wolfram, which fixes a bug in RootReduce[] in 9.0.1. ToNumberField won't recognize Root as explicit algebraic number


8

The error is due to the issue being fixed on the server, which involves removing the CloudObject-10.3.760 paclet so it is no longer downloadable. Evaluate first PacletSiteUpdate /@ PacletSites[] and then PacletUpdate["CloudObject"] I have also updated the original answer to include this step.


8

The Autoload mechanism can be used for this. Place the package in $UserBaseDirectory/Autoload or $BaseDirectory/Autoload. However, the package must follow the standard structure, and must have a Kernel/init.m file, otherwise it won't get loaded. Also keep in mind that auto-loading of packages happens only after $UserBaseDirectory/Kernel/init.m was loaded (...


7

You possibly want to create one or more packages. Packages are special code files with extension .m or .wl, which load as code packaged (hence the name "package") in one or more namespaces. Mathematica has built-in support creating, managing, and loading packages. A good place to start learning how to organize Mathematica code follow this link


7

A simple and efficient programmatic approach: CurrentValue[Pick[#, CurrentValue[#, InitializationCell]] &@Cells[], InitializationCell] = Inherited; Just evaluate this statement in the Notebook where you wish to convert all InitializationCells into ordinary cells, and the InitializationCell option will be removed from the corresponding Cell[...] ...


6

You can run SetDirectory in the kernel initialization file, init.m. You'll find it here: SystemOpen@FileNameJoin[{$UserBaseDirectory, "Kernel"}]


6

I do not think that it is a reasonable request to do the fit without initial parameter values when you are working with such extreme numbers. The optimization algorithms will typically need to choose an initial value anyway, and with non-linear models, there will usually be multiple local minima. The solution is to use reasonable units. You have numbers ...


5

According to the documentation, To suppress the loading of kernel initialization files, use the kernel command-line option -noinit. To specify another file to be used for kernel initialization in addition to init.m, use the kernel command-line option -initfile file, where file is the additional initialization file.


5

This has to do with the Notebook's default context setting in the evaluation menu. If it isn't set to Global`, the definitions made in init.m are not seen. As rm-rf says, a good way to put custom definitions in the init.m would be to use Begin and End to create an Init` context and append that context to the context path so that the definitions are ...


4

I think that the reason is that -- depending on the format -- Import does either use external programs, java libraries via JLink or the frontend for imports of most "nontrivial" formats. Only some -- mainly simple ascii or plain binary -- formats and of course mathematicas own syntax are directly "imported" with pure kernel functionality. As you correctly ...


4

This has to do with the order in which the arguments of Animate are executed. Let's see if we can determine that: ClearAll[eval, low, hi, init, x]; i = 1; Animate[ eval[If[i > 10, 10, i++]] = x, {x, low[i++] = x; 0, hi[i++] = x; 1}, Initialization :> (init[i++] = x;), AnimationRunning -> False ] Information /@ {low, hi, init, eval}; ...


4

How about a vectorfield and a time-trajectory? Is it what you are expecting? ode = { y'[t] == 2 (y[t] - 1)*(3 y[t] - 5 m[t]) + 4 A[t]*m[t]*(y[t] - 1), m'[t] == 3 m[t]*(y[t] - 1) - 5 (m[t]^2)*(y[t]^(-1))*(3 y[t]/2 - 1) + 2 A[t]*(m[t]^2)*(y[t]^(-1))*(2 y[t] - 1) + m[t]*(3 y[t]/2 - m[t]), A'[t] == A[t]*m[t] }; time = 100; sol = NDSolve[...


4

This works Parallel`Developer`$InitCode=Hold[Get[FileNameJoin[{$BaseDirectory,"Kernel","init.m"}]]] c/o Register "initialization code" to run on any newly started parallel kernel However, it is undocumented.


4

You need to rescale your data as Scabolcs suggests. I tried without rescaling and the fit did not work. So try data1 = datax /. {x_, y_} -> {x 10^-6, y 10^35}; Show[ListPlot[data1], Plot[Evaluate[ a^2 + b^2 + 2 a*b*Cos[q*d] /. {a -> 1/Sqrt[2], b -> 1/Sqrt[2], d -> π/12}], {q, -6, 6}] ] I have made guesses at the fit that seem ...


4

Would this be acceptable? list1 = {"Testpack`", "NBStyles`", "NBUtilities`", "NBTasknmate`"} Map[Get, list1]


3

According to the "Front End" section of Configuration Files for the Wolfram System, user preferences, including those set by Options Inspector, are located in $UserBaseDirectory in the file "/FrontEnd/init.m". This is a large file, and the options set by Options Inspector are at the end. The list appears to contain all options, whether changed by the user ...


3

Using a package file open.m Needs["JLink`"]; $FrontEndLaunchCommand = FileNameJoin[{$InstallationDirectory, "Mathematica.exe"}]; UseFrontEnd[CreateDocument[]]; from a command line (Windows) cd \Program Files\Wolfram Research\Mathematica\10.4 start MathKernel -noicon -initfile C:\myPath\open.m


3

You could simply do SetOptions[$FrontEndSession, {InitializationCellEvaluation -> True, InitializationCellWarning -> False}]; Now Initialization Cells are evaluated without the warning even when these options are not set at the Notebook level explicitly: actually they are simply inherited by Notebook from the top level (from the $FrontEndSession).


3

It's probably a good idea to look at this question more more information about writing CDF-happy notebooks. In brief, Initialization cells won't function properly in the CDF format. For example if we have the following initialization cell: a = 1; And subsequent cell that is not an initialization cell Manipulate[b + x, {x, 1, 10, 1}] Manipulate[a + x, {x,...


3

I have a partial answer to my question. In order to add menu items, e.g., to submenus of the Format menu for Mathematica version 10.0.1. What to put in the init.m FrontEndExecute[ AddMenuCommands["BackgroundDialog", {Delimiter, MenuItem["Linen",Background->RGBColor[0.980,0.941,0.902]], MenuItem["AliceBlue",Background->RGBColor[0.941,0.973,1.0]], ...


3

Select[Cells[], CurrentValue[#, InitializationCell] &] You can use SelectionMove or just click on those objects to go there. And here is a palette: CreatePalette[ Button[ "To the next initialization cell", With[{nb = InputNotebook[]}, While[ SelectionMove[nb, Next, Cell, AutoScroll -> False]; Not@Or[ First[SelectedCells[nb]] ...


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