Wolfram Blog News, views, and ideas from the front lines at Wolfram Research. 2015-10-06T14:08:52Z http://blog.wolfram.com/feed/atom/ WordPress Adriana O'Brien http://www.wolfram.com <![CDATA[Using the Wolfram Language in the Classroom: English]]> http://blog.internal.wolfram.com/?p=28016 2015-10-06T14:08:52Z 2015-10-06T14:08:52Z It’s day two of the Wolfram Language in the Classroom series, and I’ll be bringing coding into an English class today. For the most part, educators and administrators consider programming a tool only for STEM courses. While coding in the Wolfram Language is excellent for STEM, it is an invaluable tool for many other subject areas as well.

Using the Wolfram Language in an English class supports a computational approach to critical thinking, which allows students to collect and analyze data to become reflective writers. In the following lesson, educators can prompt students to write just a little bit of code to reflect on their written work.

Lesson title: Becoming Reflective Writers
Grades: 6–12
Student goals:
- Formulate problems in a way that enables students to use a computer to help solve those problems
- Logically organize and analyze data
- Discover insights on individual writing styles

- Have students import their essays into the programming environment
- Have students code and analyze the length, average word size, and the Automated Readability Index (ARI) of their writing
- Lead the students in a discussion on insights discovered through their analysis

The first step is to have the students import an essay into either a Mathematica notebook or a cloud notebook. I used a sample ACT essay:

Import an essay into a notebook

An easy first step in the analysis of the essay is to have the students compute the number of words in the essay:

Compute the number of words in an essay

Have the students create a word cloud to visualize the most frequent words. Is there anything surprising about the most frequent words? It seems like in the sample essay, the writer used the words “you,” “to,” “school,” and “that” most often. Depending on the type of essay, it might be worthwhile to have the student rephrase a few sentences that contain the word “you”:

Turning an essay into a WordCloud

To get at specific details of the essay, students can tally the words and sort them in descending order by frequency:

Sorting words in descending order of frequency

Have the students visualize the word frequency in a bar chart. This would be another opportunity to prompt students to reflect on their writing. Do certain words or word phrases appear frequently? Is there a way to rephrase to reduce high word frequencies?

Frequency of words placed in bar chart

There are other text analyses available besides word frequency, such as word length. Compute the mean word length to determine if a student’s words are on average long or short:

Computing the average word length

For older students, educators can introduce the Automated Readability Index (ARI) to determine the approximate grade level of a student’s essay:

Automated Readability Index

The first step is to compute the number of characters:

Compute the number of characters

We’ve already found the number of words in the essay:

Number of words in the essay

Compute the number of sentences:

Number of sentences

Walk the students through creating a function for the ARI:

Creating a function for the ARI

Compute the ARI for the essay:

Computing the ARI for the essay

The final result above indicates that the readability of this essay is nearly grade 6.

Depending on how familiar the students are with programming in the Wolfram Language, educators might want to structure the activity such that all the code is available, and perhaps the students can change a few things here and there. If the students have had an introduction to the Wolfram Language, I would suggest giving them hints on what functions they should use, but let the students come up with the code to accomplish these tasks.

This type of inquiry-based programming allows students to make informed decisions about their writing. With this activity, educators are providing students the opportunity to be reflective writers. I hope you enjoyed this installment of the Wolfram Language in the Classroom series. Stay tuned for tomorrow’s post on integrating Wolfram technologies into a chemistry course.

To see more posts in this series, please click here.

Download this post as a Computable Document Format (CDF) file.

Rob Morris <![CDATA[Using the Wolfram Language in the Classroom: Math]]> http://blog.internal.wolfram.com/?p=27986 2015-10-06T13:29:19Z 2015-10-05T14:36:24Z Welcome to the first in a series of posts on using the Wolfram Language in the classroom! Each day this week my colleagues and I will share some of our thoughts about how to use the Wolfram Language in various classroom settings. Each post will focus on a different subject and will provide an example lesson for instructors to use with their students, complete with the appropriate grade levels, goals, and procedures. Our lessons are designed with the principles of computational thinking in mind, and we will highlight specifically how these lessons fit into that paradigm.

Today I’ll discuss a subject the Wolfram Language was born and bred to tackle: math. But since there is so much to do with math in the Wolfram Language, we need to focus on a specific aspect. I want to talk about how to use the Wolfram Language to create exploratory tools that allow students to develop their intuition and curiosity without the pressures of rigorous formalization.

Using the Wolfram Language in a math class supports a computational approach to critical thinking, where students explore mathematical concepts using a computer.

In this lesson I will show you how to create two exploratory tools that can be revisited at various levels of math.

