20000 Leagues Under the Sea by Jules Verne - ShareLaTeX

20000 Leagues Under the Sea by Jules Verne - ShareLaTeX

20,000 LEAGUES UNDER THE SEA BY JULES VERNE A Thesis Presented to The Academic Faculty by Frodo Baggins In Partial Fulfillment of the Requirements f...

198KB Sizes 0 Downloads 11 Views

Recommend Documents

20000 Leagues Under the Sea
Action was I told them there was only one sea creature with a tusk ... l. marine biologist: a scientist who studies sea

20000 Leagues Under the Sea - literacymalden
monster turns out to be the Nautilus, a submarine run by the .... ocean floor. ... Conclusions Why was Ned Land a good p

20000 Leagues Under the Sea - The Well-Trained Mind
English. Title: Jules Verne's 20,000 leagues under the sea : a companion reader / as told by Jim .... But what kind of m

20000 Leagues Under the Sea - Fairfield Union Local School District
IT IS ONLY A SELECTED LIST, NOT A COMPLETE. LISTING. ... between two worlds: one as an artist on a ...... outlaws, halfm

20000 Leagues Under The Sea (answers) - Surviving Homeschool
Ch. 1 The Monster at Sea. 1. ... What did the captain of the ship think the creature was? ... What did they see when the

Twenty Thousand Leagues Under the Sea - neyture.info
Where did the crew of the Abraham Lincoln plan to meet the sea creature? ... How big is the sea creature estimated to be

Jules Verne Die Propellerinsel
nen in dem Rosenbett, worauf man ihn gelegt hat, finden will. »Und übrigens unser Gepäck . . . ?« Ja freilich, das G

Search of the Castaways By Jules Verne - Free Classic eBooks
In Search of the Castaways or. The Children of Captain Grant. South America. CHAPTER I THE SHARK. ON the 26th of July, 1

Jules Verne Der Grüne Strahl
Sie sagten beide die Wahrheit. Warum aber diese Eile? Weil Aristobulos Ursiclos sich seit 14 Tagen zum Landauf- enthalt

20,000 Leagues Under the Sea Unit by Katy Hobson Fourth grade
fight the sea monster, which Aronnax assumes to be a giant sea unicorn. The crew ... The Magic School Bus on the Ocean F

20,000 LEAGUES UNDER THE SEA BY JULES VERNE

A Thesis Presented to The Academic Faculty by Frodo Baggins

In Partial Fulfillment of the Requirements for the Degree Doctor of Philosophy in the School of Electrical and Computer Engineering

Georgia Institute of Technology August 2002 Copyright © 2002 by Frodo Baggins

20,000 LEAGUES UNDER THE SEA BY JULES VERNE

VOLUME I

by

Frodo Baggins

ii

A dedication would go here...

iii

ACKNOWLEDGEMENTS

Acknowledgement text goes here. You could also (optionally) have a forward or a preface, instead of an acknowledgement. The text used as “filler” for Chapters 1, 2, 3, and Appendix A and B in this example was taken from the Project Gutenberg edition of Jules Verne’s 20,000 Leagues Under the Sea. That text can be freely distributed according to the Gutenberg license, in any markup language desired (here, LATEX) — so long as the original text version is also available. To abide by these requirements, the full original etext of 20,000 Leagues is included in this archive as 2000010.txt. Check 2000010.txt for Gutenberg licence and distribution information. This class file, gatech-thesis.cls, would not have been possible without the following people: • Francois Pitt — ut-thesis.cls version 1.8, 1999 Dec 10 • Aichen Low — original modifications to ut-thesis.cls to minimally conform to the Georgia Tech requirements. Also, her gt-thesissty.sty provided additional useful code that was incorporated into gatech-thesis.cls. • Stanford University — suthesis.sty was adapted by: • Ahmed Gheith — adapted suthesis.sty to create GTthesis.sty. GTthesis. sty was the previous “official” Georgia Tech style for dissertations. • Joonwon Lee, Eilin Tien Lin, and Wei Lui — modifications to Ahmed’s original GTthesis.sty • Kalyan Perumalla — additional modifications to GTthesis.sty (1999 Nov 18) • Cody Watson, David Swanson — even more modifications to GTthesis.sty

iv

TABLE OF CONTENTS VOLUME I DEDICATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

ii

ACKNOWLEDGEMENTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

iii

LIST OF TABLES

vi

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

LIST OF FIGURES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii LIST OF SYMBOLS OR ABBREVIATIONS

. . . . . . . . . . . . . . . . . . . viii

GLOSSARY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viii LIST OF LISTINGS

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viii

SUMMARY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

ix

CHAPTERS I

A SHIFTING REEF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.1

This section is not in the original text, and we give it a very very long title. No, even longer than that. . . . . . . . . . . . . . . . . . . . . . . . . . .

1

1.2

Another added section . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1

1.3

back to the original text . . . . . . . . . . . . . . . . . . . . . . . . . . .

2

1.4

Yet another section that’s not really in the text . . . . . . . . . . . . . . .

2

1.5

Back to the real text . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3

1.6

extra section marker . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

4

1.7

another section marker . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5

1.7.1

a subsection marker . . . . . . . . . . . . . . . . . . . . . . . . .

5

1.7.2

another subsection . . . . . . . . . . . . . . . . . . . . . . . . . .

5

a final section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7

PRO AND CON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

9

2.1

9

1.8 II

1

An added section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1.1

A subsection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

v 2.2

Another added section . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

2.3

The last added section . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 VOLUME II

III I FORM MY RESOLUTION . . . . . . . . . . . . . . . . . . . . . . . . . . 15 3.1

Section marker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

3.2

Another marker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

3.3

Yet Another Marker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

APPENDICES APPENDIX A

— NED LAND . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

APPENDIX B

— AT A VENTURE . . . . . . . . . . . . . . . . . . . . . . . . 26

APPENDIX C

— PROGRAM LISTINGS . . . . . . . . . . . . . . . . . . . . 31

REFERENCES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 VITA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

vi

LIST OF TABLES

1

Add a table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

2

Add another table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

vii

LIST OF FIGURES

1

A test figure. This is a test figure inserted into this text. This is a test figure inserted into this text. This is a test figure inserted into this text. . . . . . .

6

2

Another test figure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

3

The last test figure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

viii

LIST OF LISTINGS

1

crc16.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

2

crc8.m . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

3

crc32.cxx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

4

crc32.java . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

ix

SUMMARY

A brief summary of the entire dissertation should go here.

1

CHAPTER I

A SHIFTING REEF

The year 1866 was signalised by a remarkable incident, a mysterious and puzzling phenomenon, which doubtless no one has yet forgotten. Not to mention rumours which agitated the maritime population and excited the public mind, even in the interior of continents, seafaring men were particularly excited. Merchants, common sailors, captains of vessels, skippers, both of Europe and America, naval officers[1] of all countries, and the Governments of several States on the two continents, were deeply interested in the matter. For some time past vessels had been met by “an enormous thing,” a long object, spindleshaped, occasionally phosphorescent, and infinitely larger and more rapid in its movements than a whale.

1.1

This section is not in the original text, and we give it a very very long title. No, even longer than that.

