Skip to content

Commit e54d620

Browse files
committed
Fix a few minor bugs.
1 parent 643d32f commit e54d620

12 files changed

+36
-22
lines changed

asset/style.scss

+4
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,10 @@ footer {
477477
.codehilite .nl { color: $primary; } // keyword label (private: etc.)
478478
.codehilite .nt { color: $primary; } // json key
479479

480+
// Hack: Pygments isn't recognizing preprocessor directives, so just color the
481+
// error like a keyword.
482+
.codehilite .err { color: $primary; }
483+
480484
// On phone-size screens, shrink all of the text a bit.
481485
@media only screen and (max-width: 479px) {
482486
.content {

book/command.markdown

+3-3
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,12 @@ Now the input handling just delegates to those:
119119

120120
<aside name="null">
121121

122-
Notice how we don't check for `null` here? This assumes each button will have
122+
Notice how we don't check for `NULL` here? This assumes each button will have
123123
*some* command wired up to it.
124124

125125
If we want to support buttons that do nothing without having to explicitly check
126-
for `null`, we can define a command class whose `execute()` method does nothing.
127-
Then, instead of setting a button handler to `null`, we point it to that object.
126+
for `NULL`, we can define a command class whose `execute()` method does nothing.
127+
Then, instead of setting a button handler to `NULL`, we point it to that object.
128128
This is a pattern called [Null
129129
Object](http://en.wikipedia.org/wiki/Null_Object_pattern).
130130

book/event-queue.markdown

+1-1
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ starts making the speaker wiggle.
339339
We want to defer that work until later so that `playSound()` can return quickly.
340340
To do that, we need to *reify* the request to play a sound. We need a little
341341
structure that stores the details of a pending request so we can keep it around
342-
until later.
342+
until later:
343343

344344
^code play-message
345345

book/observer.markdown

+1-1
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ require much knowledge of the other.
630630

631631
## Observers Today
632632

633-
*Design Patterns* came out in the <span name="90s">90s</span>. Back then,
633+
*Design Patterns* came out in <span name="90s">1994</span>. Back then,
634634
object-oriented programming was *the* hot paradigm. Every programmer on Earth
635635
wanted to "Learn OOP in 30 Days," and middle managers paid them based on the
636636
number of classes they created. Engineers judged their mettle by the depth of

code/cpp/service-locator.h

-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ class LoggedAudio : public Audio
7878
wrapped_.stopAllSounds();
7979
}
8080

81-
8281
private:
8382
void log(const char* message)
8483
{

code/cpp/update-method.h

+10-9
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ namespace UpdateMethod
102102
//^statues
103103
}
104104
}
105-
105+
106106
namespace KeepInMind
107107
{
108108
struct Entity
@@ -113,7 +113,7 @@ namespace UpdateMethod
113113
};
114114

115115
static const int MAX_ENTITIES = 10;
116-
116+
117117
void refreshGame() {}
118118

119119
void skipAdded()
@@ -146,7 +146,7 @@ namespace UpdateMethod
146146
namespace SampleCode
147147
{
148148
static const int MAX_ENTITIES = 10;
149-
149+
150150
//^entity-class
151151
class Entity
152152
{
@@ -179,7 +179,7 @@ namespace UpdateMethod
179179
{}
180180

181181
void gameLoop();
182-
182+
183183
private:
184184
Entity* entities_[MAX_ENTITIES];
185185
int numEntities_;
@@ -192,7 +192,7 @@ namespace UpdateMethod
192192
while (true)
193193
{
194194
// Handle user input...
195-
195+
196196
// Update each entity.
197197
//^update-component-entities
198198
for (int i = 0; i < numEntities_; i++)
@@ -213,7 +213,7 @@ namespace UpdateMethod
213213
Skeleton()
214214
: patrollingLeft_(false)
215215
{}
216-
216+
217217
virtual void update()
218218
{
219219
if (patrollingLeft_)
@@ -247,7 +247,7 @@ namespace UpdateMethod
247247
if (++frames_ == delay_)
248248
{
249249
shootLightning();
250-
250+
251251
// Reset the timer.
252252
frames_ = 0;
253253
}
@@ -256,7 +256,7 @@ namespace UpdateMethod
256256
private:
257257
int frames_;
258258
int delay_;
259-
259+
260260
void shootLightning()
261261
{
262262
// Shoot the lightning...
@@ -310,7 +310,8 @@ namespace UpdateMethod
310310
else
311311
{
312312
x += elapsed;
313-
if (x >= 100) {
313+
if (x >= 100)
314+
{
314315
patrollingLeft_ = true;
315316
x = 100 - (x - 100);
316317
}

html/command.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,11 @@ <h2><a href="#configuring-input" name="configuring-input">Configuring Input</a><
177177

178178
<aside name="null">
179179

180-
<p>Notice how we don&#8217;t check for <code>null</code> here? This assumes each button will have
180+
<p>Notice how we don&#8217;t check for <code>NULL</code> here? This assumes each button will have
181181
<em>some</em> command wired up to it.</p>
182182
<p>If we want to support buttons that do nothing without having to explicitly check
183-
for <code>null</code>, we can define a command class whose <code>execute()</code> method does nothing.
184-
Then, instead of setting a button handler to <code>null</code>, we point it to that object.
183+
for <code>NULL</code>, we can define a command class whose <code>execute()</code> method does nothing.
184+
Then, instead of setting a button handler to <code>NULL</code>, we point it to that object.
185185
This is a pattern called <a href="http://en.wikipedia.org/wiki/Null_Object_pattern">Null
186186
Object</a>.</p>
187187
</aside>

html/event-queue.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ <h2><a href="#sample-code" name="sample-code">Sample Code</a></h2>
338338
<p>We want to defer that work until later so that <code>playSound()</code> can return quickly.
339339
To do that, we need to <em>reify</em> the request to play a sound. We need a little
340340
structure that stores the details of a pending request so we can keep it around
341-
until later.</p>
341+
until later:</p>
342342
<div class="codehilite"><pre><span class="k">struct</span> <span class="n">PlayMessage</span>
343343
<span class="p">{</span>
344344
<span class="n">SoundId</span> <span class="n">id</span><span class="p">;</span>

html/observer.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ <h3><a href="#what's-going-on" name="what's-going-on">What&#8217;s going on?</a>
687687
minimum of communication between them so that working on either one doesn&#8217;t
688688
require much knowledge of the other.</p>
689689
<h2><a href="#observers-today" name="observers-today">Observers Today</a></h2>
690-
<p><em>Design Patterns</em> came out in the <span name="90s">90s</span>. Back then,
690+
<p><em>Design Patterns</em> came out in <span name="90s">1994</span>. Back then,
691691
object-oriented programming was <em>the</em> hot paradigm. Every programmer on Earth
692692
wanted to &#8220;Learn OOP in 30 Days,&#8221; and middle managers paid them based on the
693693
number of classes they created. Engineers judged their mettle by the depth of

html/service-locator.html

-1
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,6 @@ <h3><a href="#logging-decorator" name="logging-decorator">Logging decorator</a><
368368
<span class="n">wrapped_</span><span class="p">.</span><span class="n">stopAllSounds</span><span class="p">();</span>
369369
<span class="p">}</span>
370370

371-
372371
<span class="nl">private:</span>
373372
<span class="kt">void</span> <span class="n">log</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span><span class="o">*</span> <span class="n">message</span><span class="p">)</span>
374373
<span class="p">{</span>

html/update-method.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,8 @@ <h3><a href="#passing-time" name="passing-time">Passing time</a></h3>
597597
<span class="k">else</span>
598598
<span class="p">{</span>
599599
<span class="n">x</span> <span class="o">+=</span> <span class="n">elapsed</span><span class="p">;</span>
600-
<span class="k">if</span> <span class="p">(</span><span class="n">x</span> <span class="o">&gt;=</span> <span class="mi">100</span><span class="p">)</span> <span class="p">{</span>
600+
<span class="k">if</span> <span class="p">(</span><span class="n">x</span> <span class="o">&gt;=</span> <span class="mi">100</span><span class="p">)</span>
601+
<span class="p">{</span>
601602
<span class="n">patrollingLeft_</span> <span class="o">=</span> <span class="nb">true</span><span class="p">;</span>
602603
<span class="n">x</span> <span class="o">=</span> <span class="mi">100</span> <span class="o">-</span> <span class="p">(</span><span class="n">x</span> <span class="o">-</span> <span class="mi">100</span><span class="p">);</span>
603604
<span class="p">}</span>

note/log.txt

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
2014-10-08 - finish layout, proofread, re-upload to createspace for review
2+
2014-10-07 - layout through data locality
3+
2014-10-06 - layout through event queue
4+
2014-10-05 - layout through subclass sandbox
5+
2014-10-04 - layout through behavioral patterns
6+
2014-10-03 - layout through singleton (!)
7+
2014-10-02 - decimal inches page layout
8+
2014-10-01 - work on new page layout
9+
2014-09-30 - work on new page layout
10+
2014-09-29 - cover and other epub front matter
111
2014-09-28 - email
212
2014-09-27 - go through bugs and pull requests
313
2014-09-26 - finish applying proofreading, tweak other web stuff

0 commit comments

Comments
 (0)