0% found this document useful (0 votes)
7 views40 pages

Programming Basics: Getting Started With Java, C#, and Python 1st Edition Robert Ciesla PDF Download

The document provides an overview of programming basics, focusing on Java, C#, and Python, and includes essential concepts such as hardware components and programming terminology. It emphasizes the importance of self-confidence, selecting the right programming language, and patience for aspiring programmers. Additionally, it features links to various related programming and educational resources.

Uploaded by

gparhvkuck3766
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views40 pages

Programming Basics: Getting Started With Java, C#, and Python 1st Edition Robert Ciesla PDF Download

The document provides an overview of programming basics, focusing on Java, C#, and Python, and includes essential concepts such as hardware components and programming terminology. It emphasizes the importance of self-confidence, selecting the right programming language, and patience for aspiring programmers. Additionally, it features links to various related programming and educational resources.

Uploaded by

gparhvkuck3766
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

Programming Basics: Getting Started with Java,

C#, and Python 1st Edition Robert Ciesla


download

https://ebookmeta.com/product/programming-basics-getting-started-
with-java-c-and-python-1st-edition-robert-ciesla/

Download full version ebook from https://ebookmeta.com


We believe these products will be a great fit for you. Click
the link to download now, or visit ebookmeta.com
to discover even more!

Programming the Raspberry Pi: Getting Started with


Python (Third Edition) Simon Monk

https://ebookmeta.com/product/programming-the-raspberry-pi-
getting-started-with-python-third-edition-simon-monk/

Programming Arduino: Getting Started with Sketches,


Third Edition Simon Monk

https://ebookmeta.com/product/programming-arduino-getting-
started-with-sketches-third-edition-simon-monk/

Game Development with Ren'Py 1st Edition Robert Ciesla

https://ebookmeta.com/product/game-development-with-renpy-1st-
edition-robert-ciesla/

Up In Flames Steamy Instalove Firefighter Romance Cedar


Falls Fire Rescue 1st Edition Kelsie Calloway

https://ebookmeta.com/product/up-in-flames-steamy-instalove-
firefighter-romance-cedar-falls-fire-rescue-1st-edition-kelsie-
calloway-2/
Thomas Jefferson and the Development of American Public
Education James B. Conant

https://ebookmeta.com/product/thomas-jefferson-and-the-
development-of-american-public-education-james-b-conant/

Advances in Cryptology CRYPTO 2021 41st Annual


International Cryptology Conference CRYPTO 2021 Virtual
Event August 16 20 2021 Proceedings Part III Lecture
Notes in Computer Science 12827 Tal Malkin (Editor)
https://ebookmeta.com/product/advances-in-cryptology-
crypto-2021-41st-annual-international-cryptology-conference-
crypto-2021-virtual-event-august-16-20-2021-proceedings-part-iii-
lecture-notes-in-computer-science-12827-tal-malkin/

Safe and Healthy Schools Practical Prevention


Strategies 2nd 2nd Edition Jeffrey R. Sprague

https://ebookmeta.com/product/safe-and-healthy-schools-practical-
prevention-strategies-2nd-2nd-edition-jeffrey-r-sprague/

Korean Routledge Library Editions Korean Studies Ho-


Min Sohn

https://ebookmeta.com/product/korean-routledge-library-editions-
korean-studies-ho-min-sohn/

The Ones We Burn 1st Edition Rebecca Mix

https://ebookmeta.com/product/the-ones-we-burn-1st-edition-
rebecca-mix/
Bible Sisters A Year of Devotions with the Women of the
Bible 1st Edition Gennifer Benjamin Brooks

https://ebookmeta.com/product/bible-sisters-a-year-of-devotions-
with-the-women-of-the-bible-1st-edition-gennifer-benjamin-brooks/
Robert Ciesla

Programming Basics
Getting Started with Java, C#, and Python
1st ed.
Robert Ciesla
HELSINKI, Finland

ISBN 978-1-4842-7285-5 e-ISBN 978-1-4842-7286-2


https://doi.org/10.1007/978-1-4842-7286-2

© Robert Ciesla 2021

This work is subject to copyright. All rights are solely and exclusively
licensed 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.

The use of general descriptive names, registered names, trademarks,


service marks, etc. in this publication does not imply, even in the
absence of a specific statement, that such names are exempt from the
relevant protective laws and regulations and therefore free for general
use.

The publisher, the authors and the editors are safe to assume that the
advice and information in this book are believed to be true and accurate
at the date of publication. Neither the publisher nor the authors or the
editors give a warranty, expressed or implied, with respect to the
material contained herein or for any errors or omissions that may have
been made. The publisher remains neutral with regard to jurisdictional
claims in published maps and institutional affiliations.

This Apress imprint is published by the registered company APress


Media, LLC part of Springer Nature.
The registered company address is: 1 New York Plaza, New York, NY
10004, U.S.A.
Dedication
Thank you to the Association of Finnish Non-fiction Writers for their
support in the production of this book.
Contents
Chapter 1:​Wet Toes:​The Very Basics of Programming
Chapter 2:​Java, C#, and Python 101
Chapter 3:​Setting Up Your Programming Environments
Chapter 4:​Object-Oriented Programming (OOP)
Chapter 5:​File Operations, Multithreading, and Other Wonders of
Java
Chapter 6:​And Now for Something Completely Different:​Advanced
Python
Chapter 7:​Calendars, Culture, and Multithreading in C#
Chapter 8:​Graduation Day:​Slightly Larger Programming Projects
Chapter 9:​UML Class Diagrams
Index
About the Author
Robert Ciesla
is an author and filmmaker from
Helsinki, Finland. He is also a freelance-
programmer working mostly in the indie
game scene. Robert is the author of
Encryption for Organizations and
Individuals (2020), Game Development
with Ren’Py (2019), and Mostly Codeless
Game Development (2017).
Visit www.robertciesla.com for
more information. (image © by A.C. in
2021)
© The Author(s), under exclusive license to APress Media, LLC, part of Springer
Nature 2021
R. Ciesla, Programming Basics
https://doi.org/10.1007/978-1-4842-7286-2_1

1. Wet Toes: The Very Basics of


Programming
Robert Ciesla1
(1) HELSINKI, Finland

What do video games, social networks, and your activity bracelet have
in common? They run on software a group of (more or less)
programmers wrote somewhere far, far away. Gadgets and hardware
are only one, more visible side of the coin of our technology-driven
societies. In this chapter, we’ll discuss the very basics of programming.
We’ll also take a gander at the visible parts of digital systems: the
hardware.

What Is Programming Anyway?


Basically, programming is the act of telling digital devices, such as your
personal computer, what to do. We type in listings of commands, as
defined by a programming language, in order to have useful or
entertaining events occur. Properly programmed computers run much
of the communications and online services in the world. You can
mention things like ATMs, ticket readers, and smart phones as gadgets
that run on software that somebody created in some programming
language.

Basic Hardware Rundown


As a budding programmer, you’ll benefit from understanding the kind
of universally found electronics you’re working with. It’s a good idea to
have at least a basic understanding of the most commonly found
components inside a computer.
These hardware components in a computer represent your work
force. As a programmer, you run this show. Think of the act of
programming as telling the factory workers what to build. You
manufacture applications, whether they be big, complicated software
projects or tutorials from some awesome book on coding.

For the purposes of this book, any relatively modern desktop or


laptop computer works fine. We won’t be needing any expensive
hardware while getting our feet wet in programming.

1. Central Processing Unit (CPU)


Naturally, a digital device can’t run on software alone; a central
processing unit (CPU) is the hardware “brain” which executes code
and makes things actually happen (see Figure 1-1). Even in a less
complicated piece of electronics, all instructions flow toward and
through a CPU (or a bunch of them). Being very small in size, these
microchips have increasingly been a part of our lives since the 1970s.
Every digital device has a CPU in it, probably even your stationary
bicycle/clothes rack.
Figure 1-1 A top-down view of an older Intel “Pentium 4” CPU used in millions of
PCs back in 2005. Image by Eric Gaba. CC BY-SA 3.0

2. Hard Drives (a.k.a. Hard Disks)


This component is there to store data just about permanently. Within a
hard drive, you’ll find tens of thousands of files, whether they be
pictures, text files, or databases. Your operating system (e.g., Windows
or macOS), too, rests within the confines of a hard drive. These devices
come in two varieties: mechanical hard drives (see Figure 1-2) and solid
state disks (SSDs).
Figure 1-2 A top-down view of a Western Digital mechanical hard drive. Image by
“Darkone.” Licensed under CC BY-SA 2.5 (creativecommons.​org/​licenses/​by-sa/​2.​5/​
deed.​en)
Mechanical drives are more affordable, but since they have moving
parts inside, they are somewhat more easily damaged than SSDs by
excessive vibration and extreme weather. In addition, solid state disks
usually operate much faster.

3. Video Card
Video cards are responsible for displaying a system’s visuals, whether
they be plain text or dazzling 3D graphics in a modern video game.
These devices come in a variety of configurations and prices, ranging
from $30 word processor fiends to $1000 gaming monsters (see Figure
1-3). Computer monitors are typically connected directly to a video
card.
Figure 1-3 An Nvidia 7900GS video card from 2006

The video card business has basically been a duopoly between


Nvidia and AMD, two multibillion tech giants, ever since the early
2000s. However, Intel is making gains in this sector as well.

4. Random Access Memory (RAM)


Random access memory , commonly called RAM, is used as a computer’s
temporary storage. Physically it most often comes in the form of stick-
like add-ons (see Figure 1-4). When running any type of software, your
computer uses RAM to execute it from. Switching off your device will
clear out your RAM. By contrast, data written on hard drives isn’t
erased when powering off a computer. Save your documents on a
regular basis.
Figure 1-4 A typical stick of RAM. Image by Henry Kellner. CC BY-SA 4.0. Source:
upload.wikimedia.org/wikipedia/commons/3/32/DDR3_RAM_53051.jp
g

As of 2021, 4 GB (i.e., four gigabytes) is an adequate amount of RAM


to have for most uses. Power users, such as video editors, will benefit
from having 16 GB of RAM or more.

5. Motherboard
All of the aforementioned four hardware components (i.e., the CPU, the
video card, the hard disks, and RAM) come together at the motherboard
to create a working computer unit. The motherboard also has
connectors for keyboard, mice, and other control devices (see Figure 1-
5).
Figure 1-5 A modern PC motherboard. Image by Evan-Amos. CC BY-SA 3.0. Source:
upload.wikimedia.org/wikipedia/commons/0/0c/A790GXH-128M-
Motherboard.jpg

The Three Requirements of Becoming a Decent


Programmer
Let’s next discuss some personal priorities all programmers should
have in order to advance in their craft, whatever their starting level
might be:
1. Self-confidence: Ask yourself this, why do you want to learn to
code? Some perfectly valid answers include “For professional
development,” “To maintain my faculties,” and “I want to be a part of
something great.” Now, programming is sometimes considered a
frightening activity by laypeople. It does take some guts to sit down,
tune out, and enter the world of bit manipulation. Just remember
that you, too, can achieve competence in this field, even if you’re a
complete beginner. Confidence comes from experience. Line by line
you will obtain more good vibes and gain independence from
programming books and online tutorials.

