## Mathematica Q&A Series: CDF Embedding in a Nutshell

February 22, 2012 — Vitaliy Kaurov, Technical Communication & Strategy

Got questions about Mathematica? The Wolfram Blog has answers! We’ll regularly answer selected questions from users around the web. You can submit your question directly to the Q&A Team.

This week’s question comes from Tom, a teacher who wants to post his lessons online:

How can I use CDF to include Mathematica content on web pages?

Read below or watch this screencast for the answer (we recommend viewing it in full-screen mode):

We’re being asked this question more and more, and I am really glad to see how quickly the Computable Document Format (CDF) is being adopted. Whether you want to deliver your CDF content on your website or blog or as a desktop application, Mathematica 8.0.4 makes it quick and easy with a new CDF Web Deployment Wizard.

## Mathematica Q&A Series: Converting to Conventional Mathematical Typesetting

December 15, 2011 — Vitaliy Kaurov, Technical Communication & Strategy

Got questions about Mathematica? The Wolfram Blog has answers! We’ll regularly answer selected questions from users around the web. You can submit your question directly to the Q&A Team.

This week’s question comes from Jee:

How can I transform the output of partial differentiation such as f(1, 0)[x, y] to the mathematical form ?

Read below or watch this screencast for the answer (we recommend viewing it in full-screen mode):

We will assume that the reader is already familiar with the basics of differentiation in Mathematica. To quickly catch up with the topic, one should read the recent Q&A blog post “Three Functions for Computing Derivatives”.

## Mathematica Q&A Series: Surprises in Differentiation and Integration

November 8, 2011 — Andrew Moylan, Technical Communication & Strategy

Got questions about Mathematica? The Wolfram Blog has answers! We’ll regularly answer selected questions from users around the web. You can submit your question directly to the Q&A Team.

This week’s question comes from Kutha, a math lecturer:

Why doesn’t differentiating after integrating always return the original function?

Read below or watch this screencast for the answer (we recommend viewing it in full-screen mode):

The derivative of a definite integral with respect to its upper bound (with a constant lower bound) is equal to the integrand:

## Mathematica Q&A Series: Generating Random Numbers

October 5, 2011 — Andrew Moylan, Technical Communication & Strategy

Got questions about Mathematica? The Wolfram Blog has answers! We’ll regularly answer selected questions from users around the web. You can submit your question directly to the Q&A Team.

This week’s question comes from Peter, a secondary school teacher:

How can I generate random integers between -10 and 10, but excluding 0?

Read below or watch this screencast for the answer (we recommend viewing it in full-screen mode):

## Mathematica Q&A: Combining and Annotating Plots

August 10, 2011 — Andrew Moylan, Technical Communication & Strategy

Got questions about Mathematica? The Wolfram Blog has answers! We’ll regularly answer selected questions from users around the web. You can submit your question directly to the Q&A Team using this form.

Today’s question is from Herbert, a reader of this blog:

How can I plot a function like sin(x) together with a relation like x = π?

## Mathematica Q&A: Creating Movie Files

July 15, 2011 — Andrew Moylan, Technical Communication & Strategy

Got questions about Mathematica? The Wolfram Blog has answers! We’ll regularly answer selected questions from users around the web. You can submit your question directly to the Q&A Team using this form.

Here is this week’s question:

How can I create and export movies and animations in Mathematica?

This is something we do often—just about every movie or animation on the Wolfram Blog is created in Mathematica.

## Mathematica Q&A: Computing Freight-Container Check Digits

June 16, 2011 — Andrew Moylan, Technical Communication & Strategy

Got questions about Mathematica? The Wolfram Blog has answers! We’ll regularly answer selected questions from users around the web. You can submit your question directly to the Q&A Team using this form.

This week’s question comes from Adri, an engineer:

How can I calculate the check digit in freight container codes like MSKU3881107?

We had to start with some quick research for this question: it turns out that freight (shipping) container identification is covered by the ISO 6346 standard (Wikipedia). Under ISO 6346, each container is labeled with an 11-digit code (four letters + seven numerals) in which the last digit is a “check” digit that is computed from the other 10 digits, according to a fixed rule. For example, in MSKU3881107, the final “7” is the check digit.

The rule specified by ISO 6346 for computing the check digit is designed so most accidental changes or misreadings of a single digit in a code will also change the check digit. This means you can use the check digit to catch most such errors; whenever you see a code, you calculate the check digit yourself and see if it matches up with the one in the code.

## Mathematica Q&A: Three Functions for Computing Derivatives

May 20, 2011 — Andrew Moylan, Technical Communication & Strategy

Got questions about Mathematica? The Wolfram Blog has answers! We’ll regularly answer selected questions from users around the web. You can submit your question directly to the Q&A Team using this form.

This week’s question comes from Bashir, a student:

What are the different functions for computing derivatives in Mathematica?

The main function for computing derivatives in Mathematica is D, which computes the familiar partial derivative of an expression with respect to a variable:

D supports generalizations including multiple derivatives and derivatives with respect to multiple variables, such as differentiating twice with respect to x, then once with respect to y:

And vector and tensor derivatives, such as the gradient:

## Mathematica Q&A: Four Ways to Sum Integer Digit Blocks

May 3, 2011 — Andrew Moylan, Technical Communication & Strategy

Got questions about Mathematica? The Wolfram Blog has answers! We’ll regularly answer selected questions from users around the web. You can submit your question directly to the Q&A Team using this form.

This week’s question comes from Craig, a hobbyist:

For each six-digit number in a list, how can I check whether the sums of the first and last three digits are equal?

For example, the sums of the first and last three digits of the number 123,222 are equal because 1 + 2 + 3 == 2 + 2 + 2.

There are several different ways of solving this straightforward programming problem in Mathematica, and it’s instructive to compare them. In this post you’ll see four methods demonstrating various combinations of built-in Mathematica functions for working with lists and digits of integers.

## Mathematica Q&A: Sow, Reap, and Parallel Programming

April 20, 2011 — Andrew Moylan, Technical Communication & Strategy

Got questions about Mathematica? The Wolfram Blog has answers! We’ll regularly answer selected questions from users around the web. You can submit your question directly to the Q&A Team using this form.

This week’s question comes from Patrick, a student:

How can I use Sow & Reap across parallel kernels?

Before we answer this question, a review of the useful functions Sow and Reap is in order.

Sow and Reap are used together to build up a list of results during a computation. Sow[expr] puts expr aside to be collected later. Reap collects these and returns a list:

The first part of the list is the regular result of the computation. The second part is everything that was “sown”.

Sow and Reap are ideally suited to situations in which you don’t know in advance how many results you will get. For example, suppose that you want to find simple initial conditions that lead to “interesting” results in Conway’s game of life, the famous two-dimensional cellular automaton: