100% found this document useful (2 votes)
10 views

Sensor Projects with Raspberry Pi Internet of Things and Digital Image Processing 2nd Edition Guillermo Guillen instant download

The document is about the book 'Sensor Projects with Raspberry Pi: Internet of Things and Digital Image Processing, Second Edition' by Guillermo Guillen, which covers various projects and applications using Raspberry Pi in IoT and digital image processing. It includes theoretical fundamentals, practical projects, and tutorials for building systems like alarm systems and weather stations. The book aims to provide hands-on experience and knowledge for both beginners and seasoned makers in hardware design and engineering.

Uploaded by

makankiterte
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
10 views

Sensor Projects with Raspberry Pi Internet of Things and Digital Image Processing 2nd Edition Guillermo Guillen instant download

The document is about the book 'Sensor Projects with Raspberry Pi: Internet of Things and Digital Image Processing, Second Edition' by Guillermo Guillen, which covers various projects and applications using Raspberry Pi in IoT and digital image processing. It includes theoretical fundamentals, practical projects, and tutorials for building systems like alarm systems and weather stations. The book aims to provide hands-on experience and knowledge for both beginners and seasoned makers in hardware design and engineering.

Uploaded by

makankiterte
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 82

Sensor Projects with Raspberry Pi Internet of

Things and Digital Image Processing 2nd Edition


Guillermo Guillen download

https://ebookgate.com/product/sensor-projects-with-raspberry-pi-
internet-of-things-and-digital-image-processing-2nd-edition-
guillermo-guillen/

Get Instant Ebook Downloads – Browse at https://ebookgate.com


Get Your Digital Files Instantly: PDF, ePub, MOBI and More
Quick Digital Downloads: PDF, ePub, MOBI and Other Formats

Learning Internet of Things explore and learn about


Internet of Things with the help of engaging and
enlightening tutorials designed for the Raspberry Pi
Waher
https://ebookgate.com/product/learning-internet-of-things-
explore-and-learn-about-internet-of-things-with-the-help-of-
engaging-and-enlightening-tutorials-designed-for-the-raspberry-
pi-waher/

Introduction to IoT with Machine Learning and Image


Processing using Raspberry Pi 1st Edition Shrirang
Ambaji Kulkarni

https://ebookgate.com/product/introduction-to-iot-with-machine-
learning-and-image-processing-using-raspberry-pi-1st-edition-
shrirang-ambaji-kulkarni/

Raspberry Pi Robotic Projects 3rd Edition Richard


Grimmett

https://ebookgate.com/product/raspberry-pi-robotic-projects-3rd-
edition-richard-grimmett/

Raspberry Pi Projects for Kids Second Edition Bates

https://ebookgate.com/product/raspberry-pi-projects-for-kids-
second-edition-bates/
Raspberry Pi Hardware Projects 2 1st Edition Andrew
Robinson

https://ebookgate.com/product/raspberry-pi-hardware-
projects-2-1st-edition-andrew-robinson/

Smart Home Automation with Linux and Raspberry Pi 2nd


ed. Edition Goodwin

https://ebookgate.com/product/smart-home-automation-with-linux-
and-raspberry-pi-2nd-ed-edition-goodwin/

Smart Home Automation with Linux and Raspberry Pi 2nd


Edition Steven Goodwin

https://ebookgate.com/product/smart-home-automation-with-linux-
and-raspberry-pi-2nd-edition-steven-goodwin/

Raspberry Pi Home Automation with Arduino 2nd Edition


Andrew K. Dennis

https://ebookgate.com/product/raspberry-pi-home-automation-with-
arduino-2nd-edition-andrew-k-dennis/

Getting Started with Raspberry Pi 1st Edition Matt


Richardson

https://ebookgate.com/product/getting-started-with-raspberry-
pi-1st-edition-matt-richardson/
Maker Innovations Series
Jump start your path to discovery with the Apress Maker Innovations
series! From the basics of electricity and components through to the most
advanced options in robotics and Machine Learning, you’ll forge a path to
building ingenious hardware and controlling it with cutting-edge software.
All while gaining new skills and experience with common toolsets you can
take to new projects or even into a whole new career.
The Apress Maker Innovations series offers projects-based learning,
while keeping theory and best processes front and center. So you get
hands-on experience while also learning the terms of the trade and how
entrepreneurs, inventors, and engineers think through creating and
executing hardware projects. You can learn to design circuits, program AI,
create IoT systems for your home or even city, and so much more!
Whether you’re a beginning hobbyist or a seasoned entrepreneur
working out of your basement or garage, you’ll scale up your skillset to
become a hardware design and engineering pro. And often using low-
cost and open-source software such as the Raspberry Pi, Arduino, PIC
microcontroller, and Robot Operating System (ROS). Programmers and
software engineers have great opportunities to learn, too, as many projects
and control environments are based in popular languages and operating
systems, such as Python and Linux.
If you want to build a robot, set up a smart home, tackle assembling a
weather-ready meteorology system, or create a brand-new circuit using
breadboards and circuit design software, this series has all that and more!
Written by creative and seasoned Makers, every book in the series tackles
both tested and leading-edge approaches and technologies for bringing
your visions and projects to life.​

More information about this series at https://www.apress.com/


series/17311.
Sensor Projects with
Raspberry Pi
Internet of Things and Digital
Image Processing
Second Edition

Guillermo Guillen
Sensor Projects with Raspberry Pi: Internet of Things and Digital Image
Processing, Second Edition
Guillermo Guillen
Ciudad de Mexico, Mexico

ISBN-13 (pbk): 979-8-8688-0463-2 ISBN-13 (electronic): 979-8-8688-0464-9


https://doi.org/10.1007/979-8-8688-0464-9

Copyright © 2024 by Guillermo Guillen


This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or
part of the material is concerned, specifically the rights of translation, reprinting, reuse of
illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way,
and transmission or information storage and retrieval, electronic adaptation, computer software,
or by similar or dissimilar methodology now known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark
symbol with every occurrence of a trademarked name, logo, or image we use the names, logos,
and images only in an editorial fashion and to the benefit of the trademark owner, with no
intention of infringement of the trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if
they are not identified as such, is not to be taken as an expression of opinion as to whether or not
they are subject to proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of
publication, neither the authors nor the editors nor the publisher can accept any legal
responsibility for any errors or omissions that may be made. The publisher makes no warranty,
express or implied, with respect to the material contained herein.
Managing Director, Apress Media LLC: Welmoed Spahr
Acquisitions Editor: Miriam Haidara
Development Editor: James Markham
Editorial Project Manager: Jessica Vakili
Copyeditor: Kim Wimpsett
Cover designed by eStudioCalamar
Distributed to the book trade worldwide by Springer Science+Business Media New York, 1
New York Plaza, Suite 4600, New York, NY 10004-1562, USA. Phone 1-800-SPRINGER, fax (201)
348-4505, e-mail orders-ny@springer-sbm.com, or visit www.springeronline.com. Apress Media,
LLC is a California LLC and the sole member (owner) is Springer Science + Business Media
Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.
For information on translations, please e-mail booktranslations@springernature.com; for
reprint, paperback, or audio rights, please e-mail bookpermissions@springernature.com.
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook
versions and licenses are also available for most titles. For more information, reference our Print
and eBook Bulk Sales web page at http://www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the author in this book is available
to readers on GitHub. For more detailed information, please visit https://www.apress.com/gp/
services/source-code.
If disposing of this product, please recycle the paper
For my readers, who breathe life into these pages.
To the challenges that made me stronger in hard times.
To the resilience of humanity, a beacon in the darkest
pandemics.
To the dreamers who dare to envision a better world for you
and for me.
Table of Contents
About the Author�������������������������������������������������������������������������������xiii

Acknowledgments������������������������������������������������������������������������������xv

Introduction��������������������������������������������������������������������������������������xvii

Chapter 1: Theoretical Fundamentals���������������������������������������������������1


Programming with the Raspberry Pi���������������������������������������������������������������������2
Elements of the Language�������������������������������������������������������������������������������4
Flow Control Structures���������������������������������������������������������������������������������10
Important Differences Between Python 2.7.x and Python 3.x�����������������������16
Internet of Things������������������������������������������������������������������������������������������������20
History�����������������������������������������������������������������������������������������������������������22
Smart Home Applications������������������������������������������������������������������������������23
Elder-Care Applications���������������������������������������������������������������������������������23
Medical and Healthcare Applications������������������������������������������������������������24
Transportation Applications���������������������������������������������������������������������������25
Building and Home Automation Applications�������������������������������������������������27
Manufacturing Applications���������������������������������������������������������������������������28
Agriculture Applications��������������������������������������������������������������������������������30
Metropolitan-Scale Deployments������������������������������������������������������������������31
Energy Management Applications�����������������������������������������������������������������32
Environmental Monitoring Applications���������������������������������������������������������33

vii
Table of Contents

Living Lab Application�����������������������������������������������������������������������������������34


IoT Security����������������������������������������������������������������������������������������������������35
What’s the Difference Between OT and the IoT?�������������������������������������������36
Digital Image Processing������������������������������������������������������������������������������������36
History�����������������������������������������������������������������������������������������������������������38
Tasks�������������������������������������������������������������������������������������������������������������39
Techniques����������������������������������������������������������������������������������������������������40
Applications���������������������������������������������������������������������������������������������������46
Artificial Intelligence�������������������������������������������������������������������������������������������47
Turing Test�����������������������������������������������������������������������������������������������������48
Dartmouth Conference����������������������������������������������������������������������������������48
Perceptron�����������������������������������������������������������������������������������������������������48
Birth of AI�������������������������������������������������������������������������������������������������������48
Deep Learning Revolution�����������������������������������������������������������������������������49
Computer Vision��������������������������������������������������������������������������������������������49
Machine Learning������������������������������������������������������������������������������������������50
Edge Impulse������������������������������������������������������������������������������������������������������52
Why TensorFlow and Edge Impulse?�������������������������������������������������������������53
TensorFlow vs. TensorFlow Lite���������������������������������������������������������������������53
Summary������������������������������������������������������������������������������������������������������������54

Chapter 2: Alarm System��������������������������������������������������������������������55


Hardware������������������������������������������������������������������������������������������������������������55
Software��������������������������������������������������������������������������������������������������������������59
Procedure������������������������������������������������������������������������������������������������������������61
Creating a Project in ThingSpeak������������������������������������������������������������������62
Using Your Twitter/X Account in ThingSpeak�������������������������������������������������64
Sending an Alert to Your Twitter/X Account���������������������������������������������������66

viii
Table of Contents

Challenges����������������������������������������������������������������������������������������������������������68
Conclusion����������������������������������������������������������������������������������������������������������68

Chapter 3: Gas Leak Alarm�����������������������������������������������������������������69


Hardware������������������������������������������������������������������������������������������������������������69
Software��������������������������������������������������������������������������������������������������������������74
Procedure������������������������������������������������������������������������������������������������������������76
Installing the ADS1115 Sensor Library����������������������������������������������������������76
Enabling the 12C Interface����������������������������������������������������������������������������77
Creating a Project in ThingSpeak������������������������������������������������������������������77
Using Your Twitter/X Account in ThingSpeak�������������������������������������������������81
Sending an Alert to Your Twitter/X Account���������������������������������������������������81
Challenges����������������������������������������������������������������������������������������������������������84
Conclusion����������������������������������������������������������������������������������������������������������84

Chapter 4: Weather Station�����������������������������������������������������������������85


Hardware������������������������������������������������������������������������������������������������������������86
Software��������������������������������������������������������������������������������������������������������������90
Library Installation����������������������������������������������������������������������������������������������95
Installing the DHT11 Sensor Library��������������������������������������������������������������95
Installing the BMP085 Sensor Library�����������������������������������������������������������95
Enabling the 12C Interface����������������������������������������������������������������������������������96
Creating a Project in ThingSpeak������������������������������������������������������������������������96
Using Your Twitter/X Account in ThingSpeak�����������������������������������������������������100
Sending an Alert to Your Twitter/X Account�������������������������������������������������������100
Challenges��������������������������������������������������������������������������������������������������������102
Conclusion��������������������������������������������������������������������������������������������������������103

ix
Table of Contents

Chapter 5: Digital Image Processing with Python and OpenCV��������105


