100% found this document useful (1 vote)
36 views

Reactive Programming with Kotlin Learn Rx with RxJava RxKotlin and RxAndroid 2nd Edition Raywenderlich Tutorial Team & Alex Sullivan download

The document is a promotional material for the book 'Reactive Programming with Kotlin' by Alex Sullivan, which covers RxJava, RxKotlin, and RxAndroid. It includes links to download the book and other related eBooks, along with acknowledgments and information about the authors and editors. The book aims to teach readers about reactive programming and its application in mobile app development using Kotlin.

Uploaded by

cokkyhasyir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
36 views

Reactive Programming with Kotlin Learn Rx with RxJava RxKotlin and RxAndroid 2nd Edition Raywenderlich Tutorial Team & Alex Sullivan download

The document is a promotional material for the book 'Reactive Programming with Kotlin' by Alex Sullivan, which covers RxJava, RxKotlin, and RxAndroid. It includes links to download the book and other related eBooks, along with acknowledgments and information about the authors and editors. The book aims to teach readers about reactive programming and its application in mobile app development using Kotlin.

Uploaded by

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

Reactive Programming with Kotlin Learn Rx with

RxJava RxKotlin and RxAndroid 2nd Edition


Raywenderlich Tutorial Team & Alex Sullivan pdf
download
https://ebookmeta.com/product/reactive-programming-with-kotlin-
learn-rx-with-rxjava-rxkotlin-and-rxandroid-2nd-edition-
raywenderlich-tutorial-team-alex-sullivan/

Download more ebook from https://ebookmeta.com


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

Real World Android by Tutorials Second Edition


Professional App Development With Kotlin Raywenderlich
Tutorial Team

https://ebookmeta.com/product/real-world-android-by-tutorials-
second-edition-professional-app-development-with-kotlin-
raywenderlich-tutorial-team/

RxSwift Reactive Programming with Swift Second Edition


Raywenderlich.Com Team

https://ebookmeta.com/product/rxswift-reactive-programming-with-
swift-second-edition-raywenderlich-com-team/

Flutter Apprentice First Edition Learn to Build Cross


Platform Apps Raywenderlich Tutorial Team

https://ebookmeta.com/product/flutter-apprentice-first-edition-
learn-to-build-cross-platform-apps-raywenderlich-tutorial-team/

Imagine A Vision for Christians in the Arts Steve


Turner

https://ebookmeta.com/product/imagine-a-vision-for-christians-in-
the-arts-steve-turner/
The Plant Contract Art s Return to Vegetal Life 1st
Edition Prudence Gibson

https://ebookmeta.com/product/the-plant-contract-art-s-return-to-
vegetal-life-1st-edition-prudence-gibson/

The Two Faces of Democracy: Decentering Agonism and


Deliberation Mary F. Scudder

https://ebookmeta.com/product/the-two-faces-of-democracy-
decentering-agonism-and-deliberation-mary-f-scudder/

Cricket Radio Tuning in the Night Singing Insects 1st


Edition John Himmelman

https://ebookmeta.com/product/cricket-radio-tuning-in-the-night-
singing-insects-1st-edition-john-himmelman/

Chasing the Chinese Dream Four Decades of Following


China s War on Poverty 1st Edition William N. Brown

https://ebookmeta.com/product/chasing-the-chinese-dream-four-
decades-of-following-china-s-war-on-poverty-1st-edition-william-
n-brown/

Bifurcate There Is No Alternative 1st Edition Bernard


Stiegler And The International Collective (Eds.)

https://ebookmeta.com/product/bifurcate-there-is-no-
alternative-1st-edition-bernard-stiegler-and-the-international-
collective-eds/
Exhibitions for Social Justice 1st Edition Elena
Gonzales

https://ebookmeta.com/product/exhibitions-for-social-justice-1st-
edition-elena-gonzales/
Reactive Programming with Kotlin

Reactive Programming with Kotlin


By Alex Sullivan

Copyright ©2020 Razeware LLC.

Notice of Rights
All rights reserved. No part of this book or corresponding materials (such as text,
images, or source code) may be reproduced or distributed by any means without prior
written permission of the copyright owner.

Notice of Liability
This book and all corresponding materials (such as source code) are provided on an
“as is” basis, without warranty of any kind, express of implied, including but not
limited to the warranties of merchantability, fitness for a particular purpose, and
noninfringement. In no event shall the authors or copyright holders be liable for any
claim, damages or other liability, whether in action of contract, tort or otherwise,
arising from, out of or in connection with the software or the use of other dealing in
the software.

Trademarks
All trademarks and registered trademarks appearing in this book are the property of
their own respective owners.

raywenderlich.com 2
Reactive Programming with Kotlin

Dedications
"To my wonderful partner Pallavi, without whom I would have
never been able to start this undertaking. Your support and
encouragement mean the world to me."

— Alex Sullivan

raywenderlich.com 3
Reactive Programming with Kotlin

About the Author


Alex Sullivan is the author of this book. Alex is a freelance mobile
architect in Boston, where he enjoys reactive programming,
experimenting with different programming languages, and
tinkering with fun approaches to building mobile applications. In
his spare time, Alex enjoys traveling and relaxing with his partner,
binging unhealthy amounts of Netflix and reading. Alex hopes to
one day find a cat he's not allergic to and rant about bracket
placement to him or her.

About the Editors


Victoria Gonda is a tech editor for this book. Victoria is a software
developer with a passion for accessible and quality apps. When
she's not traveling to speak at conferences, she works remotely
from Chicago. Her interest in tech started while studying computer
science and dance production in college. In her spare time, you can
find Victoria relaxing with a book, her partner, and her pets. You
can connect with her on Twitter at @TTGonda.

Alex Curran is a technical editor of this book. He is a mobile-


focused Principle Engineer at a finance startup, with a keen
interest in development best practices and encouraging
collaboration between iOS, Android, and backend developers. In his
spare time, he cooks, reads avidly, and makes natural soaps by
hand. You can find him anywhere at @amlcurran.

Amanjeet Singh is a tech editor for this book. Amanjeet is an


Android Engineer based out of India and an open source
enthusiast. As a developer he always tries to build apps with
optimized performance and good architectures which can be used
on a large scale. In spare time, you can find Amanjeet traveling,
eating and watching movies. You can find him on twitter at
@droid_singh.

raywenderlich.com 4
Reactive Programming with Kotlin

Matei Suica is the final pass editor for this book. Matei is a
software developer that dreams about changing the world with his
work. From his small office in Romania, Matei is always trying to
work on Apps that will help millions. When the laptop lid closes, he
likes to read and go to the gym. You can find him on Twitter:
@mateisuica

About the Artist


Vicki Wenderlich is the designer and artist of the cover of this
book. She is Ray’s wife and business partner. She is a digital artist
who creates illustrations, game art and a lot of other art or design
work for the tutorials and books on raywenderlich.com. When she’s
not making art, she loves hiking, a good glass of wine and
attempting to create the perfect cheese plate.

raywenderlich.com 5
Reactive Programming with Kotlin

Acknowledgments
We'd also like to thank the RxSwift: Reactive Programming with Swift authors, whose
work served as the basis for parts of this book:
• Scott Gardner has been developing iOS apps since 2010, Swift since the day it was
announced, and RxSwift since before version 1. He's authored several video
courses, tutorials, and articles on iOS app development, presented at numerous
conferences, meetups, and online events, and this is his second book. Say hello to
Scott on Twitter at @scotteg.
• Junior Bontognali has been developing on iOS since the first iPhone and joined
the RxSwift team in the early development stage. Based in Switzerland, when he's
not eating cheese or chocolate, he's doing some cool stuff in the mobile space,
without denying to work on other technologies. Other than that he organizes tech
events, speaks and blogs. Say hello to Junior on Twitter at @bontoJR.
• Florent Pillet has been developing for mobile platforms since the last century and
moved to iOS on day 1. He adopted reactive programming before Swift was
announced and has been using RxSwift in production since 2015. A freelance
developer, Florent also uses Rx on Android and likes working on tools for
developers like the popular NSLogger when he's not contracting for clients
worldwide. Say hello to Florent on Twitter at @fpillet.
• Marin Todorov is one of the founding members of the raywenderlich.com team
and has worked on seven of the team's books. Besides crafting code, Marin also
enjoys blogging, teaching, and speaking at conferences. He happily open-sources
code. You can find out more about Marin at www.underplot.com.

raywenderlich.com 6
Reactive Programming with Kotlin

Table of Contents: Overview


Book License ............................................................................................. 17
Book Source Code & Forums ............................................................. 18
What You Need ........................................................................................ 20
Book Updates ........................................................................................... 21
About the Cover ...................................................................................... 22
Section I: Getting Started with RxJava ....................... 23
Chapter 1: Hello, RxJava! ........................................................ 24
Chapter 2: Observables ........................................................... 46
Chapter 3: Subjects .................................................................... 66
Chapter 4: Observables & Subjects in Practice .............. 83
Section II: Operators & Best Practices...................... 105
Chapter 5: Filtering Operators ........................................... 107
Chapter 6: Filtering Operators in Practice .................... 126
Chapter 7: Transforming Operators ................................. 141
Chapter 8: Transforming Operators in Practice .......... 158
Chapter 9: Combining Operators ...................................... 174
Chapter 10: Combining Operators in Practice ............ 197
Chapter 11: Time-Based Operators ................................. 218
Section III: Intermediate RxJava................................. 240
Chapter 12: Error Handling in Practice .......................... 241
Chapter 13: Intro to Schedulers ........................................ 264

raywenderlich.com 7
Reactive Programming with Kotlin

Chapter 14: Flowables & Backpressure.......................... 284


Chapter 15: Testing RxJava Code ..................................... 301
Chapter 16: Creating Custom Reactive Extensions .. 319
Section IV: RxJava Community Cookbook .............. 337
Chapter 17: RxBindings ........................................................ 338
Chapter 18: Retrofit ............................................................... 360
Chapter 19: RxPreferences ................................................. 378
Chapter 20: RxPermissions ................................................. 395
Section V: Putting It All Together ............................... 411
Chapter 21: RxJava & Jetpack ............................................ 412
Chapter 22: Building a Complete RxJava App ............. 431
Conclusion .............................................................................................. 464

raywenderlich.com 8
Reactive Programming with Kotlin

Table of Contents: Extended


Book License . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Book Source Code & Forums . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
What You Need . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Book Updates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
About the Cover . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Section I: Getting Started with RxJava . . . . . . . . . . . . . 23
Chapter 1: Hello, RxJava! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Defining RxJava and RxKotlin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Introducing asynchronous programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Learning the foundations of RxJava . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
App architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
RxAndroid and RxBinding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Installing RxJava . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Community . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Key points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Where to go from here?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Chapter 2: Observables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
What is an observable? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Lifecycle of an observable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Creating observables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Subscribing to observables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Disposing and terminating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
The create operator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Creating observable factories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Using other observable types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

raywenderlich.com 9
Reactive Programming with Kotlin

Challenges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Key points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Chapter 3: Subjects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
What are subjects? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Working with publish subjects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Working with behavior subjects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Working with replay subjects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Working with async subjects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Working with the RxRelay library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Challenge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Key points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Where to go from here?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Chapter 4: Observables & Subjects in Practice . . . . . . . . . . . . . . 83
Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Using a BehaviorSubject in a ViewModel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Adding photos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Communicating with other views via subjects. . . . . . . . . . . . . . . . . . . . . . . . 92
Creating a custom observable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Review: Single, Maybe, Completable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Using Single in the app . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
Key points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Where to go from here? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104

Section II: Operators & Best Practices . . . . . . . . . . . . 105


Chapter 5: Filtering Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Ignoring operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Skipping operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Taking operators. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
Distinct operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120

raywenderlich.com 10
Reactive Programming with Kotlin

Challenge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
Key points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
Where to go from here? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
Chapter 6: Filtering Operators in Practice . . . . . . . . . . . . . . . . . 126
Improving the Combinestagram project . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
Challenge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Key points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
Where to go from here? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
Chapter 7: Transforming Operators . . . . . . . . . . . . . . . . . . . . . . . . 141
Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Transforming elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
Transforming inner observables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
Observing events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
Challenge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
Key points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
Where to go from here? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
Chapter 8: Transforming Operators in Practice . . . . . . . . . . . . 158
Getting started with GitFeed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Fetching data from the web . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
Transforming the response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
Processing the response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
Persisting objects to disk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
Adding a last-modified header . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
Challenge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
Key points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
Where to go from here? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
Chapter 9: Combining Operators . . . . . . . . . . . . . . . . . . . . . . . . . . 174
Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
Prefixing and concatenating. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
Merging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180

raywenderlich.com 11
Reactive Programming with Kotlin

Combining elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183


Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
Switches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
Combining elements within a sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
Challenge: The zip case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
Key points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
Where to go from here? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
Chapter 10: Combining Operators in Practice . . . . . . . . . . . . . 197
Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Preparing the EONET API class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
Add events into the mix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
Combining events and categories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
Downloading in parallel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
Wiring up the days seek bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
Challenge: Adding a progress bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
Key points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
Where to go from here? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
Chapter 11: Time-Based Operators . . . . . . . . . . . . . . . . . . . . . . . . 218
Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
Buffering operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
Time-shifting operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
Timer operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
Challenge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
Key points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239

Section III: Intermediate RxJava . . . . . . . . . . . . . . . . . . 240


Chapter 12: Error Handling in Practice . . . . . . . . . . . . . . . . . . . . 241
Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
Managing errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
Handling errors with catch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
Catching errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248

raywenderlich.com 12
Reactive Programming with Kotlin

Retrying on error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250


Errors as objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
Challenges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
Key points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
Where to go from here? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
Chapter 13: Intro to Schedulers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
What is a scheduler? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
Setting up the project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
Switching schedulers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
Pitfalls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
Best practices and built-in schedulers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
Key points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
Where to go from here? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
Chapter 14: Flowables & Backpressure . . . . . . . . . . . . . . . . . . . . 284
Backpresssure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
Buffering danger!. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
Natural backpressure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
Introduction to Flowables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
Backpressure strategies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
Flowables, Observables, Processors and Subjects — Oh, My! . . . . . . 295
Key points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
Where to go from here? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
Chapter 15: Testing RxJava Code . . . . . . . . . . . . . . . . . . . . . . . . . . 301
Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
Introduction to TestObserver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
Using a TestScheduler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
Injecting schedulers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
Using Trampoline schedulers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
Using subjects with mocked data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
Testing ColorViewModel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314

raywenderlich.com 13
Reactive Programming with Kotlin

Key points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318


Where to go from here? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
Chapter 16: Creating Custom Reactive Extensions . . . . . . . . 319
Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
Extending a framework class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
Wiring the extension up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
Wrapping the locations API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
The lift and compose functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
Testing your custom reactive extension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
Key points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336
Where to go from here? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336

Section IV: RxJava Community Cookbook . . . . . . . . 337


Chapter 17: RxBindings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338
Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
Extending ValueAnimator to be reactive . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
Using RxBindings with Android widgets . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341
Dangerzone!. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
Working around the issue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
Fetching colors from an API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
Displaying an information dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
Challenges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356
Key points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
Where to go from here? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
Chapter 18: Retrofit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360
Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360
Recap of Retrofit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
Including Rx adapters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
Creating a JSON object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
Updating the JSON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368
Retrieving JSON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373

raywenderlich.com 14
Reactive Programming with Kotlin

Key points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377


Where to go from here? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377
Chapter 19: RxPreferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378
Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
Using SharedPreferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
Listening for preference updates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
Using RxPreferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
Subscribing to preference changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386
Dealing with old versions of RxJava . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387
Saving custom objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389
Key points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
Where to go from here? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
Chapter 20: RxPermissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
Requesting the location permission . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
Using RxPermissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
Requesting another permission . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402
Reading from external storage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
Writing the weather to external storage . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
Reacting to orientation changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
Key points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
Where to go from here? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410

Section V: Putting It All Together . . . . . . . . . . . . . . . . . 411


Chapter 21: RxJava & Jetpack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412
Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
RxJava and Room . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
Reacting to database changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
Updating individual items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
Starting the app with cached data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
Paging data in . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422

