Skip to content

Commit 517fb4b

Browse files
committed
New layout draft for Data tutorial, part 1
1 parent 0e07c2f commit 517fb4b

3 files changed

Lines changed: 27 additions & 20 deletions

File tree

content/static/tutorials/data/index.html

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,38 @@
1-
<h1>Data</h1>
2-
3-
<p>
4-
<table width="656">
5-
<tr>
6-
7-
<p class="license">This tutorial is for Processing version 2.0+. If you see any errors or have comments, please <a href="https://github.com/processing/processing-docs/issues?state=open">let us know</a>. This tutorial is from the book, <a href="http://www.processing.org/learning/books/#shiffman">Learning Processing</a>, by Daniel Shiffman, published by Morgan Kaufmann Publishers, Copyright &copy; 2008 Elsevier Inc. All rights reserved.</p>
8-
9-
<p>&nbsp;</p>
1+
<table width="650">
2+
<tr>
3+
<td>
104

11-
<p>This tutorial picks up where the <a href="http://processing.org/learning/text/">Strings and Drawing Text</a> tutorial leaves off and examines how to use String objects as the basis for reading and writing data. We'll start by learning more sophisticated methods for manipulating Strings, searching in them, chopping them up, and joining them together. Afterwards, we'll see how these skills allow us to use input from data sources, such as text files, web pages, xml feeds, and 3rd party APIs and take a step into the world of data visualization.</p>
5+
<p class="license">
6+
This tutorial is from the book <a href="http://www.processing.org/learning/books/#shiffman">Learning Processing</a> by Daniel Shiffman, published by Morgan Kaufmann, &copy; 2008 Elsevier Inc. All rights reserved. If you see any errors or have comments, please <a href="https://github.com/processing/processing-docs/issues?state=open">let us know</a>.
7+
</p>
128

13-
<h3>Manipulating Strings</h3>
9+
<h1 style="line-height: 0.7em;">Data</h1>
10+
<h3 style="line-height: 0.7em;"><em>Daniel Shiffman</em></h3>
1411

15-
<p>In <a href="http://processing.org/learning/text/">Strings and Drawing Text</a>, we touched on a few of the basic functions available in the Java String class, such as charAt(), toUpperCase(), equals(), and length(). These functions are documented on the Processing reference page for Strings. Nevertheless, in order to perform some more advanced data parsing techniques, we'll need to explore some additional String manipulation functions <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html">documented in the Java API</a>.</p>
1612

17-
<p>Let's take a closer look at the following two String functions: indexOf() and substring(). indexOf() locates a sequence of characters within a String. It takes one argument, a search String, and returns a numeric value that corresponds to first occurrence of the search string inside of the string being searched. </p>
13+
<p>
14+
This tutorial picks up where the <a href="http://processing.org/learning/text/">Strings and Drawing Text</a> tutorial leaves off and examines how to use String objects as the basis for reading and writing data. We'll start by learning more sophisticated methods for manipulating Strings, searching in them, chopping them up, and joining them together. Afterwards, we'll see how these skills allow us to use input from data sources, such as text files, web pages, xml feeds, and 3rd party APIs and take a step into the world of data visualization.
15+
</p>
16+
17+
<h3>Manipulating Strings</h3>
18+
19+
<p>
20+
In <a href="http://processing.org/learning/text/">Strings and Drawing Text</a>, we touched on a few of the basic functions available in the Java String class, such as charAt(), toUpperCase(), equals(), and length(). These functions are documented on the Processing reference page for Strings. Nevertheless, in order to perform some more advanced data parsing techniques, we'll need to explore some additional String manipulation functions <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html">documented in the Java API</a>.
21+
</p>
22+
23+
<p>
24+
Let's take a closer look at the following two String functions: indexOf() and substring(). indexOf() locates a sequence of characters within a String. It takes one argument, a search String, and returns a numeric value that corresponds to first occurrence of the search string inside of the string being searched.
25+
</p>
1826

1927
<pre>
2028
String search = "def";
2129
String toBeSearched = "abcdefghi";
2230
int index = toBeSearched.indexOf(search); // The value of index in this example is 3.
2331
</pre>
2432

25-
<p>Strings are just like arrays, in that the first character is index number zero and the last character is the length of the string minus one. If the search string cannot be found, indexOf() returns -1. This is a good choice because -1 is not a legitimate index value and therefore can indicate "not found." After finding a search phrase within a String, we might want to separate out part of the string, saving it in a different variable. A part of a string is known as "substring." The substring() function which takes two arguments, a start index and an end index and returns the substring in between the two indices.</p>
33+
<p>
34+
Strings are just like arrays, in that the first character is index number zero and the last character is the length of the string minus one. If the search string cannot be found, indexOf() returns -1. This is a good choice because -1 is not a legitimate index value and therefore can indicate "not found." After finding a search phrase within a String, we might want to separate out part of the string, saving it in a different variable. A part of a string is known as "substring." The substring() function which takes two arguments, a start index and an end index and returns the substring in between the two indices.
35+
</p>
2636

2737
<pre>
2838
String alphabet = "abcdefghi";
@@ -510,11 +520,8 @@ <h3>Threads</h3>
510520

511521
<p>While using the thread() function is a very simple way of getting an independent thread, it should be noted that it is somewhat limited. Being able to make a thread object is a great deal more powerful, and this can be done by extending the Java <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Thread.html">Thread</a> class.</p>
512522

513-
<p>&nbsp;</p>
514-
515-
<p class="license">This tutorial is for Processing version 2.0+. If you see any errors or have comments, please <a href="https://github.com/processing/processing-docs/issues?state=open">let us know</a>. This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License</a>.</p>
516523

517524
</td>
518525
</tr>
519526
</table>
520-
</p>
527+

content/static/tutorials/rendering/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ <h1 style="line-height: 0.7em;">Render Techniques</h1>
99
<h3 style="line-height: 0.7em;"><em>Casey Reas and Ben Fry</em></h3>
1010

1111

12-
<p class="txt">
12+
<p>
1313
By default, everything is drawn to the primary display window. Sometimes, however, there is an advantage in drawing to another graphics surface. All of the drawing features available in the display window can be applied to an offscreen drawing surface and then drawn back into the display window as an image or texture. This technique makes it easier to imagine a program as a stack of layers similar to the technique used in photo editing and vector drawing software. Similarly, drawing surfaces in Processing can be moved around, drawn using blending effects and transparency, and drawn in different orders to change how the layers combine. Before the discussion moves to multiple drawing surfaces, this chapter starts with a discussion of the different renderers used by Processing.
1414
</p>
1515

content/static/tutorials/trig/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ <h3 style="line-height: 0.7em;"><em>Ira Greenberg</em></h3>
1212

1313

1414
<p>
15-
Trigonometry (really just a couple of the trig functions) is central to graphics programming. That being said if you're anything like me you probably have a hazy memory of trig. Perhaps you remember the mnemonic device <strong>soh-cah-toa</strong>, used to remember the relationships between the trig functions and a right triangle. Here's a diagram to awaken your memory.
15+
Trigonometry (really just a couple of the trig functions) is central to graphics programming. That being said, if you're anything like me you probably have a hazy memory of trig. Perhaps you remember the mnemonic device <strong>soh-cah-toa</strong> to remember the relationships between the trig functions and a right triangle. Here's a diagram to awaken your memory.
1616
<br /><br />
1717
<!--<img src="imgs/sohcahtoa.jpg">-->
1818
<img src="imgs/sohcahtoa.svg" style= "width: 645px; height: 486px">

0 commit comments

Comments
 (0)