Lesson title: Creating Exploratory Math Tools
Grades: 6–12
Student goals:
- Formulate questions in a way that enables them to be answered with a computer
- Use the Wolfram Language to experiment with math concepts
- Use computer-based tools for experiential math learning

- Create tools to explore polynomials and polygons
- Have students use these tools to develop their intuition

For the first part of the lesson, you will create a tool that your students can use to explore regular polygons. Draw a single polygon using CirclePoints:

Using CirclePoints to draw a single polygon

In contrast to other educational platforms, with the Wolfram Language it’s trivially easy to turn any such expression into an interactive exploration. Use Manipulate to attach a slider to the number of sides of the polygon:

Using Manipulate to add a slide

You can see that as you increase the number of sides, the polygons look more and more like disks. Add a disk in the background for comparison:

Add a disk in the background

Even at the elementary level, this is an engaging tool for students to explore and develop their understanding of polygons and disks. But you can make it an even more powerful tool by thinking about the areas of the polygons.

Luckily, you don’t have to build the code out more in this example because it’s already written for you! The Wolfram Demonstrations Project is an excellent resource for prebuilt exploratory content. You can just download the code from the Demonstration “Approximating Pi with Inscribed Polygons”:

Approximating pi with inscribed polygons

The same concept—approximating circles with multi-sided polygons—can be used as the basis for teaching elementary-school students about shape and high-school students about limits and integration. Students can ask questions such as “How does increasing the number of sides of a polygon affect the area?”, and then use this tool to explore the answer without ever having a formal introduction to the number π.

For the next part of the lesson, you will create a tool to develop intuition about polynomials. Start by plotting a quadratic polynomial:

Plotting a quadratic polynomial

By changing the constant term, the plot shifts up and down the y axis. By changing the coefficient on the quadratic term, the parabola becomes broader or narrower:

Changing the constant term and the coefficient

For most students, this is where intuition about polynomials ends. What happens if one changes the coefficient on the linear term? What if one adds a cubic term? To help students develop their intuition to answer these questions, create a tool that allows them to dynamically change the coefficients of a plotted polynomial:

Dynamically change the coefficients of a plotted polynomial

By adjusting the sliders, students can see how the coefficients affect the shape of the polynomial. But because it never hurts to give students a little extra motivation, you can make this tool more engaging by adding a challenge. Plot a random polynomial and ask the students to slide the sliders until they feel like they’ve sufficiently matched the underlying polynomial. This “gamification” builds intuition and understanding while providing a satisfying brain teaser. As before, you don’t even have to work very hard to create this tool. You can again just go to the Wolfram Demonstrations Project and download the code. In this case, download the notebook for “Polynomial Fitter”:

Polynomial Fitter

These are just two examples of exploratory tools you can create (or download) using the Wolfram Language. Tools like these provide a playground for students to cultivate their intuition outside the classroom, allowing for more effective usage of their time in class. These tools also allow students who don’t feel like they “get” formal math to still develop their conceptual understanding.

To see more posts in this series, please click here.

Download this post as a Computable Document Format (CDF) file.

Peter Barendse <![CDATA[Literary Analysis and the Wolfram Language: Jumping Down a Reading Rabbit Hole]]> http://blog.internal.wolfram.com/?p=27953 2015-10-01T18:56:01Z 2015-10-01T18:56:01Z As summer wraps up and students are hitting the books once again here in the US, it’s fun to explore how the Wolfram Language can be used in the classroom to analyze texts.

Take the beloved classic Alice in Wonderland by Lewis Carroll as an example. In just a few lines of code, you can create a word cloud from its text, browse its numerous covers, and visualize its emotional content.

Jump right in by creating a WordCloud:

Creating a WordCloud for <em>Alice in Wonderland</em>

WordCloud includes low-information words like “the” and “a”; using DeleteStopwords to eliminate them gives a more meaningful word cloud:

Using DeleteStopwords in WordCloud

Even if you’ve never read Alice in Wonderland, you can get a one-sentence summary from the word cloud: Alice is the star of a story with lots of talking, royalty, and animals.

You can see the covers for different editions of Alice in Wonderland by browsing them at Open Library.

First, fetch the URL:

<em>Alice in Wonderland</em> book covers from Open Library

Then look through the page to find cover image locations and import them.

Uh-oh! These covers are only thumbnails—too small. There is no potion to drink to make them magically larger, but you can fine-tune the code, locating edition-specific pages from the main URL and importing the corresponding full-size cover images:

Importing the full-size cover images

You can browse through the different covers using the thumbnails for the drop-down control:

Using Manipulate to browse through different covers

You can also create a cartoon summary of the emotional content expressed in the sentences of a book. With a summary, you can tell at a glance whether that Shakespeare play you’re reading is a comedy or a tragedy. Or, in this case, find out what’s happening with Alice.