2. The right language: Not all of us benefit from becoming fluent in


Esperanto or Classical Latin. When learning a new language, we
tend to go for something useful, such as Spanish or French.
Similarly, choosing a programming language which best suits your
intentions is of paramount importance. If you want to eventually
code recipe apps for mobile users, becoming proficient in, say,
FORTRAN from 1957 only gets you so far. For this reason, this book
introduces three of the most popular programming languages of
our times: Java, C#, and Python.

3. Patience: After choosing which programming language you want to


specialize in, you quite simply just have to stick to it. It takes
anything between six months and a year of hands-on experience to
become proficient in a new language. This is actually good news.
Coding is great for insomnia and boredom. It may also ward off
dementia, as it does fire those brain synapses to quite an extent.
A Novice Programmer’s Glossary
We’ll now delve into some essential terminology related to the
hallowed hobby of coding. There are hundreds of terms and concepts
related to the various programming techniques and languages
available. However, we’ll only be focusing on the most relevant
associated keywords, and in no particular order.

Input/Output
Input in the context of programming refers to us entering data for a
piece of software running on a computer to process. This comes in the
form of typed text, mouse commands, or various types of files. For
example, a word processing program (e.g., Microsoft Office) most often
takes its input mostly as alphanumerical data provided by keystrokes.
Output refers to data that has been processed by software. In a word
processor this usually refers to a file document saved with the program.
Such output can also be directed at printers or other devices. The
output from programmers (carbon dioxide and other things
notwithstanding) is typically a working application, whether it’s a
completed tutorial file or a bigger project.

Algorithm
A working program listing basically constitutes an algorithm, which
refers to a set of steps created to solve problems. Most software
consists of numerous sub-algorithms. In the case of, say, a video game,
there are algorithms for displaying graphics, saving and loading the
game state, and playing audio files to name just a few.

Flowchart
Programming projects and their algorithms are often visualized using
flowcharts, especially in a team environment. These are a great way to
demonstrate basic program flow in most instances.
Another Random Scribd Document
with Unrelated Content
fascinated him and was a better place for an artist than his
childhood town, but he never tired of going back to the old home or
lost interest in the pigs and cows and the market folk on the Rhine
road. Sometimes on these visits he would lie on the ramparts just as
he had done when a boy, and strangers journeying to and from The
Hague had no idea that the grave-eyed man dreaming there in the
shadow of the mill sails was the famous painter of Amsterdam.
Then, one day he died, and they laid him to rest in the harbor city
where for so many years he had lived and worked. The people of
Leyden asked to have him taken back there, and those who know
how he loved it wish it had been done; for it would be pleasant to
think of him sleeping in the shadow of the mill sails, and perhaps if
he could have been asked he would have wanted it, too.
Years passed, but instead of dimming the glory of Rembrandt’s
name they brightened it. After his death his works became priceless,
and the world still prizes them just as Amsterdam prized them two
hundred years ago. To own a canvas by this king of Dutch painters is
to be rich and envied, for it requires a great deal of money to buy
one of his paintings. Even the crude drawings of his boyhood are
now treasured by princes, and one of the most prized possessions of
a great museum in Holland is a pair of wooden shoes. They are
brown and clumsy and covered with marks, half of which have been
worn away by the staining finger of Time; but a fortune could not
buy them, because ever so long ago they were worn by little
Wilhelmina van Rijn to the Latin school of Leyden, and were
decorated by the hand of a mill boy, and who would not be proud to
own them? That mill boy became the immortal Flemish painter,
Rembrandt, whose work will be treasured as long as the world loves
beautiful things.

THE LADY OF STAVOREN

Retold from a Dutch Legend


