(Ebook) Python High Performance Programming: Boost the performance of your Python programs using advanced techniques by Gabriele Lanaro ISBN 9781783288458, 9781782163367, 9781782161523, 9781782163923, 9781782171249, 1783288450, 1782163360, 178216152X, 1782163921 - Own the ebook now with all fully detailed content
(Ebook) Python High Performance Programming: Boost the performance of your Python programs using advanced techniques by Gabriele Lanaro ISBN 9781783288458, 9781782163367, 9781782161523, 9781782163923, 9781782171249, 1783288450, 1782163360, 178216152X, 1782163921 - Own the ebook now with all fully detailed content
https://ebooknice.com/product/biota-grow-2c-gather-2c-cook-6661374
https://ebooknice.com/product/matematik-5000-kurs-2c-larobok-23848312
https://ebooknice.com/product/sat-ii-success-
math-1c-and-2c-2002-peterson-s-sat-ii-success-1722018
https://ebooknice.com/product/python-high-performance-
programming-43140680
(Ebook) Python High Performance Programming by Gabriele Lanaro ISBN
9781783288458, 1783288450
https://ebooknice.com/product/python-high-performance-
programming-43192998
(Ebook) Master SAT II Math 1c and 2c 4th ed (Arco Master the SAT
Subject Test: Math Levels 1 & 2) by Arco ISBN 9780768923049,
0768923042
https://ebooknice.com/product/master-sat-ii-math-1c-and-2c-4th-ed-
arco-master-the-sat-subject-test-math-levels-1-2-2326094
https://ebooknice.com/product/cambridge-igcse-and-o-level-history-
workbook-2c-depth-study-the-united-states-1919-41-2nd-edition-53538044
https://ebooknice.com/product/python-high-performance-6781574
https://ebooknice.com/product/python-data-visualization-
cookbook-20632872
Python High Performance
Programming
Gabriele Lanaro
BIRMINGHAM - MUMBAI
Python High Performance Programming
All rights reserved. No part of this book may be reproduced, stored in a retrieval
system, or transmitted in any form or by any means, without the prior written
permission of the publisher, except in the case of brief quotations embedded in
critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy
of the information presented. However, the information contained in this book is
sold without warranty, either express or implied. Neither the author, nor Packt
Publishing, and its dealers and distributors will be held liable for any damages
caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.
ISBN 978-1-78328-845-8
www.packtpub.com
Reviewers Proofreader
Daniel Arbuckle Linda Morris
Mike Driscoll
Albert Lukaszewski Indexer
Rekha Nair
Acquisition Editors
Owen Roberts Production Coordinators
Pooja Chiplunkar
Harsha Bharwani
Manu Joseph
Commissioning Editor
Shaon Basu Cover Work
Pooja Chiplunkar
Technical Editors
Akashdeep Kundu
Faisal Siddiqui
About the Author
Mike Driscoll has been programming in Python since Spring 2006. He enjoys
writing about Python on his blog at http://www.blog.pythonlibrary.org/.
Mike also occasionally writes for the Python Software Foundation, i-Programmer,
and Developer Zone. He enjoys photography and reading a good book. Mike has
also been a technical reviewer for Python 3 Object Oriented Programming, Python
2.6 Graphics Cookbook, and Tkinter GUI Application Development Hotshot.
Did you know that Packt offers eBook versions of every book published, with PDF
and ePub files available? You can upgrade to the eBook version at www.PacktPub.
com and as a print book customer, you are entitled to a discount on the eBook copy.
Get in touch with us at service@packtpub.com for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign
up for a range of free newsletters and receive exclusive discounts and offers on Packt
books and eBooks.
TM
http://PacktLib.PacktPub.com
Why Subscribe?
• Fully searchable across every book published by Packt
• Copy and paste, print and bookmark content
• On demand and accessible via web browser
[ ii ]
Preface
Python is a programming language renowned for its simplicity, elegance, and
the support of an outstanding community. Thanks to the impressive amount
of high-quality third-party libraries, Python is used in many domains.
Python is an easier language to deal with and it can be used to quickly write
complex applications. Thanks to its tight integration with C, Python is able to
avoid the performance drop associated with dynamic languages. You can use
blazing fast C extensions for performance-critical code and retain all the
convenience of Python for the rest of your application.
In this book, you will learn, in a step-by-step method how to find and speedup
the slow parts of your programs using basic and advanced techniques.
The style of the book is practical; every concept is explained and illustrated with
examples. This book also addresses common mistakes and teaches how to avoid
them. The tools used in this book are quite popular and battle-tested; you can be
sure that they will stay relevant and well-supported in the future.
This book starts from the basics and builds on them, therefore, I suggest you
to move through the chapters in order.
Chapter 2, Fast Array Operations with NumPy is a guide to the NumPy package.
NumPy is a framework for array calculations in Python. It comes with a clean
and concise API, and efficient array operations.
The book was written and tested on Ubuntu 13.10. The examples will likely run on
Mac OS X with little or no changes.
[2]
Preface
However, the scope of this book is broad and the concepts can be applied to any
domain. Since the book addresses both basic and advanced topics, it contains
useful information for programmers with different Python proficiency levels.
Conventions
In this book, you will find a number of styles of text that distinguish between
different kinds of information. Here are some examples of these styles, and an
explanation of their meaning.
Code words in text, database table names, folder names, filenames, file extensions,
pathnames, dummy URLs, user input, and Twitter handles are shown as follows:
"The plot function included in matplotlib can display our particles as points
on a Cartesian grid and the FuncAnimation class can animate the evolution of
our particles over time."
def visualize(simulator):
[3]
Preface
When we wish to draw your attention to a particular part of a code block, the
relevant lines or items are set in bold:
In [1]: import purepy
In [2]: %timeit purepy.loop()
100 loops, best of 3: 8.26 ms per loop
In [3]: %timeit purepy.comprehension()
100 loops, best of 3: 5.39 ms per loop
In [4]: %timeit purepy.generator()
100 loops, best of 3: 5.07 ms per loop
New terms and important words are shown in bold. Words that you see on the
screen, in menus or dialog boxes, for example, appear in the text like this: "You
can navigate to the Call Graph or the Caller Map tabs by double-clicking on the
rectangles."
Reader feedback
Feedback from our readers is always welcome. Let us know what you think about
this book—what you liked or may have disliked. Reader feedback is important for
us to develop titles that you really get the most out of.
If there is a topic that you have expertise in and you are interested in either writing
or contributing to a book, see our author guide on www.packtpub.com/authors.
[4]
Preface
Customer support
Now that you are the proud owner of a Packt book, we have a number of things to
help you to get the most from your purchase.
Errata
Although we have taken every care to ensure the accuracy of our content, mistakes
do happen. If you find a mistake in one of our books—maybe a mistake in the text or
the code—we would be grateful if you would report this to us. By doing so, you can
save other readers from frustration and help us improve subsequent versions of this
book. If you find any errata, please report them by visiting http://www.packtpub.
com/submit-errata, selecting your book, clicking on the errata submission form link,
and entering the details of your errata. Once your errata are verified, your submission
will be accepted and the errata will be uploaded on our website, or added to any list of
existing errata, under the Errata section of that title. Any existing errata can be viewed
by selecting your title from http://www.packtpub.com/support.
Piracy
Piracy of copyright material on the Internet is an ongoing problem across all media.
At Packt, we take the protection of our copyright and licenses very seriously. If you
come across any illegal copies of our works, in any form, on the Internet, please
provide us with the location address or website name immediately so that we can
pursue a remedy.
We appreciate your help in protecting our authors, and our ability to bring you
valuable content.
Questions
You can contact us at questions@packtpub.com if you are having a problem with
any aspect of the book, and we will do our best to address it.
[5]
Benchmarking and Profiling
Recognizing the slow parts of your program is the single most important task when it
comes to speeding up your code. In most cases, the bottlenecks account for a very small
fraction of the program. By specifically addressing those critical spots you can focus on
the parts that need improvement without wasting time in micro-optimizations.
You may also want to assess the total execution time of your program and see how
it is affected by your changes. We will learn how to write benchmarks and how to
accurately time your programs.
In the early development stages, the design of the program can change quickly,
requiring you to rewrite and reorganize big chunks of code. By testing different
prototypes without bothering about optimizations, you learn more about your
program, and this will help you make better design decisions.
Benchmarking and Profiling
The mantras that you should remember when optimizing your code, are as follows:
• Make it run: We have to get the software in a working state, and be sure that
it produces the correct results. This phase serves to explore the problem that
we are trying to solve and to spot major design issues in the early stages.
• Make it right: We want to make sure that the design of the program is solid.
Refactoring should be done before attempting any performance optimization.
This really helps separate the application into independent and cohesive
units that are easier to maintain.
• Make it fast: Once our program is working and has a good design we want
to optimize the parts of the program that are not fast enough. We may also
want to optimize memory usage if that constitutes an issue.
In this section we will profile a test application—a particle simulator. The simulator
is a program that takes some particles and evolves them over time according to a
set of laws that we will establish. Those particles can either be abstract entities or
correspond to physical objects. They can be, for example, billiard balls moving on
a table, molecules in gas, stars moving through space, smoke particles, fluids in a
chamber, and so on.
Those simulations are useful in fields such as Physics, Chemistry, and Astronomy,
and the programs used to simulate physical systems are typically performance-
intensive. In order to study realistic systems it's often necessary to simulate the
highest possible number of bodies.
In our first example, we will simulate a system containing particles that constantly
rotate around a central point at various speeds, like the hands of a clock.
The necessary information to run our simulation will be the starting positions of
the particles, the speed, and the rotation direction. From these elements, we have
to calculate the position of the particle in the next instant of time.
[8]
Chapter 1
(vx, vy)
(x, y)
(0, 0)
The basic feature of a circular motion is that the particles always move
perpendicularly to the direction connecting the particle and the center, as shown in
the preceding image. To move the particle we simply change the position by taking a
series of very small steps in the direction of motion, as shown in the following figure:
[9]
Benchmarking and Profiling
Another class, called ParticleSimulator will encapsulate our laws of motion and
will be responsible for changing the positions of the particles over time. The __
init__ method will store a list of Particle instances and the evolve method will
change the particle positions according to our laws.
We want the particles to rotate around the point (x, y), which, here, is equal to (0, 0),
at constant speed. The direction of the particles will always be perpendicular to the
direction from the center (refer to the first figure of this chapter). To find this vector
v=(vx ,vy)
(corresponding to the Python variables v_x and v_y) it is sufficient to use these
formulae:
If we let one of our particles move, after a certain time dt, it will follow a circular path,
reaching another position. To let the particle follow that trajectory we have to divide
the time interval dt into very small time steps where the particle moves tangentially
to the circle. The final result, is just an approximation of a circular motion and, in fact,
it's similar to a polygon. The time steps should be very small, otherwise the particle
trajectory will diverge quickly, as shown in the following figure:
[ 10 ]
Chapter 1
In a more schematic way, to calculate the particle position at time dt we have to carry
out the following steps:
for i in range(nsteps):
for p in self.particles:
p.x += d_x
p.y += d_y
# 3. repeat for all the time steps
[ 11 ]
Random documents with unrelated
content Scribd suggests to you:
the incentive, which drove him forward facing the desperate chances
of death by starvation or sickness, to discover the hidden treasures
of this almost impenetrable region, and his companion was equally
reticent as to his own counsels of the past. Willing to lead in the trail
where almost certain death seemed ahead, he had proved himself
many times in their short acquaintance a man of reckless daring.
The look each encountered in the other’s eyes upon this eve, as they
watched the sun go down behind the opposite hills, plainly said: “My
secret is a sacred one; ask me nothing.”
On the morrow they were to begin their task of digging for the
yellow nuggets, in the search for which thousands of others had
gone into the same ranges, many to join the bandit gangs of roving
miners, never again to return to their loved ones, others to sicken
and die with the malignant fevers of camp life, and a few—a very
few—to realize their dreams, and return again to their homes,
bearing with them the shining golden nuggets, at the sight of which
a new army of inspired prospectors would soon be started upon its
way to repeat the same acts in the great drama entitled “The Hunt
for Gold.”
And here we leave for the present, Andy and his youthful partner to
dig for the elusive golden specks which had drawn them onward
with a terrible fascination for thousands of miles. They are now
securely hidden away in the mountain fastnesses where never a
human voice nor the tread of man had yet fallen.
CHAPTER V.
At the Four Corners.
In the Arcadian neighborhood of our story, as is true of all rural
sections, there are at the four corners of the road the indispensable
blacksmith’s shop, the general store, the wheelwright’s place and the
creamery or the cheese factory. As places of business they always
flourish, not because of the enterprise or business tact of the
proprietors, but because, for the most part, of the natural demand
created by the wear and tear of implements used in pursuit of the
absolute necessities for the maintenance of life by the populace of
the district.
First, at the four corners of the road at The Front, and a short
distance from the Cameron farms, is Davy Simpson’s blacksmith
shop. Adjoining this is the wheelwright’s place. The front of this
building when new had been partly painted a dull red color, and then
left, as though the workman had become disgusted with the color
effect, and had abandoned the task as an artist might a shapeless
daub on a half-finished canvas. The general store, with its lean-to
porch, up to which the farmers’ wagons drive and unload their
produce to exchange for merchandise, occupies at the four corners a
conspicuous frontage on the main road.
Another industry of even greater moment to the community at The
Front is the cheese factory, which stands just past the corners and
fronting the road, jagged up on the side of a steep embankment,
and resting unsteadily upon crazy-looking standards. At the foot of
the incline, winding in its very uncertain course, is a small stream.
Into this the whey, escaping from the cheese vats, filters down the
abutment spiles, reeking in the Summer sun, to be gathered finally
into the stream, whose waters push quietly along beneath the
overhanging weeds, then crossing the roadway extending along its
course, passes in the rear of the farms of the adjoining township,
The Gore.
Unpretentious and surely uninviting is the cheese factory at The
Front, but in local history, in the stories of the feuds waged between
the clans of the farmers at The Front and those at The Gore, it plays
a vitally important part, for through the lands of the latter flow the
waters of the whey-tainted creek, endangering the products of their
dairies by polluting the source of the cattle’s water supply.
At the close of each Summer’s day, regularly assembled in front of
the door to Davy Simpson’s blacksmith shop, the official gossips of
the neighborhood.
Easy is the task to picture in one’s mind this group of characters.
Seated around the doorway of the smithy, and perched upon the
cinder heap, an accumulation of years from Davy’s forge, they
discussed the affairs of their neighborhood. There in his accustomed
place was William Fraser, the country carpenter, a bent-over, round-
shouldered little man with a fringe of red whiskers extending from
ear to ear and a mustache chopped off even with the mouth as if
done by a carpenter’s adze; a pair of blue eyes peered out at you
from overhanging eyebrows, and when in motion he glided along
with a walk of meekness. A long service among the families in
Glengarry, while building for them a new barn or stable, had taught
him that an agreeable opinion to whatever were their politics or
views would greatly facilitate his comfort and pleasure. He listened
intently to all that was told him of the family troubles of his
employers, and with equal interest retailed for their entertainment
the latest gossip of their neighbors. It was because of this
accomplishment that William Fraser, the carpenter, could always be
relied upon to add a few words of interest to any subject up for
discussion at the shop.
Another familiar figure was Angus Ferguson, he who had bought the
McDonald place, next to the cheese factory, a well-meaning and very
respectable man, whose wife insisted that he be back at the house
each night at eight o’clock, and she never hesitated, when he failed
to obey, to go out into the middle of the road fronting their house,
and, with her arms akimbo, call to him to “come away home.” Angus
was tall, slender and awkward. His features were kindly and the
mutton-chop cut to his whiskers and his high, bald forehead gave
him more the look of a clergyman than of a Glengarry farmer. Angus
Ferguson was at all times a listener only in the councils before the
blacksmith’s. If he had opinions, he never expressed them, and
when his time would arrive to go, without a good-night wish to his
companions he slid down from the plank placed upon the coal
barrels, which was his particular seat, and, crushing his straw hat
down upon his head, started up the road, his long, awkward arms
and legs as he retreated through the darkness making a pantomime
figure in the gathering shadows.
Old Bill Blakely was the unique figure in these nightly councils of the
gossips. He came originally from no one knew where; was not of any
particular descent; knew no religious creed and respected no forms
of social etiquette. His remarks at the discussions held before the
blacksmith’s shop were always emphatic and punctuated with
copious expectorations from tobacco, followed by a line of adjectives
admitting of no uncertain meaning. Old Bill lived at quite a distance
from the meeting place of the gossip club and was always late in
putting in an appearance. He was never counted upon, though, as
one of the “regulars,” and only came when he thought there might
be a chance of picking a row with some visitor happening along from
The Gore. He would walk deliberately into the councils of the
assembled habitues at the shop, and, totally ignoring the courtesy
due from a late arrival, would proceed to act in direct violation of the
club’s established rules. Looking down upon the group of loungers,
his blue eyes twinkling and his tobacco-moistened lips quivering with
a cynical smile, he would steady himself by placing his legs at a wide
angle apart, the yellow-stained goatee of his chin bobbing an
accompaniment to the twitching of his tightly-compressed mouth.
“Well,” he would begin, “hae ye lied all there is to tell aboot your
neighbors, William Fraser? And you, Angus,” motioning with his head
toward down the road, “had better gang your way home, fer I’m
goin’ to lick the first red-head that comes over from The Gore; the
night.”
Then Bill would let go a string of oaths that invariably brought the
frowning face of Davy Simpson from out of the darkness of the shop
to greet the newcomer. Dave at such times had nothing more to say
than, “Bill, that’s you, I see,”—but all was in the way he said it. The
two men appeared to understand each other very well, at least they
did since the time Dave ducked the incorrigible Bill head-first into the
puncheon of water by the side of the forge, just to show, as he said,
that there was no ill-feeling between them.
Bill’s hair was as white as that of any patriarch the county could
boast; as an excuse for a cap he wore a faded brown affair, whose
shapeless peak was as often pointed sidewise and backward as it
was straight ahead. Always blinking with a mischievous twinkle in his
eyes, his lips moistened with the tobacco he was so fond of chewing,
and quivering as though he were about to address a remark to you,
his hands pushed down deep into his pockets, his square shoulders
and well-rounded body supported by a stocky pair of legs,—imagine
all this, and you will see Bill Blakely.
For many Summers the feud of the creek existing between the men
of the two towns required the personal attention and made frequent
claims upon the fistic powers of Blakely. All the trouble had been
caused by the whey-tainted waters of the creek, which menaced the
dairies of the men at The Gore. Chuckling with great glee, old Bill
would listen to his neighbors repeat the story current over at The
Gore, how upon a certain dark night he (Blakely) had pulled the plug
from the whey-tank at the cheese factory on The Front and allowed
its soured contents to course slowly down through the stream. In
the controversies with his enemies following the perpetration of
these midnight escapades at the four corners Bill Blakely had
heretofore by his convincing arguments successfully combatted their
charge. After one of these discussions with him the men from The
Gore returned to their clansmen bearing to them, besides a pair of
discolored optics, the best wishes of the men at The Front.
But of late the tables seemed to be turning. A new condition of
affairs had developed, and the arguments which hitherto had stood
Blakely in critical times successfully failed now to give him the same
degree of satisfaction over his foes from The Gore.
CHAPTER VI.
Donald Visits the Gossip Club.
Up to this time the absence of Andy Cameron from The Front formed
only a topic of minor discussion before the smithy’s. It was on one of
the evenings which marked the end of the outdoor sessions of the
gossip club when Laughing Donald presented himself shyly at the
outskirts of the group. Weeks had elapsed since he had appeared
there before. Until of late, each night of the weary months and years
of waiting for the return of the absent brother, he had haunted the
blacksmith’s shop, where the group of news-gatherers met to
exchange notes. At first they welcomed him as a valuable addition to
their circle. William Fraser, the carpenter, found in him an attentive
listener to the “small talk” he gathered from the country side. The
remarks Donald overheard upon his early visits at the four corners
concerning his family he carried to his invalid wife, and then to
Barbara and Dan up at the Nole.
Upon this night he came slowly down the hill along the road which
partially hid the blacksmith’s shop from view. The group around the
smithy’s door was surprised at his coming. The timid nature of the
man showed itself in each hesitating step, while in his large, fawn-
like eyes was an appealing look, as if he were a pet animal wishing
to be taken by his master from the tormenting pranks of a gang of
youthful bandits. In his nervous excitement Donald always laughed—
not loudly, but in showing his perfect, white teeth, he gurgled softly
the sound which was responsible for the distinguishing feature of his
name in Glengarry, Laughing Donald.
“Well! if here ain’t Laughing Donald,” exclaimed Fraser, the
carpenter, in an insinuating whisper, and a hush fell upon the group.
“I wonder if he would like to know,” he continued, in an undertone,
“that Nick Perkins, the tax collector, says all the Camerons on The
Front will be working the ‘county farm’ in six months’ time?” At that
moment a large, curly head, crowned by the remnants of a straw
hat, was protruded through the jamb of the half-opened door of the
shop.
“Well, now, you just be the first to tell that to Donald,” drawled out
Davy, the blacksmith, looking straight at the cringing little carpenter,
“and I’ll crimp your red whiskers with the hot tongs of my forge.”
Here was a friend to Donald and the missing Andy, till now
unannounced. No end of gossiping by the tattler of the
neighborhood had failed to prejudice the mind of the honest smith.
Angus Ferguson had already humped off from his seat upon the coal
puncheon, and with his awkward strides was making rapidly toward
the scared Donald, extending his hand in such an enthusiastic
welcome that the poor fellow nearly mistook the demonstration for
one of unfriendliness. “How de doo, Donald! I am a-goin’ to tell you
I am a-comin’ over to-morrow to help ye draw in that grain over
yonder by the woods. It’s been there now nigh onto two weeks in
the sun.”
“Is it dry, Angus, think ye?” inquired Donald, brightening at the show
of friendship. Then an awkward silence followed.
“Got a new horse, Donald,” blurted out Angus.
“Aye,” returned Donald, the broad grin covering his face.
“Want to see him?” urged Angus. Then they both started down the
road like the two overgrown country lads that they were. This
spontaneous act of kindness by Ferguson was prompted by his
heart’s sympathy, which had been penned up for weeks, rebelling
constantly against the insinuating remarks repeated by the
carpenter.
Fraser nursed his displeasure alone. Angus Ferguson, the silent, had
outwitted him. Davy Simpson had exposed his deceitfulness, and in
a short time his supposed strength as a member of the gossip club
had crumbled in a humiliating climax.
At that moment, as he was regretfully acknowledging to himself the
failure he had made in gaining the confidence and respect of his
associates, his attention was drawn to a familiar vehicle which had
approached silently in the gathering darkness, and now stood in the
roadway before the blacksmith’s shop. “Good-evening, William
Fraser,” began Nicholas Perkins (for it was the polite tax gatherer,
who lived near The Gore), and Fraser walked out with his meekest
walk to the side of the wagon. Perkins patronized the shop over at
The Gore, and like all the rest from his town, halting before Davy’s
place, kept upon neutral ground, remaining in the middle of the
road.
“Fraser, I am told,” continued Perkins, as he hitched himself along to
the end of the wagon seat and leaned out over the wheel, to strike a
confidential attitude, “that there is no news from Cameron.”
“Well, that’s about true, Mr. Perkins; no news, and they say that the
mortgage time is about up, too.” A little more encouragement, and
the carpenter’s sympathies were at once enlisted with the
newcomer.
“Well, it’s very bad, isn’t it, Fraser? They have been left to go to the
poorhouse. We didn’t think that of Cameron over at The Gore, but,
then, the expense will fall on your town, on The Front, of course,”
said Perkins, turning to get the full effect of his wise remark upon
Fraser.
The two deceitful maligners were unconscious of the presence of a
figure which had come stealthily upon them in the darkness, and
standing in the shadow of the vehicle, was now listening to the
conversation.
“Well, you ought to know, Mr. Perkins,” replied the carpenter in a
patronizing tone. “You will probably have the say in what will have to
be done,”—but before he could finish his remark, he had leaped into
the air, precipitated upon the toe of a heavy boot.
“‘Now, Nick Perkins, if you have
got anything to say to me personally, just come down here
in the road
and I’ll talk to you.’”
“Oh, he will have the say about whom they take to the county farm,
will he!” and Bill Blakely danced in a howling rage around the wagon
of his hated foe. “You hypocrite! You prowling tax-gatherer! You
hunter of the weak and homeless!” he yelled, and half climbing into
the wagon, he shook his fist in the face of the surprised tax collector,
shouting right into his ear, “Not while Bill Blakely lives and Andy
Cameron is away from The Front will you ever hitch your ring-boned
and spavined outfit to a post before the home of a Cameron on The
Front! Now, Nick Perkins, if you have got anything to say to me
personally, just come down here in the road and I’ll talk to you.” Bill
was rolling up his gingham shirt sleeves and again dancing around
bear fashion, while the discomfiture of the astonished Perkins was
being hugely enjoyed by the group, now enlarged by the return of
Angus Ferguson and Laughing Donald. Davy Simpson stood in the
door of his shop watching the proceedings over the rims of his
spectacles.
“Oh, you ain’t a-comin’ down, be you! Well, I didn’t expect you,”
retorted Bill. “Your kind fight the women only. You’re sneaking
around now to see if they ain’t a-gettin’ hungry, some on ’em over
here. But we’ll fool you, Perkins. Laughing Donald is a better man
dead than anything you can produce alive in your hull county at The
Gore. And Andy Cameron won’t let the wind blow a whiff of ye to
the lee side of his place when he comes back, neither. And that
won’t be long from now,” and old Bill threw his quid of tobacco after
the retreating wheels of the vehicle as Perkins drove away amid the
jeering laughter of the group.
As soon as the tax gatherer was out of hearing distance, Bill turned
to Donald, and in a tone serious for him, said, “Donald, I am a-
speakin’ fer you. The Camerons are from The Front. Your brother
Andy is a good man; he is a friend of mine. He will be back soon, for
that I am telling ye. William Fraser, the carpenter, he’s been telling
ye what ‘they say.’ Tell yer wife, Donald, when ye go home, what I
say, what Davy says, and what Angus’ wife says for him to say, and
don’t you worry about the mortgage.” Then Bill went over to the
shop door, and they thought he was going to confide something to
Davy, but he hesitated, finally bit off an enormous quid of tobacco
and sauntered slowly down the road homeward.
Donald climbed the little hill by the shop, going away happier than
he had been in months. Angus Ferguson still stood in the road
watching him; then, looking behind him and catching sight of the
carpenter closing the door to the wheelwright shop, he turned his
face to the open meadow at the opposite side of the road, and
slamming his straw hat down upon his head, struck into his rapid
circular gait down the road, past the cheese factory toward his
home.
The quietness outside seemed unusual. Davy looked out of his shop
door, scanned the cinder heap, glanced at the puncheon seat, then
at the wagon parts: nothing was moving, nothing was doing, all was
darkness. The club had gone. He closed the door, put the bar across
the staple, inserted the padlock, turned the key, then climbed the
hillside to the back door of his house; his day’s labors were done.
CHAPTER VII.
In the Mining Camp.
Time has sped all too swiftly at the little mining camp in the Cariboo
Valley. There is now only a month left of the two years set by Andy
Cameron for his return to his family, and all indications thus far point
to a tragic ending for the ambitions and loves of the unfortunate
Glengarry farmer.
All this while the two persistent miners had worked with an
unlessened zeal at their unproductive diggings. Each night, by turn,
one took from the sluices the ore while the other climbed the hill
overlooking the scene of their daily toils and cooked before the cabin
door the simple evening meal. Many times since their coming into
this mountain-locked valley had the prospectors shifted the site of
their gold diggings, but to the little cabin, which stood at the foot of
the steep rock looking down into the gulch, they clung, held fast by
many endearing associations. Edmond LeClare,—for that was the
name of Cameron’s associate—had made a few excursions up the
valley to another camp of prospectors, who had come into the hills
farther to the north, soon after he and Cameron had settled upon
their claim, now safely marked from intruders by the evidence of
their active operations. With these new friends LeClare arranged that
for an exchange in gold dust he was to obtain from them the needed
supplies of bacon and flour to replenish from time to time the cuisine
department of their household.
Each night before the door of their cabin the miners discussed the
possibilities of their undertaking. Perhaps it was that they builded
their hopes upon the returns from a certain new lead they had
struck in the mountain’s side. The deposits of gold taken from the
sluices that day, if they should continue to be found, would surely
bring to them the wealth each sought so diligently. But alas, upon
exploiting to the finish each newly discovered vein of ore, the hopes
of the unlucky miners tumbled as did the castles builded by them
with the toy blocks of their childhood.
Not a word of complaint was uttered by Andy in the presence of his
companion. His disappointment over the failure to obtain the
coveted wealth with which he had hoped to redeem his home and
the happiness of his wife and family was hidden within the recesses
of his own breast, though to the watchful eyes of the sympathetic
Edmond the wretched straits into which his friend had been thrust
by the yet unprofitable workings of their gold diggings were as easy
to read as though they had been in print upon the pages of an open
book. While Andy toiled to live and preserve his happiness, LeClare
worked and courted hardships and discouragements to deaden the
misery of his soul. He had hidden his secret well, but with Andy, as
the end of the time of their compact approached, the heart-breaking
lack of success, the fading hope of his cherished dream of wealth,
the thought of having only a bitter tale of failure to bear back to his
faithful wife, Barbara,—each one of these emotions had stamped
their relentless impress upon his honest, bronzed face, and while not
a word had passed between the two prospectors on the subject ever
uppermost in the thoughts of each, yet for Edmond LeClare, the
unhappy plight of his companion was now the daily inspiration which
drove him on in renewed efforts.
A few days more, thought Cameron, and he should tell his friend all.
Then they must divide the paltry store of gold dust between them,
and sadly at their parting and with a broken heart he would retrace
his steps as best he could to his home at The Front, and there tell of
his disappointment.
“‘Speak. Edmond!’ gasped Cameron. ‘What have you behind
your back?
It’s gold! gold!—I know it!’”
Thus Cameron argued as he sat upon the wood block before the
cabin stirring the fire, cooking the evening meal. He had thrown
upon the coals some dry branches, and through the gray smoke
which enveloped him he saw the figure of his companion coming
toward him up the hill. “He is early,” thought Andy, and he looked
again, stepping aside out of the blinding smoke. Edmond had
paused down the hill a few rods from the cabin, his right hand
behind him, his head thrown back and eyes wide open, glaring with
excitement.
“Speak, Edmond!” gasped Cameron. “Speak to me, boy. My God,
speak! What have you behind your back? It’s gold! gold!—I know it!”
Rushing together, the two companions sobbed in each other’s arms.
“Look, Andy!” cried LeClare, through his tears of joy. “There are two
of them,” and he held up nuggets of gold larger than their combined
fists, “and there are plenty more of them in the same spot where
these came from.”
Poor Andy sobbed in his happiness upon the shoulder of his mining
partner, and then, clutching him by the arm as though awakening
from a dream, he half sobbed, half cried: “He won’t get them now,
Edmond; he won’t get them now! Laughing Donald stays on where
he is, and his invalid wife will have a servant to wait on her. And
Barbara—my wife, Edmond, my wife, do you hear?—she shall have a
new silk dress, a new straw bonnet, Edmond, with red posies in it,
and a new yarn carpet to put in the parlor, my boy. And you shall
come and live at The Nole. You and Dan can go fishing, rain or
shine, and I will get my lawyer friend from the village to come out
and see us; I’ll hire a carriage for him, too, Edmond. And Nick
Perkins, the tax collector——” Then, at the mention of that name,
Cameron slowly regained his composure, and a stern, cold look
passed over his features. “What day of the month did you say it was,
Edmond?” He had lowered his voice almost to a whisper. Then, as
LeClare answered, he continued: “The time will soon be up. To-
morrow, Edmond, to-morrow we must start for home—to-morrow
we must go.”
LeClare half carried his companion, who was exhausted by the
excitement over the discovery, to the seat by the cabin door. The
sun had now gone down behind the mountain opposite, and in the
autumn glow of this golden sunset, alone with their Maker, they
offered a silent prayer over their evening meal.
The miners sat facing each other at their scant repast. Their menu,
at all times limited, had now become stale and unappetizing. The
salted meats and hard, dried breadstuffs, to which was added the
badly mixed coffee, would no longer suffice.
“We are rich, Andy,” laughed LeClare. “We haven’t much to boast
about on top of the table, but there’s a hundred thousand beneath
it, old fellow, and in the morning I will show you a crevice in the
rocks down there on the side hill where there’s twice as much more
as we have here waiting for you to take it out.”
Cameron was at once happy and sad. Now that the great wealth in
gold had been found, his thoughts of home were strangely affecting
him. “Two years,” he murmured over and over again to himself.
“Could his wife, Barbara, have kept their little colony together during
his absence? Had Nick Perkins, the money lender, harassed his
brother Donald or annoyed Barbara for the payment of interest
money, or could any of his beloved have died?” A shudder at this
thought shook his frame. Looking across the table he encountered
the kind, inquiring smile on the face of his companion. “You are
coming with me, my boy. Edmond, this is no place for you;” but he
saw the smile on the handsome, youthful face before him fade into
an expression of sorrow. “Cheer up,” he continued. “I have no fine
words for telling you what it’s in my heart to say, but, though you
never have told me why you came out here, I know you could never
have done wrong to anybody, and to Barbara’s home and mine you
are welcome as long as you can find it comfortable.” Tears were in
the eyes of the two strong men, but the darkness had hidden the
signs of their emotions.
“Why, Andy, my old friend, I have never told you, have I?” suddenly
exclaimed LeClare.
“No, I guess you never did,” replied Andy.
CHAPTER VIII.
LeClare’s Story: The Initialed Tree.
“It’s only a boy and girl story, but, all the same, that’s why I’ve been
a gold digger. At our first meeting on the plains I said I was from the
Eastern provinces. That was all right for the time. The truth happens
to be, though, that our native homes are separated only by the
fifteen miles of intervening water channels of the Archipelago. When
you look to the southward from your farm on The Front, across the
great expanse of water, dotted here and there with wooded islands,
and then extend the view to the sloping sides of the irregular
mountain range which meets the eye, you may perhaps see there,
reposing sleepily upon the banks of the winding Salmon, a small
American village. Four miles down the river, after traversing for the
full distance the cranberry marshes of Arcadia, its waters are
gathered into one of the nearest channels of the St. Lawrence. The
approach is so unpretentious that the coming of its added volume is
only recognized by the idler drifting in his canoe along the shores of
the Archipelago from the blue and gray color line made by the
mingling of the waters. For it is just here at this line that the now
docile mountain cataracts of the Adirondacks are greeted by the
turquoise-blue waters flowing seaward from the Great Lakes.
“In Darrington, this village on the Salmon, lived Lucy Maynard. Two
miles to the eastward, upon one of the fertile farms in the valley of
the St. Lawrence, was my home. There I was taught the law of the
Ten Commandments, living in the midst of sunshine and happiness
and blest with the love of a devoted father and mother. This is only a
childish romance, Andy, and perhaps you don’t care to hear it.”
“Go on, Edmond,” came the reply. “You know my story. Now tell me
yours.”
“At the age of seventeen I had been considered by my parents a
graduate from the district school, and at the beginning of the
Autumn term I was entered in the intermediate grade of the high
school up in the village of Darrington. This was an auspicious event
in my hitherto uneventful career. Living always upon the farm, my
playmates and acquaintances were of the neighboring farm children.
Tramping the same way to the district school-house, we had pelted
the croaking frogs in the ditches by the roadside, and fired stones at
the rows of swallows swinging upon the telegraph wires, and in the
season we picked the daisies from the nearby fields, handing them
roughly, almost rudely, to the girl of our choice amongst the strolling
group of school children; while in the Autumn, in the groves by the
roadside, we hurled sticks high into the chestnut trees, then
scrambled upon our hands and knees at a lucky throw we had
made, each to pocket his catch. Simple and healthful were our
sports. Barefooted we stubbed our toes in the game of ‘tag’ and at
ball games in ‘Three Old Cats,’ where ‘over the fence is out.’ We
were each a star player of the national game. Happy children of the
country, Andy, primitive in thought, with gentle rural manners,
acquired in the religious homes of a Scotch Presbyterian settlement.
Once a week upon the Sunday, since childhood, I attended with my
father and mother the church at Darrington, and there wistfully,
shyly, I looked across the high backs of the family pews at the
children of the villagers. In my childish mind their lot in life was
greatly to be envied and admired, compared with mine. Their ‘store’
clothes and their pert, familiar manner placed them in my estimation
so far above my station in the social scale that my deference toward
them amounted to something like worship.
“In one of the family seats, across and several pews advanced from
ours, moving restlessly about between her father and mother, was a
handsome, large-eyed child, forever looking backward, and, of
course I fancied, often glancing in my direction. She was Lucy
Maynard. For years, and until I entered the village high school, we
had seen each other upon Sundays, across the backs of the seats,
never a word from either, nor a smile of recognition, Lucy’s large,
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebooknice.com