Installing the Software��������������������������������������������������������������������������������������106
Step 1: Installing Python 2.7 and 3��������������������������������������������������������������107
Step 2: Installing the Dependencies������������������������������������������������������������107
Step 3: Getting the Latest OpenCV Source Code�����������������������������������������110
Step 4: Installing pip and virtualenv������������������������������������������������������������111
Step 5: Creating a Virtual Environment��������������������������������������������������������113
Step 6: Installing Numpy and Scipy�������������������������������������������������������������114
Step 7: Installing OpenCV����������������������������������������������������������������������������114
Step 8: Testing the OpenCV Installation�������������������������������������������������������118
Classifiers���������������������������������������������������������������������������������������������������������121
Step 1: Collecting Images for a Database����������������������������������������������������121
Step 2: Arranging the Negative Images�������������������������������������������������������122
Step 3: Cropping and Marking the Positive Images�������������������������������������125
Step 4: Creating a Vector of Positive Images�����������������������������������������������129
Step 5: Haar Training�����������������������������������������������������������������������������������131
Step 6: Creating the XML File����������������������������������������������������������������������134
Testing with Images������������������������������������������������������������������������������������������136
Testing with Videos�������������������������������������������������������������������������������������������137
Moving a Robot Arm������������������������������������������������������������������������������������������141
Challenges��������������������������������������������������������������������������������������������������������147
Conclusion��������������������������������������������������������������������������������������������������������147

Chapter 6: Animations with Python and Pygame����������������������������149


Animated UFO���������������������������������������������������������������������������������������������������150
Animated Dog���������������������������������������������������������������������������������������������������159
Animated Man���������������������������������������������������������������������������������������������165

x
Table of Contents

Challenges��������������������������������������������������������������������������������������������������������176
Conclusion��������������������������������������������������������������������������������������������������������176

Chapter 7: Homemade Spectrometer ����������������������������������������������177


Optic Basics������������������������������������������������������������������������������������������������������178
Spectrophotometry Basics��������������������������������������������������������������������������������179
SparkFun Qwiic pHAT v2.0��������������������������������������������������������������������������������180
AS7262 Six-Channel Visible Light Sensor���������������������������������������������������������181
Configuring the Raspberry Pi����������������������������������������������������������������������������184
Building a Filter Spectrometer��������������������������������������������������������������������������189
Schematic����������������������������������������������������������������������������������������������������190
Library Installation���������������������������������������������������������������������������������������191
Spectrum�����������������������������������������������������������������������������������������������������193
Bar Graph����������������������������������������������������������������������������������������������������195
Data Captured����������������������������������������������������������������������������������������������198
Conclusion���������������������������������������������������������������������������������������������������201
Sensing Colored Solutions��������������������������������������������������������������������������������203
Device Assembly�����������������������������������������������������������������������������������������204
Schematic����������������������������������������������������������������������������������������������������207
Programming�����������������������������������������������������������������������������������������������208
Challenges���������������������������������������������������������������������������������������������������211
Conclusion���������������������������������������������������������������������������������������������������212
Plant Foliage Health������������������������������������������������������������������������������������������214
AS7263 NIR Sensor�������������������������������������������������������������������������������������217
Schematic Diagram�������������������������������������������������������������������������������������219
Code������������������������������������������������������������������������������������������������������������221
Test��������������������������������������������������������������������������������������������������������������223
Conclusion���������������������������������������������������������������������������������������������������225

xi
Table of Contents

Chapter 8: Object Classification Using Edge Impulse on


Raspberry Pi ������������������������������������������������������������������������������������227
Using Edge Impulse������������������������������������������������������������������������������������������227
Creating the Dataset�����������������������������������������������������������������������������������������230
Training the Model��������������������������������������������������������������������������������������������232
Deploying the Trained Model to Raspberry Pi���������������������������������������������������236
Conclusion��������������������������������������������������������������������������������������������������������237

Index�������������������������������������������������������������������������������������������������239

xii
About the Author
Guillermo Guillen is an electronics and
communications engineer and a military
engineer. He currently takes courses at
OpenCV University and studies renewable
energy at UnADM University. He has worked
on citizen and government projects. Guillermo
has won twelve prizes in the hackster.io
community, won three prizes at element14,
and has been a finalist three times in the
hackaday contest. In addition to this book, he has written more than
40 articles about the research, design, development, and testing of the
electronic equipment used in various systems.

xiii
Acknowledgments
First, I would like to thank everyone at Apress for their help in publishing
this book. The Apress production group has done an exceptional job in
preparing and formatting this text and are always first-class people to
work with.
Also, I would like to thank the developers projects for their positive
attitude when giving feedback on my Raspberry Pi work on the Hackster,
Hackaday and element14 platforms. I met many valuable people while
writing this book who shared very useful information, especially in the
discussion forums.
Thanks also to the Raspbian programmers and hardware Raspberry
designers who have created a machine with very discreet and powerful
features.
Writing this book was a challenge for me, but I believe it is a powerful
reference for readers with interesting and daring projects. It would not
have been possible if I had not met such valuable people along the way.

xv
Introduction
This book covers Python programming topics such as the research,
design, development, and testing of electronic devices used in the Internet
of Things (IoT) and digital image processing. You don’t have to be a
professional programmer to implement the projects in this book, but
you need to have the restlessness to solve problems using creativity and
imagination.
The first part of the book is dedicated to the theoretical explanation
needed for all the subsequent chapters. I only provide you with the
fundamental theoretical information, so if you need to further expand your
knowledge, I suggest you use the Internet to continue your research.
In the second part of this book, you will solve problems related to the
IoT with digital ports and analog ports. Finally, you will develop a weather
station in which you will put into play all your programming knowledge.
Note that the versions of the sensors used in the projects and their libraries
change frequently, as do the Python and OpenCV versions, so I invite you
to update the code on your own.
The third part of this book is dedicated to digital image processing, an
interesting field of programming because it’s the future of what is currently
being implemented in systems dedicated to artificial intelligence. You
will start by creating your own object classifier and see its advantages and
disadvantages. Once you have your classifier, you will use it in applications
with the Raspberry Pi camera and webcam. Also, you will make a
robot arm with two degrees of freedom move, taking as reference the
information of the coordinates (x, y) of your detected image.

xvii
Introduction

Finally, the fourth part consists of newer projects that I have been
working on for the past two years. First, I will show you how to create
your own animations and virtual scenarios that will help you develop
games with your Raspberry Pi in the future. Then, I will show you some
interesting experiments that you can do with spectral sensors in the
visible and infrared light ranges, such as creating color filters, detecting
colored solutions, and detecting healthy tree leaves through readings of
the standard Normalized Difference Vegetation Index (NDVI). In the final
chapter, you will learn how the Edge Impulse platform can be useful for
developing machine learning models with a Raspberry Pi for noncoders or
those with less experience.

xviii
CHAPTER 1

Theoretical
Fundamentals
This is an important chapter. You should take it as seriously as the
succeeding chapters. Let me put it this way: imagine this book is a movie,
and this chapter is the first 15 minutes of the movie. You definitely don’t
want to miss out on the part that sets up the story!
Throughout this book, I will use Python programming, so you should
be clear about all the concepts regardless of the level of programming you
have. In addition, Chapters 2, 3, and 4 will cover the Internet of Things
(IoT), so this is a good opportunity to understand all of its applications,
where only imagination is the limit of what you can do. Finally, Chapter 5
will cover digital image processing, and to understand it, you must have a
high capacity for abstraction, imagination, intelligence, and problem-
solving skills.
My general objectives for this book are as follows:

• Without needing to be an expert in programming,


you will learn to use the elements of the Python
programming language to develop projects related to
the IoT and digital image processing.

• You will understand and carry out IoT projects with


free tools so that you can use any service provider
without problems.

© Guillermo Guillen 2024 1


G. Guillen, Sensor Projects with Raspberry Pi, Maker Innovations Series,
https://doi.org/10.1007/979-8-8688-0464-9_1
Chapter 1 Theoretical Fundamentals

• You will develop a digital image processing project so


that anyone can understand it and make their own
proposals and code changes.

• Most importantly, you will learn to solve problems.


Across sciences, not everything is solved; we will use
models that can be debated and changed. In a few
words, there are many ways to do the same thing.

In this chapter, you will learn the basic concepts of the following topics:

• Programming the Raspberry Pi board with Python

• What the IoT is; its applications in the home, industries,


and cities; and why it is used in solving technological
problems

• The definition of digital image processing,


methodology, techniques, and most important
applications

Programming with the Raspberry Pi


Basically, Python is a language that can be used for developing anything
and everything you want. Although it’s an interpreted language, it’s used
widely because it’s easy to write the code and understand. If you have a
manual task to automate, Python can help you do that. If you are interested
in machine learning or data science, there are a bunch of awesome, well-
documented libraries available for Python. Its database libraries and web
development libraries are very good and are used extensively for various
use cases like hosting a website.

2
Chapter 1 Theoretical Fundamentals

Here are the important reasons why you should consider writing
software applications in Python:

• Readable and maintainable code:

Python syntax rules allow you to express concepts


without writing additional code. Python is not like
other programming languages; it emphasizes code
readability and allows you to use English-language
keywords instead of punctuation. Thus, you can use
Python to build custom applications without writing
additional code.

• Compatibility with major platforms and systems:

Python supports many operating systems. You may


even use Python interpreters to run the code on
specific platforms and tools. Python also allows you
to run the same code on multiple platforms without
recompilation. Thus, you are not required to recompile
the code after making an alteration.

• Robust standard library:

It has a large and robust standard library, making


Python better over other programming languages. The
standard Python library allows you to choose from a
wide range of modules according to your precise needs.

• Many open-source frameworks and tools:

Python, being an open-source programming language,


helps you curtail software development costs
significantly. You may even use several open-source
Python frameworks, libraries, and development tools.

3
Chapter 1 Theoretical Fundamentals

Elements of the Language


As in most high-level programming languages, Python is composed of a
series of elements that feed its structure, such as the following:

• Variables and constants

• Types of data

• Arithmetic operators

• Comments

• Complex data types

Variables and Constants


A variable is a space to store modifiable data in the memory of a computer.
In Python, a variable is defined with the following syntax:

name_of_the_variable = value_of_the_variable

Each variable has a name and a value, which defines at the same time
the data type of the variable. There is a type of variable called a constant
that is used to define fixed values, which do not need to be modified.

Variables
Variables use descriptive and lowercase names. For compound names, you
separate the words by underscores. Before and after the sign =, there must
be only one blank space.

my_variable = 13

4
Chapter 1 Theoretical Fundamentals

Constants
Constants use descriptive and uppercase names, separating words by
underscores.

MY_CONSTANT = 23

In Python, to print a value on the screen, the word print is used.

my_variable = 34
print my_variable

This will print the value of the variable my variable on the screen.

Types of Data
A variable or constant can contain values of various types. Consider the
following examples.
Text string (string):

my_chain = "Hello World!"

Whole number:

age = 34

Octal integer:

age = 033

Hexadecimal integer number:

age = 0x12

Real number:

price = 745.89

5
Chapter 1 Theoretical Fundamentals

Boolean (true/false):

one = True
two = False

There are other types of more complex data, which you will see
throughout the book.

Arithmetic Operators
Among the arithmetic operators that Python uses, you will find the
following:
Sum (+):

a = 11 + 6
a is 17

Subtraction (–):

a = 16 – 6
a is 10

Denial (–):

a = -9
a is -9

Multiplication (*):

a = 8 * 10
a is 80

Exponent (**):

a = 2 ** 2
a is 4

6
Chapter 1 Theoretical Fundamentals

Division (/):

a = 14.4 / 2
a is 7.2