Here, we’re just exercising the gatech-thesis-losa.sty style, which helps create a List of Symbols or Abbreviations. To add an item to the [LOSA??], you need to create an entry in the database file specified by the \losafile command. Then, use the \losa{} command within the bodytext. This will both typeset the symbol/abbreviation, and add its definition to the [LOSA??]. So, here are some bogus abbreviaions: We refer to [VLSI??] and to [gnu??] and various other things like [neuroeng??] and [PE??]s. Finally, you should be sure to read the [losahang??] note.

1.2

Another added section

Now, the List of Symbols or Abbreviations is different from a Glossary or List of Nomenclature. In the former, the description text is rigidly separate from the symbols themselves.

CHAPTER 1. A Shifting Reef

2

In a glossary, since the items are typically longer, this kind of separation is impractical. Use the gatech-thesis-losa style and the \losa{} command for Lists of Symbols or Abbreviations; use the gatech-thesis-gloss style and the \gloss{} command for glossaries. Now, here’s a few words to exercise the glossary: [reallylongword??], [myelin??], [neuroeng??], and [frobozz??]. Oh, and [glosshang??].

1.3

back to the original text

The facts relating to this apparition (entered in various log-books) agreed in most respects as to the shape of the object or creature in question, the untiring rapidity of its movements, its surprising power of locomotion, and the peculiar life with which it seemed endowed. If it was a whale, it surpassed in size all those hitherto classified in science. Taking into consideration the mean of observations made at divers times—rejecting the timid estimate of those who assigned to this object a length of two hundred feet, equally with the exaggerated opinions which set it down as a mile in width and three in length—we might fairly conclude that this mysterious being surpassed greatly all dimensions admitted by the learned ones of the day, if it existed at all. And that it DID exist was an undeniable fact; and, with that tendency which disposes the human mind in favour of the marvellous, we can understand the excitement produced in the entire world by this supernatural apparition. As to classing it in the list of fables, the idea was out of the question.

1.4

Yet another section that’s not really in the text