In the output, neutral text is represented by an underscore, positive content by a blue smiley face, and negative content by a red face. With Tooltip, you can hover over a symbol to read its corresponding sentence:

Summary of emotional content using Tooltip

Diving further down the rabbit hole, you can also graph swings of emotion. Here, each positive or negative sentence adds or subtracts from the cumulative emotion, while each neutral one brings the emotion closer to zero:

Graphing swings of emotion

Finally, you can classify the sentences in Alice by "FacebookTopic", which is a useful tool for identifying themes within any book. The output gives the number of sentences with the corresponding sentiment and could likewise be used to generate ideas for a term paper on The Catcher in the Rye or a literary critique of Pride and Prejudice:

Using FacebookTopic to identify themes

We take the six most popular topics and color the data by those topics, leaving everything else gray:

Color coding topics by popularity

Putting these colors on the previous “cumulative emotion” graph allows you to compare topic and emotional content:

Cummulative emotion graph

No matter what books you’re reading—for study or for pleasure—you’ll find new ways to explore them with the Wolfram Language.

Download this post as a Computable Document Format (CDF) file.

Jeffrey Bryant http:// <![CDATA[Stranded on Mars: Exploring Travel on Mars in The Martian]]> http://blog.internal.wolfram.com/?p=27897 2015-09-24T14:38:40Z 2015-09-24T14:32:12Z The popular book The Martian by Andy Weir will be released in movie form on October 2. The Martian is about an astronaut, Mark Watney, stranded alone on Mars. The crew of Ares 3, the third manned mission to Mars, thought he had been killed during an evacuation. When the crew left, they took the only planned means of escape and communication with them. The next manned mission to Mars isn’t for four years, so Watney has to face the fact that he must either figure out how to survive for up to four years on Mars or die. The book does a wonderful job of supplying technical details of the conditions and supplies available, as well as of the problems that arise as a result of using things in ways for which they were not designed. The details are great for allowing us to explore the travels of the main character with the Wolfram Language.

It’s at this point I should probably post a warning: SPOILER ALERT! From here on I will be exploring aspects of the story and so will be giving away plot points. If you don’t like those kinds of details, stop here and go read the book… and then come back and read this blog.

Travel and communication with NASA are among the major problems Watney faces. He decides to modify the abandoned mission rover for longer travel and go to the nearest communication site, the Mars Pathfinder landing site. The book tells us the coordinates of Watney’s home base, called a habitat, or HAB for short. I used Mathematica 10.2 (which includes high-resolution tiles of Mars) and GeoGraphics to visualize the area around the Ares 3 HAB:

Using GeoGraphics to visualize the area around the Ares 3 HAB

To put this into a more global perspective, you can change the GeoRange and the GeoProjection:

Using GeoRange and GeoProjection to gain a global perspective

The distance from the HAB to the Mars Pathfinder can be easily computed using the Wolfram Language:

Finding the distance between HAB to the Mars Pathfinder

We can visualize the path Watney takes using GeoGraphics:

Visualisizing the path Watney takes using GeoGraphics

Once Watney has retrieved the Mars Pathfinder and established communication, he makes plans for an escape. Because of the way the Ares missions are planned and executed, the Mars Ascent Vehicle (MAV) is landed long before the arrival of the next crew (the way off the planet). Basically, the Ares 4 crew won’t arrive for four years, but its MAV has already landed. The problem is that the Ares 4 MAV is in a different location on Mars, Schiaparelli Crater.

Schiaparelli Crater

This is quite a long way from the Ares 3 HAB—over 2000 miles. This is much farther than the previous jaunt to get the Mars Pathfinder:

Distance to get to the Mars Pathfinder

Of course, nothing is ever easy. Due to craters, valleys, and other complications, the actual path is not a straight line. One of the first deviations along the way comes from Mawrth Vallis. This is a water-carved valley on Mars that bridges the transition from the relatively flat Acidalia Planitia (upper left in the following graphic) to the more rugged, higher-altitude, and crater-strewn Arabia Terra (lower right in the following graphic):

Mawrth Vallis

Although Mawrth Vallis makes for a less direct route, it’s a more gradual slope, and therefore easier to traverse. We can zoom into Mawrth Vallis by changing the GeoRange:

Mawrth Vallis

In the CDF version of this post (downloadable below), if you click the graphic and press the “.” key on the keyboard you can hover over the graphic to get various latitude/longitude coordinates. In addition, you can click and set down a set of points and trace out a path through Mawrth Vallis. Once the path is laid down, you can do a simple copy and paste to paste the set of points that were just specified. I also rounded the results to 0.01 angular degrees, which is around 1/2 of a pixel in the above graphic. These can be used to create a GeoPath through Mawrth Vallis:

Creating a GeoPath through Mawrth Vallis

Along the way to Schiaparelli Crater, Watney navigates using a number of geographic features, and even names some after himself. For example, he names the area bounded by Becquerel Crater, Trouvelot Crater, and Marth Crater the “Watney Triangle”. In the words of Mark Watney, “I’m calling it the Watney Triangle because after what I’ve been through, #!&% on Mars should be named after me.”

The Watney Triangle

Taking all of the references and features mentioned in the book, we can get a fairly decent picture of the region visited by Watney along his way:

Using references and features mentioned in the book to get a picture of the region visited by Watney

The actual path covered is far from a straight line, so the total distance traveled is longer than the straight-line distance computed earlier. We can combine all the destination points together to estimate the total distance Watney actually had to travel, nearly 300 miles farther than the straight-line distance:

Calculating the total distance Watney traveled

The story doesn’t end there. Once Watney reaches the Ares 4 MAV, he still has to take off and intercept the Hermes, the large spacecraft used to ferry astronauts between Earth and Mars. Due to the use of ion propulsion, the Hermes cannot make sudden changes in its velocity, and due to the abrupt change in plans, Hermes can’t enter orbit. So Watney has to figure out how to take a MAV designed to only reach orbit and get it to go much higher to intercept the Hermes as it makes a close flyby of Mars. The proposed solutions to these problems are almost as scary as the problems themselves. The book was really fun to read. Mark Watney had a lot of challenges to overcome in order to survive on Mars. I will not reveal the ultimate outcome so you have something to look forward to. I just hope I can survive the wait until the movie comes out!

Download this post as a Computable Document Format (CDF) file.

Wolfram Blog Team http:// <![CDATA[MHacks 6 Brings Hacking to a Higher Level]]> http://blog.internal.wolfram.com/?p=27884 2015-09-25T19:13:48Z 2015-09-23T17:20:41Z MHacks is a hackathon hosted by the University of Michigan every year that brings together a diverse group of students to redefine the modern perception of hackers as criminals or programming experts and to make something amazing. At this year’s MHacks 6, Wolfram was proud to be a sponsor and see our technologies in action in several of the group projects.

Last year’s winners, Olivia Walch and Matt Jacobs, returned with new teammates Sam Oliver and David Renardy as Team Fusion Furniture. Their hack, which tied for first place in Best Use of Wolfram Technology, allows users to turn photos and pictures from their phones into custom, 3D-printed tables and chairs. Team Fusion Furniture used the Wolfram Language and Wolfram Development Platform (formerly known as Wolfram Programming Cloud) to “generate, export, and email the 3D model from the images” and for other back end needs.

Team Fusion Furniture

Tying Fusion Furniture for first place in Best Use of Wolfram Technology was Team SpeakEasy. University of Michigan students Daniel Zhang, Sarthak Bhandari, Tharun Selvakumar, Jason Brown, and Apoorva Gupta created SpeakEasy to use audio analysis to aid public-speaking skills. Using Wolfram Language machine learning functions such as Classify and image analysis, SpeakEasy compares the tone fluctuation and speaking speed of an individual reading a text with the same individual reciting it as a speech. Once the analysis is complete, SpeakEasy outputs a description of the analysis as well as advice on how to improve the speech.

Our mentors with team SpeakEasy

The members of winning teams Fusion Furniture and SpeakEasy were awarded passes to the 2015 Wolfram Technology Conference this coming October. Two other teams, Moooooodify! and FluxDuck, took second and third place in the Wolfram category, winning one-year, developer-level subscriptions to Wolfram Development Platform.

Team Moooooodify Team FluxDuck

Team Moooooodify!, comprised of Tushita Gupta, Aishwarya Premremu, and Ridlu Ruana, created an Android app using the Wolfram Language that tracks moods by analyzing the user’s outgoing texts and Facebook posts for each 24-hour period. Although it currently only identifies “happy” and “sad,” the Moooooodify! team plans to expand the emotional range in the future.

Team members Mark Gee, Mitchell Lee, and Sai Naidu of FluxDuck built an app that determines worthy companies with which to seek employment based on their reputations in the news media. Information scraped from sites like CNN Money is processed with sentiment analysis using the Wolfram Cloud API and Python to rank companies and help job seekers choose employers they would like to work for.

At least five other teams at MHacks made use of Wolfram Development Platform, the Wolfram|Alpha API, and/or the Wolfram Language. A big thanks to the University of Michigan for hosting. This was another great hackathon to attend and sponsor, and we can’t wait for the next one!

Have a hackathon on the horizon? Contact Wolfram to request our participation, or check out the resources on our hackathon page.