(Geography—Ethics)
There was once, in Holland, a great and beautiful city called
Stavoren. It stood beside the sea, and many of the inhabitants were
proud and rich. They had houses stately enough for royal palaces.
They had gold and silver plate and diamonds without number, and
great oaken chests filled with money. Their vessels sailed to the
farthest parts of the ocean and brought back treasures from every
land, and as the wealth of the people increased their selfishness
increased, until they thought of nothing but their good fortune and
had no pity for the poor.
Richest of all the rich folk in the city was a stately, beautiful
woman. There was no home in Stavoren as princely as hers, there
were no jewels as gorgeous or silks and velvets as lustrous as those
she possessed, and when she drove through the streets in her gold-
blazoned carriage her splendor dazzled the eyes of all who saw. But
she was as selfish as she was rich and powerful, and always she
pondered in her mind the question, “How can I become richer still?”
One day she summoned the captain of her largest vessel and said,
“Make ready to sail at once.”
“Yes, madame,” the officer replied, “but where shall I go and upon
what mission?”
“Where you go you must decide for yourself, for I care nothing
about that. But you must bring back the most precious cargo in all
the world.”
The man looked at her in surprise.
“That shall I gladly do, madame,” he said, “if you will but tell me
what you wish. Is it to be gold and silver, diamonds and jewels, or
rare laces, tapestries, and velvets?”
The rich woman tossed her head and replied haughtily, “There is
but one thing in the world more precious than all others, and what it
is you must find out. I have given my orders. Go now and fulfill
them.”
The captain was greatly troubled, for he feared the anger of his
mistress. She was so powerful that she could have him thrown into
prison or even put to death if she chose, and as he walked down the
street from the house he thought, “What is the most precious thing
in all the world?”
Sometimes he thought it was one thing and sometimes another,
but when he reached the shipyard he had not decided. He called to
the officers and sailors standing there, told them of the woman’s
strange order, and said sadly, “But, alas! I know not what it may be.
If any among you can tell, let him speak.”
Every one thought a minute, then came a chorus of suggestions.
One officer suggested gold, another silver, and another precious
stones, but the captain was not sure which was right. He must not
decide too quickly, for to make a mistake would be a terrible thing.
Silently listening the sailors stood, for according to the law of the
city they must not open their lips until the officers had had their say.
Then one of the group, a slender, blue-eyed fellow, who seemed no
more than a boy, said, “No, my captain! The most precious thing in
the world is neither gold and silver, pearls and diamonds, nor costly
laces and velvets. It is wheat, for without it we could have no bread,
and without bread we cannot live.”
Some of the officers laughed at this idea, for common sailors were
not supposed to know much. But the captain quieted them, saying,
“He is right. We will sail away and bring back a cargo of wheat.”
So they sailed out of the harbor, and across the Baltic to Dantzic.
There they bought a great cargo of wheat, the largest that had ever
been started out to sea, and the captain, delighted with the
purchase, turned the ship’s prow back toward Stavoren town.
He could hardly wait to get to his mistress and tell her what a wise
and wonderful choice he had made. She frowned when she saw him,
displeased that he had returned so soon.
“You must have flown like a pigeon,” she said. “Have you brought
me the cargo I ordered?”
“Yes, madame,” he replied, bowing low before her. “I have the
finest cargo of wheat that ever went out of a port.”
The woman screamed in anger. “Wheat!” she yelled. “A cargo of
wheat! I told you to bring me the most precious thing in the world,
and do you mean to say that you have brought a common, cheap
thing like wheat?”
The captain was terribly frightened, but he did not regret his
selection. He believed in the value of his cargo, and tried to lead the
woman to see that he had made a wise purchase.
“Pardon, madame,” he spoke. “Wheat is not cheap and common.
It is in truth the most precious thing in the world, for without it we
could have no bread, and without bread we could not live.”
But he could not convince his mistress. She tossed her head and
wrung her hands in anger and exclaimed, “Wheat! Wheat! Go to the
port and throw your precious cargo of wheat into the sea.”
The captain was horrified.
“Madame!” he exclaimed, “surely you do not command me to do
that! Wheat is precious. If you will not have it yourself, give it to the
poor and hungry, of whom there are many in Stavoren.”
But she drove him from the house, saying, “Do as I bid you. In a
few minutes I shall come myself to see if you have carried out my
order.”
Sadly the man went down the street, wondering how one so rich
and beautiful could be so hard and unkind. But he had no thought of
executing the order. Instead, he told all the poor he met, and
dispatched messengers to tell others, that his mistress had refused
to accept the cargo of wheat and perhaps, if they came to the port
and asked her, she would give it to them.
A little later the great lady of Stavoren drove in her gold-
emblazoned carriage to the shipyard, where a group of men,
women, and children had joined the sailors and stood looking at the
splendid vessel piled high with the best wheat that ever came out of
Dantzic. But when she saw them her anger increased.
“Have you carried out my orders?” she said to the captain, as he
came in answer to her summons and stood beside the carriage.
“No, madame, not yet,” he replied.
“Then,” the woman commanded, “do it at once. Throw the cargo
of wheat into the sea. I want to see, myself.”
But the captain shook his head. “See these poor people,” he said,
pointing to the hollow-eyed men, women, and children who were
standing there. “Give them the wheat, for they are hungry.”
But the haughty woman silenced him and commanded, “Throw it
into the sea!”
Then the captain seemed afraid no longer. He stood straight and
fearless before her and declared, “Never, madame!”
But she shouted word to the officers, who dared not disobey, and
amid the cries and pleas of the poor, the cargo that would have
meant bread for thousands, was thrown into the sea.
The woman watched the waters swallow it up and smiled
heartlessly. Then she called to the people, “Did you see it go into the
waves?”
“Yes, madame,” they answered sadly.
“Yes, madame,” repeated the captain, “and a day will come when
you will regret what you have done. A day will come when you will
be hungry, and no one will pity and help you.”
The mistress looked at him in amazement. Then she laughed
loudly. “I, go hungry,” she exclaimed, “I, the richest of all the rich of
Stavoren! It is impossible!”
Then she took a diamond ring, held it up for the people to see,
and tossed it into the ocean. “When that ring returns into my hand,”
she said, “I shall believe what the captain has said.” And she drove
away in her splendid carriage, and boasted to the citizens of what
she had done.
The next day one of her servants came running to her in wild
excitement. “Madame,” she cried, “the cook has found this in the
stomach of a fish he is preparing for dinner.” And she held up the
diamond ring the woman had tossed into the sea the day before.
The great lady of Stavoren opened her eyes wide and wider. She
was amazed and frightened, for she remembered the captain’s
words. “Can it be,” she thought, “that they are to come true?”
It proved to be just as she feared, for that same afternoon she
received word of the destruction of all her ships, of the loss of all her
houses and lands, of the pillaging of her chests of gold. She was no
longer the richest woman in Stavoren, but was as poor as any
beggar. She went from house to house, begging for food as pitifully
as the people at the port had begged her for wheat, but no one
helped her, and at last she died from cold and hunger.
The other rich folk of Stavoren still lived on in the old selfish way.
They drove through the streets in sumptuous carriages. They wore
costly clothing and jewels, they danced and feasted and sailed their
vessels out across the seas, forgetful of every one but themselves.
There were still many poor in the city, but they neither thought nor
cared about them. They believed themselves to be so great and
powerful that nothing could harm them, and they refused to listen to
advice.
After a while the port of Stavoren became blocked by a great
sandbank. It rose just at the spot where the lady’s cargo had been
thrown into the sea, and was covered with wheat. Ships could no
longer go in and out. Commerce was ruined, and because there
were no vessels to unload, the poor lost the only way they had of
making a living. They begged the rich people to help them dig the
bar away, but they refused. They had enough to eat and plenty of
gold, so what cared they for the distress of the laborers?
Then something else happened. One night as they feasted, a man
came running into the banquet hall. “I have found two fish in my
well,” he said. “The dike is broken. Protect the city! Protect the
houses of the poor that are close to the sea wall and will be swept
away.”
But one of the great folk said haughtily, “Let the beggars take care
of themselves. The sea cannot harm us. We must finish the
banquet.” They turned away from him and went on with their
revelry, but only for a short time. A few hours later the entire dike
gave away, and the ocean rolled in and covered the houses,—not
only the huts of the poor which were in the low quarter of the city,
but even the palaces of the rich who had declared they could not be
harmed. The great perished as well as the humble, and the waves of
the Zuider Zee rolled where the banquet laughter had sounded.
It rolls there still. The sailors say that sometimes when the
weather is fine and the sea is smooth as glass, they see spires and
domes and stately columns far down under the water. They declare,
too, that often strange, weird music like the sound of distant bells
falls upon their ears, and then they look and listen and nod to each
other, for they think of the palaces and chimes of Stavoren, once the
fairest city of the Netherlands, submerged hundreds of years ago
while the poor cried for help and the mighty danced.