raywenderlich.com 15
Discovering Diverse Content Through
Random Scribd Documents
that he was in possession of documents to substantiate the fact;
but, to my surprise, instead of such documents, he has adduced and
principally relied on the constitution, in which there is not a single
imperative sentence obligatory on Congress, either to receive a
cession, or, when received, to continue exclusive jurisdiction over
one foot of territory—the plain and unequivocal language of the
constitution leaving it perfectly optional whether to receive, and, if
received, whether to retain jurisdiction or not. Hence, I conceive that
no legislative body can be justly charged with tyranny or oppression
for altering or (if from experience it becomes necessary) disannulling
their own acts—a contra-opinion I consider as altogether
uncongenial to improvement, genuine liberty, and the inherent rights
of man, and as such, I hope will ever be exploded in these United
States.

Wednesday, January 9.
District of Columbia.

Mr. Thatcher was opposed to the motion for a recession, and he


had heard only two reasons urged in favor of the measure; that the
exercise of exclusive legislation by Congress over the District of
Columbia was attended with an undue expense of the public money,
and occupied so much of their time, that the business of the Union
was interrupted and put to a stand by the interference of the local
concerns of this place. This statement he did not believe to be
perfectly correct; no doubt some of their time was taken up, but he
would leave it to every gentleman to say, whether, if they had even
more business before them than they had, there was not time
enough to transact it. The House usually sat from eleven o’clock until
three; but it must have been frequently observed, that the
adjournment took place much earlier for want of business to employ
them. But he was not an advocate for the present mode of
conducting the business of the district; it would perhaps be a better
way to give them a subordinate government, controllable by
Congress; or a committee of Congress might be appointed for the
purpose. He did not see that the complaint of too much legislation
was well founded, in any thing that had taken place during the
present session. If the little labor they had to perform was too great
for them, what must the labor of their predecessors have been, who
had passed all the laws in existence for the government of the
district, and yet he had never heard any complaint made by them on
the ground now taken; they knew that the constitution enjoined
upon them the duty of exercising exclusive legislation over the ten
miles square, and they performed it with patient attention.
His mind revolted at the idea of recession. Gentlemen had
contended that the powers exercised over the people of Columbia
were derogatory of, and inconsistent with the principles of free
government. Yet, what does this motion for recession propose? Why,
to transfer them and the territory away, in the manner practised in
Russia, in the transfer of provinces or manors, transferring the
vassals with the soil. This may be truly called derogatory to the
principles of freedom. Nor is this all; for you do not transfer them
merely without their consent, but in the face of their serious
remonstrances against the transfer.
Mr. Smilie advocated, and Messrs. Huger and Claiborne opposed the
resolutions; when the question was taken on agreeing to the first
resolution, for receding that part of the district formerly attached to
Virginia, and passed in the negative—yeas 42, nays 62.
The question was then taken on the second resolution, for
receding that part of the district, excepting the city of Washington,
formerly attached to Maryland, and passed in the negative—yeas 42,
nays 65.
The question was then taken by yeas and nays on agreeing to that
part of the report which involved a disagreement to the first
resolution, and carried affirmatively—yeas 87, nays 46, as follows:

Yeas.—Nathaniel Alexander, Simeon Baldwin, William Blackledge,


Adam Boyd, Robert Brown, Joseph Bryan, George W. Campbell, John
Campbell, Levi Casey, William Chamberlin, Martin Chittenden, Clifton
Claggett, Thomas Claiborne, John Clopton, Frederick Conrad, Jacob
Crowninshield, Manasseh Cutler, Richard Cutts, John Davenport,
John Dennis, William Dickson, Thomas Dwight, John B. Earle, James
Elliot, William Eustis, Calvin Goddard, Andrew Gregg, Gaylord
Griswold, Roger Griswold, Seth Hastings, William Helms, David
Holmes, David Hough, Benjamin Huger, Samuel Hunt, John G.
Jackson, William Kennedy, Joseph Lewis, jun., Henry W. Livingston,
Thomas Lowndes, John B. C. Lucas, Matthew Lyon, William
McCreery, Nahum Mitchell, Thomas Moore, Roger Nelson, Anthony
New, Thomas Newton, jun., Thomas Plater, Samuel D. Purviance,
Thomas Sammons, Thomas Sanford, John Smith, Henry Southard,
Joseph Stanton, William Stedman, James Stephenson, Samuel
Taggart, Benjamin Tallmadge, Samuel Tenney, David Thomas, Philip
R. Thompson, Abram Trigg, Philip Van Cortlandt, Isaac Van Horne,
Peleg Wadsworth, Matthew Walton, Lemuel Williams, Marmaduke
Williams, Richard Wynn, Joseph Winston, and Thomas Wynns.
Nays.—Willis Alston, jun., Isaac Anderson, John Archer, George
Michael Bedinger, Phanuel Bishop, John Boyle, William Butler,
Christopher Clark, Matthew Clay, John Dawson, Peter Early, Ebenezer
Elmer, John W. Eppes, William Findlay, John Fowler, Edwin Gray, John
A. Hanna, Josiah Hasbrouck, Joseph Heister, John Hoge, James
Holland, Walter Jones, Simon Larned, Michael Leib, Andrew McCord,
David Meriwether, Nicholas R. Moore, Jeremiah Morrow, James Mott,
Gideon Olin, Beriah Palmer, John Randolph, John Rea, of
Pennsylvania, John Rhea, of Tennessee, Jacob Richards, Samuel
Riker, Erastus Root, Ebenezer Seaver, James Sloan, John Smilie,
Richard Stanford, John Stewart, Joseph B. Varnum, Daniel C.
Verplanck, John Whitehill, and Alexander Wilson.

Mr. Smilie moved to amend the second resolution by striking out


the words “without the limits of the city of Washington,” so that the
city as well as the other parts of the district might be receded.
Only twenty-one members rising in favor of this motion, it was
lost.
The question was then taken by yeas and nays on agreeing to the
report of the committee, involving a disagreement to the second
resolution, and carried affirmatively—yeas 69, nays 39.
So the said motion was rejected.
The question was then taken on agreeing to the whole report of
the committee, and carried—yeas 50, nays 28.

Saturday, January 12.


Resolved, That the Speaker address a letter to the Executive of
the State of North Carolina, communicating information of the death
of James Gillespie, late a member of this House, in order that
measures may be taken to supply any vacancy occasioned thereby in
the Representation from that State.

Tuesday, January 15.

District of Columbia.

The bill to prohibit the exaction of bail upon certain suits within
the District of Columbia was brought in engrossed, and read the
third time.
The final passage of the bill was opposed by Mr. Goddard, Mr. Root,
and Mr. Nelson, and defended by Mr. Newton, as a proper measure to
prevent the oppression of malignant creditors.
Mr. Eppes desired Mr. Beckley to read that part of the Constitution of
the United States relative to the extent of the Judiciary power, and
that part of the law establishing the Judicial authority of the District
of Columbia, with a view of showing that the bill was not essentially
necessary.
Mr. Early moved a recommitment of the bill to a select committee.
Mr. Bedinger wished that the bill might go to a select committee,
because he considered the principle a valuable one. He imagined,
however, that the details were not altogether perfect. He felt
concerned on this subject, on account of several of his constituents
who had been tricked out of notes and bonds for lands in Kentucky,
which had been advertised, and were no longer available against the
drawers in that State; but, should it so happen that business called
them to Washington, they might be extremely harassed for want of
bail.
The reference was opposed by Mr. R. Griswold, as he was against
the principle of the bill altogether.
On the question to recommit it, it passed in the negative—ayes
44, noes 59.
The question was then taken on the passage of the bill, and it was
lost, there being but thirty members who voted in its favor.

Wednesday, January 16.


Naval Appropriations.

The House again resolved itself into a Committee of the Whole, on


the bill making appropriations for the support of Government for the
year one thousand eight hundred and five.
Mr. J. Randolph moved to fill the blank, in the clause providing for
the expense of intercourse with the Barbary Powers, with $63,500,
instead of the sum of $113,000, stated in the estimate for the
current year. The difference ($50,000) would make a part of
additional appropriations, for which he should move a distinct
clause.—Motion carried.
Mr. R. then moved to add the following words: “for the contingent
expenses of intercourse with the Barbary Powers —— dollars.” He
said, that he should be obliged to ask $150,000, in addition to the
sum reserved out of the preceding appropriation, and of course to fill
the blank with the words $200,000. This was rendered necessary
because the Mediterranean fund, heretofore liable to this charge,
had been subjected, on the motion of a gentleman from
Connecticut, to the whole expense of the support of the Navy. He
supposed that no difference of opinion could exist on the subject of
enabling the Executive to make peace with Tripoli. He had no
objection to any restriction which might be thought necessary to
limit the application of the additional sum of $150,000, which he
required, to the object for which it was intended. But as the words
ransom, or tribute, had never been introduced into our statutes
heretofore, he hoped they would not be admitted on this occasion.
Mr. R. Griswold had no objection to making the appropriation
required, or even a larger sum; for he was well convinced that the
President ought to have funds as well as the authority to accomplish
any object connected with the present subject, which he might wish
to accomplish.