Arnoud Buzing <![CDATA[The Coffee “Flavor-Rator”]]> http://blog.internal.wolfram.com/?p=27850 2015-09-21T18:17:47Z 2015-09-21T18:17:47Z I drink too much coffee—it’s one of my few vices. Recently, my favorite espresso machine at the Wolfram Research headquarters in Champaign, Illinois, was replaced with a fancy new combination coffee and espresso maker. The coffee now comes in little pouches of various flavors, ranging from “light and smooth” to “dark and intense”. There even is a “hot chocolate” pouch and a way to make cappuccinos using both a “froth” pouch and an “espresso” pouch. Here is a picture of the new coffee selection:

Coffee flavor display

I noticed a great interest in the new machine, so I decided to create a sort of instant poll to find out which flavors were the most liked (while also saving myself the trouble of trying each flavor individually). To do this I used a number of somewhat-new features in the Wolfram Language and the Wolfram Cloud, specifically deployed web forms and databins. And so the “Flavor-Rator” was created. This post describes all the details you need to know to create a poll like this yourself.

At the core of this instant poll is a databin that holds the flavors and their ratings. The CreateDatabin command creates it. The flavor is always a string, like “Colombia (Medium and Balanced)”, and the rating is always an integer (from 1 to 5, with 5 representing an excellent flavor):

Databin that holds the flavors and their ratings

The databin only needs to be created once. In subsequent coding sessions, you can refer to the resulting databin directly:

Can reuse the databin directly in other coding sessions

Next I defined the coffee flavors, of which there are thirteen (plus the frothing pouch):

Defining the coffee flavors

And I also defined the ratings. Higher numbers mean better coffee:

Define the ratings for the coffee

The flavor poll is implemented as an online form. Its layout and the action taken on the data that is entered is specified via a FormFunction.

This form has two fields, “Flavor” and “Rating”. The syntax {“flavor”,“Flavor”} indicates that the form parameter name is “flavor”, but the form label reads “Flavor”. The full syntax {“flavor”,“Flavor”} ->flavors means that the form will show a pull-down menu with all the given flavors and assign “flavor” to the selected flavor upon the form submission. The syntax for “rating” is similar to that for “flavor”.

The second form function argument defines the action to take on the submitted data. This action does two things: it adds the submitted data to the previously defined databin (using DatabinAdd), and generates a result that shows the average ratings so far (in image/png form to show the nice typeset form of the dataset):

Second form function argument defines the action to take on the submitted data

Finally, I deployed this form function to an object in the cloud. First I created a cloud object named “flavor-rator”:

Created cloud object named flavor-rator

Then I deployed the form function to the cloud object:

Deployed for function to the cloud object

Here is the form as it looks on the web:

Form on the web

That’s it! The form is now ready to be announced to the coffee drinkers in the building. I sent an email to the employee “social” email list, and printed a QR barcode image and placed it near the coffee machine:

QR Barcode


After waiting a day or so for data to accumulate from the coffee drinkers, it was time to analyze the data I’d been given by our coffee-thirsty Wolfram employees. Which coffee flavor is the most popular? Which is most disliked? Which has been rated the most frequently? Let’s find out!

This is the raw data from the databin, converted to a dataset. Every row is one rating for a given flavor from one employee. A few dozen ratings accumulated in about two days’ time.

Raw data from databin
Raw data from databin

You can make this a bit more understandable by grouping the ratings by flavor. That way you can more readily see the rating patterns for each flavor. You can see how Colombia and Dove Hot Chocolate were the most frequently rated flavors. Getting that result is a simple database query:

Grouping ratings by flavor

From there it’s a simple matter of applying Mean to compute the average rating for each flavor:

Using Mean to compute the average rating

Let’s also sort this by rating, from the highest-rated coffee (Sumatra) to the lowest-rated coffee (Espresso Delicato). Clearly Sumatra, Hazelnut, and the Alterra House Blend are the flavors I will need to try out over the next couple of days:

Sort by highest rated coffee first

Now you can get a little fancier by looking at how the ratings are distributed visually, with a histogram plot. Clearly more ratings would be useful to get a solid rating distribution, but there are some things that are of interest to note: the Dove Hot Chocolate (the only non-coffee flavor) is not getting high marks, with only one 4 rating and everything else 3 or lower. And the French Vanilla flavor is the most controversial flavor, having both 1 and 5 ratings:

Ratings as a histogram

Ratings as a histogram

So there it is: with a handful of simple commands (Databin, Dataset, FormFunction, CloudDeploy, CloudObject, GroupBy, and SortBy), I can quickly create a completely custom web rating system and analyze and share the results. By doing all this in the Wolfram Language, I can interactively tweak and improve my prototype design and iterate to a web form that I am happy to put into production. And I can do all this while sipping a cup of Sumatra coffee from the new coffee machine!