THE LUCK BOAT OF LAKE GENEVA

A Swiss Legend
(Geography)
The Alpine herdsmen say that in the marvelous long ago an
enchanted boat was seen gliding up and down the blue waters of
Lake Geneva. Neither oars nor sails were needed to speed it over
the waves, for it was drawn by singing swans and carried a fairy
crew. A radiant creature in a robe whiter than goat’s milk stood on
the prow, her gleaming hair rippling down over the hem of her
garment. She bore a golden basket of rare fruits and flowers, and
although she scattered the contents with lavish hand upon the
sprites at her feet, it was never empty. Sometimes the vessel
touched the shore, and then the soil around that spot produced as
never soil produced before or since, and if any peasant was so
fortunate as to catch a glimpse of the boat, he and his children
became rich beyond want and were blessed and happy to the end of
their days.
For hundreds of years the magic ship sailed the lake, and as it
touched the shore frequently and numbers of peasants saw it, there
was wonderful prosperity in Old Helvetia.
But a great misfortune befell the country and the glad, abundant
days became but a memory. A steamboat was brought to Geneva,
and it plowed, a screaming, snorting monster, across the waters.
The noise terrified the gentle swans, and with one wild cry they flew
away. Never again did the peasants catch a glimpse of the white-
robed fairy and the shining sprites. Never again did the music of the
snowy pilots gladden their ears.
The Luck Boat disappeared, and with it went prosperity from the
land of Geneva. But marvelous things like that are never forgotten.
Those who had seen the fairy craft in their youth told the story to
their sons and daughters, who passed it on to their children and
their children’s children, and although the mountain folk of today
have never beheld it, they know just how it looked. They have
pictured it so often in their minds, that their artists have pictured it
on paper, and so it has become the custom for the peasants around
Lake Geneva to send “Luck cards” to their friends on New Year’s
Day. These are gay, colored postals containing a likeness of the Luck
Boat, and to those of whom a peasant is fondest he sends as many
as he can afford, because to receive them is supposed to bring good
fortune, just as a glimpse of the swan-drawn vessel was said to do
in the marvelous long ago.

WHY THE JAPANESE LOVE THE STORK


A Japanese Legend
(Geography)
Ages ago, in the Japanese city of Nagasaki, there lived a young
and handsome noble named Vasobiove. Life seemed very beautiful
to him. He loved the blossoms that are so sweet and abundant in his
native Saikaido, loved the racing and the wrestling matches, the
sunset on the purple Gulf of Sinabara, the evening festivals with the
dances of the geisha girls, and his only sorrow was the thought that
he could not live forever.
“Alas, to have to leave this beautiful world!” he often sighed.
At which his old father would say, “Fear not, my son. By the time
you are threescore years and ten you will think differently.”
But the young noble would shake his head and reply, “Nay, nay, I
want to live always, always.”
One day an aged pilgrim came into Nagasaki and rested on a
stone outside Vasobiove’s garden. The owner was walking under the
tulip trees, and seeing the sad-looking man in the sun and dust of
the road, called and bade him come into the shade of his park.
Leaning heavily upon his staff, the wanderer came and sat down
beside the fountain, and the young noble asked him many a
question of lands and men he had seen.
“Is it throughout the world as here in Japan,” he questioned, “that
people must die even while they yearn to live?”
The aged pilgrim nodded.
“Yea,” he answered, “in all the lands through which I have
journeyed. But men have told me that there is a region where death
never comes.”
The young noble leaned forward eagerly. “Where is it,” he
questioned, “ah, where? Tell me, for I mean to go to that land.”
The pilgrim shook his head, saying, “That you cannot do, my son.
It is in the Happy Islands of Everlasting Life, but although mortals
have seen them in the distance, never has one succeeded in
entering there.”
“But I must, I will reach that land!” Vasobiove exclaimed.
His father, who was old and wise, begged him not to go.
“You will perish on the way,” he said sorrowfully. “But even if you
reach and enter the islands, you will not be happy. That which is
best for us is given to us, and after a long life, death is good.”
But Vasobiove shook his head and objected, “No, no! I go to the
Everlasting Islands.” And the next day he set out from Nagasaki in a
boat.
Straight southward he journeyed and eastward. Storms raged and
tropic heat beat fiercely on his head, but he pressed onward, and at
last, in spite of wave and tempest, reached the green shore of
Horaisan. It was the land no mortal had ever entered, the Happy
Islands of Everlasting Life.
Vasobiove’s cup of joy was full. There was no sorrow there, no
birth or death, no tempest and black weather or flight of time—
nothing but dancing, music, splendid men and beautiful women,
with enchanted flowers of unfading beauty in the groves and
gardens, and always iridescent reaches of the sea beyond. There
were wrestling matches, such as were not dreamed of in Nagasaki,
long days filled with feasting, and long nights of dance and song.
Vasobiove smiled the smile of the contented.
“At last!” he said. “It is good to know that I shall live forever.”
Two hundred years he spent in the eternal mirth of Horaisan, and
then, somehow, he longed for other things. The music he had loved
grew wearisome, the never ending dance became hateful to his
eyes.
He wanted to return to Nagasaki, but there was no way. The boat
that had carried him to the islands had long since fallen into decay,
and it was impossible to get another. He must stay forever and ever
in the land of dance and song, and the thought became hideous.
Then he heard a weird cry. Looking behind him, he saw a giant
stork settling on the bank of a lake to catch some of the rainbow fish
within.
A happy thought came to him. No, he would not dwell eternally in
Horaisan. He would go back to Nagasaki.
Catching the bird, he tamed it, and one morning while the
islanders reveled and the sea was as many colored as the enchanted
blossoms in the gardens, he flew away, borne by the giant stork
back to the sweet land of Saikaido, back to the shining Gulf of
Sinabara, and his native Nagasaki. He would live as his fathers had
lived, he would die when his time came, and never again would he
pine for a land where all was revelry and beauty and song.
Ever since that time the Japanese have loved the stork. They
picture it upon their royal banners and upon the walls of their
houses, and give it the freedom of their gardens. Whenever a youth
becomes dissatisfied and yearns for a land where delights are never
ending, they tell him the story of the man who went to the
Everlasting Islands, show a picture of the stork that carried him back
to Nagasaki, and say,
“Even as it was with Vasobiove, so would it be with you.”

