Clojure Data Analysis Cookbook 2nd Edition Eric Rochester download
Clojure Data Analysis Cookbook 2nd Edition Eric Rochester download
https://ebookname.com/product/clojure-data-analysis-cookbook-2nd-
edition-eric-rochester/
https://ebookname.com/product/clojure-data-analysis-cookbook-1st-
edition-eric-rochester/
https://ebookname.com/product/clojure-data-structures-and-
algorithms-cookbook-25-recipes-to-deeply-understand-and-
implement-advanced-algorithms-in-clojure-1st-edition-rafik-
naccache/
https://ebookname.com/product/haskell-data-analysis-cookbook-1st-
edition-nishant-shukla/
https://ebookname.com/product/oral-microbiology-and-
immunology-2nd-edition-richard-j-lamont/
Alcohol No Ordinary Commodity Research and Public
Policy 2nd Edition Thomas F. Babor
https://ebookname.com/product/alcohol-no-ordinary-commodity-
research-and-public-policy-2nd-edition-thomas-f-babor/
https://ebookname.com/product/tresch-and-aronow-s-cardiovascular-
disease-in-the-elderly-5th-edition-wilbert-s-aronow-editor/
https://ebookname.com/product/the-norton-anthology-of-english-
literature-the-romantic-period-vol-d-10th-edition-stephen-
greenblatt/
https://ebookname.com/product/the-bomb-a-life-48940th-edition-
gerard-j-de-groot/
https://ebookname.com/product/fundamentals-of-project-management-
developing-core-competencies-to-help-outperform-the-
competition-2nd-ed-edition-james-p-lewis/
Air Plants Epiphytes and Aerial Gardens 1st Edition
David H. Benzing
https://ebookname.com/product/air-plants-epiphytes-and-aerial-
gardens-1st-edition-david-h-benzing/
Clojure Data Analysis
Cookbook
Second Edition
Eric Rochester
BIRMINGHAM - MUMBAI
Clojure Data Analysis Cookbook
Second Edition
All rights reserved. No part of this book may be reproduced, stored in a retrieval system,
or transmitted in any form or by any means, without the prior written permission of the
publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the
information presented. However, the information contained in this book is sold without
warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers
and distributors will be held liable for any damages caused or alleged to be caused directly
or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.
ISBN 978-1-78439-029-7
www.packtpub.com
Credits
Reviewers Proofreaders
Vitomir Kovanovic Ameesha Green
Muktabh Mayank Srivastava Joel T. Johnson
Federico Tomassetti Samantha Lyon
Eric Rochester enjoys reading, writing, and spending time with his wife and kids. When
he’s not doing these things, he programs in a variety of languages and platforms, including
websites and systems in Python, and libraries for linguistics and statistics in C#. Currently,
he is exploring functional programming languages, including Clojure and Haskell. He works
at Scholars’ Lab in the library at the University of Virginia, helping humanities professors and
graduate students realize their digitally informed research agendas. He is also the author of
Mastering Clojure Data Analysis, Packt Publishing.
A special thanks to Jackie, Melina, and Micah. They’ve been patient and
supportive while I worked on this project. It is, in every way, for them.
About the Reviewers
His new venture is ParallelDots. It is a tool that allows any content archive to be presented
in a story using advanced techniques of NLP and machine learning. For publishers and
bloggers, it automatically creates a timeline of any event using their archive and presents
it in an interactive, intuitive, and easy-to-navigate interface on their webpage. You can find
him on LinkedIn at http://in.linkedin.com/in/muktabh/ and on Twitter at
@muktabh / @ParallelDots.
Federico Tomassetti has been programming since he was a child and has a PhD
in software engineering. He works as a consultant on model-driven development and
domain-specific languages, writes technical articles, teaches programming, and works as
a full-stack software engineer.
He has experience working in Italy, Germany, and Ireland, and he is currently working
at Groupon International.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub
files available? You can upgrade to the eBook version at www.PacktPub.com and as a print
book customer, you are entitled to a discount on the eBook copy. Get in touch with us at
service@packtpub.com for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up
for a range of free newsletters and receive exclusive discounts and offers on Packt books
and eBooks.
TM
https://www2.packtpub.com/books/subscription/packtlib
Do you need instant solutions to your IT questions? PacktLib is Packt’s online digital book
library. Here, you can search, access, and read Packt’s entire library of books.
Why subscribe?
f Fully searchable across every book published by Packt
f Copy and paste, print, and bookmark content
f On demand and accessible via a web browser
ii
Table of Contents
iii
Table of Contents
iv
Table of Contents
v
Preface
Welcome to the second edition of Clojure Data Analysis Cookbook! It seems that books
become obsolete almost as quickly as software does, so here we have the opportunity to
keep things up-to-date and useful.
Moreover, the state of the art of data analysis is also still evolving and changing. The
techniques and technologies are being refined and improved. Hopefully, this book will capture
some of that. I've also added a new chapter on how to work with unstructured textual data.
In spite of these changes, some things have stayed the same. Clojure has further proven
itself to be an excellent environment to work with data. As a member of the lisp family of
languages, it inherits a flexibility and power that is hard to match. The concurrency and
parallelization features have further proven themselves as great tools for developing
software and analyzing data.
Clojure's usefulness for data analysis is further improved by a number of strong libraries.
Incanter provides a practical environment to work with data and perform statistical analysis.
Cascalog is an easy-to-use wrapper over Hadoop and Cascading. Finally, when you're ready
to publish your results, ClojureScript, an implementation of Clojure that generates JavaScript,
can help you to visualize your data in an effective and persuasive way.
Moreover, Clojure runs on the Java Virtual Machine (JVM), so any libraries written for Java are
available too. This gives Clojure an incredible amount of breadth and power.
I hope that this book will give you the tools and techniques you need to get answers from
your data.
Preface
Chapter 4, Improving Performance with Parallel Programming, covers how to use Clojure's
parallel processing capabilities to speed up the processing of data.
Chapter 5, Distributed Data Processing with Cascalog, covers how to use Cascalog as a
wrapper over Hadoop and the Cascading library to process large amounts of data distributed
over multiple computers.
Chapter 6, Working with Incanter Datasets, covers the basics of working with Incanter
datasets. Datasets are the core data structures used by Incanter, and understanding them is
necessary in order to use Incanter effectively.
Chapter 7, Statistical Data Analysis with Incanter, covers a variety of statistical processes and
tests used in data analysis. Some of these are quite simple, such as generating summary
statistics. Others are more complex, such as performing linear regressions and auditing data
with Benford's Law.
Chapter 8, Working with Mathematica and R, talks about how to set up Clojure in order to talk
to Mathematica or R. These are powerful data analysis systems, and we might want to use
them sometimes. This chapter will show you how to get these systems to work together, as
well as some tasks that you can perform once they are communicating.
Chapter 9, Clustering, Classifying, and Working with Weka, covers more advanced machine
learning techniques. In this chapter, we'll primarily use the Weka machine learning library.
Some recipes will discuss how to use it and the data structures its built on, while other recipes
will demonstrate machine learning algorithms.
Chapter 10, Working with Unstructured and Textual Data, looks at tools and techniques used
to extract information from the reams of unstructured, textual data.
Chapter 11, Graphing in Incanter, shows you how to generate graphs and other visualizations
in Incanter. These can be important for exploring and learning about your data and also for
publishing and presenting your results.
Chapter 12, Creating Charts for the Web, shows you how to set up a simple web application in
order to present findings from data analysis. It will include a number of recipes that leverage
the powerful D3 visualization library.
2
Preface
The other major piece of software that you'll need is Leiningen 2, which you can download
and install from http://leiningen.org/. Leiningen 2 is a tool used to manage Clojure
projects and their dependencies. It has become the de facto standard project tool in the
Clojure community.
Throughout this book, we'll use a number of other Clojure and Java libraries, including Clojure
itself. Leiningen will take care of downloading these for us as we need them.
You'll also need a text editor or Integrated Development Environment (IDE). If you already have
a text editor of your choice, you can probably use it. See http://clojure.org/getting_
started for tips and plugins for using your particular favorite environment. If you don't have a
preference, I'd suggest that you take a look at using Eclipse with Counterclockwise. There are
instructions to this set up at https://code.google.com/p/counterclockwise/.
That is all that's required. However, at various places throughout the book, some recipes will
access other software. The recipes in Chapter 8, Working with Mathematica and R, that are
related to Mathematica will require Mathematica, obviously, and those that are related to R
will require that. However, these programs won't be used in the rest of the book, and whether
you're interested in those recipes might depend on whether you already have this software.
Likewise, you don't have to be an expert on data analysis, although you should probably be
familiar with its tasks, processes, and techniques. While you might be able to glean enough
from these recipes to get started with, for it to be truly effective, you'll want to get a more
thorough introduction to this field.
3
Preface
Conventions
In this book, you will find a number of styles of text that distinguish between different kinds of
information. Here are some examples of these styles, and an explanation of their meaning.
Code words in text, database table names, folder names, filenames, file extensions,
pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "Now, there
will be a new subdirectory named getting-data.
When we wish to draw your attention to a particular part of a code block, the relevant lines or
items are set in bold:
(defn watch-debugging
[input-file]
(let [reader (agent
(seque
(mapcat
lazy-read-csv
input-files)))
caster (agent nil)
sink (agent [])
counter (ref 0)
done (ref false)]
(add-watch caster :counter
(partial watch-caster counter))
(add-watch caster :debug debug-watch)
(send reader read-row caster sink done)
(wait-for-it 250 done)
{:results @sink
:count-watcher @counter}))
4
Preface
New terms and important words are shown in bold. Words that you see on the screen,
in menus or dialog boxes for example, appear in the text like this: "Take a look at the
Hadoop website for the Getting Started documentation of your version. Get a single
node setup working".
Reader feedback
Feedback from our readers is always welcome. Let us know what you think about this
book—what you liked or may have disliked. Reader feedback is important for us to develop
titles that you really get the most out of.
If there is a topic that you have expertise in and you are interested in either writing or
contributing to a book, see our author guide on www.packtpub.com/authors.
Customer support
Now that you are the proud owner of a Packt book, we have a number of things to help you to
get the most from your purchase.
5
Preface
Errata
Although we have taken every care to ensure the accuracy of our content, mistakes do happen.
If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be
grateful if you could report this to us. By doing so, you can save other readers from frustration
and help us improve subsequent versions of this book. If you find any errata, please report them
by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on
the Errata Submission Form link, and entering the details of your errata. Once your errata are
verified, your submission will be accepted and the errata will be uploaded to our website or
added to any list of existing errata under the Errata section of that title.
Piracy
Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt,
we take the protection of our copyright and licenses very seriously. If you come across any
illegal copies of our works, in any form, on the Internet, please provide us with the location
address or website name immediately so that we can pursue a remedy.
We appreciate your help in protecting our authors, and our ability to bring you
valuable content.
Questions
You can contact us at questions@packtpub.com if you are having a problem with any
aspect of the book, and we will do our best to address it.
6
Importing Data for
1
Analysis
In this chapter, we will cover the following recipes:
Introduction
There's not much data analysis that can be done without data, so the first step in any project
is to evaluate the data we have and the data that we need. Once we have some idea of what
we'll need, we have to figure out how to get it.
Importing Data for Analysis
Many of the recipes in this chapter and in this book use Incanter (http://incanter.org/)
to import the data and target Incanter datasets. Incanter is a library that is used for statistical
analysis and graphics in Clojure (similar to R) an open source language for statistical
computing (http://www.r-project.org/). Incanter might not be suitable for every task
(for example, we'll use the Weka library for machine learning later) but it is still an important
part of our toolkit for doing data analysis in Clojure. This chapter has a collection of recipes
that can be used to gather data and make it accessible to Clojure.
For the very first recipe, we'll take a look at how to start a new project. We'll start with very
simple formats such as comma-separated values (CSV) and move into reading data from
relational databases using JDBC. We'll examine more complicated data sources, such as
web scraping and linked data (RDF).
We'll use Leiningen for this (http://leiningen.org/). This has become a standard
package automation and management system.
Getting ready
Visit the Leiningen site and download the lein script. This will download the Leiningen JAR
file when it's needed. The instructions are clear, and it's a simple process.
How to do it...
To generate a new project, use the lein new command, passing the name of the project
to it:
$ lein new getting-data
Generating a project called getting-data based on the default template.
To see other templates (app, lein plugin, etc), try lein help new.
There will be a new subdirectory named getting-data. It will contain files with stubs for the
getting-data.core namespace and for tests.
8
Chapter 1
How it works...
The new project directory also contains a file named project.clj. This file contains
metadata about the project, such as its name, version, license, and more. It also contains
a list of the dependencies that our code will use, as shown in the following snippet. The
specifications that this file uses allow it to search Maven repositories and directories of
Clojure libraries (Clojars, https://clojars.org/) in order to download the project's
dependencies. Thus, it integrates well with Java's own packaging system as developed with
Maven (http://maven.apache.org/).
(defproject getting-data "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.6.0"]])
In the Getting ready section of each recipe, we'll see the libraries that we need to list in the
:dependencies section of this file. Then, when you run any lein command, it will download
the dependencies first.
Getting ready
First, let's make sure that we have the correct libraries loaded. Here's how the project
Leiningen (https://github.com/technomancy/leiningen) project.clj file should
look (although you might be able to use more up-to-date versions of the dependencies):
(defproject getting-data "0.1.0-SNAPSHOT"
:dependencies [[org.clojure/clojure "1.6.0"]
[incanter "1.5.5"]])
9
Importing Data for Analysis
Finally, downloaded a list of rest area locations from POI Factory at http://www.poi-
factory.com/node/6643. The data is in a file named data/RestAreasCombined(Ver.
BN).csv. The version designation might be different though, as the file is updated. You'll also
need to register on the site in order to download the data. The file contains this data, which is
the location and description of the rest stops along the highway:
-67.834062,46.141129,"REST AREA-FOLLOW SIGNS SB I-95 MM305","RR, PT,
Pets, HF"
-67.845906,46.138084,"REST AREA-FOLLOW SIGNS NB I-95 MM305","RR, PT,
Pets, HF"
-68.498471,45.659781,"TURNOUT NB I-95 MM249","Scenic Vista-NO
FACILITIES"
-68.534061,45.598464,"REST AREA SB I-95 MM240","RR, PT, Pets, HF"
In the project directory, we have to create a subdirectory named data and place the file in
this subdirectory.
I also created a copy of this file with a row listing the names of the columns and named it
RestAreasCombined(Ver.BN)-headers.csv.
How to do it…
1. Now, use the incanter.io/read-dataset function in your REPL:
user=> (read-dataset "data/RestAreasCombined(Ver.BJ).csv")
10
Exploring the Variety of Random
Documents with Different Content
take part in the fighting, they may not directly be attacked and killed
or wounded, although they are exposed to all injury indirectly
resulting from an attack on or by their vessel. If they are mere
private individuals, they may as an exception only and under the
same circumstances as private individuals on occupied territory be
made prisoners of war.[411] But they are nevertheless, for the time
they are on board the captured vessel, under the discipline of the
captor. All restrictive measures against them which are necessary are
therefore lawful, as are also punishments, in case they do not
comply with lawful orders of the commanding officer. If they are
enemy officials in important positions,[412] they may be made
prisoners of war.
[411] See U.S. Naval War Code, article 11, and above, § 116.
[412] See above, § 117.
V
TREATMENT OF WOUNDED AND SHIPWRECKED
Hospital Ships.
§ 206. Three different kinds of hospital ships must be
distinguished—namely, military hospital ships, hospital ships
equipped by private individuals or relief societies of the belligerents,
and hospital ships equipped by private neutral individuals and
neutral relief societies.
(1) Military hospital ships (article 1) are ships constructed or
assigned by States specially and solely for the purpose of assisting
the wounded, sick, and shipwrecked. Their names must be
communicated to the belligerents at the commencement of or during
hostilities, and in any case before they are employed. They must be
respected by the belligerents, they may not be captured while
hostilities last, and they are not on the same footing as men-of-war
during their stay in a neutral port.
(2) Hospital ships equipped wholly or in part at the cost of private
individuals or officially recognised relief societies of the belligerents
must be respected by either belligerent (article 2), and are exempt
from capture, provided their home State has given them an official
commission and has notified their names to the other belligerent at
the commencement of or during hostilities, and in any case before
they are employed. They must, further, be furnished with a
certificate from the competent authorities declaring that they had
been under the latter's control while fitting out and on final
departure.
(3) Hospital ships, equipped wholly or in part at the cost of private
individuals or officially recognised relief societies of neutral States
(article 3), must likewise be respected, and are exempt from
capture, provided that they are placed under the control of one of
the belligerents, with the previous consent of their own Government
and with the authorisation of the belligerent himself, and that the
latter has notified their names to his adversary at the
commencement of, or during, hostilities, and in any case before they
are employed.
According to article 4 all military and other hospital ships must
afford relief and assistance to the wounded, sick, and shipwrecked
of either belligerent. The respective Governments are prohibited
from using these ships for any military purpose. The commanders of
these vessels must not in any way hamper the movements of the
combatants, and during and after an engagement they act at their
own risk and peril. Both belligerents have a right to control and visit
all military and other hospital ships, to refuse their assistance, to
order them off, to make them take a certain course, to put a
commissioner on board, and, lastly, to detain them temporarily, if
important circumstances require this. In case a hospital ship receives
orders from a belligerent, these orders must, as far as possible, be
inscribed in the ship papers.
The protection to which hospital ships are entitled ceases if they
are made use of to commit acts harmful to the enemy[415] (article 8).
But the fact of the staff being armed for the purpose of maintaining
order and defending the wounded and sick, and the fact of the
presence of wireless telegraphic apparatus on board, are not
sufficient reasons for withdrawing protection.
[415] An interesting case of this kind occurred during the Russo-Japanese war. The Aryol
(also called the Orel), a hospital ship of the Russian Red Cross Society, was captured,
and afterwards condemned by the Prize Court on the following grounds:—(a) For having
communicated the orders of the commander-in-chief of the Russian squadron with which
she was sailing to other Russian vessels; (b) for carrying, by order of the commander-in-
chief of the squadron, in order to take them to Vladivostock, the master and some
members of the crew of the British steamship Oldhamia, which had been captured by the
Russians; (c) for having been instructed to purchase in Cape Town, or its neighbourhood,
11,000 ft. of conducting wire of good insulation; (d) for having navigated at the head of
the squadron in the position usually occupied by reconnoitring vessels.—See Takahashi,
pp. 620-625, and Higgins, op. cit. p. 74, and in The Law Quarterly Review, XXVI. (1910),
p. 408.
It must be specially observed that any man-of-war of either
belligerent may, according to article 12, demand the surrender of the
wounded, sick, or shipwrecked who are on board hospital ships of
any kind. According to a reservation by Great Britain, article 12 is
understood "to apply only to the case of combatants rescued during
or after a naval engagement in which they have taken part."
Sick-Bays.
§ 206b. According to article 7, in case of a fight on board a man-
of-war, the sick-bays must, as far as possible, be respected and
spared. These sick-bays, and the material belonging to them, remain
subject to the laws of war; they may not, however, be used for any
purpose other than that for which they were originally intended so
long as they are required for the wounded and sick. But should the
military situation require it, a commander into whose power they
have fallen may nevertheless apply them to other purposes, under
the condition that he previously makes arrangements for proper
accommodation for the wounded and sick on board. The protection
to which sick-bays are entitled ceases if they are made use of to
commit acts harmful to the enemy (article 8). But the fact that the
staff of sick-bays is armed in order to defend the wounded and sick
is not sufficient reason for withdrawing protection.
Distinctive Colour and Emblem of Hospital Ships.
§ 207. All military hospital ships must be painted white outside
with a horizontal band of green about one metre and a half in
breadth. Other hospital ships must also be painted white outside,
but with a horizontal band of red. The boats and small craft of
hospital ships used for hospital work must likewise be painted white.
And besides being painted in this distinguishing colour, all military
and other hospital ships (article 5) must hoist, together with their
national flag, the white flag with a red cross stipulated by the
Geneva Convention. If they belong to a neutral State, they must also
fly at the main mast the national flag of the belligerent under whose
control they are placed. Hospital ships which, under the terms of
article 4, are detained by the enemy, must haul down the national
flag of the belligerent to whom they belong. All hospital ships which
wish to ensure by night the freedom from interference to which they
are entitled, must, subject to the assent of the belligerent they are
accompanying, take the necessary measures to render their special
painting sufficiently plain. According to article 6 the distinguishing
signs mentioned in article 5 may only be used, whether in time of
peace or war, for protecting or indicating the ships therein
mentioned.
Although in this connection the red cross is especially stipulated as
the distinctive emblem, there is no objection to the use by non-
Christian States, who object to the cross on religious grounds, of
another emblem. Thus Turkey reserved the right to use a red
crescent, and Persia to use a red sun.
Neutral Vessels assisting the Wounded, Sick, or Shipwrecked.
§ 208. A distinction must be made between neutral men-of-war
and private vessels assisting the sick, wounded, and shipwrecked.
(1) If men-of-war take on board wounded, sick, or shipwrecked
persons, precaution must be taken, so far as possible, that they do
not again take part in the operations of war (article 13). Such
individuals must not, however, be handed over to the adversary but
must be detained till the end of the war.[416]
(2) Neutral merchantmen,[417] yachts, or boats which have of their
own accord rescued sick, wounded, or shipwrecked men, or who
have taken such men on board at the appeal of the belligerent,
must, according to article 9, enjoy special protection and certain
immunities. In no case may they be captured for the sole reason of
having such persons on board. But, subject to any undertaking that
may have been given to them, they remain liable to capture for any
violation of neutrality they may have committed.
[416] See below, § 348.
[417] See below, § 348a.
VI
ESPIONAGE, TREASON, RUSES
See, besides the literature quoted above at the commencement of §§ 159 and 163,
Pradier-Fodéré, VIII. No. 3157, and Bentwich in The Journal of the Society of
Comparative Legislation, New Series, X. (1909), pp. 243-249.
Ruses.
§ 211. Ruses are customarily allowed in sea warfare within the
same limits as in land warfare, perfidy being excluded. As regards
the use of a false flag, it is by most publicists considered perfectly
lawful for a man-of-war to use a neutral's or the enemy's flag (1)
when chasing an enemy vessel, (2) when trying to escape, and (3)
for the purpose of drawing an enemy vessel into action.[421] On the
other hand, it is universally agreed that immediately before an attack
a vessel must fly her national flag. Halleck (I. p. 568) relates the
following instance: In 1783 the Sybille, a French frigate of thirty-
eight guns, enticed the British man-of-war Hussar by displaying the
British flag and intimating herself to be a distressed prize of a British
captor. The Hussar approached to succour her, but the latter at once
attacked the Hussar without showing the French flag. She was,
however, overpowered and captured, and the commander of the
Hussar publicly broke the sword of the commander of the Sybille,
whom he justly accused of perfidy, although the French commander
was acquitted when subsequently brought to trial by the French
Government. Again, Halleck (I. p. 568) relates: In 1813 two
merchants of New York carried out a plan for destroying the British
man-of-war Ramillies in the following way. A schooner with some
casks of flour on deck was expressly laden with several casks of
gunpowder having trains leading from a species of gunlock, which,
by the action of clockwork, went off at a given time after it had been
set. To entice the Ramillies to seize her, the schooner came up, and
the Ramillies then sent a boat with thirteen men and a lieutenant to
cut her off. Subsequently the crew of the schooner abandoned her
and she blew up with the lieutenant and his men on board.
[421]The use of a false flag on the part of a belligerent man-of-war is analogous to the
use of the enemy flag and the like in land warfare; see above, § 164. British practice—
see Holland, Prize Law, § 200—permits the use of false colours. U.S. Naval War Code,
article 7, forbids it altogether, whereas as late as 1898, during the war with Spain in
consequence of the Cuban insurrection, two American men-of-war made use of the
Spanish flag (see Perels, p. 183). And during the war between Turkey and Russia, in
1877, Russian men-of-war in the Black Sea made use of the Italian flag (see Martens, II.
§ 103, p. 566). The question of the permissibility of the use of a neutral or enemy flag is
answered in the affirmative, among others, by Ortolan, II. p. 29; Fiore, III. No. 1340;
Perels, § 35, p. 183; Pillet, p. 116; Bonfils, No. 1274; Calvo, IV. 2106; Hall, § 187. See
also Pillet in R.G. V. (1898), pp. 444-451. But see the arguments against the use of a
false flag in Pradier-Fodéré, VI. No. 2760.
Vattel (III. § 178) relates the following case of perfidy: In 1755,
during war between Great Britain and France, a British man-of-war
appeared off Calais, made signals of distress for the purpose of
soliciting French vessels to approach to her succour, and seized a
sloop and some sailors who came to bring her help. Vattel is himself
not certain whether this case is a fact or fiction. But be that as it
may, there is no doubt that, if the case be true, it is an example of
perfidy, which is not allowed.
VII
REQUISITIONS, CONTRIBUTIONS, BOMBARDMENT
VIII
INTERFERENCE WITH SUBMARINE TELEGRAPH CABLES
Moore, VII. § 1176—Westlake, II. pp. 280-283—Liszt, § 41, III.—Bonfils, No. 1278—
Pradier-Fodéré, VI. No. 2772—Fiore, III. No. 1387, and Code, Nos. 1650-1655—
Perels, § 35, p. 185—Perdrix, Les câbles sousmarines et leur protection
internationale (1902)—Kraemer, Die unterseeischen Telegraphenkabel in
Kriegszeiten (1903)—Scholz, Krieg und Seekabel (1904)—Zuculin, I cavi
sottomarini e il telegrafo senza fili nel diritto di guerra (1907)—Holland, in Journal
de Droit International Privé et de la Jurisprudence comparée (Clunet), XXV. (1898),
pp. 648-652, and War, No. 114—Goffin, in The Law Quarterly Review, XV. (1899),
pp. 145-154—Bar, in the Archiv für Oeffentliches Recht, XV. (1900), pp. 414-421—
Rey, in R.G. VIII. (1901), pp. 681-762—Dupuis, in R.G. X. (1903), pp. 532-547—
Nordon in The Law Magazine and Review, XXXII. (1907), pp. 166-188. See also the
literature quoted above, vol. I., at the commencement of § 286.
[428]It is impossible for a treatise to discuss the details of the absolutely unsettled
question as to how far belligerents may interfere with submarine telegraph cables.
Readers who take a particular interest in it may be referred to the excellent monograph
of Scholz, Krieg und Seekabel (1904), which discusses the matter thoroughly and ably.
CHAPTER V
NON-HOSTILE RELATIONS OF BELLIGERENTS
I
ON NON-HOSTILE RELATIONS IN GENERAL BETWEEN BELLIGERENTS
Licences to Trade.
§ 217. Several writers[432] speak of non-hostile relations between
belligerents created by licences to trade granted by a belligerent to
enemy subjects either within certain limits or generally. It has been
explained above, in § 101, that it is for Municipal Law to determine
whether or not through the outbreak of war all trade and the like is
prohibited between the subjects of belligerents. If the Municipal Law
of one or both belligerents does contain such a prohibition, it is of
course within the discretion of one or both of them to grant
exceptional licences to trade to their own or the other belligerent's
subjects, and such licences naturally include certain privileges. Thus,
for instance, if a belligerent allows enemy subjects to trade with his
own subjects, enemy merchantmen engaged in such trade are
exempt from capture and appropriation by the grantor. Yet it is not
International Law which creates this exemption, but the very licence
to trade granted by the belligerent and revocable at any moment;
and no non-hostile international relations between the belligerents
themselves originate from such licences. The matter would be
different if, either in time of peace for the time of war, or, during war,
the belligerents agreed to allow certain trade between their subjects;
but non-hostile relations originating from such an agreement would
not be relations arising from a licence to trade, but from a cartel.[433]
[432]See, for instance, Hall, § 196; Halleck, II. pp. 343-363; Lawrence, § 214; Manning,
p. 168; Taylor, § 512; Wheaton, §§ 409-410; Fiore, III. No. 1500; Pradier-Fodéré, VII.
No. 2938.
[433] See below, § 224.
II
PASSPORTS, SAFE-CONDUCTS, SAFEGUARDS
Grotius, III. c. 21, §§ 14-22—Vattel, III. §§ 265-277—Hall, §§ 191 and 195—
Lawrence, § 213—Phillimore, III. §§ 98-102—Halleck, II. pp. 323-328—Taylor, §
511—Wheaton, § 408—Moore, VII. §§ 1158-1159—Bluntschli, §§ 675-678—Heffter,
§ 142—Lueder in Holtzendorff, IV. pp. 525-527—Ullmann, § 185—Bonfils, Nos.
1246-1247—Despagnet, Nos. 558-561—Pradier-Fodéré, VII. Nos. 2884, 2932-2938
—Nys, III. pp. 504-505—Calvo, IV. §§ 2413-2418—Fiore, III. No. 1499, and Code,
Nos. 1742-1749—Longuet, §§ 142-143—Mérignhac, pp. 239-240—Pillet, pp. 359-
360—Kriegsbrauch, p. 41—Holland, War, No. 101—Land Warfare, §§ 326-337.
III
FLAGS OF TRUCE
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookname.com