Download this post as a Computable Document Format (CDF) file.

Jonathan Wallace <![CDATA[The Republican Presidential Debate Clouds: Round 2]]> http://blog.internal.wolfram.com/?p=27810 2015-09-18T20:58:13Z 2015-09-18T20:50:26Z After the first Republican presidential debate, we showed you how the WordCloud function in the Wolfram Language can be used to create compelling visualizations of what the candidates said.

This time around, Alan Joyce and Vitaliy Kaurov have done an even cooler analysis over at Wolfram Community, delving further into what words were used most frequently and what subjects the candidates had in common—and how they set themselves apart.

For example, check out the words uniquely used by each candidate in Wednesday’s debate below.

Jeb Bush WordCloud Ben Carson WordCloud Chris Christie WordCloud Ted Cruz WordCloud Carly Fiorina WordCloud Mike Huckabee WordCloud John Kasich WordCloud Rand Paul WordCloud Marco Rubio WordCloud Donald Trump WordCloud Scott Walker WordCloud

Says Alan, “It’ll be interesting to start watching trends over time, as the campaign season progresses and more debates occur.” We can’t debate that.

Dana Flinn <![CDATA[Experts in Action: Live-Coding with Christopher Wolfram]]> http://blog.internal.wolfram.com/?p=27745 2015-09-21T12:59:02Z 2015-09-17T18:00:28Z If you’ve ever hit a roadblock while learning to code, then you know the frustration of trying to find the best resource to help you out. We have good news. We are happy to announce that Christopher Wolfram, son of Wolfram Research’s founder, Stephen Wolfram, will be live-coding on Livecoding.tv. This new Y Combinator–backed coding platform brings programmers together to watch live streams of people coding real products.

Christopher live-coding onstage at Maker Faire

Enhance your coding skills and learn directly from someone with the knowledge and expertise that results from working directly with Stephen Wolfram. Christopher’s presentation will focus on education analytics; users who tune in will see a firsthand demonstration of how to interact with datasets and visualizations in the Wolfram Language. The live streaming is scheduled for Tuesday, September 22 at 7pm CDT.

Livecoding.tv is an educational startup designed to allow developers to stream live videos of themselves coding anything from apps and games to real products. Much like Twitch aspired to revolutionize gaming, Livecoding.tv is eager to transform the way people learn to code. Focused on online learning, it gives coders the ability to watch experienced programmers at work and interact with them. Once the live stream is over, users can play back the video to pick up on anything they might have missed.

Christopher has been programming for half his life and has given a number of public lectures about Mathematica from as young an age as 13. “One of the things I always liked about programming was that there are few limitations on what you can build. With something like, say, carpentry, you are limited by all sorts of practical issues,” says Christopher.

In a presentation he gave at Maker Faire in New York, Christopher demoed connecting Mathematica to an Arduino board and a quadricopter.

Earlier this summer, Stephen Wolfram demonstrated the power and simplicity of the Wolfram Language on Livecoding.tv. The streaming took place on the 27th anniversary of the first release of Mathematica; Wolfram used the theme to have some impromptu fun with Wolfram Language code.

Improve your coding skills and register to watch the livestream September 22 at 7pm CDT. For more information about the event, please click here.

Peter Barendse <![CDATA[Surfaces and Solids of Revolution: Using Wolfram|Alpha’s “Virtual Potter’s Wheel”]]> http://blog.internal.wolfram.com/?p=27688 2015-09-21T18:47:37Z 2015-09-16T17:17:38Z Before today’s 3D printing technology allowed us to make objects of virtually any shape, humanity was limited in the kind and precision of shapes we could produce. Driven to overcome these limitations, we gradually invented a series of machines that could create ever-more-complicated types of shapes, culminating (just before the 3D printer) in machines like this multiaxis computer-numerical-controlled (CNC) mill:

Multiaxis computer-numerical-controlled (CNC) mill

The first of this series of machines was perhaps the potter’s wheel, which allowed us to make precisely round objects of any profile. To me, it still seems a bit magical to watch as potters trace out a curve with their hands, and seeing, as the wheel spins, that curve get copied all the way around the vase:

Potter's wheel

A simple generalization of the potter’s wheel is the lathe. It’s basically a potter’s wheel for wood or metal. Lathes are similar to potter’s wheels, but the work is laid horizontally and a firmly braced, sharp cutting tool is used. The cutting tool can also be attached to a curved guide specifically built to help carve out a certain precise shape repeatedly.


Both the lathe and potter’s wheel create only a certain class of shapes, called solids of revolution. The surface of a solid of revolution is called a surface of revolution.