Friday, January 18.


Relief of Tax Collectors in New York.

A petition of John York, of Brookefield, in the county of Chenango,


and State of New York, late collector of the taxes on lands, slaves,
and dwelling-houses, for the eighty-third collection district within the
said State, and now confined in the jail of said county, was
presented to the House and read, praying relief in the case of a
judgment awarded against the petitioner and execution issued
thereon, for the sum of eight hundred dollars, including interest and
cost of suit, for the payment of which the petitioner was compelled
to apply a certain proportion of the proceeds of taxes collected by
him in the capacity aforesaid.—Referred to Messrs. Root, Gregg, and
Hastings; to examine and report their opinion thereupon to the
House.
District of Columbia.

DIVORCES.

Mr. Dawson, from the committee appointed on the petition of


Marcella Stanton, and others, reported a bill, entitled an act to
authorize the Court of the District of Columbia to decree divorces in
certain cases; which was read twice, and referred to a Committee of
the Whole on Tuesday next.
Mr. Dawson prefaced his motion, on this subject, when he
introduced it in the manner following:
He observed that, after the decision which had taken place a few
days ago, he had resolved not to meddle any further with the affairs
of the District of Columbia, but to leave the inhabitants in the
enjoyment of the blessings of that government which they seem to
have chosen, and the principles of which were sanctioned by this
House.
There was, however, one class of persons who claimed, in all
situations, our particular attention; who had not made a surrender of
their political rights; and, if they had been defrauded out of their
natural ones, were anxious to regain them.
It would be remembered that, at the last session, a gentleman
from Maryland, who had been absent for some time, and whom he
rejoiced now to see in his place, (Mr. Nicholson,) presented a petition
from a person in this district, praying for a divorce, and he two
others for the same relief. These were referred to a select
committee, and a bill reported, which remained among the
unfinished business; as he learned that the situations and wishes of
these unfortunate persons were still the same, he thought the
subject ought again to be renewed.

Emancipation in the District of Columbia.


Mr. Sloan moved the following resolution:

Resolved, That, from and after the fourth of July, 1805, all blacks
and people of color that shall be born within the District of Columbia,
or whose mother shall be the property of any person residing within
the said district, shall be free, the males at the age of ——, and the
females at the age of ——.

The House proceeded to consider the said motion, and on the


question that the same be referred to a Committee of the whole
House, it passed in the negative—yeas 47, nays 65.
And then the main question being taken that the House do agree
to the said motion as originally proposed, it passed in the negative—
yeas 31, nays 77, as follows:

Yeas.—Isaac Anderson, John Archer, David Bard, Phanuel Bishop,


Robert Brown, Clifton Claggett, Joseph Clay, James Elliot, Ebenezer
Elmer, William Findlay, Gaylord Griswold, John A. Hanna, Josiah
Hasbrouck, David Hough, Nehemiah Knight, Michael Leib, Andrew
McCord, Nahum Mitchell, Beriah Palmer, John Rea of Pennsylvania,
Jacob Richards, Erastus Root, Thomas Sammons, Ebenezer Seaver,
James Sloan, John Smilie, Joseph Stanton, Isaac Van Horne, Joseph
B. Varnum, Peleg Wadsworth, and John Whitehill.
Nays.—Willis Alston, jr., Simeon Baldwin, George Michael Bedinger,
William Blackledge, Adam Boyd, Joseph Bryan, William Butler,
George W. Campbell, John Campbell, Levi Casey, Thomas Claiborne,
Matthew Clay, John Clopton, Frederick Conrad, Jacob Crowninshield,
Manasseh Cutler, John Davenport, John Dawson, John Dennis,
William Dickson, John B. Earle, Peter Early, John W. Eppes, William
Eustis, John Fowler, Calvin Goddard, Peterson Goodwyn, Thomas
Griffin, Roger Griswold, Joseph Heister, William Helms, John Hoge,
James Holland, Benjamin Huger, Samuel Hunt, Walter Jones, William
Kennedy, Simon Larned, Joseph Lewis, jun., Henry W. Livingston,
Thomas Lowndes, John B. C. Lucas, Matthew Lyon, William
McCreery, David Meriwether, Nicholas R. Moore, Thomas Moore,
James Mott, Roger Nelson, Anthony New, Thomas Newton, jun.,
Joseph H. Nicholson, Gideon Olin, John Randolph, John Rhea of
Tennessee, Samuel Riker, Thomas Sanford, John Smith, Henry
Southard, Richard Stanford, William Stedman, James Stephenson,
John Stewart, Samuel Taggart, Samuel Tenney, Philip R. Thompson,
George Tibbits, Abram Trigg, Philip Van Cortlandt, Killian K. Van
Rensselaer, Daniel C. Verplanck, Matthew Walton, Marmaduke
Williams, Alexander Wilson, Richard Wynn, Joseph Winston, and
Thomas Wynns.

So the said motion was rejected.

Monday, January 21.


Slavery in Territories.

A memorial of the people called Quakers, at their yearly meeting,


held in the city of Philadelphia, in the month of December last, was
presented to the House and read, praying that effectual measures
may be adopted by Congress to prevent the introduction of slavery
into any of the Territories of the United States.—Referred to the
committee appointed on the twelfth of November last, on so much
of the Message of the President of the United States as relates “to
an amelioration of the form of government of the Territory of
Louisiana.”

Wednesday, January 23.


Protection of Seamen.

The Speaker laid before the House a letter from the Secretary of
State, accompanying statements and abstracts relative “to the
number of American seamen who have been impressed or detained
on board of the ships of war of any foreign nation; with the names
of the persons impressed; the name of the ship or vessel by which
they were impressed; the nation to which she belonged, and the
time of the impressment; as also certain facts and circumstances
relating to the same;” prepared in obedience to a resolution of this
House of the thirty-first ultimo.
Mr. Crowninshield said, that the list of impressed seamen, furnished
by the Secretary of State, exceeded in number any thing he had
expected. He thought these impressments ought to be prevented,
and that the subject demanded investigation. He had drafted a
resolution, which he would submit to the House, having in view to
connect this with another very important subject. Many gentlemen
must have observed that some late proclamations had been issued
by the Governors of the several British West India Islands,
interdicting the American trade after May next. The proclamations
bore date in October or November, and were to take effect in six
months. It appeared to him that the British Government were
determined to exclude us from their islands, upon the expectation
that their own vessels would be competent to carry the necessary
supplies. Mr. C. said we had a right to carry the productions of the
United States in American bottoms, and he hoped we should never
permit foreign ships to come to our ports and carry on an exclusive
trade with any country whatever, where our vessels were not
allowed the same privilege. His intention was to prevent the
American carrying trade to the West Indies from falling into the
hands of other nations. He would not exclude foreign vessels from
our ports, but it was desirable that our own export trade should not
be monopolized by foreigners. The subject was highly important to
this country. Will the United States tamely submit to see some of its
best citizens torn from their families and friends, without attempting
something for their relief? Shall we see another country pursuing
measures hostile to our commercial rights and make no effort to
correct the mischief? The West India Islands depended on the
United States for their ordinary supplies, and our vessels had usually
carried a large proportion of their cargoes on American account; but
it appeared now that we were to be shut out from this trade, and it
was in future to be carried on in foreign vessels. An effectual remedy
would be to prohibit the exportation of our productions in foreign
bottoms to all ports of islands with which we were not permitted to
have intercourse, and in order that the subject might undergo the
examination which its importance demanded, he offered the
following resolution:

Resolved, That the Committee of Commerce and Manufactures be


