You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: chapters/animation/chapter.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@
6
6
7
7
## Background
8
8
9
-
The word animation is a medieval term stemming from the Latin animare, which means ‘instill with life’. In modern terms, it's used to describe the process of creating movement from still, sequential images. Early creators of animation used spinning discs (phenakistoscopes) and cylinders (zoetropes) with successive frames to create the illusion of a smooth movement from persistence of vision. In modern times, we're quite used to other techniques such as flip books and cinematic techniques like stop motion. Increasingly, artists have been using computational techniques to create animation -- using code to "bring life" to objects on the screen over successive frames. This chapter is going to look at these techniques and specifically try to address a central question: how can we create compelling, organic, and even absurd movement through code?
9
+
The word animation is a medieval term stemming from the Latin animare, which means 'instill with life'. In modern terms, it's used to describe the process of creating movement from still, sequential images. Early creators of animation used spinning discs (phenakistoscopes) and cylinders (zoetropes) with successive frames to create the illusion of a smooth movement from persistence of vision. In modern times, we're quite used to other techniques such as flip books and cinematic techniques like stop motion. Increasingly, artists have been using computational techniques to create animation -- using code to "bring life" to objects on the screen over successive frames. This chapter is going to look at these techniques and specifically try to address a central question: how can we create compelling, organic, and even absurd movement through code?
10
10
11
11
As a side note, I studied fine arts, painting and printmaking, and it was accidental that I started using computers. The moment I saw how you could write code to move something across the screen, even as simple as silly rectangle, I was hooked. I began during the first dot-com era working with flash / actionscript and lingo / director and have never looked back.
Copy file name to clipboardExpand all lines: chapters/cplusplus_basics/chapter.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -151,16 +151,16 @@ Let's do an experiment. In the code editor, please comment out the include direc
151
151
The syntax coloring will change to all green, meaning it's now just a comment. Run the code by pressing the big green button at the bottom right, and you'll see something new in the output pane.
152
152
153
153
```
154
-
prog.cpp: In function ‘int main()’:
155
-
prog.cpp:5:2: error: ‘cout’ was not declared in this scope
154
+
prog.cpp: In function 'int main()':
155
+
prog.cpp:5:2: error: 'cout' was not declared in this scope
156
156
cout << "Hello World" << endl;
157
157
^
158
-
prog.cpp:5:27: error: ‘endl’ was not declared in this scope
158
+
prog.cpp:5:27: error: 'endl' was not declared in this scope
159
159
cout << "Hello World" << endl;
160
160
^
161
161
```
162
162
163
-
The compiler found an error and did not run the program. Instead, in attempt to help you fix it, the compiler is showing you where it got confused in attempt to help you fix it. The first part, *prog.cpp*: tells you the file that contains the error. In this case, ideone.com saved your code into that default file name. Next, it says `In function ‘int main()’`: file showing you the specific section of the code that contains the error, in this case, between the {curly brace} of a function called *main*. (We will talk about functions and curly braces later). On the next line, we see `prog.cpp:5:2:`. The 5 is how many lines from the top of the file, and 2 is how many characters rightward from the beginning of the line. Next, we see `error: ‘cout’ was not declared in this scope`. That is a message describing what it believes it wrong in the code. In this case, it's fairly correct. iostream.h is gone, and therefore no `cout` is provided to us, and so when we try to send "Hello World", the compile fails. On the next couple of lines, you see the line of code containing the fallacious `cout`, plus an extra little up-caret character on the line beneath it, and that is supposed to be an arrow pointing at a character in the code. In this case, the arrow should be sitting beneath the 'c' in `cout`. The system is showing you visually which token is at fault. A second error is shown, and this time, the compiler complains that there is no endl. Of course, we know that in order to fix the error, we need to include `<iostream.h>` so let us do that now. Please un-comment line 1 and re-run the code.
163
+
The compiler found an error and did not run the program. Instead, in attempt to help you fix it, the compiler is showing you where it got confused in attempt to help you fix it. The first part, *prog.cpp*: tells you the file that contains the error. In this case, ideone.com saved your code into that default file name. Next, it says `In function 'int main()'`: file showing you the specific section of the code that contains the error, in this case, between the {curly brace} of a function called *main*. (We will talk about functions and curly braces later). On the next line, we see `prog.cpp:5:2:`. The 5 is how many lines from the top of the file, and 2 is how many characters rightward from the beginning of the line. Next, we see `error: ‘cout’ was not declared in this scope`. That is a message describing what it believes it wrong in the code. In this case, it's fairly correct. iostream.h is gone, and therefore no `cout` is provided to us, and so when we try to send "Hello World", the compile fails. On the next couple of lines, you see the line of code containing the fallacious `cout`, plus an extra little up-caret character on the line beneath it, and that is supposed to be an arrow pointing at a character in the code. In this case, the arrow should be sitting beneath the 'c' in `cout`. The system is showing you visually which token is at fault. A second error is shown, and this time, the compiler complains that there is no endl. Of course, we know that in order to fix the error, we need to include `<iostream.h>` so let us do that now. Please un-comment line 1 and re-run the code.
164
164
165
165
```cpp
166
166
#include<iostream>
@@ -187,7 +187,7 @@ It's a very similar error as before, where it cannot find `cout` or `endl`, but
Copy file name to clipboardExpand all lines: chapters/cplusplus_basics/unabridged.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -149,16 +149,16 @@ Let's do an experiment. In the code editor, please comment out the include direc
149
149
The syntax coloring will change to all green, meaning it's now just a comment. Run the code by pressing the big green button at the bottom right, and you'll see something new in the output pane.
150
150
151
151
```
152
-
prog.cpp: In function ‘int main()’:
153
-
prog.cpp:5:2: error: ‘cout’ was not declared in this scope
152
+
prog.cpp: In function 'int main()':
153
+
prog.cpp:5:2: error: 'cout' was not declared in this scope
154
154
cout << "Hello World" << endl;
155
155
^
156
-
prog.cpp:5:27: error: ‘endl’ was not declared in this scope
156
+
prog.cpp:5:27: error: 'endl' was not declared in this scope
157
157
cout << "Hello World" << endl;
158
158
^
159
159
```
160
160
161
-
The compiler found an error and did not run the program. Instead, in attempt to help you fix it, the compiler is showing you where it got confused in attempt to help you fix it. The first part, *prog.cpp*: tells you the file that contains the error. In this case, ideone.com saved your code into that default file name. Next, it says `In function ‘int main()’`: file showing you the specific section of the code that contains the error, in this case, between the {curly brace} of a function called *main*. (We will talk about functions and curly braces later). On the next line, we see `prog.cpp:5:2:`. The 5 is how many lines from the top of the file, and 2 is how many characters rightward from the beginning of the line. Next, we see `error: ‘cout’ was not declared in this scope`. That is a message describing what it believes it wrong in the code. In this case, it's fairly correct. iostream.h is gone, and therefore no `cout` is provided to us, and so when we try to send "Hello World", the compile fails. On the next couple of lines, you see the line of code containing the fallacious `cout`, plus an extra little up-caret character on the line beneath it, and that is supposed to be an arrow pointing at a character in the code. In this case, the arrow should be sitting beneath the 'c' in `cout`. The system is showing you visually which token is at fault. A second error is shown, and this time, the compiler complains that there is no endl. Of course, we know that in order to fix the error, we need to include `<iostream.h>` so let us do that now. Please un-comment line 1 and re-run the code.
161
+
The compiler found an error and did not run the program. Instead, in attempt to help you fix it, the compiler is showing you where it got confused in attempt to help you fix it. The first part, *prog.cpp*: tells you the file that contains the error. In this case, ideone.com saved your code into that default file name. Next, it says `In function 'int main()'`: file showing you the specific section of the code that contains the error, in this case, between the {curly brace} of a function called *main*. (We will talk about functions and curly braces later). On the next line, we see `prog.cpp:5:2:`. The 5 is how many lines from the top of the file, and 2 is how many characters rightward from the beginning of the line. Next, we see `error: ‘cout’ was not declared in this scope`. That is a message describing what it believes it wrong in the code. In this case, it's fairly correct. iostream.h is gone, and therefore no `cout` is provided to us, and so when we try to send "Hello World", the compile fails. On the next couple of lines, you see the line of code containing the fallacious `cout`, plus an extra little up-caret character on the line beneath it, and that is supposed to be an arrow pointing at a character in the code. In this case, the arrow should be sitting beneath the 'c' in `cout`. The system is showing you visually which token is at fault. A second error is shown, and this time, the compiler complains that there is no endl. Of course, we know that in order to fix the error, we need to include `<iostream.h>` so let us do that now. Please un-comment line 1 and re-run the code.
162
162
163
163
```cpp
164
164
#include<iostream>
@@ -185,7 +185,7 @@ It's a very similar error as before, where it cannot find `cout` or `endl`, but
Copy file name to clipboardExpand all lines: chapters/data_vis/MichaelHadleyChapterFeedback.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ It is a very brief overview of dealing with data in OF. It overviews how to load
9
9
10
10
**[mh: you can omit the second sentence from the title]**
11
11
12
-
Computation has driven a huge increase in our capacity to collect, sort and store data. Yet our ability to perceive and understand this data remains limited by the human body’s sensory and cognitive abilities. Data visualisation aims to aid in the interpretation and presentation of data so it can be understood as information and potentially applied as knowledge. Spanning science, art, design, computation and (as some theorists argue) also philosophy, data visualisation is a way of presenting large and complex datasets graphically that can reveal trends and patterns that might otherwise remain invisible.
12
+
Computation has driven a huge increase in our capacity to collect, sort and store data. Yet our ability to perceive and understand this data remains limited by the human body's sensory and cognitive abilities. Data visualisation aims to aid in the interpretation and presentation of data so it can be understood as information and potentially applied as knowledge. Spanning science, art, design, computation and (as some theorists argue) also philosophy, data visualisation is a way of presenting large and complex datasets graphically that can reveal trends and patterns that might otherwise remain invisible.
13
13
14
14
**[mh: since you haven't defined data at this point, maybe you could start off with talking about recording observations rather than saying "data"]**
15
15
@@ -33,7 +33,7 @@ These definitions may need to be further refined.
33
33
Ben Fry is a data artist and the author of Visualizing Data (2008), a well-known text outlining data visualisation approaches for the Processing programming environment. This an excellent reference text for anyone who wishes to dive deeper into thinking and working with data visualisation techniques. In it, Fry describes seven stages for visualising data that are useful for structuring a general process of working with data. These steps are:
34
34
35
35
* Acquire: Obtain the data, whether from a file on a disk or a source over a network.
36
-
* Parse: Provide some structure for the data’s meaning, and order it into categories.
36
+
* Parse: Provide some structure for the data's meaning, and order it into categories.
37
37
* Filter: Remove all but the data of interest.
38
38
* Mine: Apply methods from statistics or data mining as a way to discern patterns or place the data in mathematical context.
39
39
* Represent: Choose a basic visual model, such as a bar graph, list, or tree.
@@ -59,7 +59,7 @@ Your dataset is likely to contain extra information not relevant to your visuali
59
59
###Mine
60
60
As Fry (2008) outlines, the mining stage of visualising data involves applying statistical methods and math to your dataset to analyse patterns and trends within it. This might be as simple as identifying the minimum and maximum values so that you know the range of variation in your data. Depending on your data, you may wish to calculate an average or a median value.
61
61
62
-
Once you have completed this step, it is now time to load and visualise your data in OF. We will return to the last three stages of Fry’s data visualisation steps following this example.
62
+
Once you have completed this step, it is now time to load and visualise your data in OF. We will return to the last three stages of Fry's data visualisation steps following this example.
63
63
64
64
##2.1 Quick overview of some common file structures. tsv, csv, xml, json
65
65
Data is available and stored in specific file types that have particular structures and syntax. The following file types are some of the most common forms of structuring data.
@@ -78,7 +78,7 @@ Data is available and stored in specific file types that have particular structu
78
78
79
79
Reading an XML file in OF requires the use of an OF addon called ofXmlSettings. **[mh: your xml isn't being rendered in md]**
80
80
81
-
* JSON: JSON stands for ‘javascript object notation’. This is a human readable file that is built on two structures, a collection of name/value pairs which can be realised in OF as a struct and an ordered list of values, realised as a vector. Json files also are parsed using an OF addon called ofxJSON, see example 2.XX for how to implement this.
81
+
* JSON: JSON stands for 'javascript object notation'. This is a human readable file that is built on two structures, a collection of name/value pairs which can be realised in OF as a struct and an ordered list of values, realised as a vector. Json files also are parsed using an OF addon called ofxJSON, see example 2.XX for how to implement this.
82
82
83
83
##2.2 Loading and saving data
84
84
@@ -88,15 +88,15 @@ FIGURE OF FILE STRUCTURE HERE
88
88
###2.2.2 ofBuffer
89
89
90
90
Once you have done this you will load this file into your OF program using the ofBuffer class. ofBuffer will read the data into a buffer (a temporary storage for our data as we write code to restructure and process it).
91
-
ofBuffer is what is known as a convenience class, and provides easy methods for reading from and writing to files. A convenience class simply means that this is a class that doesn’t do anything by itself but wraps or allows access to the functionality of a group of other classes.
91
+
ofBuffer is what is known as a convenience class, and provides easy methods for reading from and writing to files. A convenience class simply means that this is a class that doesn't do anything by itself but wraps or allows access to the functionality of a group of other classes.
92
92
93
93
###2.2.2 Buffer Functions
94
94
95
95
ofBufferFromFile(); is a function that allows you to load your data file.
96
96
ofBuffer file = ofBufferFromFile("weather.tsv");
97
97
cout << buffer.getText();
98
98
99
-
So here our weather tsv file has been loaded into a variable called ‘file’.
99
+
So here our weather tsv file has been loaded into a variable called 'file'.
100
100
101
101
```cpp
102
102
getFirstLine();
@@ -227,6 +227,6 @@ To finish this example here
227
227
JSON validation tools like: http://jsonlint.com/
228
228
229
229
##References
230
-
Fry, B. (2008). *Visualizing Data,* O’Reilly Media.
230
+
Fry, B. (2008). *Visualizing Data,* O'Reilly Media.
231
231
Ackoff, R. L. (1989). *From Data to Wisdom. Journal of Applied Systems Analysis,* 16, 3–9.
0 commit comments