All Questions

871 views

Connecting to and disconnecting from a continuously running kernel, on demand

I realized that there are lots of advantages to driving C/C++/FORTRAN code directly from Mathematica as LibraryLink functions (instead of running them from the command line or a shell script, as I ...
248 views

Is the communication protocol underlying MathLink user-customizable?

MathLink supports two communication protocols on all platforms: TCPIP or shared memory. There are additional protocols supported on some systems only ("FileMap" and "Pipes" according to the docs). I ...
3k views

How to generate random directed acyclic graphs?

How to programmatically build random directed acyclic graphs (DAG)? I know about the AcyclicGraphQ predicate and the ...
182 views

Most of the Mathematica users beyond beginner level will be aware of the phenomenon of Packed Arrays. The user-accessible functions related to packed arrays live in the ...
733 views

Why does Mathematica claim there is no even prime?

I wonder if this is a bug, or if I'm misunderstanding something: Exists[n, EvenQ[n] && PrimeQ[n]] // Resolve (* ==> False *) So if I interpret this ...
328 views

Why is FindInstance finding non-instances?

Consider this example: FindInstance[Exists[{x, y}, x > 1 && y > 1 && x > Sqrt[x + y]], {x, y}] which finds values of $x$ and $y$ such ...
381 views

Is it possible to use Begin and End inside a Manipulate?

May be someone can explain why I can't use Begin["context"] and End[] inside a Manipulate ...
394 views

Function that caches when it returns unevaluated

How would you go about implementing a function that caches not the result but the fact that it didn't match a pattern? So that it doesn't waste time recomputing a complex time-consuming pattern ...
589 views

How can you give a Module a context and have its local variables and Modules belong to that context?

What would be the best way to give a module its own context and have its local variables and Modules belong to that context?
402 views

Distributing PlusMinus consistently

I would like to give the built-in function PlusMinus, which is undefined by default, the intuitive meaning: considering all possible combinations of $+$ and $-$. ...
1k views

Why don't * and ^ work as I expected on matrices?

For example, this input... {{1, 2}, {3, 4}}*{{1, 2}, {3, 4}} produces this output... {{1, 4}, {9, 16}} and this input... ...
9k views

Figuring when the minute and hour hand coincide on a clock

I would like to list all possible times in a 12-hour period, where the hour hand overlaps the minute hand completely. This is really a question about three distinct things - to be done in Mathematica ...
181 views

How can I set a fixed cell height?

I did this often in previous versions of the Mathematica notebook front end. I would have a cell with lots of raw data, e.g. a very long list. The list might go on for pages. I would set the cell ...
471 views

Undocumented syntax of FilledCurve [duplicate]

Possible Duplicate: Undocumented form for FilledCurve[] A nice trick to get the outline paths of letters is to use the PDF exporter/importer ...
4k views

What are the use cases for different scoping constructs?

Mathematica includes three functions that I know of which can be used to effectively (if not actually) define a variable and give it a value within a local scope: ...
3k views

How do I replace a variable in a polynomial?

How do I substitue z^2->x in the following polynomial z^4+z^2+4? z^4+z^2+4 /. z^2->x ...
2k views

Plotting an implicit polar equation

Mathematica can use ContourPlot to draw implicit Cartesian equations, but doesn't seem to have a similar function to plot an implicit polar equation, for example ...
323 views

Interfacing Mathematica with MINE using JLink

In last December's Science David N. Reshef, et al. proposed an interesting method to detect associations in data (Detecting Novel Associations in Large Data Sets, Science 334, 1518, 2011). Contrary to ...
662 views

How do you set attributes on SubValues?

SubValues, as discussed in a previous question, are declared as follows ...
296 views

Unexpected behavior from GatherBy in version 7

I have come across what appears to be a bug in GatherBy. It appears similar to the problem of using Table[Random[], {1000}] in ...
683 views

Placement of Condition /; expressions

It is my practice to place Condition expressions on the left side of := and :> in almost ...
4k views

Intersecting graphics

Does the Mathematica graphics system have any concept of intersecting graphics? I've not found much in the documents so far. For example, if I want to show the intersection of two shapes: ...
882 views

Is it possible to import dates and times directly as AbsoluteTime and by pass DateLists?

Date and time calculations are quite slow so I am exploring ways to minimize the number of calculations performed. As an example: ...
219 views

What's a robust way to insert another extension into a filename?

I'd like to add an extension to a filename before the file extension, otherwise leaving the given filename the same. In particular, absolute filenames should stay absolute, and relative filenames ...
720 views

Is it possible to use C# LINQ from Mathematica using .NET/Link?

Using Mathematica's .NET/Link (NETLink) package, is it possible to call out to .NET's LINQ facilities for list manipulation and other operations?
680 views

How can I share objects with dynamic content with non-Mathematica users?

Often when I construct some cool Manipulate[] function, I would like to share it with others—non-Mathematica users. Some software, notably Cinderella, ...
322 views

Operations on online files via public URL access

I need Mathematica to access an online public directory via some URL (fake in this case) http://example.com/images and perform operations similar to those Mathematica can do on OS directories and ...
313 views

532 views

Correct way to handle mysterious NaN` result from MathLink function

I have a Mathematica expression that is mapped onto an external C function via MathLink. The external function passes a ...
251 views

Why is Neptune missing from AstronomicalData?

An old notebook I've recently started working with has a strange error: Prior to version 8, a figure I generated using Drop[AstronomicalData["Planet"],-1] to ...
392 views

Are later versions of the Front-End compatible with older Kernels?

At my graduate school, all of the clusters still use version-6, and I only have version-7 and version-8 installed on my computer. I would like to use those machines remotely. Are either of the ...