WHY GRIZZLY BEAR GOES ON ALL FOURS

A Shasta Legend. Adapted from Bancroft


(Indian Folk Tale—Geography—Ethics)
Ages ago, before there were any mountains or valleys or rivers
flowing seaward, Great Spirit lived up in the sky, higher than the
most distant star. All about him were snow heaps and white cloud
billows, so thick he could not see through them, and he wondered
what lay beyond.
“I will make a hole and see,” he said.
So, taking a sharp rock, he bored an opening through the cloud
floor and looked below. A strange sight met his eyes. There lay the
world, but a very different world from the one we know. It was flat
like a table, with no hills or valleys, or rivers, or growing things, and
Great Spirit said, “I will build a teepee there, and then I shall make it
better.”
The snow heaps lying around him made him think of a good way
of building a wigwam; so he pushed some down through the floor
window, working day and night through many, many moons, until he
had the pyramid white men call Mount Shasta. He built a fire and
lived in the teepee, and then he walked abroad.
It was a fine land for a home, but lonely and too flat. He wanted
mountains and valleys; so he created them. Then he wanted living
and growing things about him; so he said, “I will make men and
animals too.”
He dug holes in the ground with his fingers, some large, some
small, and when he breathed into them, trees of many sizes and
kinds rose out of the earth. Then he stripped leaves from the
branches and scattered them about, and they became men. He
caused snow from the mountain sides to melt and flow in streams,
and now, instead of the flat, brown vastness, there were uplands
and lowlands, green fields and snowy peaks, and rivers running
seaward, and other leaves stripped from the branches and torn into
bits became fishes that swim.
“Now I shall make beasts of every kind,” he said, and as he spoke
he smote down a mighty tree. He broke it into pieces, some large,
some small, which he turned into animals of various sizes and
varying strength. Grizzly Bear he created from the heaviest part of
the trunk, and the bear stood before him, on his hind legs, straight
and powerful like a young hunter, stronger than any other creature
of the earth.
It pleased Great Spirit to have living creatures around him, and he
did not go back to the cloud world, but stayed in the teepee. The
Indians knew he was inside, because often they saw the smoke from
his flaming coals curl far above the peaks.
Many, many moons he dwelt there and grew so lonely that he sent
for Little Daughter. She came and lived with him, made his
moccasins and tended his fire, and was happy.
One day there was a mighty storm. The wind raged fiercely,
sending the smoke back through the smoke hole into Great Spirit’s
face. He did not like that, and bade Little Daughter go up to
command the wind to stop.
She did as she was told, and put her head out through the hole to
call to the wind. But never having beheld the world before, she grew
very curious at the strange sights that met her eyes, and leaned out
far, far, to see all she could.
Suddenly she fell, and the wind carried her to the land of the
Grizzly Bear. Little Daughter did not want to stay there and begged
to be taken back to the teepee of her father.
“Let her stay here and work for me,” Mother Grizzly growled, and
Young Grizzly agreed, saying, “Yes, let her work.”
So they would neither go with her nor let her try to find the way
herself.
Great Spirit knew Little Daughter was in the land of the Grizzly
Bear, and he went to take her home. When she told him how she
had begged to go back, but was forced to stay and work, he was
very angry.
“I shall punish you,” he said to the bears. “Never again shall you
walk upright like a man; always you must go on all fours.”
Taking Little Daughter, he went back to the snow teepee, and they
lived there for ages and ages, always keeping the fire burning, and
always the Indians saw the smoke come out through the smoke
hole.
At last the white men came, and as Great Spirit did not like the
palefaces, he went away and the fire died out. But the teepee they
call Mount Shasta is still there, although smoke no longer curls
above it, and Grizzly Bear still goes on all fours, never standing
upright except when he is fighting.