Here, we’re testing the index stuff. The @ sign is one item. There’s also the width of rules and the color or weight of boxes. PostScript is a font format. If I had more energy I could list the dimensions of a table, and talk about the height of a rule. Then, there’s the size of figures to worry about and don’t forget the box. (See, here I used the starred from of \index like so: \index*{box} and it typeset “box” for me. Now, usually you don’t want the starred version of the \index command—it’s only useful for single level index entries

CHAPTER 1. A Shifting Reef

3

(that is, those that don’t have a ‘!’ character in them, because \index* will typeset the whole thing, like this: \index*{foo!bar} gives foo!bar. Silly. Here’s a fun one: LATEX (here I used the symbol in the \index command, because I wanted to alphabetize LATEX as LaTeX, and not as a symbol. So, I used this command: \LaTeX{}\index{[email protected]\LaTeX{} program}. Now, a few more index entries: Computer Modern is a font. We can also talk of the size of boxes and the depth and of rules. Also, let’s try to reference the PostScript fonts again. Note that the starred form of \index is unique to the index.sty package, on which the gatech-thesis-index.sty package is built. The starred \index is not available in “normal” LATEX.

1.5

Back to the real text E = mc2

(1)

On the 20th of July, 1866, the steamer Governor Higginson, of the Calcutta and Burnach Steam Navigation Company, had met this moving mass five miles off the east coast of Australia. Captain Baker thought at first that he was in the presence of an unknown sandbank; he even prepared to determine its exact position when two columns of water, projected by the mysterious object, shot with a hissing noise a hundred and fifty feet up into the air. Now, unless the sandbank had been submitted to the intermittent eruption of a geyser, the Governor Higginson had to do neither more nor less than with an aquatic mammal, unknown till then, which threw up from its blow-holes columns of water mixed with air and vapour.[2][3] Similar facts were observed on the 23rd of July in the same year, in the Pacific Ocean, by the Columbus, of the West India and Pacific Steam Navigation Company. But this extraordinary creature could transport itself from one place to another with surprising velocity; as, in an interval of three days, the Governor Higginson and the Columbus had observed it at two different points of the chart, separated by a distance of more than seven hundred nautical leagues.

CHAPTER 1. A Shifting Reef

1.6

4

extra section marker

Fifteen days later, two thousand miles farther off, the Helvetia, of the Compagnie-Nationale, and the Shannon, of the Royal Mail Steamship Company, sailing to windward in that portion of the Atlantic lying between the United States and Europe, respectively signalled the monster to each other in [email protected] 15’ N. lat. and [email protected] 35’ W. long. In these simultaneous observations they thought themselves justified in estimating the minimum length of the mammal at more than three hundred and fifty feet, as the Shannon and Helvetia were of smaller dimensions than it, though they measured three hundred feet over all. Now the largest whales, those which frequent those parts of the sea round the Aleutian, Kulammak, and Umgullich islands, have never exceeded the length of sixty yards, if they attain that.

E = mc2

(2)

In every place of great resort the monster was the fashion. They sang of it in the cafes, ridiculed it in the papers, and represented it on the stage. All kinds of stories were circulated regarding it. There appeared in the papers caricatures of every gigantic and imaginary creature, from the white whale, the terrible “Moby Dick” of sub-arctic regions, to the immense kraken, whose tentacles could entangle a ship of five hundred tons and hurry it into the abyss of the ocean. The legends of ancient times were even revived. Then burst forth the unending argument between the believers and the unbelievers in the societies of the wise and the scientific journals. “The question of the monster” inflamed all minds. Editors of scientific journals, quarrelling with believers in the supernatural, spilled seas of ink during this memorable campaign, some even drawing blood; for from the sea-serpent they came to direct personalities.

CHAPTER 1. A Shifting Reef

1.7

5

another section marker

During the first months of the year 1867 the question seemed buried, never to revive, when new facts were brought before the public. It was then no longer a scientific problem to be solved, but a real danger seriously to be avoided. The question took quite another shape. The monster became a small island, a rock, a reef, but a reef of indefinite and shifting proportions. 1.7.1

a subsection marker

On the 5th of March, 1867, the Moravian, of the Montreal Ocean Company, finding herself during the night in [email protected] 30’ lat. and [email protected] 15’ long., struck on her starboard quarter a rock, marked in no chart for that part of the sea. Under the combined efforts of the wind and its four hundred horse power, it was going at the rate of thirteen knots. Had it not been for the superior strength of the hull of the Moravian, she would have been broken by the shock and gone down with the 237 passengers she was bringing home from Canada. The accident happened about five o’clock in the morning, as the day was breaking. The officers of the quarter-deck hurried to the after-part of the vessel. They examined the sea with the most careful attention. They saw nothing but a strong eddy about three cables’ length distant, as if the surface had been violently agitated. The bearings of the place were taken exactly, and the Moravian continued its route without apparent damage. Had it struck on a submerged rock, or on an enormous wreck? They could not tell; but, on examination of the ship’s bottom when undergoing repairs, it was found that part of her keel was broken. 1.7.2

another subsection

This fact, so grave in itself, might perhaps have been forgotten like many others if, three weeks after, it had not been re-enacted under similar circumstances. But, thanks to the nationality of the victim of the shock, thanks to the reputation of the company to which the vessel belonged, the circumstance became extensively circulated.

CHAPTER 1. A Shifting Reef

6

Figure 1: This is a test figure inserted into this text.

The 13th of April, 1867, the sea being beautiful, the breeze favourable, the Scotia, of the Cunard Company’s line, found herself in [email protected] 12’ long. and [email protected] 37’ lat. She was going at the speed of thirteen knots and a half. At seventeen minutes past four in the afternoon, whilst the passengers were assembled at lunch in the great saloon, a slight shock was felt on the hull of the Scotia, on her quarter, a little aft of the port-paddle. The Scotia had not struck, but she had been struck, and seemingly by something rather sharp and penetrating than blunt. The shock had been so slight that no one had been alarmed, had it not been for the shouts of the carpenter’s watch, who rushed on to the bridge, exclaiming, “We are sinking! we are sinking!” At first the passengers were much frightened, but Captain Anderson hastened to reassure them. The danger could not be imminent. The Scotia, divided into seven compartments by strong partitions, could brave with impunity any leak. Captain Anderson went down immediately into the hold. He found that the sea was pouring into the fifth compartment; and the rapidity of the influx proved that the force of the water was considerable. Fortunately this compartment did not hold the boilers, or the fires would have been immediately extinguished. Captain Anderson ordered the engines to be stopped at once, and one of the men went down to ascertain the extent of the injury. Some minutes afterwards they discovered the existence of a large hole, two

CHAPTER 1. A Shifting Reef

7

yards in diameter, in the ship’s bottom. Such a leak could not be stopped; and the Scotia, her paddles half submerged, was obliged to continue her course. She was then three hundred miles from Cape Clear, and, after three days’ delay, which caused great uneasiness in Liverpool, she entered the basin of the company. 1.7.2.1

a subsubsection with a really really really really really really really really really really long title. I mean a really really really really really really really really really really long title. No, even longer than that.

The engineers visited the Scotia, which was put in dry dock. They could scarcely believe it possible; at two yards and a half below water-mark was a regular rent, in the form of an isosceles triangle. The broken place in the iron plates was so perfectly defined that it could not have been more neatly done by a punch. It was clear, then, that the instrument producing the perforation was not of a common stamp and, after having been driven with prodigious strength, and piercing an iron plate 1 3/8 inches thick, had withdrawn itself by a backward motion. 1.7.2.2

a subsubsection with shorter title

Such was the last fact, which resulted in exciting once more the torrent of public opinion. From this moment all unlucky casualties which could not be otherwise accounted for were put down to the monster.

1.8

a final section

Upon this imaginary creature rested the responsibility of all these shipwrecks, which unfortunately were considerable; for of three thousand ships whose loss was annually recorded at Lloyd’s, the number of sailing and steam-ships supposed to be totally lost, from the absence of all news, amounted to not less than two hundred! Now, it was the “monster” who, justly or unjustly, was accused of their disappearance, and, thanks to it, communication between the different continents became more and more

CHAPTER 1. A Shifting Reef

8

dangerous. The public demanded sharply that the seas should at any price be relieved from this formidable cetacean.1

1

Member of the whale family.

9

CHAPTER II

PRO AND CON

At the period when these events took place, I had just returned from a scientific research in the disagreeable territory of Nebraska, in the United States. In virtue of my office as Assistant Professor in the Museum of Natural History in Paris, the French Government had attached me to that expedition. After six months in Nebraska, I arrived in New York towards the end of March, laden with a precious collection. My departure for France was fixed for the first days in May. Meanwhile I was occupying myself in classifying my mineralogical, botanical, and zoological riches, when the accident happened to the Scotia. I was perfectly up in the subject which was the question of the day. How could I be otherwise? I had read and reread all the American and European papers without being any nearer a conclusion. This mystery puzzled me. Under the impossibility of forming an opinion, I jumped from one extreme to the other. That there really was something could not be doubted, and the incredulous were invited to put their finger on the wound of the Scotia.[4]

2.1

An added section

On my arrival at New York the question was at its height. The theory of the floating island, and the unapproachable sandbank, supported by minds little competent to form a judgment, was abandoned. And, indeed, unless this shoal had a machine in its stomach, how could it change its position with such astonishing rapidity? From the same cause, the idea of a floating hull of an enormous wreck was given up.

There remained, then, only two possible solutions of the question, which created two distinct parties: on one side, those who were for a monster of colossal strength; on the

CHAPTER 2. Pro and Con

10

Table 1: Add an extra table here. Chinese Menu.

column A hot Kung Pao Chicken mild Moo Goo Gai Pan

column B General Tso’s Chicken Sweet and Sour Pork

other, those who were for a submarine vessel of enormous motive power. 2.1.1

A subsection

But this last theory, plausible as it was, could not stand against inquiries made in both worlds. That a private gentleman should have such a machine at his command was not likely. Where, when, and how was it built? and how could its construction have been kept secret? Certainly a Government might possess such a destructive machine. And in these disastrous times, when the ingenuity of man has multiplied the power of weapons of war, it was possible that, without the knowledge of others, a State might try to work such a formidable engine. But the idea of a war machine fell before the declaration of Governments. As public interest was in question, and transatlantic communications suffered, their veracity could not be doubted. But how admit that the construction of this submarine boat had escaped the public eye? For a private gentleman to keep the secret under such circumstances would be very difficult, and for a State whose every act is persistently watched by powerful rivals, certainly impossible. Upon my arrival in New York several persons did me the honour of consulting me on the phenomenon in question. I had published in France a work in quarto, in two volumes, entitled Mysteries of the Great Submarine Grounds. This book, highly approved of in the learned world, gained for me a special reputation in this rather obscure branch of Natural History. My advice was asked. As long as I could deny the reality of the fact, I confined myself to a decided negative. But soon, finding myself driven into a corner, I was obliged to explain myself point by point. I discussed the question in all its forms, politically and

CHAPTER 2. Pro and Con

11

Figure 2: This is another test figure inserted into this text [5]

scientifically; and I give here an extract from a carefully-studied article which I published in the number of the 30th of April. It ran as follows:

2.2

Another added section

“After examining one by one the different theories, rejecting all other suggestions, it becomes necessary to admit the existence of a marine animal of enormous power.

E = mc2

(3)

“The great depths of the ocean are entirely unknown to us. Soundings cannot reach them. What passes in those remote depths—what beings live, or can live, twelve or fifteen miles beneath the surface of the waters—what is the organisation of these animals, we can scarcely conjecture. However, the solution of the problem submitted to me may modify the form of the dilemma. Either we do know all the varieties of beings which people our planet, or we do not. If we do NOT know them all—if Nature has still secrets in the deeps for us, nothing is more conformable to reason than to admit the existence of fishes, or cetaceans of other kinds, or even of new species, of an organisation formed to inhabit the strata inaccessible to soundings, and which an accident of some sort has brought at long intervals to the upper level of the ocean.

CHAPTER 2. Pro and Con

12

“If, on the contrary, we DO know all living kinds, we must necessarily seek for the animal in question amongst those marine beings already classed; and, in that case, I should be disposed to admit the existence of a gigantic narwhal. “The common narwhal, or unicorn of the sea, often attains a length of sixty feet. Increase its size fivefold or tenfold, give it strength proportionate to its size, lengthen its destructive weapons, and you obtain the animal required. It will have the proportions determined by the officers of the Shannon, the instrument required by the perforation of the Scotia, and the power necessary to pierce the hull of the steamer.[6] “Indeed, the narwhal is armed with a sort of ivory sword, a halberd, according to the expression of certain naturalists. The principal tusk has the hardness of steel. Some of these tusks have been found buried in the bodies of whales, which the unicorn always attacks with success. Others have been drawn out, not without trouble, from the bottoms of ships, which they had pierced through and through, as a gimlet pierces a barrel. The Museum of the Faculty of Medicine of Paris possesses one of these defensive weapons, two yards and a quarter in length, and fifteen inches in diameter at the base. “Very well! suppose this weapon to be six times stronger and the animal ten times more powerful; launch it at the rate of twenty miles an hour, and you obtain a shock capable of producing the catastrophe required. Until further information, therefore, I shall maintain it to be a sea-unicorn of colossal dimensions, armed not with a halberd, but with a real spur, as the armoured frigates, or the ‘rams’ of war, whose massiveness and motive power it would possess at the same time. Thus may this puzzling phenomenon be explained, unless there be something over and above all that one has ever conjectured, seen, perceived, or experienced; which is just within the bounds of possibility.”

2.3

The last added section

These last words were cowardly on my part; but, up to a certain point, I wished to shelter my dignity as professor, and not give too much cause for laughter to the Americans, who

CHAPTER 2. Pro and Con

13

laugh well when they do laugh. I reserved for myself a way of escape. In effect, however, I admitted the existence of the “monster.” My article was warmly discussed, which procured it a high reputation. It rallied round it a certain number of partisans. The solution it proposed gave, at least, full liberty to the imagination. The human mind delights in grand conceptions of supernatural beings. And the sea is precisely their best vehicle, the only medium through which these giants (against which terrestrial animals, such as elephants or rhinoceroses, are as nothing) can be produced or developed. The industrial and commercial papers treated the question chiefly from this point of view. The Shipping and Mercantile Gazette, the Lloyd’s List, the Packet-Boat, and the Maritime and Colonial Review, all papers devoted to insurance companies which threatened to raise their rates of premium, were unanimous on this point. Public opinion had been pronounced. The United States were the first in the field; and in New York they made preparations for an expedition destined to pursue this narwhal. A frigate of great speed, the Abraham Lincoln, was put in commission as soon as possible. The arsenals were opened to Commander Farragut, who hastened the arming of his frigate; but, as it always happens, the moment it was decided to pursue the monster, the monster did not appear. For two months no one heard it spoken of. No ship met with it. It seemed as if this unicorn knew of the plots weaving around it. It had been so much talked of, even through the Atlantic cable, that jesters pretended that this slender fly had stopped a telegram on its passage and was making the most of it. So when the frigate had been armed for a long campaign, and provided with formidable fishing apparatus, no one could tell what course to pursue. Impatience grew apace, when, on the 2nd of July, they learned that a steamer of the line of San Francisco, from California to Shanghai, had seen the animal three weeks before in the North Pacific Ocean. The excitement caused by this news was extreme. The ship was revictualled and well stocked with coal. Three hours before the Abraham Lincoln left Brooklyn pier, I received a letter worded

CHAPTER 2. Pro and Con as follows: To M. ARONNAX, Professor in the Museum of Paris, Fifth Avenue Hotel, New York. SIR,–If you will consent to join the Abraham Lincoln in this expedition, the Government of the United States will with pleasure see France represented in the enterprise. Commander Farragut has a cabin at your disposal. Very cordially yours, J.B. HOBSON, Secretary of Marine.

14

20,000 LEAGUES UNDER THE SEA BY JULES VERNE

VOLUME II

by

Frodo Baggins

15

CHAPTER III

I FORM MY RESOLUTION

Three seconds before the arrival of J. B. Hobson’s letter I no more thought of pursuing the unicorn than of attempting the passage of the North Sea. Three seconds after reading the letter of the honourable Secretary of Marine, I felt that my true vocation, the sole end of my life, was to chase this disturbing monster and purge it from the world. But I had just returned from a fatiguing journey, weary and longing for repose. I aspired to nothing more than again seeing my country, my friends, my little lodging by the Jardin des Plantes, my dear and precious collections—but nothing could keep me back! I forgot all—fatigue, friends and collections—and accepted without hesitation the offer of the American Government. “Besides,” thought I, “all roads lead back to Europe; and the unicorn may be amiable enough to hurry me towards the coast of France. This worthy animal may allow itself to be caught in the seas of Europe (for my particular benefit), and I will not bring back less than half a yard of his ivory halberd to the Museum of Natural History.” But in the meanwhile I must seek this narwhal in the North Pacific Ocean, which, to return to France, was taking the road to the antipodes.[7] “Conseil,” I called in an impatient voice. Conseil was my servant, a true, devoted Flemish boy, who had accompanied me in all my travels. I liked him, and he returned the liking well. He was quiet by nature, regular from principle, zealous from habit, evincing little disturbance at the different surprises of life, very quick with his hands, and apt at any service required of him; and, despite his name, never giving advice–even when asked for it.

CHAPTER 3. I Form My Resolution

16

Figure 3: This is the last test figure inserted into this text

3.1

Section marker

Conseil had followed me for the last ten years wherever science led. Never once did he complain of the length or fatigue of a journey, never make an objection to pack his portmanteau for whatever country it might be, or however far away, whether China or Congo. Besides all this, he had good health, which defied all sickness, and solid muscles, but no nerves; good morals are understood. This boy was thirty years old, and his age to that of his master as fifteen to twenty. May I be excused for saying that I was forty years old?

E = mc2

(4)

But Conseil had one fault: he was ceremonious to a degree, and would never speak to me but in the third person, which was sometimes provoking. “Conseil,” said I again, beginning with feverish hands to make preparations for my departure. Certainly I was sure of this devoted boy. As a rule, I never asked him if it were convenient for him or not to follow me in my travels; but this time the expedition in question might be prolonged, and the enterprise might be hazardous in pursuit of an animal capable of sinking a frigate as easily as a nutshell. Here there was matter for reflection even to the most impassive man in the world. What would Conseil say?

CHAPTER 3. I Form My Resolution

3.2

17

Another marker

“Conseil,” I called a third time. Conseil appeared. “Did you call, sir?” said he, entering. “Yes, my boy; make preparations for me and yourself too. We leave in two hours.” “As you please, sir,” replied Conseil, quietly. “Not an instant to lose; lock in my trunk all travelling utensils, coats, shirts, and stockings—without counting, as many as you can, and make haste.” “And your collections, sir?” observed Conseil. “They will keep them at the hotel.” “We are not returning to Paris, then?” said Conseil. “Oh! certainly,” I answered, evasively, “by making a curve.” “Will the curve please you, sir?” “Oh! it will be nothing; not quite so direct a road, that is all. We take our passage in the Abraham, Lincoln.” “As you think proper, sir,” coolly replied Conseil. “You see, my friend, it has to do with the monster—the famous narwhal. We are going to purge it from the seas. A glorious mission, but a dangerous one! We cannot tell where we may go; these animals can be very capricious. But we will go whether or no; we have got a captain who is pretty wide-awake.”

3.3

Yet Another Marker

Our luggage was transported to the deck of the frigate immediately. I hastened on board and asked for Commander Farragut. One of the sailors conducted me to the poop, where I found myself in the presence of a good-looking officer, who held out his hand to me. “Monsieur Pierre Aronnax?” said he. “Himself,” replied I. “Commander Farragut?”

CHAPTER 3. I Form My Resolution

18

Table 2: Add another Chinese Menu.

column A hot Kung Pao Chicken mild Moo Goo Gai Pan

column B General Tso’s Chicken Sweet and Sour Pork

“You are welcome, Professor; your cabin is ready for you.” I bowed, and desired to be conducted to the cabin destined for me. The Abraham Lincoln had been well chosen and equipped for her new destination. She was a frigate of great speed, fitted with high-pressure engines which admitted a pressure of seven atmospheres. Under this the Abraham Lincoln attained the mean speed of nearly eighteen knots and a third an hour—a considerable speed, but, nevertheless, insufficient to grapple with this gigantic cetacean.

The interior arrangements of the frigate corresponded to its nautical qualities. I was well satisfied with my cabin, which was in the after part, opening upon the gunroom. “We shall be well off here,” said I to Conseil. “As well, by your honour’s leave, as a hermit-crab in the shell of a whelk,” said Conseil. I left Conseil to stow our trunks conveniently away, and remounted the poop in order to survey the preparations for departure. At that moment Commander Farragut was ordering the last moorings to be cast loose which held the Abraham Lincoln to the pier of Brooklyn. So in a quarter of an hour, perhaps less, the frigate would have sailed without me. I should have missed this extraordinary, supernatural, and incredible expedition, the recital of which may well meet with some suspicion. But Commander Farragut would not lose a day nor an hour in scouring the seas in which the animal had been sighted. He sent for the engineer. “Is the steam full on?” asked he. “Yes, sir,” replied the engineer.

CHAPTER 3. I Form My Resolution “Go ahead,” cried Commander Farragut.

19

20

APPENDIX A

NED LAND

Captain Farragut was a good seaman, worthy of the frigate he commanded. His vessel and he were one. He was the soul of it. On the question of the monster there was no doubt in his mind, and he would not allow the existence of the animal to be disputed on board. He believed in it, as certain good women believe in the leviathan–by faith, not by reason. The monster did exist, and he had sworn to rid the seas of it. Either Captain Farragut would kill the narwhal, or the narwhal would kill the captain. There was no third course. The officers on board shared the opinion of their chief. They were ever chatting, discussing, and calculating the various chances of a meeting, watching narrowly the vast surface of the ocean. More than one took up his quarters voluntarily in the cross-trees, who would have cursed such a berth under any other circumstances. As long as the sun described its daily course, the rigging was crowded with sailors, whose feet were burnt to such an extent by the heat of the deck as to render it unbearable; still the Abraham Lincoln had not yet breasted the suspected waters of the Pacific. As to the ship’s company, they desired nothing better than to meet the unicorn, to harpoon it, hoist it on board, and despatch it. They watched the sea with eager attention. Besides, Captain Farragut had spoken of a certain sum of two thousand dollars, set apart for whoever should first sight the monster, were he cabin-boy, common seaman, or officer. I leave you to judge how eyes were used on board the Abraham Lincoln.

A.1

added section marker

For my own part I was not behind the others, and, left to no one my share of daily observations. The frigate might have been called the Argus, for a hundred reasons. Only one

APPENDIX A. Ned Land

21

amongst us, Conseil, seemed to protest by his indifference against the question which so interested us all, and seemed to be out of keeping with the general enthusiasm on board.

E = mc2

(5)

I have said that Captain Farragut had carefully provided his ship with every apparatus for catching the gigantic cetacean. No whaler had ever been better armed. We possessed every known engine, from the harpoon thrown by the hand to the barbed arrows of the blunderbuss, and the explosive balls of the duck-gun. On the forecastle lay the perfection of a breech-loading gun, very thick at the breech, and very narrow in the bore, the model of which had been in the Exhibition of 1867. This precious weapon of American origin could throw with ease a conical projectile of nine pounds to a mean distance of ten miles. Thus the Abraham Lincoln wanted for no means of destruction; and, what was better still she had on board Ned Land, the prince of harpooners. Ned Land was a Canadian, with an uncommon quickness of hand, and who knew no equal in his dangerous occupation. Skill, coolness, audacity, and cunning he possessed in a superior degree, and it must be a cunning whale to escape the stroke of his harpoon. Ned Land was about forty years of age; he was a tall man (more than six feet high), strongly built, grave and taciturn, occasionally violent, and very passionate when contradicted. His person attracted attention, but above all the boldness of his look, which gave a singular expression to his face. Who calls himself Canadian calls himself French; and, little communicative as Ned Land was, I must admit that he took a certain liking for me. My nationality drew him to me, no doubt. It was an opportunity for him to talk, and for me to hear, that old language of Rabelais, which is still in use in some Canadian provinces. The harpooner’s family was originally from Quebec, and was already a tribe of hardy fishermen when this town belonged to France. Little by little, Ned Land acquired a taste for chatting, and I loved to hear the recital of

APPENDIX A. Ned Land

22

his adventures in the polar seas. He related his fishing, and his combats, with natural poetry of expression; his recital took the form of an epic poem, and I seemed to be listening to a Canadian Homer singing the Iliad of the regions of the North.

E = mc2

(6)

I am portraying this hardy companion as I really knew him. We are old friends now, united in that unchangeable friendship which is born and cemented amidst extreme dangers. Ah, brave Ned! I ask no more than to live a hundred years longer, that I may have more time to dwell the longer on your memory. Now, what was Ned Land’s opinion upon the question of the marine monster? I must admit that he did not believe in the unicorn, and was the only one on board who did not share that universal conviction. He even avoided the subject, which I one day thought it my duty to press upon him. One magnificent evening, the 30th July (that is to say, three weeks after our departure), the frigate was abreast of Cape Blanc, thirty miles to leeward of the coast of Patagonia. We had crossed the tropic of Capricorn, and the Straits of Magellan opened less than seven hundred miles to the south. Before eight days were over the Abraham Lincoln would be ploughing the waters of the Pacific. Seated on the poop, Ned Land and I were chatting of one thing and another as we looked at this mysterious sea, whose great depths had up to this time been inaccessible to the eye of man. I naturally led up the conversation to the giant unicorn, and examined the various chances of success or failure of the expedition. But, seeing that Ned Land let me speak without saying too much himself, I pressed him more closely. “Well, Ned,” said I, “is it possible that you are not convinced of the existence of this cetacean that we are following? Have you any particular reason for being so incredulous?” The harpooner looked at me fixedly for some moments before answering, struck his broad forehead with his hand (a habit of his), as if to collect himself, and said at last, “Perhaps I have, Mr. Aronnax.”

APPENDIX A. Ned Land

23

“But, Ned, you, a whaler by profession, familiarised with all the great marine mammalia— YOU ought to be the last to doubt under such circumstances!” “That is just what deceives you, Professor,” replied Ned. “As a whaler I have followed many a cetacean, harpooned a great number, and killed several; but, however strong or well-armed they may have been, neither their tails nor their weapons would have been able even to scratch the iron plates of a steamer.” “But, Ned, they tell of ships which the teeth of the narwhal have pierced through and through.” “Wooden ships—that is possible,” replied the Canadian, “but I have never seen it done; and, until further proof, I deny that whales, cetaceans, or sea-unicorns could ever produce the effect you describe.” “Well, Ned, I repeat it with a conviction resting on the logic of facts. I believe in the existence of a mammal power fully organised, belonging to the branch of vertebrata, like the whales, the cachalots, or the dolphins, and furnished with a horn of defence of great penetrating power.” “Hum!” said the harpooner, shaking his head with the air of a man who would not be convinced. “Notice one thing, my worthy Canadian,” I resumed. “If such an animal is in existence, if it inhabits the depths of the ocean, if it frequents the strata lying miles below the surface of the water, it must necessarily possess an organisation the strength of which would defy all comparison.” “And why this powerful organisation?” demanded Ned. “Because it requires incalculable strength to keep one’s self in these strata and resist their pressure. Listen to me. Let us admit that the pressure of the atmosphere is represented by the weight of a column of water thirty-two feet high. In reality the column of water would be shorter, as we are speaking of sea water, the density of which is greater than that of fresh water. Very well, when you dive, Ned, as many times 32 feet of water as there are

APPENDIX A. Ned Land

24

above you, so many times does your body bear a pressure equal to that of the atmosphere, that is to say, 15 lb. for each square inch of its surface. It follows, then, that at 320 feet this pressure equals that of 10 atmospheres, of 100 atmospheres at 3,200 feet, and of 1,000 atmospheres at 32,000 feet, that is, about 6 miles; which is equivalent to saying that if you could attain this depth in the ocean, each square three-eighths of an inch of the surface of your body would bear a pressure of 5,600 lb. Ah! my brave Ned, do you know how many square inches you carry on the surface of your body?” “I have no idea, Mr. Aronnax.” “About 6,500; and as in reality the atmospheric pressure is about 15 lb. to the square inch, your 6,500 square inches bear at this moment a pressure of 97,500 lb.” “Without my perceiving it?” ”Without your perceiving it. And if you are not crushed by such a pressure, it is because the air penetrates the interior of your body with equal pressure. Hence perfect equilibrium between the interior and exterior pressure, which thus neutralise each other, and which allows you to bear it without inconvenience. But in the water it is another thing.” “Yes, I understand,” replied Ned, becoming more attentive; “because the water surrounds me, but does not penetrate.” “Precisely, Ned: so that at 32 feet beneath the surface of the sea you would undergo a pressure of 97,500 lb.; at 320 feet, ten times that pressure; at 3,200 feet, a hundred times that pressure; lastly, at 32,000 feet, a thousand times that pressure would be 97,500,000 lb.—that is to say, that you would be flattened as if you had been drawn from the plates of a hydraulic machine!” “The devil!” exclaimed Ned. “Very well, my worthy harpooner, if some vertebrate, several hundred yards long, and large in proportion, can maintain itself in such depths—of those whose surface is represented by millions of square inches, that is by tens of millions of pounds, we must estimate

APPENDIX A. Ned Land

25

the pressure they undergo. Consider, then, what must be the resistance of their bony structure, and the strength of their organisation to withstand such pressure!” “Why!” exclaimed Ned Land, “they must be made of iron plates eight inches thick, like the armoured frigates.” “As you say, Ned. And think what destruction such a mass would cause, if hurled with the speed of an express train against the hull of a vessel.” “Yes—certainly—perhaps,” replied the Canadian, shaken by these figures, but not yet willing to give in. “Well, have I convinced you?” “You have convinced me of one thing, sir, which is that, if such animals do exist at the bottom of the seas, they must necessarily be as strong as you say.” “But if they do not exist, mine obstinate harpooner, how explain the accident to the Scotia?”

26

APPENDIX B

AT A VENTURE

The voyage of the Abraham Lincoln was for a long time marked by no special incident. But one circumstance happened which showed the wonderful dexterity of Ned Land, and proved what confidence we might place in him. The 30th of June, the frigate spoke some American whalers, from whom we learned that they knew nothing about the narwhal. But one of them, the captain of the Monroe, knowing that Ned Land had shipped on board the Abraham Lincoln, begged for his help in chasing a whale they had in sight. Commander Farragut, desirous of seeing Ned Land at work, gave him permission to go on board the Monroe. And fate served our Canadian so well that, instead of one whale, he harpooned two with a double blow, striking one straight to the heart, and catching the other after some minutes’ pursuit. Decidedly, if the monster ever had to do with Ned Land’s harpoon, I would not bet in its favour. The frigate skirted the south-east coast of America with great rapidity. The 3rd of July we were at the opening of the Straits of Magellan, level with Cape Vierges. But Commander Farragut would not take a tortuous passage, but doubled Cape Horn. The ship’s crew agreed with him. And certainly it was possible that they might meet the narwhal in this narrow pass. Many of the sailors affirmed that the monster could not pass there, “that he was too big for that!” The 6th of July, about three o’clock in the afternoon, the Abraham Lincoln, at fifteen miles to the south, doubled the solitary island, this lost rock at the extremity of the American continent, to which some Dutch sailors gave the name of their native town, Cape Horn. The course was taken towards the north-west, and the next day the screw of the frigate was

APPENDIX B. At a Venture

27

at last beating the waters of the Pacific. “Keep your eyes open!” called out the sailors. And they were opened widely. Both eyes and glasses, a little dazzled, it is true, by the prospect of two thousand dollars, had not an instant’s repose. I myself, for whom money had no charms, was not the least attentive on board. Giving but few minutes to my meals, but a few hours to sleep, indifferent to either rain or sunshine, I did not leave the poop of the vessel. Now leaning on the netting of the forecastle, now on the taffrail, I devoured with eagerness the soft foam which whitened the sea as far as the eye could reach; and how often have I shared the emotion of the majority of the crew, when some capricious whale raised its black back above the waves! The poop of the vessel was crowded on a moment. The cabins poured forth a torrent of sailors and officers, each with heaving breast and troubled eye watching the course of the cetacean. I looked and looked till I was nearly blind, whilst Conseil kept repeating in a calm voice: “If, sir, you would not squint so much, you would see better!” But vain excitement! The Abraham Lincoln checked its speed and made for the animal signalled, a simple whale, or common cachalot, which soon disappeared amidst a storm of abuse. But the weather was good. The voyage was being accomplished under the most favourable auspices. It was then the bad season in Australia, the July of that zone corresponding to our January in Europe, but the sea was beautiful and easily scanned round a vast circumference. The 20th of July, the tropic of Capricorn was cut by 105d of longitude, and the 27th of the same month we crossed the Equator on the 110th meridian. This passed, the frigate took a more decided westerly direction, and scoured the central waters of the Pacific. Commander Farragut thought, and with reason, that it was better to remain in deep water, and keep clear of continents or islands, which the beast itself seemed to shun (perhaps because there was not enough water for him! suggested the greater part of the crew). The frigate passed at some distance from the Marquesas and the Sandwich Islands, crossed the tropic

APPENDIX B. At a Venture

28

of Cancer, and made for the China Seas. We were on the theatre of the last diversions of the monster: and, to say truth, we no longer LIVED on board. The entire ship’s crew were undergoing a nervous excitement, of which I can give no idea: they could not eat, they could not sleep–twenty times a day, a misconception or an optical illusion of some sailor seated on the taffrail, would cause dreadful perspirations, and these emotions, twenty times repeated, kept us in a state of excitement so violent that a reaction was unavoidable. And truly, reaction soon showed itself. For three months, during which a day seemed an age, the Abraham Lincoln furrowed all the waters of the Northern Pacific, running at whales, making sharp deviations from her course, veering suddenly from one tack to another, stopping suddenly, putting on steam, and backing ever and anon at the risk of deranging her machinery, and not one point of the Japanese or American coast was left unexplored. The warmest partisans of the enterprise now became its most ardent detractors. Reaction mounted from the crew to the captain himself, and certainly, had it not been for the resolute determination on the part of Captain Farragut, the frigate would have headed due southward. This useless search could not last much longer. The Abraham Lincoln had nothing to reproach herself with, she had done her best to succeed. Never had an American ship’s crew shown more zeal or patience; its failure could not be placed to their charge– there remained nothing but to return. This was represented to the commander. The sailors could not hide their discontent, and the service suffered. I will not say there was a mutiny on board, but after a reasonable period of obstinacy, Captain Farragut (as Columbus did) asked for three days’ patience. If in three days the monster did not appear, the man at the helm should give three turns of the wheel, and the Abraham Lincoln would make for the European seas. This promise was made on the 2nd of November. It had the effect of rallying the ship’s crew. The ocean was watched with renewed attention. Each one wished for a last glance in which to sum up his remembrance. Glasses were used with feverish activity. It was a grand

APPENDIX B. At a Venture

29

defiance given to the giant narwhal, and he could scarcely fail to answer the summons and “appear.”

E = mc2

(7)

Two days passed, the steam was at half pressure; a thousand schemes were tried to attract the attention and stimulate the apathy of the animal in case it should be met in those parts. Large quantities of bacon were trailed in the wake of the ship, to the great satisfaction (I must say) of the sharks. Small craft radiated in all directions round the Abraham Lincoln as she lay to, and did not leave a spot of the sea unexplored. But the night of the 4th of November arrived without the unveiling of this submarine mystery. The next day, the 5th of November, at twelve, the delay would (morally speaking) expire; after that time, Commander Farragut, faithful to his promise, was to turn the course to the south-east and abandon for ever the northern regions of the Pacific. The frigate was then in [email protected] 15’ N. lat. and [email protected] 42’ E. long. The coast of Japan still remained less than two hundred miles to leeward. Night was approaching. They had just struck eight bells; large clouds veiled the face of the moon, then in its first quarter. The sea undulated peaceably under the stern of the vessel. At that moment I was leaning forward on the starboard netting. Conseil, standing near me, was looking straight before him. The crew, perched in the ratlines, examined the horizon which contracted and darkened by degrees. Officers with their night glasses scoured the growing darkness: sometimes the ocean sparkled under the rays of the moon, which darted between two clouds, then all trace of light was lost in the darkness. In looking at Conseil, I could see he was undergoing a little of the general influence. At least I thought so. Perhaps for the first time his nerves vibrated to a sentiment of curiosity. “Come, Conseil,” said I, “this is the last chance of pocketing the two thousand dollars.” “May I be permitted to say, sir,” replied Conseil, “that I never reckoned on getting the prize; and, had the government of the Union offered a hundred thousand dollars, it would

APPENDIX B. At a Venture

30

have been none the poorer.” “You are right, Conseil. It is a foolish affair after all, and one upon which we entered too lightly. What time lost, what useless emotions! We should have been back in France six months ago.” “In your little room, sir,” replied Conseil, “and in your museum, sir; and I should have already classed all your fossils, sir. And the Babiroussa would have been installed in its cage in the Jardin des Plantes, and have drawn all the curious people of the capital!” “As you say, Conseil. I fancy we shall run a fair chance of being laughed at for our pains.” “That’s tolerably certain,” replied Conseil, quietly; “I think they will make fun of you, sir. And, must I say it—?” “Go on, my good friend.” “Well, sir, you will only get your deserts.” “Indeed!” “When one has the honour of being a savant as you are, sir, one should not expose one’s self to—”

E = mc2

(8)

Conseil had not time to finish his compliment. In the midst of general silence a voice had just been heard. It was the voice of Ned Land shouting: “Look out there! The very thing we are looking for—on our weather beam!”

31

APPENDIX C

PROGRAM LISTINGS

This (obviously) isn’t in the original Jules Verne story, either. Instead, this appendix includes a few implementations of the Cyclic Redundancy Check (CRC) algorithm, as Matlab code, C code, C++ code, and Java code, just to demonstrate the listings package.

C.1

CRC in C

Some text describing this file. Some other text that might take two or more lines so I’ll just keep typing and typing. One day I’ll actually hit a linewrap, and then we will be sure to see the effect. In Listing 1, you’ll find a C implementation of the CRC-16 algorithm. /* +++ Date last modified : 05-Jul -1997 */

1

# define POLY 0x8408 /* // 6

16

// this is the CCITT CRC 16 polynomial X

+ X

+ X

12

+ 1.

// This works out to be 0x1021 , but the way the algorithm works // lets us use 0 x8408 (the reverse of the bit pattern ).

The high

// bit is always assumed to be set , thus we only use 16 bits to // represent the 17 bit value . 11

*/

# include "crc.h"

16

WORD crc16 (char *data_p , WORD length ) { unsigned char i; unsigned int data; unsigned int crc = 0xffff;

21

if ( length == 0) return (~ crc);

5

APPENDIX C. Program Listings

32

do {

26

for (i = 0, data = ( unsigned int) 0xff & * data_p↓ ++; i < 8; i++, data >>= 1) { if (( crc & 0x0001) ^ (data & 0x0001)) crc = (crc >> 1) ^ POLY; else crc >>= 1; }



31

} while (-- length );

36

crc = ~crc; data = crc; crc = (crc << 8) | (( data >> 8) & 0xff); 41

return (crc); } Listing 1: (crc16.c) The CRC-16 algorithm in C.

C.2

CRC in Matlab

Some text describing this file. Some other text that might take two or more lines so I’ll just keep typing and typing. One day I’ll actually hit a linewrap, and then we will be sure to see the effect. In Listing 2, you’ll find a Matlab implementation of the CRC-8 algorithm. 1

function code=crc( msg )

2

% function for row by row encoding of msg

% generator polynomial

generator = [1 0 0 0 0 0 1 1 1]; 7

c = [1 0 0 0 0 0 0 0 0];

% x^k

for k=1: size(msg ,1) multip =conv(c,msg(k ,:));

% 8bit CRC

APPENDIX C. Program Listings

12

33

[divid , remainder ]= deconv (multip , generator ); remainder =mod(remainder ,2); code(k ,:)=xor(multip , remainder ); end Listing 2: (crc8.m) The CRC-8 algorithm in Matlab

C.3

CRC in C++

Some text describing this file. Some other text that might take two or more lines so I’ll just keep typing and typing. One day I’ll actually hit a linewrap, and then we will be sure to see the effect. In Listing 3, you’ll find a C++ implementation of the CRC-32 algorithm. // +++ Date last modified : 05-Jul -1997

1

/*

6

**

CRC Calculator by Paul Johnston

**

Version 1.0 Copyright 10/9/96 ( September )

**

Explicitly released to the public domain 30-Oct -1996 by the author

*/

# include "crc.hpp" 11

unsigned long Reflect ( unsigned long toref , char w) { unsigned long v = 0; for (int i = 1; i < (w + 1); i++) { if (toref & 1L) v |= 1L << (w - i); toref >>= 1; } return v;

16

21

}

26

unsigned long CrcCalc :: Add ( unsigned long crc , char *sCrc)

APPENDIX C. Program Listings

34

{ crc ^= crxo; if (fcrr) { while (* sCrc) crc = (crc >> 8) ^ acrpt [( crc & 0xFF) ^ *sCrc↓ ++]; } else { while (* sCrc) crc = (crc << 8) ^ acrpt [(( crc >> (crwd - 8)) & ↓ 0xFF) ^ *sCrc ++]; } return (crc ^ crxo) & (-1l >> (32 - crwd));

31



36



41

46

51



56

→ →

} unsigned long CrcCalc :: Add ( unsigned long crc , PData sCrc) { crc ^= crxo; if (fcrr) { while (sCrc.l--) crc = (crc >> 8) ^ acrpt [( crc & 0xFF) ^ *(( unsigned char *) ↓ sCrc.pData)++]; } else { while (sCrc.l--) crc = (crc << 8) ^ acrpt [(( crc >> (crwd - 8)) & ↓ 0xFF) ^ *(( unsigned char *) ↓ sCrc.pData)++]; } return (crc ^ crxo) & (-1l >> (32 - crwd)); }

61

66

unsigned long CrcCalc :: Add ( unsigned long crc , unsigned char sCrc) { crc ^= crxo; if (fcrr) crc = (crc >> 8) ^ acrpt [( crc & 0xFF) ^ sCrc ];

APPENDIX C. Program Listings

else crc = (crc << 8) ^ acrpt [(( crc >> (crwd - 8)) & 0xFF↓ ) ^ sCrc ]; return (crc ^ crxo) & (-1l >> (32 - crwd));

→ 71

76



81

86

91

96

101

106



35

} unsigned long CrcCalc :: Init () { return fcrr ? Reflect (crgi , crwd) ^ crxo : crgi ^ ↓ crxo; } CrcCalc :: CrcCalc (Crst crst) { switch (crst) { case Crc16: InitCalc (0 x1021l , 0xFFFFl , 0l, 0, 16); break ; case Crc32: InitCalc (0 x04C11DB7l , -1l, -1l, 1, 32); break ; case JamCrc : InitCalc (0 x04C11DB7l , -1l, 0l, 1, 32); break ; case XModemCrc : InitCalc (0 x8408l , 0l, 0l, 1, 16); break ; case ZModemCrc16 : InitCalc (0 x1021l , 0l, 0l, 0, 16); break ; case ZModemCrc32 : InitCalc (0 x04C11DB7l , -1l, -1l, 1, 32); break ; } } CrcCalc :: CrcCalc ( unsigned long crpNew , unsigned long crgiNew , unsigned long crxoNew , unsigned char fcrrNew , unsigned char ↓ crwdNew ) { InitCalc (crpNew , crgiNew , crxoNew , fcrrNew , crwdNew );

APPENDIX C. Program Listings

36

} 111

116



121

void CrcCalc :: InitCalc ( unsigned long unsigned long unsigned long unsigned char crwdNew ) { crp = crpNew ; crgi = crgiNew ; crxo = crxoNew ; fcrr = fcrrNew ; crwd = crwdNew ;

crpNew , crgiNew , crxoNew , fcrrNew , unsigned char ↓

// Calculate look -up table

for ( unsigned long i = 0; i <= 0xFF; i++) { acrpt[i] = (fcrr ? Reflect (i, 8) : i) << (crwd - ↓ 8); for ( unsigned long j = 0; j < 8; j++) acrpt[i] = (acrpt[i] << 1) ^ (acrpt[i] & (1l << (crwd - ↓ 1)) ? crp : 0); if (fcrr) acrpt[i] = Reflect (acrpt[i], crwd); }

126



131



} Listing 3: (crc32.cxx) The CRC-32 algorithm in C++

C.4

CRC in Java

Some text describing this file. Some other text that might take two or more lines so I’ll just keep typing and typing. One day I’ll actually hit a linewrap, and then we will be sure to see the effect. In Listing 4, you’ll find a Java implementation of the CRC-32 algorithm. 1

/** * This program reads a file and generates the checksum .

APPENDIX C. Program Listings

37

* The CheckedInputStream class is an example of the Strategy pattern * 5

* @author Greg Gagne - May 2001 */

import java.io .*; import java.util.zip .*; 10



public class CheckSum { public static void main ( String [] args) throws ↓ IOException { CheckedInputStream inFile = null;

15

// generate the checksum using the CRC32 algorithm

Checksum cs = new CRC32 (); // check for necessary parameters 20



25

→ 30

35



40

if (args. length != 1) { System .err. println ("Usage: CheckSum "); System .exit (0); } else { try { inFile = new CheckedInputStream (new ↓ FileInputStream (args [0]) , cs); int data; while (( data = inFile .read ()) != -1) ; } catch ( FileNotFoundException fnfe) { System .err. println ("File " + args [0] + " not ↓ found."); } finally { if ( inFile != null) inFile .close (); }

APPENDIX C. Program Listings

38

System .out. println ("The checksum of the input ↓ file is " + inFile . getChecksum ().↓ getValue ());

→ 45

→ } } }

Listing 4: (crc32.java) The CRC-32 algorithm in Java (gee, that was easy: the CRC32 computation is built in to Java.)

And that’s the end of this demonstration.

39

REFERENCES

[1] Aamport, L. A., “The gnats and gnus document preparation system,” G-Animal’s Journal, vol. 41, pp. 73+, July 1986. This is a full ARTICLE entry. 1 [2] Knuth, D. E., Fundamental Algorithms, vol. 1 of The Art of Computer Programming, section 1.2, pp. 10–119. Reading, Massachusetts: Addison-Wesley, second ed., 10 Jan. 1973. This is a full INBOOK entry. 1.5 [3] Knuth, D. E., Seminumerical Algorithms, vol. 2 of The Art of Computer Programming. Reading, Massachusetts: Addison-Wesley, second ed., 10 Jan. 1981. This is a full BOOK entry. 1.5 [4] Lincoll, D. D., “Semigroups of recurrences,” in High Speed Computer and Algorithm Organization (Lipcoll, D. J., Lawrie, D. H., and Sameh, A. H., eds.), no. 23 in Fast Computers, part 3, pp. 179–183, New York: Academic Press, third ed., Sept. 1977. This is a full INCOLLECTION entry. 2 [5] Missilany, J.-B., “Handing out random pamphlets in airports.” Handed out at O’Hare, Oct. 1984. This is a full MISC entry. 2 [6] Oaho, A. V., Ullman, J. D., and Yannakakis, M., “On notions of information transfer in VLSI circuits,” in Proc. Fifteenth Annual ACM Symposium on the Theory of Computing (Oz, W. V. and Yannakakis, M., eds.), no. 17 in All ACM Conferences, (Boston), pp. 133–139, The OX Association for Computing Machinery, Academic Press, Mar. 1983. This is a full INPROCEDINGS entry. 2.2 [7] Oz, W. V. and Yannakakis, M., eds., Proc. Fifteenth Annual Symposium on the Theory of Computing, no. 17 in All ACM Conferences, (Boston), The OX Association for Computing Machinery, Academic Press, Mar. 1983. This is a full PROCEEDINGS entry. 3

40

INDEX

Symbols @ sign . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 B box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 dimensions of. . . . . . . . . . . . . . . . . . . .3 parameters . . . . . . . . . . . . . . . . . . . . . . 2 D dimensions figure . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 rule height . . . . . . . . . . . . . . . . . . . . . . . . . 2 width . . . . . . . . . . . . . . . . . . . . . . . . . 2 table . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 F fonts

Computer Modern . . . . . . . . . . . . . . . 3 PostScript . . . . . . . . . . . . . . . . . . . . . 2, 3 foo bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 I \index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 \index* . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 L EX program . . . . . . . . . . . . . . . . . . . . . . . 3

LAT

R rule depth . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 width . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

41

VITA

Jules Verne was a really good writer from the Nineteenth century. He wrote a number of novels which today would be classified as “science fiction,” including From the Earth to the Moon and Around the World in 80 days, as well as 20,000 Leagues Under the Sea.