Hot answers tagged

34

I can confirm that upgrading to Windows 10 from either Windows 7 or Windows 8.1 (you can't upgrade from Windows 8 directly, you first have to upgrade to 8.1) leaves all your settings and licenses intact and that includes your Mathematica (9, 10.0, 10.1, 10.2) installation, I didn't have version 8 installed but I would guess it should work too. I have also ...


32

Copying my answer from StackOverflow (edit, now updated) ... If you are on Windows (with .NET), then you could use Mathematica's NETLink functionality in conjunction with the WebBrowser class to capture a screenshot of a web page: Needs["NETLink`"] LoadNETType["System.Drawing.Imaging.ImageFormat", AllowShortContext -> False] LoadNETType["System.Windows....


27

The following guide shows how to conduct communication between nanohttpd, an http server for Java, and Mathematica. The result is a server that, if you go to its address in a web browser, displays the result of SessionTime[], i.e. the time since the Mathematica kernel associated to the server started. I'm going to write as if the reader was using OS X with ...


22

Mathematica 10 is not high-DPI-aware on Windows and so Windows renders it at the native resolution and then scales it by a factor of 2 by default to make it readable. Once Mathematica supports high-DPI displays in Windows, they will be able to properly render text and graphics that aren't blurry. If you're running Windows 8.1, you can disable this default ...


22

It appears that the last version of Mathematica to have official support for Windows 98 was Mathematica 5.2. We can see this by comparing archived versions of the system requirements pages for version 5 and version 6. Version 5 Version 6


21

You can call an external (shell) command cmd without showing a command window by using the pipe syntax "!"<>cmd. This can be used in place of a filename with any Mathematica function that opens a file for reading. For example: Import["!dir", "Text"] Read["!dir"] (opens stream, must be closed) OpenRead["!dir"], followed by Read, ReadList etc to grab ...


19

With a few rare exceptions, Mathematica is generally unable to work with long path names on Windows. This response presents two strategies to work around this difficulty: extended-length path syntax and short path names (documented in Naming Files, Paths, and Namespaces from the Windows Dev Center). Let's start with a big file name: $big = "...


18

I upgraded three machines from Windows 7 to Windows 10, two of which were work machines containing installations of Mathematica 10.x (and earlier). So far I have encountered zero issues related to Mathematica with this Windows upgrade. From a personal perspective, upgrading to Windows 10 was very simple. Also the QA team for Mathematica did a full test of ...


17

There are a few problems with your code. If you fix those up, as I did, your program will run fine. First off, the reason you see "no source available" when you pause the program is probably that when you break, the program is down inside a MathLink function, and so it is complaining that it doesn't have access to the MathLink library source code. To debug ...


16

You create metafiles every time when you copy graphics from Mathematica FrontEnd and paste it in MS Word because it is native format for exchanging vector graphics under Windows. So your question is actually about corrupted metafiles in MS Word document opened on a machine without Mathematica fonts installed. This behavior is expected because unlike PDF and ...


16

If you need to achieve the best possible quality I strongly recommend against using the Clipboard for transferring graphics. Under Windows the clipboard will contain a Windows Metafile generated with display resolution fidelity! This is the reason why you see jaggies. The same is true for the vector graphics files generated by Mathematica's Save Selection ...


15

After much digging, I found this MathGroup archive detailing how to get Mathematica working with SQL servers protected by Windows authentication. It's repeated here mainly for posterity's sake. Download the jTDS files from here: http://sourceforge.net/projects/jtds/files/ Unzip and locate the ntlmauth.dll file in the appropriate folder (x64, x86, IA64). ...


15

As indicated in the documentation, one can access the Mathematica kernel from the command prompt using the command math in Unix/Linux and MathKernel from Mac OS X/ Windows. If the MathKernel command is not in your PATH variable, you can try one of several things: Enter the full pathname as part of the command Add MathKernel as a PATH variable using the ...


15

Until a better answer comes along, I present, for your edification, an ugly hack that isn't really Mathematica per se: Needs["CCompilerDriver`"] src = " #include \"WolframLibrary.h\" #include <windows.h> #include <string> BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam) { char title[256]; GetWindowText(hwnd, title, ...


14

Here is a considerable simplification of Liam's accepted answer. It avoids the need to create and compile a C# program. This is basically just a small modification to Simon Woods' answer, so that it writes directly to the clipboard instead of creating a temporary file on disk. This avoids the need to clean up the file afterward. Needs["NETLink`"] ...


14

Update It's probably easier to use Edit -> Copy As -> Bitmap from the menubar. Changing the magnification of the notebook will change the size of the image that gets sent to the clipboard Previous answer There's likely a better answer out there, but I use a hack of the SEUploader to do this. toclipboard2[] := If[ MemberQ[Hold[{}, $Failed, ...


13

Mathematica 8 automatically detects Intel version 11, but not Intel version 12 which was released later. In order to use the Intel 12 compiler, you'll need to set $CCompiler to point CCompilerDriver to where you've installed the Intel compiler: Needs["CCompilerDriver`"] $CCompiler = {"Compiler" -> CCompilerDriver`IntelCompiler`IntelCompiler, "...


13

UPDATE from 06.11.2015 Since writing the original answer I installed updates for my Windows 7 x64. Now the original bug isn't there anymore but there still persists more fundamental bug which I observe in versions 8.0.4, 9.0.1, 10.0.1, 10.2 and 10.3 installed on the same system. This bug becomes evident when you look at the plots of horizontal channel ...


13

There are a couple of issues at play. One is that the implementation of Total has changed, and it is now using several threads in parallel. Furthermore, there are platform-specific differences in how Timing works. On Windows, it will only measure the CPU time used by the main kernel thread, excluding any subthreads. On Linux, and I believe OS X, it will ...


12

I have automated a nightly backup process with Mathematica. I use a task scheduling program to run a longer version of the following .m file below with MathKernel. Functions like Complementmake it easy to copy new files from a working directory to a backup directory, and in general, Mathematica makes it easy to use sophisticated logic along with various ...


12

It turned out that the MathematicaClosingDialog.nb is a nice example for a graphical user interface that solely uses the FrontEnd MathKernel. On the downside, one has to deal with low-level code. First I made a copy of the original MathematicaClosingDialog.nb, renamed it as MathematicaClosingDialog_Default.nb, and then imported it into a notebook: nb = ...


12

The following is a sample implementation of a simple HTTP server in Wolfram Language code only: https://github.com/arnoudbuzing/wolfram-server You send it a POST request where the body data of the HTTP request contains the Wolfram Language code you wish to evaluate. The (running) wolframserver.wls script processes the request by evaluating the code string ...


12

To whom it may concern, a workaround: path = FileNameJoin[{$HomeDirectory, "Desktop", "testWorking.nb"}]; nb = Notebook[{}, Saveable -> False, NotebookEventActions -> {{"MenuCommand", "Save"} :> {}} (*the fix*) ]; Export[path, nb, "NB"]


11

Setting a FontOpacity less than 1 appears to prevent sub-pixel rendering and therefore provides output similar (perhaps identical) to that obtained with ClearType switched off. text = Style["αβημπρτ", 20, FontFamily -> "Arial", FontOpacity -> 0.999]; Rotate[text, # °] & /@ {90, 90.1, -90, 85, 95, 45, 0} One possibility to automate this, and to ...


11

Something like this? It does just what you suggested: export the file and then place a FileDrop reference to it on the clipboard. Needs["NETLink`"]; InstallNET[]; LoadNETType["System.Windows.Forms.DataFormats"]; LoadNETType["System.Windows.Forms.Clipboard"]; exportToClipboard[graphics_] := Module[{dob, file}, file = FileNameJoin[{$TemporaryDirectory, "...


11

I have contacted the Wolfram support ([CASE:1292216]): Dear Andrew, Thank you for contacting Wolfram Customer Service. We simply ended our support of XP shortly after Microsoft had announced they would no longer support XP themselves. XP is going to become to difficult to handle without any kind of support from Microsoft as many of the issues we ...


10

Arnoud Buzing in chat made us aware of this support page that discusses possibly related issues. UPDATE: A new version of the Windows installer has been placed on the Wolfram Portal. Its file hash is: F3EEC3AFEC3186001A1A237C88B7A991 You can check this with the following command: BaseForm[FileHash["Mathematica_9.0.0_WIN.exe", "MD5"], 16]


10

The user Szabolcs gave the answer. Here are the steps: Open your Mathematica Notebook Ctrl+A, if you want to selct all your cells or simply select your desired cells Go to: Edit -> Copy as -> Metafile Open Word: Ctrl+V (paste) :)


10

Windows Command Line Here is a way using the Windows command line: getShortPathName[path_] := Import["!for %p in (\""~~path~~"\") do @echo %~sp", "Text"] So then: getShortPathName[$InstallationDirectory] (* "C:\\PROGRA~1\\WOLFRA~1\\MATHEM~1\\11.2" *) NETLink Here is a way using NETLink... First, we declare the Win32 API function GetShortPathName: ...


9

The following code copies the actua PNG image to the clipboard with transparency. This varies from the other answer in that it actual stores the entire image instead of a reference to the file. This code will likely work with more applications then the one above. It currently uses the Ctrl+Shift+C to copy with transparency. The code takes a while to run ...


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