# Tag Info

### How can a verbal reasoning question be solved with Mathematica?

Riffing off of DanielHuber's answer, and with less user intervention: ...
• 15.2k
Accepted

...
• 396k
Accepted

### Art on Mathematica: How can I export 4K resolution png images?

There are a couple ways to do this! One is with ImageSize, and one is with RasterSize (probably recommended), and they have ...
• 9,010

### Permanently extending the behaviour of functions (like decorators)

Preamble I've used similar constructs a number of times. This answer assumes that you want to decorate at definition time (which is what happens in python), rather than doing that after the ...
• 114k

### How can I implement object oriented programming in Mathematica?

Here's I think my 5th version of this type of thing. I've got another framework for this here whose construction I explained here. The package version of this lives on GitHub, which you can load by: ...
• 46.9k

### How can I implement object oriented programming in Mathematica?

[...] but I'm hoping someone can suggest a sleek and novel implementation that is easy to use. The answer to this is to use Object-Oriented Design Patterns in Mathematica as explained and ...
• 37.8k
Accepted

### How can a verbal reasoning question be solved with Mathematica?

To look for a pattern,we get the character codes: cc= ToCharacterCode["KDXPNGVNQJTLTM"] (* {75, 68, 88, 80, 78, 71, 86, 78, 81, 74, 84, 76, 84, 77} *) ...
• 52k
Accepted

### Permanently extending the behaviour of functions (like decorators)

Based on your requirements I would move the original symbol to a new context. ...
• 272k
Accepted

### Draw Graph with upper and lower limit

x0 = First[x /. Solve[2 10^5 x == 10]] 1/20000 ...
• 24k
Accepted

### Longest and Shortest won't work in ReplaceList?

To me this is an interesting problem, however I think the question is a misguided one. Briefly: Longest and Shortest only change ...
• 272k

### How and why to use monadic programming in Mathematica?

(This answer is code-less, but it is a type of answer I am interested to see for the question. This answer is also a section of "Monad code generation and extension"; [AA3].) ( It might be a good idea ...
• 37.8k

### How and why to use monadic programming in Mathematica?

(This answer comprises a few of the sections of the blog post "Monad code generation and extension"; see also [AA11].) The basic Maybe monad It is fairly easy to program the basic monad Maybe ...
• 37.8k

### What's the analogue of UML in Mathematica land?

This answer shows how to create UML diagrams in Mathematica. It is related to programming in Mathematica using Object-Oriented Design Patterns as discussed in my answer to the question General ...
• 37.8k

### Permanently extending the behaviour of functions (like decorators)

A seemingly robust approach seems to be to modify the RHS of DownValues of the symbol you want to decorate. So lets define a decorator function: ...
• 3,160

### Art on mathematica with filled circles and straight paths: how can I reproduce minimalist suns?

Something like: ...
• 52k
Accepted

### Equivalent of Nothing for patterns

You could use Repeated[..., {0,1}] to match elements which may appear zero or one times, but there's even better option in this case, that is, ...
• 19.1k

### How can I implement object oriented programming in Mathematica?

Minimal Object Implementation As part of extending my other answer, I came up with a minimal mutable object implementation: ...
• 46.9k

### How and why to use monadic programming in Mathematica?

I think the monad comprehensions style is easier for many (including me) to read and understand, especially if there is existing familiarity with set theory. I would like to make the case that code ...
• 1,028
Accepted

### How to define the pattern for the sum of some specified terms?

A similar question was asked on this stack exchange page about an equivalent for nothing for patterns. The solution was to use Optional. Using one of the answers ...
• 5,882
Accepted

...
• 54.5k

### Obtaining Pairs of Consecutive Elements with Conditional Adjustment

list = {2, 5, 8, 12, 16, 20, 24, 28, 31}; Using SequenceCases ...
• 70.8k

### Permanently extending the behaviour of functions (like decorators)

It seems that argument-less case (g[]) is special and even if you manually reorder DownValues ...
• 137k

### Can one identify the design patterns of Mathematica?

OOP Design Patterns Many of the Object-Oriented Programming (OOP) Design Patterns can be (relatively) easily implemented in Mathematica without using preliminary code (packages). This answer in the ...
• 37.8k

### How can I implement object oriented programming in Mathematica?

Data abstraction is one aspect of object-oriented programming, in my opinion, the most important aspect. I frequently use a schema abstracted, I hope in a very obvious way, from the following example, ...
• 8,661

### Longest and Shortest won't work in ReplaceList?

As a workaround, you can use Select to filter down the results of ReplaceList to the set you want by using ...
• 42.3k

### Unusual performance of the Cases function

The explanation stems from the Attributes of Condition (short form /;), which contain ...
• 236k

### Unusual performance of the Cases function

Consider: SeedRandom[1]; Cases[{{1, a}, {2, b}, {3, c}, {4, e}}, X_ /; X[[1]] == Part[RandomSample[{1, 3}, 1], 1]] // Trace As you can see, RandomSample is ...
• 52k

### Is there a way to make $g$ changeable independently of $f$ in this code?

Whenever I see an equation with an integral, I always think about trying to convert it into an ODE. Your question falls into this category. So, let's differentiate your equation: ...
• 131k