Mathematically, a surface of revolution is the result of taking a curve in the two-dimensional plane (like the guide on the lathe) and revolving it about an axis. The path swept out by the curve is a surface in three dimensions. A solid of revolution is the result of taking a two-dimensional region of the plane and revolving it about an axis; the path swept out is then a three-dimensional object.

Surfaces and solids of revolution are traditionally taught in the second semester of calculus, as an application of integration. I found them useful for teaching because they provide the next-most intuitive example of the integration concept after the area under a curve, while still only requiring a single integral.

With 3D printing and the Wolfram Language, calculus students can now have imagination and design experience added to the theory and intuition they already get. And as I’ll show, you don’t even need to understand calculus or coding to use Wolfram|Alpha’s virtual potter’s wheel! So, in the spirit of the potter’s wheel, let’s make a cup!

After playing around for a while looking at functions in Wolfram|Alpha (OK, I admit I used the Wolfram Language so I could push and pull on the curve interactively), I found a good candidate “guide” curve, perhaps for a fancy cocktail glass:

Guide curve

Now, I can just change “plot” to “revolve,” and Wolfram|Alpha tells me all about my cup and shows a picture:

Changing plot to revolve input
Changing plot to revolve output

In addition to the equations defining the surface and solid here, I get the “Volume of solid” and the “Area of surface.” The volume is about 120—this means that if my unit of measurement were centimeters, my cup would hold 120 mL (120 cc).

But this includes all the volume inside of the stem and base. Some of this space needs to be used by the actual glass (or whatever the cup is made of). So let’s add an inside curve, which I’ll create by taking the part of our first curve from 3 to 7 (using a step function) and subtracting 1/6:

Adding an inside curve by taking part of the first curve

Now, I could either print out the plot and use it as a pattern on my own lathe (if I had one), or continue to use Wolfram|Alpha’s virtual potter’s wheel:

Continue to use virtual potter's wheel
Continue to use virtual potter's wheel

I can now see how much raw material we need to buy for each cup: about 20 cc, which leaves about 100 cc of space for the liquid. I can also calculate how much paint is needed to cover the cup, since the “Surface area of solid” is about 233 cm², and paint typically says on the container how many gallons are needed to cover a certain area.

To print this cup using the Shapeways website, I followed a simplified version of the process described in Vitaliy Kaurov’s post last year.

Although I can produce any surface of revolution in the Wolfram Language using RevolutionPlot3D, I began instead by copying the “Parametric representation of surfaces” and just sticking them into ParametricPlot3D (or if you’re using the Wolfram|Alpha website, the “Wolfram Language plaintext inputs” from the “Parametric representation of surfaces” part of the Wolfram|Alpha result). It turned out that I had to change a couple things to meet Shapeways’s requirements: since they accept millimeters but not centimeters, I had to scale up the plot by 10 in every dimension (using ScalingTransform), and I had to make it 1.6 mm thick, which I did with PlotStyle:

Using ScalingTransform and PlotStyle to meet Shapeways's requirements

The only other step was to upload the cup in an .stl file to the website:

Upload the cup in an .stl file to the website

And… voilà! Here is an image of the finished product, created in plastic for $23:

Finished product in plastic

Wolfram|Alpha can create a lot more kinds of surfaces and solids of revolution, by using different kinds of functions, axes, and amounts of rotation:

Creating more surfaces and solids of revolution input
Creating more surfaces and solids of revolution output

I can even rotate an infinitely long part of a curve, which leads to a mathematical “paradox” called Gabriel’s horn (AKA, Torricelli’s trumpet):

Infinitely rotating long part of a curve

Wolfram|Alpha says that the volume is π, but the surface area is infinite! This seems to imply that I could fill the horn with a finite amount of paint, yet this would not be enough to cover the inside surface, which is clearly absurd. Of course, paint is not really a two-dimensional surface coverer, and at some point even a single molecule of paint will not be able to fit into the ever-narrowing tube, so there is no physical paradox here.

Soon Wolfram|Alpha Pro users will be able to access step-by-step solutions for the surface area and volume, showing how to compute each part of the surface area or volume and add them up. I’d love to hear your ideas for other ways to use this technology.

With my new cup now in hand (partly because I forgot to analyze its propensity to tip), I would like to propose a toast to creativity, and the tools that enable us to realize our visions.


Download this post as a Computable Document Format (CDF) file.

Bernat Espigulé-Pons <![CDATA[Track Everything with the Wolfram Data Drop IFTTT Channel!]]> http://blog.internal.wolfram.com/?p=27511 2015-09-14T14:41:11Z 2015-09-14T14:24:44Z In March, we launched the Wolfram Data Drop, an open service that makes it easy to accumulate data of any kind, from anywhere—setting it up for immediate computation, visualization, analysis, querying, or other operations. Now we are announcing the release of the Wolfram Data Drop Channel, which lets you track and accumulate data from your everyday apps, devices, and services available in IFTTT wherever and whenever you want.

