23.2.3 How to use Mathematica
Here we will use the case to explain how to use “notebook” in Mathematica.
23.2.3.1 How to Write Program in Mathematica
● Entering and executing script
23.2.3 How to use Mathematica
Here we will use the case to explain how to use “notebook” in Mathematica.
23.2.3.1 How to Write Program in Mathematica
● Entering and executing script
23.2.2 Getting Started
Mathematica can be used in windowing environment and also in Terminal environment.
23.2.2.1 Starting in Desktop GUI Environment
You can run the program using [Mathematica] menu or icon in the desktop or application menu. You can alos do the same thing by running “mathematica” command on the Terminal screen.
23.2 Mathematica or Wolfram language
23.2.1 Features
Mathematica is a programming tool specialized for numerical analysis that facilitates the professional mathematical calculations needed in science, mathematics, computers, and engineering. It was developed in 1988 by Wolfram Research.
The developer, Stephen Wolfram is originally a particle physicist. While studying particle physics, he created a program for complex mathematical calculations and digged into program development. After all, he abandoned physics and devoted himself to development of the program. Mathematica is the program he developed in this way.
23.1.3 Available Major Languages and Tools
You can use various programming languages to write programs in Raspberry Pi. The following are a part of representative examples of what you can use in Raspberry Pi, and there are many other tools you can use.
■ Mathematica or Wolfram
■ Sonic Pi
■ Scratch
■ Python
■ C
■ Java
23.1.2 What We Can Do with Program
Let’s examine what it means for a user to develop and use a program separately, and what can be done with it.
■ You can freely develop and use functions that users want. If a function is not provided by an existing command or function, it can be developed and used by itself.
■ You can utilize the functions of existing command or program. If you need it in a program, you can use it by calling an existing system command or another program.
23.1 Overview of Program Basics
23.1.1 Significance of Program
In the Raspberry Pi system, we were able to do various tasks with the basic commands provided by the system. Also, with a script tool, we could combine several commands and process them all at once, and sometimes we could do it automatically. However, in this method, only the commands or functions provided basically by the system can be used, and besides, there are many restrictions because users can not perform other unique tasks desired by users.
Chapter 23 Writing Program
Chapter’s Main Topics
This chapter describes the way and procedures to create various programs in Raspberry Pi system. It shows you how to do various tasks in the system with simple operation without writing a program yourself. It also shows how to use the full-fledged program development language like Python, C, and Java.
It includes descriptions on the following topics:
■ Overview of program basics
■ Mathematica or Wolfram language
■ Sonic Pi
■ Scratch language
■ Python language
■ C language
■ Java language
22.2.2 Program – Mail Transmitting Auxiliary Tool
As described in the previous section, ff you have only mail transport agent, you can send mail, but there are many inconveniences. When sending mail from the Shell, we have to enter a sender, a recipient, a body of the mail, etc. in the mail contents at once, and we can not transmit an attachment file.
22.2 Using E-mail
22.2.1 Program – Mail Transfer Agent
We can send E-mails to others via our own E-mail server, such as gmail.com or hanmail.net usually with outlook or other tools.
We can send E-mail via E-mail server that we use through Raspberry Pi also. To do this, we need a MTA(Mail Transfer Agent) program that sends E-mail by connecting to E-mail server.
22.1.8 Motion Detecting Web Camera – Program
22.1.8.1 Framework to Access Camera via Web
program is a program that monitors video signals coming from a camera. It has the ability to detect if there is a significant change in the image, that is, motion. This program not only has a function to view the contents on the web in real time by transmitting a video taken by a camera to the Internet, but also has a function of storing the motion as an image or video when a motion is detected on the screen.