Integer division (//):

a = 14.5 / 2
a is 7.0

Module (%):

a = 26% 4
a is 2

Always place a blank before and after an operator.

Comments
A file can contain source code as well as comments or notes that explain
the code better to other programmers. The comments can be of two types,
single-line or multiline, and are expressed as follows:

# This is a one-line comment


my_variable = 68
"" "And this is a comment of several lines "" "
my_variable = 68
my_variable = 68 # This comment is from a line too

In the comments, you can include words that help identify, in addition,
the subtype of comment, like this:

# In the comments, you can include words that help us identify,


in addition, the subtype of comment:
# ALL this is something to do
# FIX this is something that must be corrected

7
Chapter 1 Theoretical Fundamentals

Comments on the same line of the code must be separated with two
blank spaces. Then the symbol # should go in a single blank space.

Complex Data Types


Python has, in addition to the types already seen, three more complex
types, which support a collection of data. These three types can store
collections of data of different types and differ in their syntax and in the
way in which the data can be manipulated. These types are

• Tuples

• Lists

• Dictionaries

Tuples
A tuple is a variable that allows you to store several immutable data of
different types and can’t be modified once created.

my_tupla = ('text string', 16, 13.8, 'other data', 78)

You can access each of the data by its corresponding index, with 0
(zero) as the index of the first element.

print my_tupla [1] # Output: 16

You can also access a portion of the tuple, indicating (optionally) from
the start index to the end index.

print my_tupla [1: 4] # Returns: (16, 13.8, 'other data')

Another way to access the tuple in an inverse way (from back to front)
is to place a negative index.

8
Chapter 1 Theoretical Fundamentals

Lists
A list is similar to a tuple with the fundamental difference that it allows you
to modify the data once created.

my_list = ['text string', 16, 13.8, 'other data', 78]

The lists are accessed, like the tuples, by their index number.

print my_list [1] # Output: 16

The lists are not immutable: they allow for modifying the data once
created.

my_list [2] = 3.8 # the third element is now 3.8

The lists, unlike the tuples, allow adding new values.

my_list.append ('New Datum')

Dictionaries
While lists and tuples are accessed only by an index number, dictionaries
allow you to use a key to declare and access a value.

my_dictionary = {'key_1': value_1, 'key_2': value_2, \


'key_8': value_8}
print my_dictionary ['key_2'] # Output: value_2

A dictionary allows you to delete any entry and, like the lists,
allows you to modify the values. Python language elements are easy to
understand; now let’s look at control code structures.

9
Chapter 1 Theoretical Fundamentals

Flow Control Structures


A control structure is a block of code that allows you to group instructions
in a controlled manner. In this chapter, I will talk about two control
structures.

• Conditional control structures

• Iterative control structures

Indentation
To talk about flow control structures in Python, it is essential first to talk
about indentation.
What is indentation? When you write a letter, you must respect certain
indentation rules; some computer languages require indentation too.
Not all programming languages need indentation, but it can improve
the readability of the source code. In the case of Python, the indentation is
mandatory, since its structure depends on it.
An indentation of four blank spaces indicates that the instructions
entered are part of the same control structure.
A control structure, then, is defined as follows:

Start of the control structure:


    expressions
Example:
if 5 > 2:
    print("Five is greater than two!")

Encoding
The encoding is another element of the language that can’t be omitted
when talking about control structures.

10
Chapter 1 Theoretical Fundamentals

The encoding is no more than a directive that is placed at the


beginning of a Python file to indicate to the system the codification of
characters used in the file.

# - * - coding: utf-8 - * -

utf-8 could be any character encoding. If a character encoding is not


indicated, Python might fail if it encounters “ strange” characters.

Multiple Assignments
Another advantage that Python provides is the ability to assign multiple
variables in a single instruction.

a, b, c = 'string', 48, True

In this single instruction, I am declaring three variables, a, b, and c,


and assigning a specific value to each.

>>> print a
string
>>> print b
48
>>> print c
True

The multiple assignments of variables can also be given using as values


the content of a tuple.

>>> my_tupla = ('hello world', 2016)


>>> text, year = mi_tupla
>>> print text
hello world
>>> print year
2016

11
Chapter 1 Theoretical Fundamentals

Or also, from a list.

>>> my_list = ['France', 'Paris']


>>> country, province = mi_list
>>> print country
France
>>> print provincie
Paris

Conditional Flow Control Structures


Conditional control structures are those that allow us to evaluate if one or
more conditions are met, to say what action we are going to execute. The
evaluation of conditions can yield only one of two results: true or false.
In daily life, we act according to the evaluation of conditions much
more frequently than we actually believe. If the light is green, I cross the
street. If it’s not, I wait for the traffic light to turn green. Sometimes, we
also evaluate more than one condition to execute a certain action. If the
electricity bill arrives and I have money, I pay the bill.
To describe the evaluation to be performed on a condition, relational
or comparison operators are used as follows:
Like (==):

8 == 7
False

Other than (!=):

red != blue
True

Smaller than (<):

8 < 77
True

12
Chapter 1 Theoretical Fundamentals

Greater than (>):

77 > 7
False

Less than or equal to (<=):

13 <= 13
True
Greater than or equal (>=):
34 >= 5
False

And to evaluate more than one condition simultaneously, logical


operators are used:
And:

1 == 7 and 5 < 12
0 and 0
False

0r:

13 == 13 or 34 < 7
1 or 0
True

xor:

45 == 45 xor 7 > 3
1 or 1
False

(or exclusive):

12 == 12 xor 10 < 3
1 or 0
True

13
Chapter 1 Theoretical Fundamentals

The conditional flow control structures are defined by the use of three
reserved keywords: if (if ), elif (otherwise, yes), and else (otherwise).
Let’s see an example.

If the traffic light is green, cross the street. If not, wait.


if semaphore == green:
     print "Cross the street"
else:
     print "Wait"

Iterative Control Structures


Unlike the conditional control structures, the iterative ones (also called
cyclical or loops) allow us to execute the same code, repeatedly, while a
condition is fulfilled.
Sometimes, we want a logical operation to be repeated several times.
In Python, there are two cyclic structures available:

• while loop

• for loop

Let’s review them in detail now.

while Loop
The while loop is responsible for executing the same action “while” a
certain condition is met.
The following code says, “While the year is less than or equal to 2010,
print the phrase “Report of the year year”:

# - * - coding: utf-8 - * -
year = 2002
while year <= 2010:
     print " Report of the year ", str(year)
     year += 1

14
Chapter 1 Theoretical Fundamentals

This code will generate the following output:

Report of the year 2002


Report of the year 2003
Report of the year 2004
Report of the year 2005
Report of the year 2006
Report of the year 2007
Report of the year 2008
Report of the year 2009
Report of the year 2010

You will notice that in each iteration, we increase the value of the
variable that conditions the loop (year). If we did not, this variable would
always be equal to 2002, and the loop would be executed infinitely, since
the condition (year <= 2010) would always be fulfilled.
But what happens if the value that conditions the iteration is not
numeric and can’t be increased? In that case, we can use a conditional
control structure, nested within the loop, and stop the execution when the
conditional stops, with the reserved keyword break:

while True:
     name = raw_input("What is your name? ")
     if name:
        break

This loop includes a nested conditional that verifies if the variable


name is true and will be true only if the user types a text on the screen
when the name is requested. If it is true, the loop for Sino will continue to
run until the user enters a text on the screen.

15
Chapter 1 Theoretical Fundamentals

for Loop
The for loop in Python is the one that will allow us to iterate over a
complex variable, of the list or tuple type, as shown here:

For each name in my_list, print name


my_list = ['John', 'Peter', 'Ana', 'Laura']
for name in my_list:
     print name
For each color in my_tupla, print color
my_tupla = ('rose', 'green', 'blue', 'yellow')
for color in my_tupla:
     print color

In these examples, name and color are two variables declared at code’s
runtime, and we assume the value of each element of my_list or my_tupla
in each iteration.
Now that you have more programming tools, you should know that
there are currently two versions of Python, so which version are you
going to use?

Important Differences Between Python 2.7.x


and Python 3.x
Many beginning Python users wonder which version of Python they
should use. What if you are starting a new project and have the choice to
pick? There is currently no right or wrong choice as long as both Python
2.7.x and Python 3.x support the libraries that you are planning to use.
However, it is worthwhile to have a look at the major differences between
these two popular versions of Python to avoid common pitfalls when
writing the code for either one of them or when you are planning to port
your project.

16
Chapter 1 Theoretical Fundamentals

print Function
Python 2’s print statement has been replaced by the print() function,
meaning that you have to wrap the object that you want to print in
parentheses.
Python 2 doesn’t have a problem with additional parentheses, but in
contrast, Python 3 will raise a syntax error if you called the print function
the Python 2 way without the parentheses.

Python 3.x
print('Python', python_version())
print('Hello, World!')
print("some text,", end="")
print(' print more text')

Output
Python 3.4.1
Hello, World!
some text, print more text

In this code, the print function in Python 2.x is replaced by the


print() function in Python 3.x. In other words, to print in Python 3.x, you
need an extra pair of parenthesis.

Division Operator
If you are porting our code or executing Python 3.x code in Python 2.x, it
can be dangerous if integer division changes go unnoticed since they won’t
raise any errors. It is preferred to use a floating value like 6.0/5 or 6/5.0 to
get the expected result when porting our code.

17
Chapter 1 Theoretical Fundamentals

Python 3.x
print('Python', python_version())
print('3 / 2 =', 3 / 2)
print('3 // 2 =', 3 // 2)
print('3 / 2.0 =', 3 / 2.0)
print('3 // 2.0 =', 3 // 2.0)

Output
Python 3.4.1
3 / 2 = 1.5
3 // 2 = 1
3 / 2.0 = 1.5
3 // 2.0 = 1.0

Unicode
Python 2 has ASCII str() types, separate unicode(), but no byte type.
Python 3 finally has Unicode (utf-8) strings and two byte classes, byte
and bytearrays.
In other words, in Python 2, the implicit str type is ASCII. But in
Python 3.x, the implicit str type is Unicode.

Python 3.x
print('Python', python_version())
print('strings are now utf-8 \u03BCnico\u0394é!')
Python 3.4.1
strings are now utf-8 μnicoΔé!
print('Python', python_version(), end="")
print(' has', type(b' bytes for storing data'))
Python 3.4.1 has <class 'bytes'>

18
Chapter 1 Theoretical Fundamentals

print('and Python', python_version(), end="")


print(' also has', type(bytearray(b'bytearrays')))
and Python 3.4.1 also has <class 'bytearray'>

xrange
The xrange() function of Python 2.7.x doesn’t exist in Python 3.x.
In Python 2.7.x, range returns a list, so range(3) returns [0, 1, 2],
while xrange returns a xrange object, so xrange(3) returns an iterator
object, which works similar to a Java iterator and generates a number
when needed.
If we need to iterate over the same sequence multiple times, it’s best
to use range() because it provides a static list. xrange() reconstructs
the sequence every time. xrange() doesn’t support slices and other list
methods. The advantage of xrange() is that it saves memory when the task
is to iterate over a large range.
In Python 3.x, the range function now does what xrange does in
Python 2.7.x, so to keep our code portable, we should consider sticking
to using range instead. So Python 3.x’s range function is xrange from
Python 2.7.x.

for x in xrange(1, 5):


      print(x),
for x in range(1, 5):
      print(x),

Output in Python 3.x

NameError: name 'xrange' is not defined

19
Chapter 1 Theoretical Fundamentals

__future__ module
Python 3.x introduced some Python 2-incompatible keywords and features
that can be imported via the built-in __future__ module in Python 2. It
is recommended to use __future__ imports if you are planning Python
3.x support for your code. For example, if you want Python 3.x’s integer
division behavior in Python 2, you can import it via this:

from __future__ import division

For example, the following Python 2.x code uses Python 3.x’s integer
division behavior using the __future__ module:

# In below python 2.7.x code, division works


# same as Python 3.x because we use __future__
from __future__ import division
print 7 / 5
print -7 / 5

Output
1.4
-1.4

Internet of Things
Now that you’ve finished with the section related to Python programming,
I’ll begin clarifying what the Internet of Things is and all its related topics.
Imagine a world in which every device in the home, workplace, and
car is connected. A world where the lights automatically turn on when the
car approaches the driveway, the coffee starts brewing when the morning
alarm goes off, and the front door automatically unlocks when approached
by a member of the household but stays locked when a stranger arrives on
the front step. That is the type of world the Internet of Things can create.

20
Chapter 1 Theoretical Fundamentals

The true value of the Internet of Things does not lay in the lights
turning on when the car reaches the driveway but rather in the data
that the connected devices collect about their users. Imagine a hospital
with connected devices. The data collected from those devices outputs
information on the status of patients and runs analytics on the various
monitoring machines, helping the hospital to run as optimally as possible.
The collection of data from devices will allow consumers, businesses, and
even entire connected cities to run more efficiently. However, collecting
large amounts of data presents challenges.
The IoT is the extension of Internet connectivity into physical devices
and everyday objects. Embedded with electronics, Internet connectivity,
and other forms of hardware such as sensors, these devices can
communicate and interact with others over the Internet, and they can be
remotely monitored and controlled.
The definition of the Internet of Things has evolved due to the
convergence of multiple technologies, real-time analytics, machine
learning, commodity sensors, and embedded systems (Figure 1-1).
Traditional fields of embedded systems, wireless sensor networks, control
systems, automation, and others all contribute to enabling the IoT. In the
consumer market, IoT technology is most synonymous with products
pertaining to the concept of the smart home, covering devices that support
one or more common ecosystems, and can be controlled via devices
associated with that ecosystem, such as smartphones and smart speakers.

21
Chapter 1 Theoretical Fundamentals

Figure 1-1. The IoT allows objects to be controlled remotely across


existing network infrastructures

History
The concept of a network of smart devices was discussed as early as 1982,
with a modified Coke vending machine at Carnegie Mellon University
becoming the first Internet-connected appliance, able to report its
inventory and whether newly loaded drinks were cold or not. Reza Raji
described the concept in IEEE Spectrum as “small packets of data to a
large set of nodes, so as to integrate and automate everything from home
appliances to entire factories.” Between 1993 and 1997, several companies
proposed solutions like Microsoft at Work or Novell's NEST. The
field gained momentum when Bill Joy envisioned device-to-device
communication as a part of his Six Webs framework, presented at the
World Economic Forum at Davos in 1999.
The term Internet of Things was likely coined by Kevin Ashton of
Procter & Gamble. At that point, he viewed radio-frequency identification
(RFID) as essential to the Internet of Things, which would allow computers
to manage all individual things.
A research article mentioning the Internet of Things was submitted
to the conference for Nordic Researchers in Norway in June 2002, which
was preceded by an article published in Finnish in January 2002. The
implementation is an information system infrastructure for implementing
smart, connected objects.

22
Chapter 1 Theoretical Fundamentals

Smart Home Applications


IoT devices are part of the larger concept of home automation, which
can include lighting, heating, and air conditioning, as well as media and
security systems (Figure 1-2). Long-term benefits include energy savings
by automatically ensuring lights and electronics are turned off. A smart
home or automated home can be based on a platform or hubs that control
smart devices. For instance, using Apple’s HomeKit, manufacturers can
have their home products and accessories controlled by an application
on iOS devices such as the iPhone and the Apple Watch. This can be
a dedicated app or iOS native applications such as Siri. There are also
dedicated smart home hubs that are offered as stand-alone platforms to
connect different smart home products; they include the Amazon Echo,
Google Home, Apple’s HomePod, and Samsung’s SmartThings Hub.

Figure 1-2. Smart home application example

Elder-Care Applications
One key application of a smart home is to provide assistance for those with
disabilities and for elderly individuals. These home systems use assistive
technology to accommodate an owner’s specific disabilities. Voice control

23
Chapter 1 Theoretical Fundamentals

can assist users with sight and mobility limitations while alert systems
can be connected directly to cochlear implants worn by hearing-impaired
users. They can also be equipped with additional safety features. These
features can include sensors that monitor for medical emergencies such as
falls or seizures. Smart home technology applied in this way can provide
users with more freedom and a higher quality of life.

Medical and Healthcare Applications


The Internet of Medical Things is an application of the IoT for medical
and health-related purposes, data collection and analysis for research,
and monitoring. This system led to the creation of a digitized healthcare
system, connecting available medical resources and healthcare services.
IoT devices can be used to enable remote health monitoring and
emergency notification systems. These health monitoring devices can
range from blood pressure and heart rate monitors to advanced devices
capable of monitoring specialized implants, such as pacemakers,
or advanced hearing aids (Figure 1-3). Some hospitals have begun
implementing smart beds that can detect when they are occupied and
when a patient is attempting to get up. They can also adjust to ensure
appropriate pressure and support are applied to the patient without the
manual interaction of nurses.
Specialized sensors can also be equipped within living spaces to
monitor the health and general well-being of senior citizens, while
also ensuring that proper treatment is being administered, and to help
people regain lost mobility via therapy. These sensors create a network of
intelligent sensors that are able to collect, process, transfer, and analyze
valuable information in different environments, such as connecting in-
home monitoring devices to hospital-based systems. Other consumer
devices to encourage healthy living, such as connected scales or wearable
heart monitors, are also a possibility with the IoT. End-to-end health

24
Chapter 1 Theoretical Fundamentals

monitoring IoT platforms are also available for antenatal and chronic
patients, helping to manage health vitals and recurring medication
requirements.
Applications have been established for point-of-care medical
diagnostics, where portability and low system complexity is essential.
The application of the IoT in healthcare plays a fundamental role in
managing chronic diseases and in disease prevention and control. Remote
monitoring is made possible through the connection of powerful wireless
solutions. The connectivity enables health practitioners to capture
patient’s data, applying complex algorithms in health data analysis.

Figure 1-3. Medical and healthcare application example

Transportation Applications
The IoT can assist in the integration of communication, control, and
information processing across various transportation systems.
Application of the IoT extends to all aspects of transportation systems.

25
Chapter 1 Theoretical Fundamentals

Dynamic interaction between these components of a transport system


enables intra-vehicular communication, smart traffic control, smart
parking, electronic toll collection systems, logistics and fleet management,
vehicle control, safety, and road assistance. In logistics and fleet
management, for example, an IoT platform can continuously monitor the
location and conditions of cargo and assets via wireless sensors and send
specific alerts when management exceptions occur (Figure 1-4). This can
only be possible with the IoT and its seamless connectivity among devices.
Sensors such as GPS, humidity, and temperature send data to the IoT
platform, and then the data is analyzed and sent to the users. This way,
users can track the real-time status of vehicles and can make appropriate
decisions. If combined with machine learning, then it can also help in
reducing traffic accidents by introducing drowsiness alerts to drivers and
providing self-driven cars too.

26
Chapter 1 Theoretical Fundamentals

Figure 1-4. Transportation application example

Building and Home Automation Applications


IoT devices can be used to monitor and control the mechanical, electrical,
and electronic systems used in various types of buildings in home
automation and building automation systems (Figure 1-5). In this context,
three main areas are being covered in literature:

• The integration of the Internet with building energy


management systems to create energy-efficient and
IoT-driven “smart buildings”

27
Chapter 1 Theoretical Fundamentals

• The possible means of real-time monitoring for


reducing energy consumption and monitoring
occupant behaviors

• The integration of smart devices in the built


environment and how they might be used in future
applications

Figure 1-5. Building and home automation application example

Manufacturing Applications
The IoT can realize the seamless integration of various manufacturing
devices equipped with sensing, identification, processing, communication,
actuation, and networking capabilities. The IoT intelligent systems enable
rapid manufacturing of new products, dynamic response to product

28
Chapter 1 Theoretical Fundamentals

demands, and real-time optimization of manufacturing production and


supply chain networks, by networking machinery, sensors, and control
systems together (Figure 1-6).
Digital control systems to automate process controls, operator tools,
and service information systems to optimize plant safety and security are
within the purview of the IoT. But it also extends to asset management
via predictive maintenance, statistical evaluation, and measurements
to maximize reliability. Industrial management systems can also be
integrated with smart grids, enabling real-time energy optimization.
Measurements, automated controls, plant optimization, health and safety
management, and other functions are provided by a large number of
networked sensors.
IoT in manufacturing could generate so much business value that it
might eventually lead to the Fourth Industrial Revolution, also referred to
as Industry 4.0.

Figure 1-6. Manufacturing application example

Industrial big data analytics will play a vital role in manufacturing


asset predictive maintenance, although that is not the only capability of
industrial big data. Cyber-physical systems (CPSs) are the core technology

29
Other documents randomly have
different content
The Project Gutenberg eBook of Harper's Round Table,
December 29, 1896
This ebook is for the use of anyone anywhere in the United States and most other
parts of the world at no cost and with almost no restrictions whatsoever. You may
copy it, give it away or re-use it under the terms of the Project Gutenberg License
included with this ebook or online at www.gutenberg.org. If you are not located in
the United States, you will have to check the laws of the country where you are
located before using this eBook.

Title: Harper's Round Table, December 29, 1896

Author: Various

Release date: September 5, 2019 [eBook #60240]


Most recently updated: October 17, 2024

Language: English

Credits: Produced by Annie R. McGuire

*** START OF THE PROJECT GUTENBERG EBOOK HARPER'S ROUND TABLE, DECEMBER
29, 1896 ***
HOW UTE JACK WAS TAKEN.
WANTED: A GIANT.
THE REMARKABLE ADVENTURES OF SANDBOYS.
THE BOY WRECKERS.
A LOYAL TRAITOR.
THE SCHOOLBOY OF SIBERIA.
THE CROWN OF AN AMERICAN QUEEN.
INTERSCHOLASTIC SPORT.
QUESTIONS FOR YOUNG MEN.
THE STORY OF THE ARMY MULE'S LAST KICK.
THE CAMERA CLUB.
STAMPS.

Copyright, 1896, by Harper & Brothers. All Rights Reserved.

published weekly. NEW YORK, TUESDAY, DECEMBER 29, 1896. five cents a copy.
vol. xviii.—no. 896. two dollars a year.
HOW UTE JACK WAS TAKEN.
BY OWEN WISTER.
Augustus Albumblatt, young and new and sleek with the latest book-knowledge of war,
reported to his first troop commander at Fort Brown. The ladies had watched for him,
because he would increase the number of men, the officers because he would lessen the
number of duties; and he joined at a crisis favorable to becoming speedily known by
them all. Upon that same day had household servants become an extinct race. The last
one, the commanding officer's cook, had told the commanding officer's wife that she was
used to living where she could see the cars. She added that there was no society here "fit
for man or baste at all." This opinion was formed on the preceding afternoon when
Casey, a sergeant of roguish attractions in G troop, had told her he would be a brother to
her always. Three hours later she wedded a gambler, and this morning at six they took
the stage for Green River, two hundred miles south, the nearest point where the bride
could see the cars.
"Frank," said the commanding officer's wife, "send over to H troop for York."
"Catherine," he answered, "my dear, our statesmen at Washington say it's wicked to hire
the free American soldier to cook for you. It's too menial for his manhood."
"Frank, stuff!"
"Hush, my love. Therefore York must be spared the insult of twenty more dollars a
month, our statesmen must be re-elected, and you and I, Catherine, being cookless,
must join the general mess."
Thus did all separate housekeeping end, and the garrison began unitedly to eat three
meals a day what a Chinaman set before them, when the long-expected Albumblatt
stepped into their midst, just in time for supper.
This youth was spic-and-span from the Military Academy, with a top-dressing of three
months' thoughtful travel in Germany. "I was deeply impressed with the modernity of
their scientific attitude," he pleasantly remarked to the commanding officer. For Captain
Duane, silent usually, talked at this first meal to make the boy welcome in this forlorn
two-company post.
"We're cut off from all that sort of thing here," said he. "I've not been east of the
Missouri since '69. But we've got the railroad across, and we've killed some Indians, and
we've had some fun, and we're glad we're alive—eh, Mrs. Starr?"
"I should think so," said the lady.
"Especially now we've got a bachelor at the post!" said Mrs. Bainbridge. "That has been
the one drawback, Mr. Albumblatt."
"I thank you for the compliment," said Augustus, bending from his hips; and Mrs. Starr
looked at him and then at Mrs. Bainbridge.
"We're not over-gay, I fear," the Captain continued; "but the flat's full of antelope, and
there's good shooting up both cañons."
"Have you followed the recent target experiments at Metz?" inquired the traveller. "I refer
to the flattened trajectory and the obus controversy."
"We have not heard the reports," answered the commandant. "But we own a mountain
howitzer."
"The modernity of German ordnance—" began Augustus.
"Do you dance, Mr. Albumblatt?" asked Mrs. Starr.
"For we'll have a hop and all be your partners," Mrs. Bainbridge exclaimed.
"I will be pleased to accommodate you, ladies."
"It's anything for variety's sake with us, you see," said Mrs. Starr, smoothly smiling; and
once again Augustus bent blandly from his hips.
But the commanding officer wished leniency. "You see us all," he hastened to say.
"Commissioned officers and dancing-men. Pretty shabby—"
"Oh, Captain!" said a lady.
"And pretty old."
"Captain!" said another lady.
"But alive and kicking. Captain Starr, Mr. Bainbridge, the Doctor, and me. We are seven."
Augustus looked accurately about him. "Do I understand seven, Captain?"
"We are seven," the senior officer repeated.
Again Mr. Albumblatt counted heads. "I imagine you include the ladies, Captain? Ha! ha!"
"Seven commissioned males, sir. Our Major is on sick-leave, and two of our Lieutenants
have uncles in the Senate. None of us in the churchyard lie—but we are seven."
"Ha! ha, Captain! That's an elegant double-entender on Wordsworth's pome and the War
Department. Only, if I may correct your addition—ha! ha!—our total, including myself, is
eight."
The commanding officer rolled an intimate eye at his wife.
That lady was sitting big with rage, but her words were cordial still: "Indeed, Mr.
Albumblatt, the way officers who have influence in Washington shirk duty here and get
details East is something I can't laugh about. At one time the Captain was his own
adjutant and quartermaster. There are more officers at this table to-night than I've seen
in three years. So we are doubly glad to welcome you at Fort Brown."
"I am fortunate to be on duty where my services are so required, though I could object
to calling it Fort Brown." And Augustus exhaled a smile.
"Prefer Smith?" said Captain Starr.
"You misunderstand me. When we say Fort Brown, Fort Russell, Fort Et Coetera, we are
inexact. They are not fortified."
"Cantonment Et Coetera would be a trifle lengthy, wouldn't it?" put in the Doctor, his
endurance on the wane.
"Perhaps; but technically descriptive of our Western posts. The Germans criticise these
military laxities."
Captain Duane now ceased talking, but urbanely listened; and from time to time his eye
would scan Augustus, and then a certain sublimated laugh, to his wife well known, would
seize him for a single voiceless spasm, and pass. The experienced Albumblatt meanwhile
continued, "By-the-way, Doctor, you know the Charité, of course?"
Doctor Guild had visited the great hospital, but being now a goaded man he stuck his
nose in his plate, and said, unwisely: "Sharrity? What's that?" For then Augustus told him
what and where it was, and that Krankenhaus is German for hospital, and that he had
been deeply impressed with the modernity of the ventilation. "Thirty-five cubic metres to
a bed in new wards," he stated. "How many do you allow, Doctor?"
"None," answered the surgeon.
"Do I understand none, Doctor?"
"You do, sir. My patients breathe in cubic feet, and swallow their doses in grains, and
have their inflation measured in inches."
"Now there again!" exclaimed Augustus, cheerily. "More antiquity to be swept away! And
people say we young officers have no work cut out for us!"
"Patients don't die then under the metric system?" said the Doctor.
"No wonder Europe's overcrowded," said Starr.
But the student's mind inhabited heights above such trifling. "Death," he said, "occurs in
ratios not differentiated from our statistics." And he told them much more while they
looked at him over their plates. He managed to say modernity and differentiate again, for
he came from our middle West, where they encounter education too suddenly, and it
would take three generations of him to speak clean English. But with all his polysyllabic
wallowing, he showed himself keen-minded, pat with authorities, a spruce young
graduate among these dingy Rocky Mountain campaigners. They had fought and thirsted
and frozen; the books he knew were not written when they went to school; and so far as
war is to be mastered on paper, his equipment was full and polished when theirs was
meagre and rusty.
And yet, if you know things that other and older men do not, it is as well not to mention
them too hastily. These soldiers wished they could have been taught what he knew; but
they watched young Augustus unfolding himself with a gaze that might have seemed chill
to a less highly abstract thinker. He, however, rose from the table pleasantly edified by
himself and hopeful for them. And as he left them, "Good-night, ladies and gentlemen,"
he said; "we shall meet again."
"Oh, yes," said the Doctor. "Again and again."
"He's given me indigestion," said Bainbridge.
"Take some metric system," said Starr.
"And lie flat on your trajectory," said the Doctor.
"I hate hair parted in the middle for a man," said Mrs. Guild.
"And his superior eye-glasses," said Mrs. Bainbridge.
"His staring conceited teeth," hissed Mrs. Starr.
"I don't like children slopping their knowledge all over me," said the Doctor's wife.
"He's well brushed, though," said Mrs. Duane, seeking the bright side, "He'll wipe his feet
on the mat when he comes to call."
"I'd rather have mud on my carpet than that bandbox in any of my chairs," said Mrs.
Starr.
"He's no fool," mused the Doctor. "But, kingdom come, what an ass!"
"Well, gentlemen," said the commanding officer (and they perceived a flavor of the
official in his tone), "Mr. Albumblatt is just twenty-one. I don't know about you; but I'll
never have that excuse again."
"Very well, Captain, we'll be good," said Mrs. Bainbridge.
"And gr-r-ateful," said Mrs. Starr, rolling her r piously. "I prophecy he'll entertain us."
The Captain's demeanor remained slightly official, but walking home, his Catherine by his
side in the dark was twice aware of that laugh of his, twinkling in the recesses of his
opinions. And later, going to bed, a little joke took him so unready that it got out before
he could suppress it. "My love," said he, "my Second Lieutenant is grievously mislaid in
the cavalry. Providence designed him for the artillery."
It was wifely but not right in Catherine to repeat this strict confidence in strictest
confidence to her neighbor Mrs. Bainbridge over the fence next morning before
breakfast. At breakfast Mrs. Bainbridge spoke of artillery re-enforcing the post, and her
husband giggled girlishly and looked at the puzzled Duane; and at dinner Mrs. Starr
asked Albumblatt, would not artillery strengthen the garrison?
"Even a light battery," pronounced Augustus, promptly, "would be absurd and useless."
Whereupon the mess rattled knives, sneezed, and became variously disturbed. So they
called him Albumbattery, and then Blattery, which is more condensed; and Captain
Duane's official tone availed him nothing in this matter. But he made no more little
military jokes; he disliked garrison personalities. Civilized by birth and ripe from weather-
beaten years of men and observing, he looked his Second Lieutenant over, and
remembered to have seen worse than this. He had no quarrel with the metric system
(truly the most sensible), and thinking to leaven it with a little rule of thumb, he made
Augustus his acting quartermaster. But he presently indulged his wife with the soldier
cook she wanted at home; and Mrs. Starr said that showed he dreaded his quartermaster
worse than the Secretary of War.
Alas for the Quartermaster's sergeant, Johannes Schmoll, that routined and clock-work
German! He found Augustus so much more German than he had ever been that he went
speechless for three days. Upon his lists, red ink, and ciphering, Augustus swooped like a
bird of prey, and all his fond red-tape devices were shredded to the winds. Augustus set
going new quadratic ones of his own, with an index and cross-references. It was then
that Schmoll recovered his speech and walked alone, saying, "Mein Gott!" And often
thereafter, wandering among the piled stores and apparel, he would fling both arms
heavenward and repeat the exclamation. He had rated himself the unique human soul at
Fort Brown able to count and arrange under-clothing. Augustus rejected his laborious
tally, and together they vigiled after hours, verifying socks and drawers. Next Augustus
found more horse-shoes than his papers called for.
"That man gif me der stomach pain efry day," wailed Schmoll to Sergeant Casey. "I tell
him, 'Lieutenant, dose horse-shoes is expendable. We don't acgount for efry shoe like
they was men's shoes, und oder dings dot is issued.' 'I prefer to dake them oop!' says
Baby Bismarck. Und he smile mit his two beaver teeth."
"Baby Bismarck!" cried, joyfully, the rosy-faced Casey. "Yo-hanny, take a drink."
"Und so," continued the outraged Schmoll, "he haf a Board of Soorvey on dree pound
horse-shoes, und I haf der stomach pain."
It was buckles the next month. The allowance exceeded the expenditure, Augustus's
arithmetic came out wrong, and another board sat on buckles.
"Yo-hanny, you're lookin' jaded under Colonel Safetypin," said Casey. "Have something."
"Safetypin is my treat," said Schmoll; "und very apt."
But Augustus found leisure to pervade the post with his modernity. He set himself military
problems, and solved them; he wrote an essay on "The Contact Squadron"; he corrected
Bainbridge for saying "throw back" instead of "refuse the left flank"; he had reading-room
ideas, canteen ideas, ideas for the Indians and the Agency, and recruit-drill ideas, which
he presented to Sergeant Casey. Casey gave him, in exchange, the name of Napoleon
Shave-Tail; and had his whiskey again paid for by the sympathetic Schmoll.
"But bless his educated heart," said Casey, "he didn't learn me nothing that'll soil my
innercence!"
Thus did the sunny-humored Sergeant take it, but not thus the mess. Had Augustus seen
himself as they saw him, could he have heard Mrs. Starr— But he did not; the youth was
impervious, and to remove his complacency would require (so Mrs. Starr said) an
operation, probably fatal. The commanding officer held always aloof from gibing, yet
often when Augustus passed him his gray eye would dwell upon the Lieutenant's back
and his voiceless laugh would possess him. That is the picture I retain of these days—the
unending golden sun, the wide, gentle-colored plain, the splendid mountains, the Indians
ambling through the flat clear distance; and here, close along the parade-ground, eye-
glassed Augustus, neatly hastening, with the Captain on his porch, asleep you might
suppose.
One early morning the agent, with two Indian chiefs, waited on the commanding officer,
and after their departure his wife found him breakfasting in solitary mirth.
"Without me," she chided, sitting down. "And I know you've had some good news."
"The best, my love. Providence has been tempted at last. The wholesome irony of life is
about to function."
"Frank, don't tease so! And where are you rushing now before the cakes?"
"To set our Augustus a little military problem, dearest. Plain living for to-day, and high
thinking be jolly well—"
"Frank, you're going to swear, and I must know!"
But Frank had sworn and hurried out to the right to the Adjutant's office, while his
Catherine flew to the left to the fence.
"Ella!" she cried. "Oh, Ella!"
Mrs. Bainbridge, instantly on the other side of the fence, brought scanty light. A telegram
had come, she knew, from the Crow Agency in Montana. Her husband admitted this three
nights ago; and Captain Duane (she knew) had given him some orders about something;
and could it be the Crows? "Ella, I don't know," said Catherine. "Frank talked all about
Providence in his incurable way, and it may be anything." So the two ladies wondered
together over the fence, until Mrs. Duane, seeing the Captain return, ran to him and
asked, were the Crows on the war-path? Then her Frank told her yes, and that he had
detailed Albumblatt to vanquish them and escort them to Carlisle School to learn German
and Beethoven's sonatas.
"Stuff, stuff, stuff! Why, there he does go!" cried the unsettled Catherine. "It's something
at the agency!" But Captain Duane was gone into the house for a cigar.
Albumblatt with Sergeant Casey and a detail of six men was in truth hastening over that
broad mile which opens between Fort Brown and the agency. On either side of them the
level plain stretched, gray with its sage, buff with intervening grass, hay-cocked with the
smoky, mellow-stained, meerschaumlike canvas tepees of the Indians, quiet as a
painting; far eastward lay rose-red long low hills, half dissolved in the trembling mystery
of sun and distance; and westward, close at hand and high, lifted the great pale blue
serene mountains through the vaster serenity of the air. The sounding hoofs of the troops
brought the Indians out of their tepees to see. When Albumblatt reached the agency,
there waited the agent and his two chiefs, who pointed to one lodge standing apart some
three hundred yards, and said, "He is there." So then Augustus beheld his problem, the
military duty fallen to him from Providence and Captain Duane.
It seems elementary for him who has written of "The Contact Squadron." It was to arrest
one Indian. This man, Ute Jack, had done a murder among the Crows, and fled south for
shelter. The telegram heralded him, but with boundless miles for hiding he had stolen in
under the cover of night. No welcome met him. These Fort Brown Indians were not his
friends, and less so when he arrived wild drunk among their families. Hounded out, he
sought this empty lodge, and here he was, at bay, his hand against every man's,
counting his own life worthless except for destroying others before he must die.
"Is he armed?" Albumblatt inquired, and was told yes.
Augustus considered the peaked cone tent. The opening was this way, but a canvas drop
closed it. Not much of a problem—one man inside a sack with eight outside to catch him!
But the books gave no rule for this combination, and Augustus had met with nothing of
the sort in Germany. He considered at some length. Smoke began to rise through the
meeting poles of the tepee, leisurely and natural, and one of the chiefs said:
"Maybe Ute Jack cooking. He hungry."
"This is not a laughing matter," said Augustus to the bystanders, who were swiftly
gathering. "Tell him that I command him to surrender," he added to the agent, who
shouted this forthwith; and silence followed.
"Tell him I say he must come out at once," said Augustus then; and received further
silence.
"He eat now," observed the chief. "Can't talk much."
"Sergeant Casey," bellowed Albumblatt, "go over there and take him out!"
"The Lootenant understands," said Casey, slowly, "that Ute Jack has got the drop on us,
and there ain't no getting any drop on him."
"Sergeant, you will execute your orders without further comment."
At this amazing step the silence fell cold indeed; but Augustus was in command.
"Shall I take any men along, sir?" said Casey in his soldier's machine voice.
"Ah—yes. Ah—no. Ah—do as you please."
The six troopers stepped forward to go, for they loved Casey; but he ordered them
sharply to fall back. Then, looking in their eyes, he whispered, "Good-by, boys, if it's to
be that way," and walked to the lodge, lifted the flap, and fell, shot instantly dead
through the heart. "Two bullets into him," muttered a trooper, heavily breathing as the
sounds rang. "He's down," another spoke to himself with fixed eyes; and a sigh they did
not know of passed among them. The two chiefs looked at Augustus and grunted short
talk together; and one, with a sweeping lift of his hand out towards the tepee and the
dead man by it, said, "Maybe Ute Jack only got three—four—cartridges—so!" (his fingers
counted it). "After he kill three—four—men, you get him pretty good." The Indian took
the white man's death so; but the white men could not yet be even saturnine.
"This will require re-enforcement," said Augustus to the audience. "The place must be
attacked by a front and flank movement. It must be knocked down. I tell you I must have
it knocked down. How are you to see where he is, I'd like to know, if it's not knocked
down?" Augustus's voice was getting high. "I want the howitzer," he screeched generally.
A soldier saluted, and Augustus chattered at him.
"The howitzer, the mountain howitzer, I tell you. Don't you hear me? To knock the cursed
thing he's in down. Go to Captain Duane and give him my compliments, and—no, I'll go
myself. Where's my horse? My horse, I tell you! It's got to be knocked down."
"If you please, Lieutenant," said the trooper, "may we have the Red Cross ambulance?"
"Red Cross? What's that for? What's that?"
"Sergeant Casey, sir. He's a-lyin' there."
"Ambulance? Certainly. The howitzer—perhaps they're only flesh wounds. I hope they are
only flesh wounds. I must have more men—you'll come with me."
From his porch Duane viewed Augustus approach and the man stop at the hospital, and
having expected a bungle, sat to hear; but at Albumblatt's mottled face he stood up and
said, "What's the matter?" And hearing, burst out: "Casey! Why, he was worth fifty of—
Go on, Mr. Albumblatt. What next did you achieve, sir?" And as the tale was told he
cooled, bitter but official.
"Re-enforcements is it, Mr. Albumblatt?"
"The howitzer, Captain."
"Good. And G troop?"
"For my double flank movement I—"
"Perhaps you'd like H troop as reserve?"
"Not reserve, Captain. I should establish—"
"This is your duty, Mr. Albumblatt. Perform it as you can, with what force you need."
"Thank you, sir. It is not exactly a battle, but with a, so-to-speak, intrenched—"
"Take your troops and go, sir, and report to me when you have arrested your man."
Then Duane went to the hospital, and out with the ambulance, hoping. But the
wholesome irony of life reckons beyond our calculations, and the unreproachful, sunny
face of his Sergeant evoked marches through long heat and cold, back in the rough,
good times.
"Hit twice, I thought they told me," said Duane; and the steward surmised that one had
missed.
"Perhaps," mused Duane. "And perhaps it went as intended, too. What's all that fuss?"
He turned sharply, having lost Augustus among his sadder thoughts, and here were the
operations going briskly. Powder smoke in three directions at once! Here were pickets far
out-lying, and a double line of skirmishers deployed in extended order, and a mounted
reserve, and men standing to horse—a command of near a hundred, a pudding of
pompous, incompetent, callow bosh, with Augustus by his howitzer, raising and lowering
it to bear on the lone white tepee that shone in the plain. Four races were assembled to
look on—the mess Chinaman, two black laundresses, all the whites in the place (on horse
and foot, some with their hats left behind), and several hundred Indians in blankets.
Duane had a thought to go away and leave this humiliation under the eye of Starr, for the
officers were at hand also. But his second thought bade him remain, and looking at
Augustus and the howitzer, his laugh returned to him.
It was an hour of strategy and cannonade, an hour which Fort Brown tells of to this day;
and the tepee lived through it all. For it stood upon fifteen slender poles, not speedily to
be chopped down by shooting lead from afar. When low bullets drilled the canvas, the
chief suggested to Augustus that Ute Jack had climbed up; and if the bullets flew high,
then Ute Jack was doubtless in a hole. Nor did Augustus contrive to drop a shell from the
howitzer upon Ute Jack and explode him—a shrewd and deadly conception; the shells
went beyond, except one, that ripped through the canvas, somewhat near the ground;
and Augustus, dripping, turned at length, and saying "It won't go down," stood vacantly
wiping his white face. Then the two chiefs got his leave to stretch a rope between their
horses and ride hard against the tepee. It was military neither in essence nor to see, but
it prevailed. The tepee sank, a huge umbrella wreck along the earth, and there lay Ute
Jack across the fire's slight hollow, his knee-cap gone with the howitzer shell. But no
blood had flown from that, because he was already then dead some time. One single
other shot had struck him—one through his own heart, that had singed the flesh.
"You see, Mr. Albumblatt," said Duane, in the whole crowd's hearing, "he killed himself
directly after killing Casey. But if your manœuvres with his corpse have taught you
anything you did not know before, we shall all be gainers."
"Captain," said Mrs. Starr, on a later day, "you and Ute Jack have ended our fun. Since
the Court of Inquiry let Mr. Albumblatt off, he has not said Germany once—and that's
three months to-morrow."
WANTED: A GIANT.
"The giant I want to look at,"
Said Bobbie, "must be so tall
It'll take me a week and two other days,
To look at him all!"
THE REMARKABLE ADVENTURES OF
SANDBOYS.
BY JOHN KENDRICK BANGS.

AN INDIAN EXPERIENCE.
Sandboys, in his stories of adventure told to Bob and Jack, had so frequently in past
years alluded to Indians that it suddenly occurred to Bob to find out if possible just how
far Sandboys's experiences with the original owners of the soil had gone. There had been
Indians in this section of New Hampshire. The boys knew that well, for the names of
many of the hills and rivers attested the fact—Pemigewasset, Ammonoosuc, Moosilauke—
all these names were decisive evidence that the red men had once inhabited the region,
and dominated it sufficiently to leave their names at least forever impressed upon it.
Furthermore, the Great Stone Face that looked stolidly out over the placid surface of the
little lake, less than a mile from the hotel, had connected with it many an Indian legend
which the boys had from time to time picked up in the course of their stay.
But it was not with the Indian as an idea, a memory, that caught their fancy. They
wanted to have something of the Indian of the present, a live Indian and therefore a bad
one, and with this end in view they approached Sandboys one evening while waiting for
their parents to come down to supper.
"Of course," Sandboys said in reply to their question—"of course there's been Indians
around here, but there ain't any now. Civilization's driven 'em all out to Nebrasky an'
Honnerlulu and other Western States where they can afford to live. They hung on here as
long as they could, but when the hotels began to get built and a new set of prices for
things was established in the section, they couldn't afford to stay, so they enervated out
West."
"They what?" asked Bob, to whom Sandboys's meaning was not quite obvious.
"Enervated—skipped—moved out. That's the right word, ain't it?" asked Sandboys.
"Emigrated, I guess you mean," suggested Jack.
"That's it—emigrated. I allers gets enervated and emigrated mixed up somehow,"
Sandboys confessed. "Fact is, when words gets above two syllabuls they kerflummux me.
I really oughtn't to try to speak 'em, but once in awhile they drop off my tongue without
my thinking, and most generally they gets fractured in the fall. But as I was tellin' you,
when it began to git expensive living here in the mountains, the Indians found they was
too poor to keep in with the best society, and they energated to Nebrasky and other
cheaper spots. I've allers felt that the government ought to remember that point, an'
instid of sendin' the army out with cannon and shot to kill the Indians and git kilt itself,
they should civilize the section by buildin' a half a dozen swell hotels an' charge people
ten dollars a day for breathin' the air. That'll kill an Indian quicker'n anything—or if it
don't, instid of goin' about scalpin' soldiers and hullaballoin' in war-paint, after one or two
seasons he'll begin to make baskits out of hay an' bulrushes an' sell 'em to guests for
eight dollars. From what I know about Indians, they'd rather sell a baskit worth ten cents
for eight dollars than kill a man, a fact which the government doesn't seem to take notice
of. I'd like to be put in charge of the Indian question for just one administration at
Washington. You wouldn't hear about any more Piute or Siouks uprisin's in the West, but
you would hear of a great increase in the hay-baskit industry and summer-hotel-buildin'
trade."
"It sounds well," said Jack.
"I guess it does," said Sandboys. "It would work too."
"It might be dangerous for two or three seasons for the guests, though," said Bobbie. "I
don't think I'd want to go to a place for the summer where the Indians were thick and
still wild. I don't want to get scalped."
"Oh, you'd be all right as long as you wasn't a dude!" rejoined Sandboys. "Now that the
dudes has taken to wearin' their hair long in the back, no wild Indian's goin' to bother
with boys. There's no fun scalpin' a small boy, with football scalps in sight. You've hit on
the great trouble about Indians, though," Sandboys added, reflectively. "You can civilize
'em. You can teach 'em Latin, Greek, French, or plumbing. You can teach 'em to dance
and sing. You can make 'em wear swaller-tail coats and knickerbockers instead o' paint
an' hoss blankets, but you can't entirely kill their taste for takin' hair that don't belong to
'em. It was on just that point that I had my only experience with Indians in this place
here, and I tell you what there was lively times that summer. It nearly ruined this hotel,
and if it hadn't been for me, I kind o' think it would have been goin' on yet.
"It was back in the eighties somewhere that it
happened. I don't remember whether it was '87 or '88.
Tennyrate, it was the year Mr. Hicks's boy Jimmie
caught a five-pound bass in Echo Lake with his
Waterbury watch. Ever hear about that? Funniest thing
y' ever heard of. Jimmie Hicks was the liveliest little
boy you ever saw. You two rolled into one wouldn't be
half as lively. He was everywhere at once, Jimmie was.
He's the boy that busted the hole in the roof with the
elevator. Set the thing goin' up, couldn't stop it, and
bang! first thing he knew the whole thing had
smashed up through the roof and toppled over on its
side. He had a watch—a Waterbury watch. His father
got it for him just because it took an hour to wind it
up, and that kept Jimmie busy for an hour a day,
anyhow, an' he used to be doin' everything he could with it. I've seen him smash a black
fly on the wall with it, usin' it like a sling-shot; but the queerest thing of the lot was his
catchin' the bass with it. He was out in a boat, an' nothin' would do but he should trail
that watch in the water after him. The bass he see it, thought it was a shiner, snapped at
it, swallered it, and Jimmie pulls him in. Weighed five pounds an' three ounces on the
office scales. It was that year we had the time with old Rocky Face—I don't remember his
Indian name, but Rocky Face was what it meant in English.
"He was a quiet, peaceable, civilized old Indian, and
the last of the old tribe that used to live about here.
The others had fled to Nebrasky, as I told you,
because they couldn't stand the expense of livin' in
the White Mountains, but Rocky Face said they
couldn't freeze him out. He'd been born here, and he
was goin' to die here, if he had to steal a livin'. So he
staid on, an' lived in an old pine-bough shanty he
built for himself up on the other side of Mount
Lafyette. What he fed on nobody knew, but every
once in a while he'd turn up at the hotel and ask
what they'd charge to let him look at the clock, and
everybody'd laugh, and call him a droll old Indian,
and ask him to come back. Finally he got to makin'
baskits and birch-bark canoes and bows and arrows,
and he'd sell 'em to the guests. They took so many of 'em that Rocky Face soon got to
earnin' twenty an' thirty dollars a day, an' when he got to that point he could afford a
small back room in the hotel, and so he came here to live.
"He became one of what they call the features of the place, an' they got to puttin' his
picture in the hotel perspectacle."
"Prospectus, do you mean?" queried Bob.
"Hyop. That's the thing," said Sandboys. "They put his
picture in that as one o' the sights. They called him 'A
Rollic of the Past: The last of the Pemmijehosophats.' He
used to make a good many people nervous, the way he
eyed their hair, for, as I've said, although he'd become
more or less civilized, it wasn't in him not to covet other
people's hair. About that time there was an awfully
pretty girl here from down South somewheres—
Conneticut, I think. She was a regular belle, and she had
the finest yeller hair you ever see. Every night she'd be
out rowin' on the lake with all the legible young men in
the place; but all of a sudden she didn't come down to
breakfast one morning. She had it sent up, an' her
mother looked very anxious when she came down and
said her daughter was very sick. Then two other ladies
didn't appear any more, and a very well known old lady remarked in my hearin' that
there was a thief in the house—she'd lost a switch. Well, that set me to thinkin', but I
couldn't come to any conclusion until one night I took a pitcher of ice-water up to the
Conneticut young lady's room, and, by Joe, there she sat readin', with scarcely no hair at
all on her head."
"Scalped?" cried Bob, in horror.
"Not a bit of it," said Sandboys. "Robbed! An' then it all came to me. That old last of the
Pemicans had spoke several times about her hair to me, an' I could see he was kind of
thirsty for it, an' I made up my mind to two things. First was, Miss Conneticut's hair was
nothin' but a wig; and second, old Rocky Face had it. I stole into his room that night
when he was at supper and opened his trunk. Will you believe it, it was full o' false hair,
an' in an old hat-box in one corner was the beautiful yeller locks of Miss Conneticut. That
feller'd scalped enough bureaus to fill three good-sized mattresses."
"As much as that?" cried Jack.
"Hyop!" said Sandboys. "Most o' the ladies didn't like to mention it, but there was hardly
one of 'em that hadn't lost two or three headsful to that old sinner, and I found it out. Of
course I told the proprietor, and the hair was restored to its owners. Miss Conneticut
appeared again, more popular than ever, and old Rocky Face was sent to jail, and he's
never come out as I know of."
"Well, that is a singular story," said Bob.
"Isn't it," said Jack. "I should think Miss Conneticut ought to have been very much
obliged to you."
"She was," replied Sandboys. "She gave me twenty-five dollars—five for findin' the wig,
and twenty for keepin' quiet about it around the hotel. That's one reason I can't
remember her real name."
THE BOY WRECKERS.
BY W. O. STODDARD.

CHAPTER IV.
"Whoop! Bully!" That shout came from the wreckers, within fifty yards, just as Pete got
the hook of the Captain's "gaff" into the gills of the bass, and Kroom himself hoisted the
prize on board. Every ounce of their suspicion was gone in a moment, and the cat-boat
tacked away; but just then Sam said, in a very low voice:
"There's that white thing, if it's a life-preserver. It's got stuck again."
In the other boat there was trouble. All the men noticed the Elephant with her extra
passenger, now that she was near enough; and suddenly the man at the helm stood up
and said:
"Captain Kroom did go to the wreck. I saw that big feller that's with him. He was on the
Goshawk when the tug left her. We'd better watch Kroom and see if he's gropplin' on his
own account. We can't do or say a thing unless we can pick up what was thrown over."
"Thrue for ye," replied the man next him. "Thin the inlet's the place to wait for thim. We
can luk into his boat, sure."
"I'll tell you what, boys," said the steersman, "those fellers threw over more'll we know
of. They'll come back for every pound of it, but we can beat 'em."
It looked as if their view of the matter was just as Captain Kroom had said. They had not
the slightest idea but what it was entirely honest to do what they were attempting. Does
not anything that drifts ashore belong to the land it is stranded on?
It is true that the laws of most countries and the rights of other men are against the
wreckers, but they have a strong belief in a kind of "storm law." It is a law that reaches
out into the sea sometimes, and covers anything which may be found floating around. It
certainly takes in all that can be fished up from the bottom.
That is the general idea of the men who are known as wreckers. The cat-boat with these
four men in it ran on into the inlet for quite a distance while they were talking about
Kroom and the Goshawk and the tug-boats.
The place at which they had anchored was very near the bay side of the long sandbar
island whose front was toward the ocean. Here they were entirely hidden, but at the
same time they were unable to keep any watch upon the Elephant and the possible
doings of her crew. This was not exactly what they intended, and before long the
steersman arose and remarked to his mates:
"This won't do. You'd better put me ashore. I'll go over to the ocean beach and keep an
eye on 'em. Glad I brought my glass along. 'Tisn't only old Kroom. Some o' the tug-boat
fellers may have come back."
A pretty spirited debate followed, and all the while the weakfish and flounders were
biting freely. They therefore were having pretty good luck in their ordinary character of
fishermen.
In spite of that, however, they all seemed to feel very much as did their steersman, and
the entire four at last decided to go ashore on the bar and walk over to watch Kroom.
They left their boat, pulled all the way out of water, at the bay end of the inlet, and there
was not another craft of any kind in sight when they began to trudge across the sand.
In the Elephant, slowly sailing along from its place of danger too near the surf, the course
of affairs had been very interesting to its crew.
"Pete," said Sam, at the moment when the wrecker boat tacked away and the big sea-
bass lay floundering fiercely on the bottom, "that's the largest fish I ever saw caught."
"Biggest kind!" responded Pete. "You or I couldn't have done anything with him. They
generally catch 'em off shore, with a bass-rod and a reel. Tire 'em out, you know, before
they try to pull 'em in. It's science!"
Sam had heard of such things, and it made a proud boy of him to find himself right in
among what seemed to him the greatest fishing in all the world—unless, he thought, it
might be fishing for sharks or whales. Captain Kroom himself had been a whaler, and
Pete had been out shark-fishing. Sam was beginning to feel a good deal of respect for
Pete, and he whispered to him:
"Why don't you try on that blue suit? It's as dry as a bone. See if it fits."
Captain Pickering must have heard him, for he said at once: "That's it, boy; put it on.
What you need most is a new rig."
"Sam pulled it up," he said. "It's one of his fish."
"Fisherman's luck," laughed Captain Kroom, with a very deep, hearty laugh. "It's your
share. Put it on."
Pete had eyed that suit until he knew every seam and button of it. Hour after hour during
the cruise of the Elephant he had grown better and better acquainted with the strange
idea that it was to be his own. He had hardly told himself how much more it must have
cost than had any clothes he had ever owned before. "Guess I'll wait till I get home," he
said.
"No, you don't," thundered Captain Kroom; "I want to see how you look in it. Put it on!"
Pete was pretty well accustomed to obeying the Captain, and not to do so now would
have been something like mutiny on shipboard. He turned very red in the face, and he
put on the trousers wrong side out the first trial, but then he got them right, and the blue
shirt and the jacket followed.
"They fit him!" exclaimed Sam. "Make him look like another fellow."
So they all said, and it made little difference that Pete was still barefooted or that his
straw hat turned up in front. It was an out-and-out sailor rig, and it had taken only a
twinkling, or perhaps two or three twinklings, to get it on.
Meantime the Elephant had tacked to and fro, and Captain Kroom and Sam had kept
their trolling-lines out. As for Captain Pickering, he had again opened his valise, and was
now at work with his double-barrelled spy-glass, as Sam called it.
"Kroom," he remarked, "keep on fishing. Those chaps are in the inlet, out of sight, just
now. One more tack and we can stretch on across the channel, not far from that buoy."
They all knew that he meant the bit of white float, the life-preserver, that was continually
appearing and disappearing among the waves to the eastward.
"Now!" exclaimed Captain Kroom; but at that instant Sam shouted,
"Oh! Guess it's a bluefish!"
"Just the thing!" replied Kroom. "Pull! While you're getting him in we'll try for that float. It
isn't a hundred yards away."
At that moment, unknown to the crew of the Elephant, the four wreckers were plodding
along across the dry hot sand of the bar-island, eager to reach the seaward beach, from
which they might discover what was going on inside of the tossing, foaming lines of the
surf.
The life-preserver was nothing but a long India-rubber-cloth bag of wind, bent around in
a ring. It was meant to be worn under the arms of a person in the water. There it was,
bobbing to and fro on the water, but not getting along very well. The tide was strong, but
there was a hitch as of something that dragged on the bottom.
"Got it!" exclaimed Pickering, as the Elephant swung around close to the float. "I'll fetch
it up as quick as I can! Oh!"
He had not caught it, for it bobbed away from him as if it were dodging.
"Gaffed!" said Captain Kroom the next instant. "That's it, Pete. Now hold hard. Don't let it
get away."
"I won't!" almost gasped Pete, tugging with all his might. "Can't you tack, Captain?"
The Elephant seemed to swing on her own account, so perfectly was she handled by the
old sailor, but Pickering now had hold of the handle of the gaff, and it was not likely to
get away from him.
"In she comes!" he said, but he was now grasping a rope that was knotted hard to the
life-preserver.
"I'll let the boat kite along," said Kroom. "Don't let anybody see you pull that in."
He was keeping the sail of the Elephant full spread toward the bar and the inlet. That
was why a man with a spy-glass, who came running down the beach and began to look,
shouted back to some other men:
"There she comes! They're only trolling. They haven't stopped for anything. But the sail
kind o' hides 'em."
The Elephant had not paused, to speak of, but behind her sail Captain Pickering was
lifting something over her gun-wale.
"Conscience!" he exclaimed. "This here is part of my luggage that I thought went on the
tug this morning. I saw all the rest of it stowed away safe enough, but I'd ha' lost this."
"Some o' the tug crews are the worst kind o' wreckers," remarked Captain Kroom. "We've
beat 'em this time, unless there were some more life-preservers out."
"Guess not," said Pickering. "There isn't much in this that would be hurt by salt water. It's
had a soak, that's all."
It was not so large a valise as the other, but it seemed as heavy. It was just the thing to
keep a life-preserver under in deep water, and to let a strong current drag it along into
shallows.
"Don't open it till you get ashore," suggested Kroom. "I'm heading the boat for the inlet.
Cast off the float."
Pickering had already done that; but as the Elephant bowed her head and swung away,
the life-preserver, although robbed of its precious drag, seemed to be following her.
"Pete," said Sam, "look! I can see those fellows."
"They've come over the bar to watch what we're doing," growled Kroom. "Pickering,
now's our time to run through into the bay. I've an idea in my head. Can't you hide those
things?"
Off came Pickering's coat, and down it went over the two valises, side by side. Next to
them lay the handsome shapes of the bass and the two bluefish, and one more was
added to these by Sam himself before they had sailed a hundred yards.
Only four fish, but they made a pretty good appearance. At all events, there was not a
sign of recaptured wreckage on board the Elephant. Her crew and passengers could not
hear the wreckers saying to each other: "Kroom's giving it up. He's off for home. We can
go back now."
"Boys," it was the steersman, after a long squint through his glass, "I can see our float!
She's coming. Let's go for the boat. Now's our time."
Perhaps so; but they had lost a great deal of time, and the Elephant was already in the
inlet, running well, when they started back.
"Wish there was more wind," said Pickering, impatiently. "Their boat's over there
somewhere."
"That's what I'm after," replied Kroom; "and I reckon we'll get there first."
That might depend a great deal on the strength of the breeze, and even more on the
crookedness of the channel. Account had also to be taken of the fact that no man can do
his fastest walking in yielding sea-sand.
"There it is!" said Pete. "Captain, they hauled their boat a'most out o' water."
"They can shove it in again quick enough," replied Kroom. "I don't know exactly what to
do or say. The fact is, they're a prime good lot of fellows—hard-working, sober,
peaceable. All of 'em go to meeting."
"Well, Kroom," said Pickering, "I knew a real partiklar feller once, and they said he'd been
a pirate. I didn't quite believe it of him."
"Here we come!" responded Kroom, as the Elephant glided somewhat lazily around a
sandy curve. "Jump ashore, Pete! Get there!"
Sam had already noticed how remarkably quick his long-shore comrade could be in his
movements, but he was surprised now at the sudden elastic bound which took Pete out
of the Elephant as she almost grazed the bank on that side of the inlet. Then away he
went toward the wrecker boat, and his bare feet were the correct thing for sand-walking,
or wading.
At that very moment the four bay fishermen came in sight, toiling along breathlessly
under the hot sun, and the foremost of them shouted: "Hullo, Kroom! Want to see ye!"
"Come on!" roared Kroom. "We'll wait for ye! H'ist yourselves along. Plenty o' time!"
Pete was now at the hauled-out boat and was peering over into her, but he had not
uttered a sound. He was thinking very fast indeed. "We've got 'em!" he said to himself.
"What rascals they are! Who'd ha' thought it of 'em! This is what it means to be wrecked
among wild savages. Take everything you have. But then they murder a fellow, and old
Kroom says some of 'em eat him. Now I wonder what they'll say when they find they're
caught?"
He did not have to wait long before he found out. Here came the Elephant, her sail
slipping down as she ran her nose into the sand. Out stepped Captain Pickering, and at
the same moment the four bay fishermen came in a hurry to the opposite side of the cat-
boat.
"My quadrant!" shouted Captain Pickering. "Those two English guns of mine, and Captain
Sanders's spare chronometer! It beats all!"
"Yours, are they?" loudly responded the steersman of the cat-boat. "Well, if I ain't glad to
see ye! And old Kroom, too! I was wonderin' how we'd get 'em back to their owners."
"WHAT?" THUNDERED CAPTAIN KROOM. "JUST SAY THAT OVER
AGAIN!"
"What?" thundered Captain Kroom. "Just say that over again!"
"Why, Captain," replied the fisherman, "them there insurance fellers are straight enough,
but the tug-boat men are no better than so many river thieves. Reg'lar wreckers! We
couldn't do a thing while they were around. Some of the Goshawk's crew were just as
bad."
"Ye'd not belave me," put in another of the fishermen, "but it's so. They're all foreigners,
ivery mon av thim. Not an American among thim. The dirthy spalpanes! It's bad enough
for a mon to foind himself wrecked, widout bein' ploondered. We got away these things
from the toog-boat min, but they threw over stuff and buoyed it to coom and get it. We
was gropplin' for it the day. I hope ye're no wrecker, Captain Kroom. They say most o'
thim owld sailors'll sthrip ony wreck."
The bronzed face of Captain Kroom was furious with indignation for a moment, and then
he burst into a very deep-chested roar of laughter.
"Sam," whispered Pete, "think of their taking him and you and me for wreckers."
"They'll have to give up all those things, though," whispered back Sam.
The bay fishermen had no thought of doing anything else. They listened with keen
interest to the account of the spar buoy, that had been set adrift without their
knowledge. They seemed entirely satisfied with the capture of the life-preserver. In
return, they told all they knew of the ways of the tug-boat men, and Pat Malone again
and again asserted that "those chaps are all sorts, from iverywhere, and not wan
American."
Captain Pickering was ready to pay the four very honest fishermen liberally for the time
they had spent in watching the thieves and in grappling. It was quite dark, however,
before the Elephant again had her crew on board.
"Biggest day I ever had," said Sam to Pete. "Let's come again, right away."
"Bully!" said Pete. "We'll come out with Captain Kroom."
"Come along, boys," put in the Captain. "We'll fish all summer. Glad there's more breeze
to carry us home. Pickering, it's just as I told you. Our bay fishermen are honest. They'
wouldn't cheat you in the weight of a flounder."
The moon came up, as if the new fresh breeze had brought it, and the homeward sail
across the bay did great credit to the qualities of the Elephant. Nevertheless there was
much tacking to and fro, while Pete and Sam listened to the two old sailors. There was
really hardly anything for them to do but to exchange yarns about their voyages in the
splendid clipper-ships which were now being driven from the seas by that terrible fellow,
Steam.
"Pete," said Sam, as they stepped out at last upon the wharf, "ain't I glad I came."
"I'm glad you did," replied Pete; "but the Captain's going to take us out again, any day."

THE END.
A LOYAL TRAITOR.
A STORY OF THE WAR OF 1812 BETWEEN AMERICA AND ENGLAND.

BY JAMES BARNES.

CHAPTER X.

TEST TRIALS.
We did not proceed to sea, as it had been expected that we should, but we stretched
several new sails, and the Captain marked them for alteration by the ship's sail-maker,
much as a tailor changes the cut of a coat to secure a proper fitting. The men were made
to take their positions at the guns, and I found that I had been made a second captain of
the long 12-pounder, and was expected to work the roller handspike in getting her into
position. For three long hours we were kept at this, slewing the guns hither and thither,
aiming and gauging distance, and bringing powder and shot from the magazines. Of
course we indulged in no firing, but served the pieces in pantomime.
The men appeared eager, and I could see that Captain Temple looked pleased at their
performance. The majority were old hands, and needed little schooling. There is no use
denying it, they jumped to the best of their ability. But my trial was soon to come. Most
of the greenhorns had been enrolled into a company of marines. They were standing in
an awkward row arranged in the waist, and keeping out of the way of the more
experienced gunners who were indulging in the mimic battle.
"Debrin!" called a voice. "Pass the word for Debrin."
A squint-eyed bowlegged boatswain's mate was bawling about the deck.
For an instant I was so confused that I almost forgot the name I had assumed.
"Here!" I called at last, with my heart giving a wild leap into my throat. I gave over the
roller handspike to my friend of the night before, and the boatswain's mate looked at me
out of his crooked eyes.
"The old man wishes to speak to you," he said, in a low voice.
I stepped aft and pulled off my cap, as I had seen the other sailors do.
"Take hold of those gawk-legs and lick them into shape," said Captain Temple, apparently
counting up my ribs as he looked me through and through. "You say you know the drill.
There's a rack of muskets forward on the berth-deck, and a chest of cutlasses at the
after-ladder. If any one gives you a sneer or a back word make him sweat his blood."
I hope that the quiver that went over me was not apparent, but I felt a cold sensation
from my chest to the end of my spine. Now, as it happened, I had watched closely, as a
boy, the drilling of the train-band at Baltimore, where I learned much from my friend the
Major, and had once formed a company of my schoolmates at Mr. Thompson's, electing
myself their leader. I tried to recall the orders of command and the positions as I
marched the men below and armed them at the rack. But when I came back to the deck
I was again seized with a fit of trembling that made me keep in movement to conceal it,
for I perceived that those under me were watching with some curiosity to see what I
should do. Besides this, it appeared to my imagination that all the crew were standing
about with popping eyes, ready to laugh at me if I should open my mouth. So I took a
long swallow, threw back my head and shoulders (ah! there is nothing like it to keep up
one's courage!) and adopting a terse mode of speech, I began to sift the men into
military shape, according to their height.
My uncle had impressed one thing upon my mind as the surest way to obtain authority; it
was not to make men hear, but to make them listen; so I did not shout, but endeavored
to speak in low firm tones, explaining to the men as I gathered them into line how they
should stand and hold themselves. Some were inclined to smile at first, and indeed I
cannot blame them; for despite my size, my youth was evident, no matter my air of
authority.
To those who appeared amused I kept repeating my instructions until the grin had faded
from their faces, and at last I felt that feeling which expands the spirit of the holder of it
—the sense of authority over others. So stepping out before them, I picked up a musket
and began to drill them according to my recollection of the manual of arms.
If there had been an expert present, he might have found some fault with my method,
but I got through without a hitch, and I might claim, without boasting, that I held
attention. Over and over again we went through the motions. I was wondering whether
there was to be no time limit to the drill, when suddenly some one spoke to me from
behind.
"Very good, drill-master," said Mr. Bullard. "Dismiss the landsmen, and take up the
boarders with some cutlass-work."
The muskets returned to the racks, I once more came on deck, and found that I had to
face a very different ordeal. There, awaiting me, were thirty or forty sailor-men—I could
see that at a glance. They regarded the idea of my instructing them as something of a
huge joke, for they stood there open-mouthed and nudging one another, half sneering,
and all whispering. As soon as I took the position of "on guard," I noticed that some of
them fell into it at once involuntarily, but others displayed an awkwardness that I knew
must be premeditated. Now was the time for me to stand or fall.
I stepped up to a tall man who topped me by half a head, and bidding him stand out, I
gently pushed him into the right position, moulding him, as it were, and paying no
attention to the anger which flashed in his eyes and drew the corners of his mouth. The
rest were becoming interested, but I saw that they were not grinning at me now, but at
their messmate. Satisfied that the man could do what I wished, I again gave the order
for them to act together. The tall sailor twisted his cutlass in his hand and held it upside
down. Once more, as if believing this came from sheer stupidity, I went through the
same performance, trying to speak kindly and firmly, but really on the verge of breaking
down. Three times did I do this, and then the man succumbed.
But I had not finished. On the left of the line was a short, thick-set foretopman, with
brawny, tattooed arms. Apparently he considered himself beyond all this and an adept
with the weapon, for he indulged in side remarks that set those near him tittering, and
he exaggerated all my motions. I saw that he was a leader in his way, and that for
comfort's sake I should have him with me, so I called the others to a rest, and bade this
man step forward. He did so in a careless, jaunty way, although his face had reddened.
Placing him before me, I told all hands to observe me closely; that I would show them
the bad effect of too open a guard and too lowered a point. It was a dangerous game to
play, perhaps, but I called upon the seaman to make the various cuts and thrusts at my
head and body. He did so with a vengeance, and it took all my strength to keep him from
reaching me.
Captain Temple and the other officers had gathered in a little knot to one side and were
watching. My blood was up, and I would rather have died than fail in what I was
attempting. So I called upon the man to guard himself, and assured him that I would not
harm him. Keeping my wrist well up, I told him to have a care of his left cheek. He
grinned in reply. By a quick motion, the secret of which Monsieur de Brienne had taught
me (for he was an adept with the broadsword as well as with the rapier), I got inside the
man's guard and laid my blade along his throat. I well believe I could have severed his
head from his body with a backward draw-stroke. The man paled and clinched his teeth.
I resumed my position, with my eyes fixed on his, for I feared mischief. Then using the
same movement that I had in my encounter with Captain Temple, I twisted his blade
from his grasp and sent it flying. I verily believe it would have gone overboard had it not
caught a stay overhead. Picking it up myself before any one could reach it, I returned it
to him, and he stepped back into the ranks. I had no more trouble after that.
Now, strange as it may seem, when I got away I went forward and leaned out of an open
port, and there, for some strange reason, the strain under which I had been laboring
almost overcame me, and it was all I could do to keep from sobbing or to control the
shaking of my limbs. While crouched there I felt a hand laid on my shoulder, and looking
up I saw it was Edmundson, the Third Lieutenant.
"The Captain wishes to speak to you in the cabin, lad," he said, kindly. "Jump aft."
When I entered the plainly furnished little space, for the quarters of the officers were
almost as confined as those of the crew, I saw that Captain Temple was sitting at the end
of the table, which was covered with open charts. He looked up, and seeing who it was,
half smiled.
"IF YOU ARE AS GOOD A SAILOR AS YOU ARE A SWORDSMAN, YOU
WILL END THIS CRUISE AN OFFICER."
"Debrin," he said, "you have done well. If you are as good a sailor as you are a
swordsman, you will end this cruise an officer. This is more than I have ever said in the
way of praise or promise to any living man. Forget it, and do your duty."
I could not have replied at this moment, for my wits left me; so I merely touched my
forehead in salute, and went forward again. I could see that the men were whispering,
and it was all I could do to hide my embarrassment. I believe that I was blushing like a
schoolgirl.
The next day was a repetition of this one, albeit the work was quite easy for me, and I
grew keen with the interest of it. The Fourth Lieutenant, a Mr. Spencer, arrived in the
afternoon; and a sergeant, who had served in the army, was enlisted as a Lieutenant of
marines. Apparently he found no fault with whatever they had been taught under my
instruction, and Sutton, the man with whom I had had the passage of arms, came to me
to learn the disarming stroke. As I met him more than half-way in this overture, we
became friendly. In the afternoon I endeavored to get ashore (oh, how I wished to talk to
Mary!), and I was delighted at being one of the crew that pulled Captain Temple to the
wharf at six o'clock.
Captain Temple's stay on shore, however, had been short, consisting merely of a visit to
Mr. McCulough's office (the latter was part owner of the Young Eagle), and I got no
chance to run up into the town, as I had intended. My wish, if it were possible, to get
another glimpse of Mary Tanner, was frustrated. This fortune was not to be mine. Oh,
Welcome to Our Bookstore - The Ultimate Destination for Book Lovers
Are you passionate about books and eager to explore new worlds of
knowledge? At our website, we offer a vast collection of books that
cater to every interest and age group. From classic literature to
specialized publications, self-help books, and children’s stories, we
have it all! Each book is a gateway to new adventures, helping you
expand your knowledge and nourish your soul
Experience Convenient and Enjoyable Book Shopping Our website is more
than just an online bookstore—it’s a bridge connecting readers to the
timeless values of culture and wisdom. With a sleek and user-friendly
interface and a smart search system, you can find your favorite books
quickly and easily. Enjoy special promotions, fast home delivery, and
a seamless shopping experience that saves you time and enhances your
love for reading.
Let us accompany you on the journey of exploring knowledge and
personal growth!

ebookgate.com

You might also like