instructed to inquire if any, and what, further provision be necessary
for the protection of the commerce and seamen of the United
States, and to inquire whether any foreign country has made any
late regulations with a view to monopolize any branch of the
American carrying trade, to the exclusive benefit of such foreign
country, or which in their operation may be injurious to the
agricultural or commercial interest of the United States; and also to
inquire into the expediency of prohibiting the exportation from the
United States of all goods and merchandise whatever in foreign
ships bound to any port with which the vessels of the United States
are not allowed communication, or where a free and unrestricted
trade is not permitted in the productions of the United States, and
that the committee be authorized to report by bill or otherwise.

Mr. Randolph wished the resolution to lie for consideration a few


days; he would mention Monday. The gentleman had said it was an
important subject, and if he had no objection it would be as well to
allow the resolution to remain unacted upon for a little time. It might
be printed for the consideration of the House, and he rather
supposed some alteration would be necessary in the form of the
resolution.
Mr. Crowninshield replied that he was perfectly willing the
resolution should lie for consideration, agreeably to the desire of the
gentleman from Virginia, and he would consent to any reasonable
delay; but he would not consent to its remaining unacted upon till a
period so late as to preclude any measures from being adopted this
session, because the proclamation would take effect in the month of
May. He was not tenacious of forms, it was the substance of things
he looked to, and he would with great pleasure agree to modify the
resolution to any shape which the gentleman from Virginia might
suggest.
A motion was made to refer the resolution to a Committee of the
Whole for Monday next; which was agreed to, and the resolution
ordered to be printed.

Thursday, January 24.


The Speaker laid before the House a letter from the Secretary of
War, enclosing sundry documents relating to the case of William
Scott, and James and John Pettigrew, stated to have been murdered
and plundered by the Cherokee Indians, in pursuance of a resolution
of this House of the twenty-second instant; which were read and
referred to the Committee of the Whole, to whom is committed the
report of the Committee of Claims on the petition of Alexander Scott,
of the State of South Carolina, in behalf of himself and others.

Navy Yards, &c.

Mr. Eustis moved the following resolution:

“Resolved, That it is expedient to provide by law for defraying the


expense incident to fitting and preparing one of the navy yards
belonging to the United States, and lying near the margin of the
ocean, for the reception and repairing of such ships of war as are
now at sea on their return to port, and such other ships or vessels of
war as may hereafter return from their cruises or stations.”

Mr. Eustis said the resolution now submitted to the consideration


of the House had grown out of an opinion which impressed itself on
his mind, when he first beheld the whole naval force of the United
States moored in the Eastern branch of the Potomac. He had ever
considered the establishment of a navy yard in this city, as the
principal naval arsenal, to be among the errors or misfortunes which
had presided over many other arrangements respecting this city and
territory. As the United States were at that time at peace with all the
world, excepting the Dey of Algiers, as a small part of the force only
was necessary to carry on this warfare, and as the ships had been
actually hauled up at a considerable expense, there appeared to be
no immediate necessity for incurring a further expense in their
removal. Our maritime concerns have now experienced a change.
We are at war with another of the Barbary Powers, and a greater
number of ships have been necessarily taken into the service. We
have at this time six frigates, and five or six smaller vessels on duty
in the Mediterranean. After a certain time these ships must be
relieved. Others must be sent out to take their stations. Those which
return will require repairs; and in order to prepare for these
contingencies it was proper that some one of the navy yards nearer
to the ocean should be put in a condition to receive them. This was
the object of the resolution. It was desirable that some place should
be selected easy of access, where the water was deep, and in the
neighborhood of some large maritime town, having large markets
and magazines of the variety of articles required for repairing and
fitting ships for sea, with the artizans employed in that business. It
was not his intention to describe the advantages or disadvantages of
one place or of another. The United States own six navy yards. The
whole coast is before the Executive, and such a place will be
selected as will combine the greatest number of advantages and
best promote the public interests. To those who believed that ships
of war could be repaired or fitted out with the same despatch, at the
same expense, and with the same ease and convenience, at a place
three hundred miles distant from the sea, as they could be in one of
the ports lying on its margin, and possessing the advantages which
had been stated, no reasoning could be applied which would change
their opinions. The proposition was offered to the House to be
decided by common sense and understanding. There was one
objection which he had anticipated, and which had some weight in
it. The business of the department would in that case be removed
from the eye of the Government, and from the more immediate
inspection and control of the intelligent and capable officer who
directed its operations; this inconvenience would be balanced by the
more ample means and resources which his agents would find in the
large towns, and by which they would be enabled to carry his
instructions more promptly into effect.
The motion was referred to a Committee of the Whole on Monday
next.

Friday, January 25.


Mississippi Territory.

Mr. Lattimore presented a memorial from the Legislative Council


and the House of Representatives of the Mississippi Territory, stating
sundry grievances to which they were exposed by the act of
Congress for the government of the same. They complain that a
man is not qualified to vote unless he possess fifty acres of land,
whereby those who hold houses and town lots, as well as
respectable citizens of considerable personal estate, are
disfranchised. The inequality of representation in the several
counties to the number of inhabitants in each; the necessity of
extending the powers and authorities of an additional judge lately
furnished the Territory; the inconveniencies arising from the
prescribed mode of the disposal of lands; the necessity of
establishing a hospital at the Natchez; and, lastly, an increase of the
salaries of the judges.
On motion, the memorial was referred to a select committee of
five members.

Tuesday, January 29.


Another member, to wit, Oliver Phelps, from New York, appeared,
and took his seat in the House.

Georgia Claims.

The House again went into Committee of the Whole on the


Georgia claims.
After reading over the report of the Committee of Claims, which
concludes with submitting the following resolution:

Resolved, That three Commissioners be authorized to receive


propositions of compromise and settlement, from the several
companies or persons having claims to public lands within the
present limits of the Mississippi Territory, and finally to adjust and
settle the same in such manner as in their opinion will conduce to
the interest of the United States: Provided, That in such settlement
the Commissioners shall not exceed the limits prescribed by the
convention with the State of Georgia.

Mr. Dana moved that the committee rise and report the resolution.
Mr. J. Randolph wished, before the committee rose, that the
gentleman from Connecticut (Mr. Dana) would assign some reasons
for the adoption of the resolution. No two things could be more
opposite than the prefatory statement made by the Committee of
Claims and the resolution which terminated the report. As there
were no reasons assigned, he suspected the gentleman had kept
them back with a view of surprising the House by their novelty; but
he hoped the committee would not agree to the motion, unless
some better cause was assigned for its adoption than had hitherto
been made known.
Mr. Dana said the Committee of Claims, in the report now before
the Committee of the Whole, had confined themselves to a
statement of facts derived from the documents referred to them. He
conceived it to be the business of the Committee of Claims to
investigate the facts, and arrange them in such a manner as to free
the House from the labor of detail; they had done this, and the
report was a summary of all that passed in review before them. It
was left to gentlemen to reason on the case according to their
course of reflection. Whether the committee reasoned on the subject
well or ill, he did not know that gentlemen were bound to follow
them in their conclusion. Indeed, he apprehended that were the
reasoning ever so energetic, it would not go to satisfy every
gentleman. On a question like the present, he despaired of making it
satisfactory to the gentleman who had asked for reasons. He was
persuaded that gentleman could not be convinced by any argument
the committee might have used, and it was idle to call upon them to
perform impossibilities.
The question on the committee’s rising and reporting their
agreement to the resolution was put, and carried—yeas 61, nays 50.
The Speaker having resumed the chair, Mr. Varnum reported the
foregoing resolution as agreed to.
Mr. Bryan called for the reading of that rule of the House which
restrains interested persons from voting.
The Clerk read the same, as follows:

“No member shall vote on any question in the event of which he is


immediately and particularly interested; or in any other case where
he was not present when the question was put.”

A motion was made to consider the report of the Committee of the