THE LUCK BOY OF TOY VALLEY

(Geography—Ethics—Manual Training)
In a chalet high up among the Austrian mountains, blue-eyed
Franz was very unhappy because his mother and brother Johan were
going to Vienna and he had to stay at home with his old grandfather.
He bit his lips to keep back the tears as he watched the packing of
the box that was to carry their clothing. Then his mother tried to
comfort him.
“Never mind, lad,” she said. “I’ll send you a present from Vienna,
and we’ll call it a ‘luck gift’ and hope it will bring good luck. If it does
you’ll be a luck boy.”
He smiled even if he did feel sad. He had often heard of luck
children, for among the Tyrolean peasants there were many stories
of those who had been led by fairies to have such wonderful good
fortune that ever afterward they were spoken of as the elf-aided, or
“Glücks Kinder,” and it was so delightful to think about being one of
them that he forgot his sorrow. Of course it would be very fine to
travel down to Vienna and go into the service of a rich noble there,
as his mother and brother were to do, but it would be still better to
be a “Glücks Kind,” and such things sometimes did happen. So he
did not feel sad any more, but whistled and sang and helped with
the packing.
Early next morning the post chaise rattled up to the door, and
Johan and the mother drove away. Franz watched them go down the
winding white road, calling after them in sweet Tyrolean words of
endearment until they were out of sight. Then he went back into the
hut and began to sandpaper some blocks that his grandfather
needed for his work. The old man was a maker of picture frames, all
carved and decorated with likenesses of mountain flowers, and
these, when sent to Innsbruck and Vienna, brought the money that
gave him his living. The figures were too fine and difficult for Franz
to carve, but he could lend a hand at fetching blocks and
sandpapering. He worked with a vim, for Tyrolean boys think it a
disgrace to shirk, but all the while his thoughts were on the luck gift.
“I wonder what it will be?” he said to his grandfather. They took
turns at guessing, until it was time to feed the goats and house the
chickens for the night.
A week later the man who had driven Johan and his mother away
came by on his return from Vienna, and Franz fairly flew out to get
his gift.
“It is something very big,” he called to the old frame maker as he
took a bulging bag. “See, it is stuffed full!” And he expected to find
something very wonderful.
But when he opened it, he thought it wasn’t wonderful at all.
There was a blue velvet jacket, trimmed with gold braid and
fastened with glittering buttons, such as Tyrolean boys wore in those
days, and in one of the pockets he found a shining knife.
“Well, of all things!” he exclaimed as he held them up for his
grandfather to see. “It’s a splendid jacket, and the knife is a beauty,
but I don’t see where the luck part comes in.”
But Hals Berner was old and wise, and a knowing smile played
over his wrinkled face as he spoke. “It won’t be the first time luck
has hidden in a knife,” he said, as he bent over his carving.
Franz did not know what he meant. He had always had a knife, for
being of a carver’s family he was taught to whittle when he was a
very little fellow, and he had become remarkably skillful for one of
his years. But no wonderful good fortune had come to him, and he
was very sure that although each of the presents was nice, neither
would bring luck, and he sent that word to Johan. But the brother
wrote back from the city, “It will surely turn out to be a luck gift,
Franz. Just wait and see.” And still the boy wondered.
Winter came and icy winds blew down from the peaks. There was
no word from Vienna now, for the valley was shut in by a glittering
wall, and travel over the snow-drifted passes was impossible. There
were other boys in the village, but each had his work indoors, and
there was little time to play, so Franz had no chance for games. He
helped his grandfather part of the day and sometimes whittled for
his own amusement. It was a lonely life there in the hut, with just
the old frame maker, who was often too busy to talk, so Franz was
glad to do something to keep him busy. Now he made rings and tops
and then just fantastic sticks or blocks.
One day, as he whittled, his grandfather said, “Why don’t you
make an animal, Franz?”
The boy looked up in surprise. “I don’t think I can,” he answered.
“Not unless you try,” came the reply. “But if you do that you may
surprise yourself.”
Franz hated to have any one think he was afraid to make an
attempt, so he exclaimed, “I wonder if I could make a sheep?”
“Begin and see,” the old man advised.
The boy went to work. At first it was discouraging. After many
minutes of whittling there was little to suggest what he had in mind.
But then, with an occasional turn of the knife by the frame maker,
and now and then a bit of advice, the boy began to see that a sheep
would grow out of the block, and when it did he felt like a hero who
has won a battle.
“It wasn’t a bit hard, was it, lad?” Hals Berner asked when it was
finished.
And Franz agreed that it was not.
That was the beginning, and every day thereafter Franz worked at
his whittling, and animal after animal grew under his knife. He was
so busy he did not have time to be lonely, and had quite forgotten
how sad he had felt over having to stay at home. It was such fun to
see the figures come out of the wood and feel that he had made
them. Of course they were crude, and not half so handsome as
those his grandfather could have made; but any one could tell what
they were, and that was worth a great deal.
By spring he had a whole menagerie, and when his mother came
home she found he had been a busy boy, and a happy one as well.
“All made with the luck knife,” Johan said as he looked over the
work.
“So grandfather says,” Franz answered. “It’s a splendid knife, but I
don’t see yet where the luck comes in.”
And again the knowing smile went over the old man’s face.
One day soon afterward his mother had word from the man who
had been her employer in Vienna that his little son was not well, and
he was sending him to regain his health in the mountain air. A week
later the child arrived with his nurse, and the first thing that
attracted his attention was Franz’s menagerie.
“Oh! oh!” he exclaimed, “dogs, cats, sheep, goats, lions,
elephants, and all made of wood! I want them.”
“He means that he wants to buy them,” his nurse explained. “Will
you sell them, Franz?”
For a minute the boy hesitated. That menagerie had meant many
months of whittling, and he loved every animal in it, and if Johan
hadn’t interrupted, probably he would have refused.
“Why, Franz,” the brother exclaimed, “it begins to look like a luck
knife after all.”
That put a thought into his mind that caused him to answer, “Yes,
take them. I can make some more.”
So, when the child went back to Vienna he took a wooden
menagerie from the Tyrolean mountains. Other Viennese children,
seeing it, wanted to possess one, and orders began to pour in to
Franz, far more than he could fill. Then other villagers took up the
work, until all over the valley people were making animals and toys.
The work grew to be a big industry, and toys from the Grödner
Thal were sent all over Germany, and even to the lands beyond. One
generation after another went on with the work, and although it is
two hundred years since Franz began it, the craft continues there to
this day. At Christmas time shops in every land are filled with toys
from the Tyrolean mountains, and although they do not know the
story, thousands of children have been happier because of a peasant
boy’s whittling.
So out of the bag sent back from Vienna there came in truth a
luck gift, and it wasn’t the fine jacket either, but the knife with which
Franz whittled his first sheep. The boy had found out that luck
doesn’t mean something sent by fairies, but the doing a thing so
well that it brings a rich reward, and although he lived to be a very
old man, he never got over being grateful that his mother made him
stay behind when she and Johan went to the city.
The little valley among the Austrian Alps is still called Grödner Thal
on the maps, but because of the animals and toys that have come
out of it, it is almost as well known by another name. If you are
good guessers you can surely tell what it is, especially if you know
that the peasants still speak of the lad who made the first menagerie
there as the Luck Boy of Toy Valley.