Wolfram Data Drop Channel in IFTTT

IFTTT—which stands for “if this then that”—is a service that coordinates apps and other services, triggering one to do something when something else happens in another. IFTTT products and apps are organized in Channels of triggers and actions that are used to create personalized recipes and buttons on your mobile devices. A typical recipe could be “If anyone posts a new Instagram photo from Central Park, then add the photo’s URL to a databin”:

Example of IFTTT-If this then that

The advantage of using the Wolfram Data Drop Channel is that it makes it easy to perform sophisticated analysis of data collected by IFTTT recipes with the Wolfram Language. Let’s say that we would like to know what’s in the images from the above recipe. It only takes a line of code to achieve this, thanks to ImageIdentify:

Using ImageIdentiy with IFTTT recipe

At the Wolfram Innovation Summer School 2015, Colt Bradley set up several recipes to capture images taken from the world’s top ten universities. With this data, he was able to compute the average dominant colors of several campuses and tweet the results in an automated way using ServiceConnect to Twitter. Here is the result obtained for Cambridge (notice that the trending hashtags were computed from the images’ captions collected with IFTTT):

Twitter post of Dominant Colors for University of Cambridge

You can create two kinds of recipes with IFTTT: DO Recipes and IF Recipes.

DO recipes and IF recipes

DO Recipes run with a single tap, letting you create your own personalized Button, Camera, or Notepad. DO apps are available for iOS and Android.

DO apps available for iOS and Android

With a DO Recipe, you can make a button on your phone that records your GeoPosition in a databin. With that data, you can compute things like the distance and elevation between the last two entries you added:

Computing distance and elevation between two entries

Or make a map of where you’ve been:

Map of where you have been

IF Recipes run in the background, creating connections according to the pattern “if this then that”. “This” is represented by the Trigger Channel, and “that” is represented by the Action Channel. For example, here’s a recipe to add new posts in AskReddit to a databin:

Recipe to add new posts to AskReddit

With such an IF Recipe, you could build an entire website using the Wolfram Language, which is exactly what Qi Xie, another student from the Wolfram Innovation Summer School, did. Her website, AskReddit Explorer, allows you to analyze recent questions posted in AskReddit. Using a FormFunction, the visitor is asked to choose one of the built-in classifiers available in Classify to get some insights about the AskReddit activity:

AskReddit Explorer

Choosing “Topic Analysis” gives you a bar chart of post counts by topic:

Bar chart by choosing Topic Analysis

Then you can click in “See Posts” to take a look at recent questions by topic:

Using See Posts to see recent questions by topic

I like to think of IFTTT as a universal bridge that brings together the ever-increasing diversity of the apps, services, and devices surrounding us. When I first started thinking about connecting the space of possible IFTTT recipes to the Wolfram Language a year ago, I couldn’t have guessed what a great solution the Wolfram Data Drop would be. Data Drop is able to store data in a standardized way, in “databins”, with definite IDs. Databins can be set up to interpret all sorts of incoming data, from very specific physical quantities to arbitrary inputs and expressions. For example, here is a recipe that drops your elevation in feet into a databin every time it changes.

First create the databin and tell it to interpret elevations in feet:

Create databin and tell it to interpret elevations

Then make an IFTTT recipe that drops your elevation into the databin every time it changes:

Make an IFTTT recipe the drops your elevation into a databin

With the data in a databin, it’s a simple call to UnitConvert to get the elevations in meters:

Using UnitCovert to get elevations in meters

Or to plot your changes in elevation over time:

Plot changes of elevation over time

There are more than 150 trigger channels that can be connected to Data Drop. I really encourage you to explore them by going through the fun and creative process of coming up with new recipes. Here is my latest creation. I’ve used a cloudBit module with a sound trigger to be notified and to add an entry to a databin whenever my home’s telephone is ringing:

Using cloudBit module to add to databin

This extracts the data in the bin as a time series:

Extracting data in the bin as a time series

Plotting the time series shows how often my telephone rings and when:

How often the phone rings and when

To get started making your own recipes, sign up for Data Drop and IFTTT and follow the simple steps explained in my quick introduction video (download notebook):

Please do share your own experiments with us on the Wolfram Community thread that I have started especially for IFTTT recipes. Also feel free to ask any questions or suggest any related ideas there. I hope you’ll have a chance to try it and that you’ll end up doing amazing things using the Wolfram Data Drop Channel:

Wolfram Data Drop Channel

Download this post as a Computable Document Format (CDF) file.