Whole, and carried—yeas 64, nays 51.
Mr. Clark moved a proviso as an amendment, declaring that no
part of the five millions of acres reserved should go to compensate
the claimants under the act of Georgia, passed in 1795.
Mr. J. Randolph called the yeas and nays on the amendment.
Mr. Dana observed that the report on the table had been made on
the application of persons claiming land under the act of 1795. The
amendment, said he, is nothing more nor less than a denial to
comply with the prayer of the petitioners, and whether it was not to
all intents and purposes a substitute for the resolutions agreed to in
the Committee of the Whole, he would leave to the Speaker. If it
were decided to be a substitute, it could not be received,
conformably to the rules of the House.
The Speaker said, the resolution reported from the Committee of
the Whole was a general one, including all claims; the amendment
went to limit and confine the resolution to a particular class, and,
therefore, he conceived it to be in order.
Mr. J. Randolph.—It must be manifest to the House that this
discussion is forced upon those who are opposed to the report of the
committee; that we are not prepared at this time to meet it. I am
among those who hoped that some reasons would be assigned, if
indeed reasons can be found, to warrant the step about to be taken.
I did hope that, instead of a string of facts and statements which
were already before the House, the committee would have given us
something new in the shape of argument, justificatory of the
resolution which they have recommended. But I have been
disappointed. Nothing is offered either in the report itself, or in the
debate, which throws a single gleam of light on the subject. I have
particular reasons to deprecate a discussion at this time. I shall not
trouble the House by detailing them, but briefly state that I feel
myself unequal to an immediate investigation of this question, as
well from personal indisposition as from the pressure of other
important business, which has left me but little leisure to attend to
this. The few moments which I have been able to devote to it, have
convinced me that much new and important matter remains to be
brought to light. But no apology will be received: we are driven to a
vote by an inflexible majority.
The objection taken by the gentleman from Connecticut, (Mr.
Dana,) and the doubt which he raised on that point of order,
respecting the amendment offered by my worthy colleague, (Mr.
Clark,) discloses his drift, and that of the Committee of Claims, whilst
it proves the necessity of some such amendment to save citizens of
the United States and their property from spoliation and plunder. The
gentleman has stated truly that his object was to further the claim of
the New England Mississippi Land Company. As I fear I shall have
full occasion to exert my voice, I must beg that the memorial of the
agents of that company may be read by the Clerk.
Mr. J. Randolph then called for the reading of the act of Georgia of
February, 1796, generally called the rescinding act; and he hoped
they would have silence whilst the act was reading, as it was a very
important one, and ought to influence the decision on the present
subject.
The act was read in compliance with the request.
After it was finished, Mr. Clark moved to adjourn.
On the division, there were 52 yeas, and 55 nays. So the motion
was lost.
Mr. Clark requested that the act of 1795, under which they derived
their pretended titles, might be read.
Whilst the Speaker was reading the same, Mr. Dana rose and
inquired whether it was necessary to read the whole of the law, or
whether gentlemen would not be satisfied with the reading of such
part of it as bore upon the present question.
Mr. J. Randolph called the gentleman to order for interrupting the
Speaker in his reading.
Mr. Speaker.—The objection ought to have been made (if at all)
when the reading of the law was first called for.
The reading was continued to the end of the act—when,
Mr. J. Clay moved that the House adjourn.
On a division, there were 53 yeas, and 60 nays. Motion lost.
Mr. J. Randolph.—Perhaps it may be supposed, from the course
which this business has taken, that the adversaries of the present
measure indulge the expectation of being able to come forward, at a
future day—not to this House, for that hope is desperate, but to the
public, with a more matured opposition than it is in their power now
to make. But past experience has shown them that this is one of
those subjects which pollution has sanctified; that the hallowed
mysteries of corruption are not to be profaned by the eye of public
curiosity. No, sir, the orgies of Yazoo speculation are not to be laid
open to the vulgar gaze. None but the initiated are permitted to
behold the monstrous sacrifice of the best interests of the nation on
the altars of corruption. When this abomination is to be practised we
go into conclave. Do we apply to the press—that potent engine, the
dread of tyrants and of villains, but the shield of freedom and of
worth? No, sir, the press is gagged. On this subject we have a virtual
sedition law—not with a specious title, but irresistible in its
operation, which, in the language of a gentleman from Connecticut,
(Mr. Griswold,) goes directly to its object. The demon of speculation,
at one sweep, has wrested from the nation their best, their only
defence, and closed every avenue of information. But a day of
retribution may yet come. If their rights are to be bartered away and
their property squandered, the people must not, they shall not be
kept in ignorance by whom, or for whom it is done.
We have often heard of party spirit—of caucuses as they are
termed—to settle legislative questions, but never have I seen that
spirit so visible as at this time. The out-of-door intrigue is too
palpable to be disguised. When it was proposed to abolish a
judiciary system reared in the last moments of an expiring
Administration, the detested offspring of a midnight hour—when the
question of repeal was before this House, it could not be taken up
until midnight, in the third or fourth week of the discussion. When
the great and good man who now fills, and who (whatever may be
the wishes of our opponents) I hope and trust will long fill the
Executive chair, not less to his own honor than to the happiness of
his fellow-citizens; when he, sir, recommended the repeal of the
internal taxes, delay succeeded delay, and discussion was followed
by discussion, until patience itself was worn threadbare. But now,
when public plunder is the order of the day, how are we treated?
Driven into the Committee of the Whole, and out again in a breath,
by an inflexible majority, exulting and stubborn in their strength, a
decision must be had instanter. The advocates for the proposed
measure feel that it will not bear a scrutiny. Hence this precipitancy.
They wince from the touch of examination, and are willing to hurry
through a painful and disgraceful discussion. But, it may be asked,
why this tenacious adherence of certain gentlemen to each other on
every other point connected with this subject? As if animated by one
spirit, they perform all their evolutions with the most exact
discipline, and march in a firm phalanx directly up to their object. Is
it that men combined to effect some evil purpose, acting on previous
pledge to each other, are ever more in unison than those who,
seeking only to discover truth, obey the impulse of that conscience
which God has placed in their bosoms? Such men do not stand
compromitted. They will not stifle the suggestions of their own
minds, and sacrifice their private opinions to the attainment of some
common, perhaps some nefarious object.
Having given vent to that effusion of indignation which I feel, and
which I trust I shall never fail to feel and to express on this
detestable subject, permit me now to offer some crude and hasty
remarks on the point in dispute. They will be directed chiefly to the
claim of the New England Mississippi Land Company, whom we
propose to debar (with all the other claimants under the act of 1795)
from any benefit of the five millions of acres, reserved by our
compact with Georgia, to satisfy such claims not specially provided
for in that compact, as we might find worthy of recompense. I shall
direct my observations more particularly to this claim, because it has
been more insisted upon, and more zealously defended than any
other. It is alleged by the memorialists, who style themselves the
agents of that company, that they, and those whom they represent,
were innocent purchasers; in other words, ignorant of the corruption
and fraud by which the act from which their pretended title was
derived, was passed. I am well aware that this fact is not material to
the question of any legal or equitable title which they may set up;
but as it has been made a pretext for exciting the compassion of the
Legislature, I wish to examine into the ground upon which this
allegation rests. Sir, when that act of stupendous villany was passed
in 1795, attempting under the forms and semblance of law to rob
unborn millions of their birthright and inheritance, and to convey to
a band of unprincipled and flagitious men a territory more extensive,
and beyond comparison more fertile than any State of this Union, it
caused a sensation scarcely less violent than that produced by the
passage of the stamp act, or the shutting up of the port at Boston,
with this difference: when the port bill of Boston passed, her
Southern brethren did not take advantage of the forms of law, by
which a corrupt Legislature attempted to defraud her of the bounty
of nature; they did not speculate on the necessities and wrongs of
their abused and insulted countrymen. I repeat that this infamous
act was succeeded by a general burst of indignation throughout the
continent. This is matter of public notoriety, and those—I speak of
men of education and intelligence, purchasers, too, of the very
country in question—those who affect to have been ignorant of any
such circumstance, I shall consider as guilty of gross and wilful
prevarication. They offer indeed to virtue the only homage which she
is ever likely to receive at their hands—the homage of their
hypocrisy. They could not make an assertion within the limits of
possibility less entitled to credit.
The agents of the New England Land Company are unfortunate in
two points. They set out with a formal endeavor to prove that they
are entitled to their proportion of fifty millions of acres of land, under
the law of 1795, and this they make their plea to be admitted to a
proportional share of five. If they really believed what they say,
would they be willing to commute a good legal, or equitable claim,
for one tenth of its value? Their memorial contains, moreover, a
suggestion of falsehood. They aver that the reservation of five
millions for satisfying claims not otherwise provided for, in our
compact with Georgia, was especially intended for the benefit of the
claimants under the act of 1795, and that we were pledged to satisfy
them out of that reservation. Now, sir, turn to the sixth volume of
your laws, and what is the fact? In the first place, so much of the
reserved five millions as may be necessary, is appropriated
specifically for satisfying claims derived from British grants not
regranted by Spain; and as much of the residue as may be
necessary is appropriated for compensating other claims, not
recognized in our compact with Georgia. An appropriation for certain
British grants specially, and for other claims generally, is falsely
suggested to have been made for the especial benefit of the
claimants of 1795; and the reservation of a power in the United
States to quiet such claims as they should deem worthy of
compensation, is perverted into an obligation to compensate a
particular class of claims; into an acknowledgment that such claims
are worthy of compensation. Can this House be inveigled by such
barefaced effrontery? Sir, the act containing this appropriation clause
was not brought to a third reading till the first of March. Our powers
expired on the fourth: it was at the second session of the seventh
Congress. It was in the power of those opposed to the corrupt
claims of 1795 to have defeated the bill by a discussion. But, sir,
they abstained on this ground. If the appropriation of the five
millions had not been made at that session, the year within which,
by our agreement with Georgia, it was to be made, if at all, would
have expired before the meeting of the next Congress; and it was
urged, by the friends of the bill, that there were several descriptions
of claims to which no imputation of fraud could attach; that by
making a general appropriation we secured to ourselves the power
of recompensing such claims as, on examination, might be found
worthy of it, whilst we pledged ourselves to no class of claimants
whatever. But that if we should suffer the term specified, in our
compact with Georgia, to elapse without making any appropriation,
we should preclude ourselves from the ability to compensate any
claims, not specially provided for, however just and reasonable we
might find them, on investigation, to be. Under these circumstances,
and I appeal to my excellent friend from Maryland, who brought it
in, for the correctness of my statement, the opponents of the bill
gave it no other opposition than a silent vote. And now, sir, we are
told that we stand pledged, and that an appropriation for British
grants not regranted by Spain, specially, and for such other claims
against the State of Georgia, generally, as Congress should find quite
worthy, was made for the especial benefit of a particular description
of claimants, branded, too, with the deepest odium; who dare to talk
to us of public faith, and appeal to the national honor!
The conclusion of the memorial is amusing enough. After having
played over the farce, which was acted by the Yazoo Squad at the
last session, affecting to believe that an appropriation has been
made by the act of March 1803, for their especial benefit, they pray
that Congress will be pleased to give them—what? that to which
they assert they are entitled?—by no means—an eighth or tenth part
of it—which said eighth or tenth part, if we may credit them, has
been already appropriated to their use by law. From a knowledge of
the memorialists, and those whom they represent, can you believe
for a moment that, if they had the least faith in the volume of
argument (I am sorry to profane the word) which they presented to
the House to prove the goodness of their title, can you believe that
under such impression they would accept a paltry compromise of
two shillings in the pound—much less that, to obtain it, they would
descend so low! Sir, when these men talk about public faith and
national honor, they remind me of the appeals of the unprincipled
gamester and veteran usurer to the honor of the thoughtless
spendthrift, whilst in reality they are addressing themselves to his
vices and his folly.
The first year that I had the honor of a seat in this House, an act
was passed of a nature not altogether unlike the one now proposed.
I allude to the case of the Connecticut Reserve, by which the nation
were swindled out of some three or four millions of acres of land,
which, like other bad titles, had fallen into the hands of innocent
purchasers. When I advert to the applicants by whom we were then
beset, I find that among them was one of the very persons who
style themselves agents of the New England Mississippi Land
Company, who seems to have an unfortunate knack at buying bad
titles. His gigantic grasp embraces with one hand the shores of Lake
Erie, and stretches with the other to the Bay of Mobile. Millions of
acres are easily digested by such stomachs. Goaded by avarice, they
buy only to sell, and sell only to buy. The retail trade of fraud and
imposture yields too small and slow a profit to gratify their cupidity.
They buy and sell corruption in the gross, and a few millions, more
or less, is hardly felt in the account. The deeper the play, the greater
their zest for the game, and the stake which is set upon their throw
is nothing less than the patrimony of the people. Mr. Speaker, when I
see the agency that has been employed on this occasion, I must
own that it fills me with apprehension and alarm. This same agent is
at the head of an executive department of our Government,
subordinate indeed in rank and dignity, and in the ability required for
its superintendence, but inferior to none in the influence attached to
it. This officer, possessed of how many snug appointments and fat
contracts, let the voluminous records on your table of the mere
names and dates and sums declare; having an influence which is
confined to no quarter of the country, but pervading every part of
the Union; with offices in his gift amongst the most lucrative, and at
the same time the least laborious, or responsible, under the
Government, so tempting as to draw a member of the other House
from his seat, and place him as a deputy at the feet of your
applicant; this officer presents himself at your bar, at once a party
and an advocate. Sir, when I see this tremendous patronage brought
to bear upon us, I do confess that it strikes me with consternation
and dismay. Is it come to this? Are heads of executive departments
of the Government to be brought into this House, with all the
influence and patronage attached to them, to extort from us now,
what was refused at the last session of Congress? I hope not, sir.
But if they are, and if the abominable villany practised upon, and by
the Legislature of Georgia, in 1795, is now to be glossed over, I for
one will ask what security they, by whom it shall be done, can offer
for their reputations, better than can be given for the character of
that Legislature? I will pin myself upon this text, and preach upon it
as long as I have life. If no other reason can be adduced but a
regard for our own fame, if it were only to rescue ourselves from this
foul imputation, this weak and dishonorable compromise ought to
receive a prompt and decisive rejection. Is the voice of patriotism
lulled to rest, that we no longer hear the cry against an overbearing
majority, determined to put down the constitution, and deaf to every
proposition of compromise? Such were the dire forebodings to which
we have been heretofore compelled to listen. But if the enmity of
such men be formidable, their friendship is deadly destruction, their
touch pollution.
Such men, I repeat it, are formidable as enemies, but their
friendship is fraught with irresistible death. I fear indeed the
“Danaos et dona ferentes.” But, after the law in question shall have
passed, what security have you that the claimants will accede to
your terms of compromise? that this is not a trap, to obtain from
Congress something like a recognition of their title, to be hereafter
used against us? Sir, with all our wisdom, I seriously doubt our
ability to contend with the arts and designs of these claimants, if
they can once entangle us in the net of our own legislation. Let the
act of March, 1801, of which already they have made so dexterous a
use, be remembered. They themselves have pointed out the course
which we ought to pursue. They have told us, that so long as we
refrain from legislating on this subject, their case is hopeless. Let us
then persevere in a “wise and masterly inactivity.”[23]
The committee rose, and had leave to sit again, and the House
adjourned.