THE EMPEROR’S VISION

Adapted from the Swedish of Selma Lagerlöf


From Lagerlöf’s Christ Legends. Copyright, 1908, by Henry Holt &
Co.
(Medieval Legend—Ethics)
When Augustus was Emperor of Rome and Herod was King of
Jerusalem, a great and holy night sank down over the earth. It was
the darkest night that any one had seen, and one could not find the
way on the most familiar road. How could it be otherwise, since all
the stars stayed at home in their houses and the fair moon hid her
face?
The silence was as profound as the darkness. The rivers stood still
in their courses, the wind did not stir, and even the aspen leaves had
ceased to quiver. Everything was as motionless as if turned to stone,
and the grass was afraid to grow, lest it disturb the holy night.
There was no cruelty or wickedness. Wild beasts did not seek their
prey, but lay in the forest depths and wondered; serpents did not
sting or dogs bark, and no false key could have picked a lock, no
knife could have drawn a drop of blood.
In Rome, the mighty city, a group of people came from the
Emperor’s palace at the Palatine and took the path across the Forum
which led to the Capitol. During the day the senators had asked the
Emperor if he had any objection to their erecting a temple in his
honor on Rome’s sacred hill, but he had given no answer. He did not
know if it would be agreeable to the gods for him to own a temple
next to theirs, and he wanted to ascertain their will in the matter by
offering a sacrifice. Therefore he and his trusted friends were on
their way to the Capitol.
Augustus let them carry his litter, for he was old and the stairs
leading to the Capitol were long. He held in his hands the cage of
doves for the sacrifice. No priests or soldiers accompanied him, only
his nearest friends. Torch bearers walked in front of him to light the
ways through the black darkness, and behind him followed slaves
who carried the tripod, knives, and charcoal for the sacred fire. He
chatted gayly with his followers, and all were so interested in the
conversation that they did not notice the stillness over the earth.
Only when they reached the highest point on Capitol Hill did they
realize that something unusual was taking place.
There they saw a most remarkable thing. An old woman, so bent
and twisted that at first they thought it must be a distorted olive
tree, was standing on the very edge of the cliff, and they knew her
to be the sibyl who had lived as many years as the sand grains by
the sea.
“Why does she come from her cave tonight?” they whispered.
“What does she foretell for the Emperor and the Empire?”
She stood there as if she had gone up on the hillside that she
might see what was happening far away, and the night was so dark,
so dark!
Then Augustus and his retinue remarked how profound was the
stillness. They could not hear even Tiber’s hollow murmur, and they
feared some disaster was impending. But no one cared to show that
he was afraid. They told Augustus it was a good omen, and
counseled him to hurry with the sacrifice.
The sibyl seemed not to notice the Emperor’s train moving up to
the Capitol. In fact, she did not see them. She was in a distant land
making her way over something higher than grass tufts. She was
walking among great flocks of sleeping sheep.
Then she saw a shepherd’s fire. It burned in the middle of the
field, and she groped her way to it. The shepherds lay asleep in its
glow, and beside them were the long, spiked sticks with which they
defended their flocks from wild beasts. Jackals with glittering eyes
and bushy tails stole up toward the blaze, but the men did not hurl
the sticks at them. The dogs continued to sleep, the sheep did not
flee, and the beasts of prey lay down to rest beside human beings.
Only this the sibyl saw. She did not know that a sacrificial fire was
being kindled behind her. She did not see the Roman Emperor take a
dove from the cage to use as an offering. She was in the far hills of
Galilee, among slumbering shepherds and sheep.
Then, wonderful sight, a company of angels singing gloriously flew
back and forth above the wide plain. They moved in long, swaying
lines like migratory birds. Some held lutes in their hands, some
zithers and harps, and their songs rang out as merry as child
laughter, as carefree as lark trills. The shepherds wakened,

You might also like