Wednesday, January 30.


On motion, it was
Resolved, That the President of the United States be requested to
inform this House whether Samuel Hammond, a member of this House,
has not accepted of an Executive appointment, and when?
Ordered, That Mr. Bryan and Mr. Eppes be appointed a committee to
present the foregoing resolution to the President of the United
States.

Georgia Claims.

The House resumed the consideration of the resolution reported


yesterday from the Committee of the Whole on the Georgia Claims.
Mr. Elliot.—It cannot but be considered as a very fortunate
circumstance, and one which cannot fail to have a favorable
influence upon the final decision of this important question, that,
since the delivery of the animated observations which yesterday so
powerfully attracted the attention of the House, we have been
afforded a few hours of tranquil retirement from the tempest of the
forum, for the purpose, useful at all times, and peculiarly so at the
present time, of calm reflection. To transfer ourselves in a moment
from the flowery fields of fancy, to the rugged road of argument, to
descend instantaneously from the elevated scenes of eloquence to
the humble walks of common sense, requires an effort transcending
ordinary powers. In claiming your attention, Mr. Speaker, for a
greater portion of the day than I commonly occupy in debate upon
this floor, I shall not address you in the style of compliment or
ceremony. It is time to banish from these walls that idle frippery of
ceremonious conversation, which is suited only to a new year’s
compliment, or a birthday salutation, and to catch a little of the
sturdy spirit of antiquity. A bold, a loud, an impressive appeal is
made to the American people. In that appeal I fearlessly and most
cordially unite. I regret, however, the existence of a precedent which
at once justifies and demands these addresses to the people. Much
as I wish to disseminate correct information, particularly on a
subject which I believe is but imperfectly understood without these
walls, except by interested persons, and convinced as I am that the
subject is understood, and an opinion formed upon it, by every
member of this House, I shall not so completely follow the example
before us as to speak to the people in the first instance, but shall, as
usual, direct my observations to the House.
I propose to examine, in a concise, and if it be in my power, in an
argumentative manner, the following questions, which have a direct
application to the amendment proposed by the gentleman from
Virginia (Mr. Clark) to the resolution under consideration, and which,
at the same time, open to view the whole extent of the subject:
Did the State of Georgia, in the year 1795, possess a title to the
territory in question?
Were the Legislature of Georgia, in 1795, invested with the
constitutional power of making a sale of the territory, and did they
make such sale to those from whom the present claimants derive
their title or pretended title? And if such sale was made, what title or
color of title did it convey?
Were the members of the Legislature of Georgia, in 1796, invested
with the constitutional power of rescinding the acts of their
predecessors in relation to such sale, and did they rescind them?
Were the claims or pretended claims of the present claimants in
any manner recognized by the act of cession of the territory in
question from Georgia to the United States? And,
Do justice and policy, or either justice or policy, require that the
whole or any part of the five millions of acres, reserved by the act of
cession from Georgia to the United States, for the purpose of
satisfying claims of a certain description against Georgia, in
reference to the said territory, should be appropriated for the
purpose of satisfying the claims of the present claimants?
However extensive the outline which I have sketched of the
subject, the survey will be a rapid one.
It is necessary that I should make one or two preliminary
observations. I have uniformly been opposed to the doctrine which
has been so powerfully advocated, that Congress is competent to
make a legislative decision upon the validity or invalidity of the
conflicting acts of Georgia. We possess no such powers. But as
individuals we may express our opinions. Nor am I disposed to do
any thing which shall have a tendency to impugn the title of the
United States to this territory. Without deciding the question of title,
my principal object is to show that the claimants are in possession of
so strong a color of title, that it will be good policy to authorize a
negotiation with them for the abandonment of their claim, especially
as we have a prospect of obtaining that abandonment on their part,
without going beyond the reservation in the act of cession, and of
course without the actual expense of a single dollar to the United
States.
Did the State of Georgia, in the year 1795, possess a title to the
territory in question?
To answer this inquiry, it is only necessary to make one or two
quotations from the articles of agreement and cession, entered into
on the 24th of April, 1802, between the Commissioners of the United
States and those of Georgia. In the first article, “the State of Georgia
cedes to the United States all the right, title, and claim, which the
said State has to the jurisdiction and soil of the lands situated within
the boundaries of the United States south of the State of
Tennessee,” &c. By the second article, “The United States accept the
cession above mentioned, and on the condition therein expressed;
and they cede to the State of Georgia whatever claim, right, or title,
they may have to the jurisdiction or soil of any lands lying within the
United States, and out of the proper boundaries of any other State,
and situated south of the southern boundaries of the States of
Tennessee, North Carolina, and east of the boundary line herein
above described, at the eastern boundary of the territory ceded by
Georgia to the United States.” Whatever claim or title the United
States might previously have had to the territory, they thought
proper, in 1802, to combine with it, and to fortify it, by that of
Georgia; and surely we shall not do any act, or adopt any principle,
tending to impair the title under which we now exercise jurisdiction
over the territory.
Were the Legislature of Georgia, in 1795, invested with the
constitutional power of making a sale of the territory, and did they
make such sale to those from whom the present claimants derive
their title or pretended title? And if such sale was made, what title or
color of title did it convey?
In this age of political revolution and reformation, for I consider it
an age of reformation as well as revolution, there are still certain
principles and maxims, not merely venerable for their antiquity, but
consecrated by their conformity to the common sense and reason of
mankind, which are considered as universal in their application, and
irresistible in their influence. Among these may be numbered the
principles which attach to the government of every regularly-
organized community; the power of pledging the public faith, and
that of alienating the right of soil of the vacant territory of the
nation. In every free government, there must exist the power of
legislation, or of making laws; a distinct power, charged with the
execution of the laws, and a judicial power. The union of these
different powers in the same man or body of men, is the very
essence of despotism. Thus in France, prior to the Revolution, it was
a fundamental maxim of State that the King was the Legislator of
the French Monarchy; and the power exercised in some instances by
certain parliaments, of refusing to register the edicts of the
monarch, however in practice it might operate as an obstruction to
legislation, was in theory only a matter of form, or at most but a
temporary check upon the executive power. In oligarchies the
legislative power is vested in the rich and noble; and in aristocracies,
in a few individuals who are presumed to be the wisest and the best
in the community. In governments of the democratic form, this
power resides in the great body of the people, and is exercised by
themselves or their representatives. The base of the temple of
American liberty is democracy, or the sovereignty of the people;
representation and confederation are the principal pillars which
support the great superstructure. As the State governments are
unquestionably representative democracies, the General Government
is a representative federal republic. In every government of the
representative form, the representatives of the people are vested
with power to pledge the public faith, and to alienate the vacant
territory of the nation. Were the members of the Legislature of
Georgia, in 1795, invested with this authority? Certainly it was within
the sphere of those constitutional rights and powers, which had
never been surrendered to the General Government. We have since
recognized that authority by receiving a solemn deed of cession of
the territory from a subsequent Legislature of Georgia, transferring
to us not only the soil, but the right of jurisdiction. Was this
authority exercised in 1795? In the act of the Legislature of that
State of the 7th of January in that year, granting this territory to
those from whom the present claimants derive their claims, certain
lands are described, and it is enacted that those lands shall be sold
to such and such persons, as tenants in common, and not as joint
tenants. The land shall be sold, or, in other words, the right of soil
shall be alienated. A proper distinction is taken between the
dominium utile and the dominium directum of the civilians. No
transfer was made of the right of jurisdiction, although such
imaginary transfer forms a prominent article in the reasons assigned
by the Legislature of 1796 for passing the rescinding act. From this
view of the subject, whatever may be the present state of the
question of legal title, who can doubt that the present claimants,
honest purchasers from the original grantees, upon the faith of an
independent State, and innocent of fraud, if fraud existed, possess
such a color of title, such an equitable claim, as to render it prudent
and politic to enter into a compromise with them upon reasonable
terms?
Were the members of the Legislature of Georgia, in 1796, invested
with the constitutional power of rescinding the acts of their
predecessors in relation to such sale, and did they rescind them?
Congress is incompetent to the decision of this question. Nor is
such decision necessary. I will, however, make one or two inquiries,
and state one or two principles, which are applicable to the subject,
which at the same time will go to strengthen the ground I have
taken as to color of title in the claimants, and the policy of
extinguishing their claims.
Can a legislature rescind a contract made by its predecessors?
Writers on national law make a distinction between laws which
operate in the nature of contracts, and those which have no such
operation. Every enlightened and reasonable man will subscribe to
the opinion that a pledge of the public faith, given by the competent
authority, ought to be irrevocable. Laws which pledge the faith of the
community, which create contracts, which vest rights in individuals
or in corporate bodies, it may safely be assumed as a general
principle, are irrepealable. Laws of merely municipal operation are
alterable or repealable at the pleasure of the existing legislature.
Can the judicial power declare a legislative act void, as having
been passed by means of corruption?
Different opinions have existed in our country as to the right
claimed by the judiciary, of deciding upon the constitutionality of
laws. The better opinion seems to be, that from the nature of our
Government, and the very terms of the constitution itself, by which
that instrument is declared to be the supreme law of the land, the
judges not only ought to exercise that power, but that they cannot
avoid its exercise. If I am not mistaken, some gentlemen, who deny
that the judges possess this right, are prepared to invest them with
the more dangerous one of setting aside a legislative act on the
ground of corruption. To admit that the judiciary may examine into
the motives of the Legislature in passing laws, or that they may
receive and decide upon evidence tending to prove corruption in the
legislative body, would certainly be going much further than those
have gone who have claimed for that department the right of
deciding upon the constitutionality of laws. Suppose a trial of title
between a person claiming under the act of Georgia, of 1795, and
another claiming under the United States, and suppose evidence
offered to the Court to prove the corruption of the Legislature of
Georgia, in what a peculiar situation the judges would be placed?
And would they listen for a moment to an application for the
admission of such evidence? It may well be doubted. Do not then
the present claimants possess a very strong color of title? Is it not
prudent to extinguish claims of this description?

You might also like